/**
 * Favbet Intranet v2 — Stylesheet
 * Fixed header + collapsible sidebar + fluid content. Responsive.
 */

:root {
    --c-brand: #1a1f71; --c-brand-light: #2d3494; --c-brand-dark: #0e1245;
    --c-accent: #f5a623; --c-accent-hover: #e09510;
    --c-bg: #f0f2f5; --c-surface: #ffffff; --c-surface-alt: #f8f9fa;
    --c-border: #e1e4e8; --c-border-light: #eef0f2;
    --c-text: #1a1d21; --c-text-secondary: #5f6368; --c-text-muted: #8c919a;
    --c-text-on-brand: #ffffff;
    --c-success: #0d9f6e; --c-warning: #f5a623; --c-danger: #dc3545; --c-info: #3b82f6;
    --header-h: 56px; --sidebar-w: 260px;
    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: 0.2s ease;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; }
body { font-family: var(--font); background: var(--c-bg); color: var(--c-text); line-height: 1.5; min-height: 100vh; }
a { color: var(--c-brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Header ──────────────────────────────────── */
.header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: var(--header-h); background: var(--c-brand); color: var(--c-text-on-brand); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; box-shadow: var(--shadow-md); }
.header__left, .header__right { display: flex; align-items: center; gap: 12px; }
.header__menu-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 4px; }
.header__menu-toggle span { display: block; width: 22px; height: 2px; background: var(--c-text-on-brand); border-radius: 1px; }
.header__logo { display: flex; align-items: center; color: var(--c-text-on-brand); text-decoration: none; font-weight: 700; }
.header__logo-text { font-size: 1.25rem; letter-spacing: 2px; color: var(--c-accent); }
.header__greeting { font-size: 0.9rem; opacity: 0.9; }
.header__datetime { font-size: 0.8rem; background: rgba(255,255,255,0.15); padding: 4px 12px; border-radius: 4px; white-space: nowrap; }
.header__logout { color: var(--c-text-on-brand); font-size: 0.85rem; padding: 6px 14px; border: 1px solid rgba(255,255,255,0.3); border-radius: 6px; transition: var(--transition); text-decoration: none; }
.header__logout:hover { background: rgba(255,255,255,0.1); text-decoration: none; }
.header__role { font-size: 0.7rem; padding: 3px 10px; }

/* ─── Sidebar ─────────────────────────────────── */
.sidebar { position: fixed; top: var(--header-h); left: 0; bottom: 0; width: var(--sidebar-w); background: var(--c-surface); border-right: 1px solid var(--c-border); overflow-y: auto; z-index: 90; transition: transform 0.3s ease; }
.sidebar__nav { padding: 8px 0; display: flex; flex-direction: column; }
.sidebar__item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: var(--c-text); text-decoration: none; border-left: 3px solid transparent; transition: var(--transition); }
.sidebar__item:hover { background: var(--c-surface-alt); text-decoration: none; color: var(--c-brand); }
.sidebar__item--active { background: rgba(26,31,113,0.06); border-left-color: var(--c-brand); color: var(--c-brand); }
.sidebar__icon { flex-shrink: 0; width: 20px; height: 20px; opacity: 0.6; }
.sidebar__item:hover .sidebar__icon, .sidebar__item--active .sidebar__icon { opacity: 1; }
.sidebar__icon svg { width: 100%; height: 100%; }
.sidebar__item-content { display: flex; flex-direction: column; min-width: 0; }
.sidebar__label { font-size: 0.87rem; font-weight: 600; line-height: 1.3; text-transform: uppercase; letter-spacing: 0.3px; }
.sidebar__desc { font-size: 0.75rem; color: var(--c-text-muted); line-height: 1.3; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 89; }

/* ─── Main Layout ─────────────────────────────── */
.main-content { margin-left: var(--sidebar-w); padding: 24px; min-height: calc(100vh - var(--header-h)); padding-top: calc(var(--header-h) + 24px); transition: margin-left 0.3s ease; }

/* ─── Components ──────────────────────────────── */
.page-header { margin-bottom: 24px; }
.page-header__title { font-size: 1.5rem; font-weight: 700; }
.page-header__subtitle { font-size: 0.9rem; color: var(--c-text-secondary); margin-top: 4px; }

.card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 10px; box-shadow: var(--shadow-sm); }
.card__header { padding: 16px 20px; border-bottom: 1px solid var(--c-border-light); font-weight: 600; font-size: 0.95rem; }
.card__body { padding: 20px; }

.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.dash-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 10px; padding: 16px; display: flex; align-items: center; gap: 14px; transition: var(--transition); text-decoration: none; color: var(--c-text); }
.dash-card:hover { box-shadow: var(--shadow-md); border-color: var(--c-brand); transform: translateY(-1px); text-decoration: none; }
.dash-card__icon { width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: rgba(26,31,113,0.08); color: var(--c-brand); }
.dash-card__icon svg { width: 20px; height: 20px; }
.dash-card__content { min-width: 0; }
.dash-card__title { font-weight: 600; font-size: 0.88rem; }
.dash-card__desc { font-size: 0.76rem; color: var(--c-text-muted); }

/* Obavijesti linkovi */
.obavijest-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 6px; color: var(--c-text); text-decoration: none; transition: background 0.15s; }
.obavijest-link:hover { background: var(--c-surface-alt); text-decoration: none; }
.obavijest-link__icon { font-size: 1.2rem; }
.obavijest-link__naslov { font-size: 0.9rem; font-weight: 500; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 0.9rem; border: 1px solid transparent; }
.alert--success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert--error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert--warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert--info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--c-text-secondary); }
.form-control { width: 100%; padding: 10px 14px; font-size: 0.9rem; font-family: var(--font); border: 1px solid var(--c-border); border-radius: 8px; background: var(--c-surface); color: var(--c-text); transition: var(--transition); }
.form-control:focus { outline: none; border-color: var(--c-brand); box-shadow: 0 0 0 3px rgba(26,31,113,0.1); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; font-size: 0.9rem; font-weight: 600; font-family: var(--font); border: none; border-radius: 8px; cursor: pointer; transition: var(--transition); text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--c-brand); color: var(--c-text-on-brand); }
.btn--primary:hover { background: var(--c-brand-light); }
.btn--secondary { background: var(--c-surface); color: var(--c-text); border: 1px solid var(--c-border); }
.btn--danger { background: var(--c-danger); color: #fff; }
.btn--accent { background: var(--c-accent); color: #fff; }
.btn--sm { padding: 6px 12px; font-size: 0.82rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table thead th { background: var(--c-surface-alt); padding: 10px 14px; text-align: left; font-weight: 600; color: var(--c-text-secondary); border-bottom: 2px solid var(--c-border); white-space: nowrap; }
table tbody td { padding: 10px 14px; border-bottom: 1px solid var(--c-border-light); }
table tbody tr:hover { background: var(--c-surface-alt); }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; font-size: 0.73rem; font-weight: 600; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.badge--admin { background: #ede9fe; color: #5b21b6; }
.badge--it { background: #dbeafe; color: #1e40af; }
.badge--product { background: #fce7f3; color: #9d174d; }
.badge--tecajnici { background: #d1fae5; color: #065f46; }
.badge--poslovnica { background: #f3f4f6; color: #374151; }

/* Module placeholder */
.module-placeholder { text-align: center; padding: 60px 20px; color: var(--c-text-muted); }
.module-placeholder h2 { font-size: 1.2rem; color: var(--c-text-secondary); margin-bottom: 8px; }

/* Login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--c-brand-dark); padding: 20px; }
.login-card { background: var(--c-surface); border-radius: 12px; padding: 40px; width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); }
.login-card__logo { text-align: center; margin-bottom: 32px; }
.login-card__logo span { font-size: 2rem; font-weight: 700; color: var(--c-brand); letter-spacing: 3px; }
.login-card__logo small { display: block; font-size: 0.82rem; color: var(--c-text-muted); margin-top: 4px; }
.login-card .btn--primary { width: 100%; padding: 12px; }

/* ─── Responsive ──────────────────────────────── */
@media (max-width: 992px) { .header__greeting { display: none; } }
@media (max-width: 768px) {
    .header__menu-toggle { display: flex; }
    .sidebar { transform: translateX(-100%); }
    .sidebar--open { transform: translateX(0); }
    .sidebar-overlay--visible { display: block; }
    .main-content { margin-left: 0; }
    .header__datetime { display: none; }
    .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) { .main-content { padding: 16px; padding-top: calc(var(--header-h) + 16px); } .login-card { padding: 28px 24px; } }
@media print { .header, .sidebar, .sidebar-overlay { display: none !important; } .main-content { margin-left: 0 !important; padding: 0 !important; } }
