/* =============================================
   Blok 38 — glavni stylesheet
   Paleta: tamno teal (#0a2e2e), teal (#1a6b6b),
           svetli teal (#2a9d8d), bela, siva
   ============================================= */

:root {
    --teal-dark:   #0a2e2e;
    --teal-mid:    #0f4a4a;
    --teal-main:   #1a7a6a;
    --teal-light:  #2a9d8d;
    --teal-pale:   #e8f5f3;
    --white:       #ffffff;
    --gray-50:     #f8fafa;
    --gray-100:    #eef2f2;
    --gray-200:    #d4dede;
    --gray-400:    #8aacac;
    --gray-600:    #4a6868;
    --gray-800:    #1e3535;
    --text-main:   #0f2a2a;
    --text-muted:  #4a6868;
    --text-light:  #7a9898;
    --danger:      #c0392b;
    --danger-bg:   #fdf0ef;
    --success:     #1a7a6a;
    --success-bg:  #e8f5f3;
    --warning:     #d4860a;
    --warning-bg:  #fef6e4;

    --radius-sm:   6px;
    --radius-md:   10px;
    --radius-lg:   16px;
    --radius-xl:   24px;

    --shadow-sm:   0 1px 3px rgba(10,46,46,.08);
    --shadow-md:   0 4px 16px rgba(10,46,46,.12);
    --shadow-lg:   0 8px 32px rgba(10,46,46,.16);

    --nav-h:       64px;
    --sidebar-w:   240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-main);
    background: var(--gray-50);
    min-height: 100vh;
}

/* =============================================
   Navigacija
   ============================================= */

.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    background: var(--teal-dark);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--white);
}

.navbar-brand img {
    height: 80px;
    width: auto;
}

.navbar-brand-text {
    font-size: 18px;
    font-weight: 700;
    opacity: .65;
    letter-spacing: -.3px;
    line-height: 1.2;
}

.navbar-brand-sub {
    font-size: 11px;
    font-weight: 400;
    opacity: .65;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.navbar-spacer { flex: 1; }

.navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,.85);
    font-size: 14px;
}

.navbar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--teal-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    color: white;
    border: 2px solid rgba(255,255,255,.2);
}

/* =============================================
   Sidebar
   ============================================= */

.layout {
    display: flex;
    padding-top: var(--nav-h);
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    position: fixed;
    top: var(--nav-h);
    bottom: 0;
    left: 0;
    overflow-y: auto;
    padding: 16px 0;
}

.sidebar-section {
    padding: 8px 16px 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--text-light);
    margin-top: 8px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all .15s;
}

.sidebar-item:hover {
    background: var(--teal-pale);
    color: var(--teal-main);
    border-left-color: var(--teal-light);
}

.sidebar-item.active {
    background: var(--teal-pale);
    color: var(--teal-dark);
    border-left-color: var(--teal-main);
    font-weight: 600;
}

.sidebar-item .icon {
    width: 18px;
    text-align: center;
    font-size: 18px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

/* Phosphor Icons sizing in sidebar */
.sidebar-item i.icon {
    font-size: 18px;
    line-height: 1;
}

/* =============================================
   Glavni sadržaj
   ============================================= */

.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 32px 36px;
    max-width: 1400px;
    min-width: 0;
}

.page-header {
    margin-bottom: 28px;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--teal-dark);
    letter-spacing: -.4px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* =============================================
   Kartice
   ============================================= */

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    overflow: visible;
}

.card-header {
    padding: 18px 24px 16px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--teal-dark);
}

.card-body {
    padding: 24px;
}

/* =============================================
   Statistički blokovi
   ============================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--teal-pale);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-icon.teal  { background: var(--teal-pale); }
.stat-icon.green { background: #eafaf1; }
.stat-icon.amber { background: #fef6e4; }
.stat-icon.red   { background: #fdf0ef; }

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--teal-dark);
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* =============================================
   Tabele
   ============================================= */

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 11px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-light);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

td {
    padding: 13px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--text-main);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

/* =============================================
   Badges / Tagovi
   ============================================= */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .2px;
}

.badge-green   { background: #eafaf1; color: #1a7a6a; }
.badge-teal    { background: var(--teal-pale); color: var(--teal-dark); }
.badge-amber   { background: #fef6e4; color: #a06810; }
.badge-red     { background: #fdf0ef; color: #c0392b; }
.badge-gray    { background: var(--gray-100); color: var(--gray-600); }
.badge-blue    { background: #eaf4fe; color: #1a5fa8; }

/* =============================================
   Forme
   ============================================= */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    letter-spacing: .2px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-main);
    background: var(--white);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--teal-main);
    box-shadow: 0 0 0 3px rgba(26,122,106,.12);
}

.form-control::placeholder { color: var(--text-light); }

select.form-control { cursor: pointer; }

.form-hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.form-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
}

/* =============================================
   Dugmad
   ============================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all .15s;
    font-family: inherit;
    white-space: nowrap;
}

.btn-primary {
    background: var(--teal-main);
    color: var(--white);
}
.btn-primary:hover { background: var(--teal-mid); }

.btn-outline {
    background: transparent;
    color: var(--teal-main);
    border: 1.5px solid var(--teal-main);
}
.btn-outline:hover { background: var(--teal-pale); }

.btn-danger {
    background: var(--danger);
    color: var(--white);
}
.btn-danger:hover { background: #a93226; }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}
.btn-ghost:hover { background: var(--gray-100); }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }
.btn-full { width: 100%; }

/* =============================================
   Alert poruke
   ============================================= */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-bottom: 16px;
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-success {
    background: var(--success-bg);
    border-color: var(--success);
    color: #0f4a3a;
}
.alert-danger {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: #7a1a12;
}
.alert-warning {
    background: var(--warning-bg);
    border-color: var(--warning);
    color: #7a4a06;
}
.alert-info {
    background: #eaf4fe;
    border-color: #1a5fa8;
    color: #0e3a68;
}

/* =============================================
   Login stranica
   ============================================= */

.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal-mid) 60%, #0d3d3d 100%);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 24px 40px;
    overflow-y: auto;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 48px 44px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 64px rgba(0,0,0,.35);
}

.login-logo {
    text-align: center;
    margin-bottom: 15px;
}

.login-logo img {
    height: 100px;
    width: auto;
}

.login-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--teal-dark);
    text-align: center;
    margin-bottom: 6px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 32px;
}

.login-divider {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 24px 0;
}

.login-footer {
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
    margin-top: 20px;
}

.login-footer a {
    color: var(--teal-main);
    text-decoration: none;
    font-weight: 600;
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 20px 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .login-card { padding: 32px 24px; }
}

/* =============================================
   Pismo switcher (Ćir / Lat)
   ============================================= */

.pismo-switcher {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-right: 12px;
    background: rgba(255,255,255,.1);
    border-radius: var(--radius-md);
    padding: 3px;
}

.pismo-btn {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,.6);
    text-decoration: none;
    transition: all .15s;
    letter-spacing: .3px;
}

.pismo-btn:hover {
    color: rgba(255,255,255,.9);
    background: rgba(255,255,255,.1);
}

.pismo-btn.pismo-active {
    background: var(--teal-main);
    color: var(--white);
}

/* Dashboard kartice — naslov ne prelama */
.card-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}