/* SSBS-ISCMS — shared shell styles (aligned with index.php) */
:root {
    --ssbs-blue:       #1a3a6b;
    --ssbs-blue-light: #2a5298;
    --ssbs-blue-dark:  #0d1f3c;
    --ssbs-gold:       #c8a92b;
    --ssbs-gold-light: #e6c84a;
    --ssbs-green:      #1a6e2e;
    --ssbs-green-light:#28a745;
    --ssbs-red:        #c0392b;
    --sidebar-w:       240px;
    --topbar-h:        64px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #f0f4f8;
    color: #1c2b4a;
    margin: 0;
}

.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: linear-gradient(175deg, var(--ssbs-blue-dark) 0%, var(--ssbs-blue) 100%);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    transition: transform .3s;
}

.sidebar-brand {
    padding: 20px 16px 16px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    text-decoration: none;
}
.sidebar-brand .brand-logo {
    font-size: 28px;
    display: block;
    margin-bottom: 4px;
}
.sidebar-brand .brand-name {
    font-size: .85rem;
    font-weight: 700;
    color: var(--white, #fff);
    line-height: 1.2;
}
.sidebar-brand .brand-sub {
    font-size: .65rem;
    color: rgba(255,255,255,.55);
}

.flag-bar {
    display: flex;
    height: 3px;
    margin: 0 16px 12px;
}
.flag-bar span { flex: 1; }
.flag-bar .f-black { background: #000; }
.flag-bar .f-red   { background: #DD1C1A; }
.flag-bar .f-green { background: #007A3D; }
.flag-bar .f-blue  { background: #003893; }

.sidebar-nav { flex: 1; padding: 6px 0; }

.nav-section-title {
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255,255,255,.35);
    padding: 12px 20px 4px;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-size: .82rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all .2s;
}
.nav-item a i { font-size: 17px; flex-shrink: 0; }
.nav-item a:hover,
.nav-item a.active {
    color: #fff;
    background: rgba(255,255,255,.08);
    border-left-color: var(--ssbs-gold);
}
.nav-item a .badge {
    margin-left: auto;
    font-size: .65rem;
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,.1);
    font-size: .75rem;
    color: rgba(255,255,255,.4);
    text-align: center;
}

.topbar {
    position: fixed;
    top: 0; left: var(--sidebar-w); right: 0;
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    z-index: 900;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.topbar-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ssbs-blue);
    flex: 1;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.topbar-user .avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--ssbs-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    flex-shrink: 0;
}
.topbar-user .user-info .name {
    font-size: .82rem;
    font-weight: 600;
    color: var(--ssbs-blue);
}
.topbar-user .user-info .role {
    font-size: .7rem;
    color: #6b7280;
}

.topbar-bell {
    position: relative;
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    background: #f0f4f8;
    color: var(--ssbs-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: background .2s;
}
.topbar-bell:hover { background: #e2e8f0; }

.main-content {
    margin-left: var(--sidebar-w);
    margin-top: var(--topbar-h);
    padding: 24px;
    min-height: calc(100vh - var(--topbar-h));
}

.page-header {
    margin-bottom: 24px;
}
.page-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ssbs-blue);
    margin: 0 0 2px;
}
.page-header p {
    font-size: .82rem;
    color: #6b7280;
    margin: 0;
}

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

.kpi-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    border-top: 3px solid var(--card-color, var(--ssbs-blue));
    transition: transform .2s, box-shadow .2s;
}
.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
.kpi-card .kpi-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: var(--card-color-light, #e8f0fb);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    color: var(--card-color, var(--ssbs-blue));
    flex-shrink: 0;
}
.kpi-card .kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--ssbs-blue);
    line-height: 1;
}
.kpi-card .kpi-label {
    font-size: .72rem;
    color: #6b7280;
    margin-top: 4px;
}

.section-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    overflow: hidden;
    margin-bottom: 24px;
}
.section-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.section-header h2 {
    font-size: .95rem;
    font-weight: 700;
    color: var(--ssbs-blue);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-header h2 i { color: var(--ssbs-gold); }
.section-header a {
    font-size: .75rem;
    color: var(--ssbs-blue);
    text-decoration: none;
}
.section-header a:hover { text-decoration: underline; }

.ssbs-table {
    width: 100%;
    font-size: .8rem;
    border-collapse: collapse;
}
.ssbs-table thead th {
    background: #f8fafc;
    color: #6b7280;
    font-weight: 700;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 10px 14px;
    border-bottom: 1px solid #e2e8f0;
}
.ssbs-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.ssbs-table tbody tr:last-child td { border-bottom: none; }
.ssbs-table tbody tr:hover td { background: #f8fafc; }

.empty-row td {
    text-align: center;
    color: #9ca3af;
    padding: 28px !important;
    font-size: .82rem;
}

.row-critical td { background: #fff1f0; }
.row-warn     td { background: #fffbeb; }

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    padding: 16px 20px;
}
.qa-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: var(--ssbs-blue);
    text-decoration: none;
    font-size: .75rem;
    font-weight: 600;
    transition: all .2s;
    text-align: center;
}
.qa-btn i { font-size: 24px; }
.qa-btn:hover {
    background: var(--ssbs-blue);
    color: #fff;
    border-color: var(--ssbs-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26,58,107,.25);
}

.expiry-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: .7rem;
    font-weight: 700;
}
.expiry-critical { background: #fee2e2; color: #991b1b; }
.expiry-warn     { background: #fef3c7; color: #92400e; }
.expiry-ok       { background: #d1fae5; color: #065f46; }

.chart-wrap { padding: 16px 20px 20px; }

.iscms-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: .72rem;
    color: #475569;
}

@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .topbar, .main-content { margin-left: 0; left: 0; }
}
