* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    background: linear-gradient(135deg, #eef2f7 0%, #f8fafc 100%);
    color: #0f172a;
    line-height: 1.5;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #0f172a;
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 22px 14px;
    flex-shrink: 0;
    box-shadow: 4px 0 20px rgba(15, 23, 42, 0.08);
}

.sidebar-brand {
    padding: 6px 10px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 14px;
}

.sidebar-brand h2 {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #38bdf8;
}

.sidebar-brand p {
    font-size: 11.5px;
    color: #cbd5e1;
    margin-top: 4px;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.16s ease;
}

.nav-item a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: translateX(2px);
}

.nav-item a.active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.nav-item a.disabled-link {
    opacity: 0.45;
    pointer-events: none;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 12px;
    font-size: 11.5px;
    color: #94a3b8;
}

.main-content {
    flex: 1;
    padding: 24px 28px;
    max-width: 100%;
    overflow-x: auto;
}

.topbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 15px 22px;
    margin-bottom: 20px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.topbar h1 {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: #e0f2fe;
    color: #0369a1;
}

.badge-admin {
    background: #fef3c7;
    color: #92400e;
}

.card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    color: #0f172a;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 960px) {
    .app-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
    }
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 13.5px;
    color: #0f172a;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-success {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.22);
}

.btn-warning {
    background: #d97706;
    color: #ffffff;
}

.btn-danger {
    background: #dc2626;
    color: #ffffff;
}

.btn-secondary {
    background: #e2e8f0;
    color: #1e293b;
}

.btn-sm {
    padding: 6px 11px;
    font-size: 12px;
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

table th {
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
    text-align: left;
    padding: 11px 10px;
    border-bottom: 2px solid #e2e8f0;
}

table td {
    padding: 10px 10px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

table tr:hover td {
    background: #f8fafc;
}

.alert {
    padding: 12px 15px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 14px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.kpi-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
}

.kpi-box .kpi-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}

.kpi-box .kpi-value {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

/* Moderan login raspored sa dva panela */
.login-shell {
    max-width: 920px;
    margin: 36px auto;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.10);
}

.login-brand-panel {
    background: linear-gradient(160deg, #0f172a 0%, #1e3a8a 100%);
    color: #f8fafc;
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.login-brand-panel .brand-tag {
    display: inline-block;
    width: fit-content;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.16);
    color: #7dd3fc;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
    margin-bottom: 14px;
}

.login-brand-panel h2 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 10px;
    color: #ffffff;
}

.login-brand-panel p {
    font-size: 13.5px;
    color: #cbd5e1;
    line-height: 1.6;
}

.login-features {
    list-style: none;
    margin-top: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 13px;
    color: #e2e8f0;
}

.login-form-panel {
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-form-panel h3 {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}

.login-subtitle {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 20px;
}

@media (max-width: 820px) {
    .login-shell {
        grid-template-columns: 1fr;
        margin: 16px auto;
    }
    .login-brand-panel,
    .login-form-panel {
        padding: 24px 20px;
    }
}