:root {
    --portal-navy: #083b78;
    --portal-blue: #1456a0;
    --portal-bg: #f3f6fb;
    --portal-text: #182438;
    --portal-muted: #64748b;
    --portal-border: #e3eaf3;
    --portal-sidebar-width: 290px;
}

/* Consistent sizing throughout the portal */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Prevent accidental horizontal overflow */
html {
    min-height: 100%;
    width: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    width: 100%;
    background: var(--portal-bg);
    color: var(--portal-text);
    font-family: Arial, Helvetica, sans-serif;
}

img,
video,
iframe {
    max-width: 100%;
}

/* Top navigation bar */
.portal-topbar {
    position: sticky;
    top: 0;
    z-index: 2000;
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    background: #123c78;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.portal-brand {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    color: #fff;
    text-decoration: none;
}

.portal-brand-name {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: .4px;
}

.portal-brand-tagline {
    font-size: 15px;
    line-height: 1.4;
    opacity: .9;
}

.portal-topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    min-width: 0;
}

.portal-topbar-actions form {
    margin: 0;
}

.portal-user-name {
    font-size: 16px;
    color: #fff;
}

.portal-signout {
    padding: 11px 16px;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 7px;
    background: transparent;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.portal-signout:hover {
    background: rgba(255, 255, 255, .12);
}

/* Main layout: sidebar and page content sit side by side */
.portal-shell {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    min-height: calc(100vh - 82px);
}

/* Desktop sidebar */
.portal-sidebar {
    width: var(--portal-sidebar-width);
    min-width: 0;
    flex: 0 0 var(--portal-sidebar-width);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid var(--portal-border);

    position: sticky;
    top: 0;
    height: calc(100vh - 82px);
    overflow-y: auto;
    overflow-x: hidden;
    align-self: flex-start;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scrollbar-color: #b8c7da #f5f7fb;
}

.portal-sidebar::-webkit-scrollbar {
    width: 8px;
}

.portal-sidebar::-webkit-scrollbar-track {
    background: #f5f7fb;
}

.portal-sidebar::-webkit-scrollbar-thumb {
    background: #b8c7da;
    border-radius: 8px;
}

.portal-sidebar::-webkit-scrollbar-thumb:hover {
    background: #8ca3bf;
}

/* Sidebar navigation */
.portal-nav {
    width: 100%;
    min-width: 0;
    padding: 18px 12px 22px;
}

.portal-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
    min-height: 49px;
    padding: 13px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #334155;
    text-align: left;
    text-decoration: none;
    font-family: inherit;
    font-size: 17px;
    line-height: 1.4;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.portal-nav-link::-webkit-details-marker,
.portal-service-heading::-webkit-details-marker {
    display: none;
}

.portal-nav-link:hover,
.portal-sub-link:hover,
.portal-service-heading:hover,
.portal-service-link:hover {
    background: #f0f5ff;
    color: var(--portal-blue);
}

.portal-nav-link.is-active {
    background: #e8f1ff;
    color: var(--portal-navy);
    font-weight: 800;
}

.portal-nav-icon {
    width: 24px;
    flex: 0 0 24px;
    text-align: center;
    font-size: 21px;
}

.portal-nav-group {
    margin: 5px 0;
    min-width: 0;
}

.portal-nav-group > summary {
    position: relative;
    padding-right: 34px;
}

.portal-nav-group > summary::after {
    content: "+";
    position: absolute;
    right: 13px;
    font-size: 21px;
    color: var(--portal-muted);
}

.portal-nav-group[open] > summary::after {
    content: "−";
}

/* Console and other submenu links */
.portal-submenu {
    min-width: 0;
    padding: 5px 0 9px 25px;
}

.portal-sub-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    padding: 11px 10px;
    border-radius: 6px;
    color: #475569;
    text-decoration: none;
    font-size: 16px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.portal-coming-soon {
    flex: 0 0 auto;
    padding: 3px 6px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 12px;
    line-height: 1.3;
    font-weight: 700;
}

.is-unavailable {
    color: #64748b;
    cursor: default;
}

/* Expandable service categories */
.portal-service-group {
    margin: 4px 0;
    min-width: 0;
}

.portal-service-heading {
    padding: 11px 9px;
    border-radius: 6px;
    color: #334155;
    cursor: pointer;
    list-style: none;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 750;
}

.portal-service-heading::before {
    content: "›";
    display: inline-block;
    width: 19px;
    font-size: 19px;
    color: var(--portal-muted);
}

.portal-service-group[open] > .portal-service-heading::before {
    content: "⌄";
}

.portal-service-items {
    min-width: 0;
    padding: 3px 0 7px 10px;
}

.portal-service-link {
    display: block;
    padding: 10px 8px;
    border-radius: 5px;
    color: #475569;
    text-decoration: none;
    font-size: 15px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.portal-service-link[aria-current="page"] {
    background: #e8f1ff;
    color: var(--portal-navy);
    font-weight: 800;
}

/* Sidebar footer */
.portal-sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
    padding: 20px;
    border-top: 1px solid var(--portal-border);
    color: var(--portal-muted);
    font-size: 14px;
    line-height: 1.5;
}

.portal-sidebar-footer strong {
    color: var(--portal-navy);
    font-size: 15px;
}

/* Main page content */
.portal-main {
    display: block;
    flex: 1 1 0%;
    width: auto;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 30px clamp(18px, 3vw, 40px) 40px;
    overflow-x: hidden;
    overflow-wrap: anywhere;
}

/* Keep common form elements within the available content width */
.portal-main form {
    min-width: 0;
    max-width: 100%;
}

.portal-main input,
.portal-main select,
.portal-main textarea,
.portal-main button {
    max-width: 100%;
}

.portal-main input,
.portal-main select,
.portal-main textarea {
    min-width: 0;
}

/* Allow wide tables to scroll without covering the sidebar */
.portal-main table {
    max-width: 100%;
}

.portal-main .table-responsive,
.portal-main .table-scroll,
.portal-main .table-container {
    max-width: 100%;
    overflow-x: auto;
}

/* Mobile menu button */
.portal-menu-toggle {
    display: none;
    padding: 10px 13px;
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 6px;
    background: transparent;
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

/* Tablets and mobile phones */
@media (max-width: 900px) {
    .portal-topbar {
        min-height: 76px;
        padding: 12px 14px;
        gap: 10px;
    }

    .portal-menu-toggle {
        display: inline-block;
        flex: 0 0 auto;
    }

    .portal-brand-name {
        font-size: 22px;
    }

    .portal-brand-tagline {
        font-size: 13px;
    }

    .portal-shell {
        position: relative;
        display: flex;
        width: 100%;
        min-width: 0;
        min-height: calc(100vh - 76px);
    }

    /* Mobile sidebar opens over the content when requested */
    .portal-sidebar {
        display: none;
        position: absolute;
        z-index: 1000;
        top: 0;
        bottom: auto;
        left: 0;
        width: min(340px, 88vw);
        flex: 0 0 auto;
        height: auto;
        min-height: 0;
        max-height: calc(100vh - 76px);
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
        box-shadow: 8px 8px 24px rgba(15, 35, 65, .16);
    }

    .portal-sidebar.is-open {
        display: flex;
    }

    .portal-nav {
        padding: 14px 10px 18px;
    }

    .portal-nav-link {
        font-size: 17px;
        min-height: 48px;
        padding: 12px 10px;
    }

    .portal-sub-link {
        font-size: 16px;
        padding: 11px 9px;
    }

    .portal-service-heading {
        font-size: 16px;
        padding: 12px 9px;
    }

    .portal-service-link {
        font-size: 15px;
        padding: 10px 8px;
    }

    .portal-main {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        padding: 22px 16px 32px;
    }

    .portal-user-name {
        display: none;
    }
}

/* Small mobile phones */
@media (max-width: 480px) {
    .portal-topbar {
        flex-wrap: wrap;
    }

    .portal-menu-toggle {
        font-size: 14px;
        padding: 9px 10px;
    }

    .portal-brand-name {
        font-size: 20px;
    }

    .portal-brand-tagline {
        font-size: 12px;
    }

    .portal-topbar-actions {
        gap: 8px;
    }

    .portal-signout {
        padding: 9px 11px;
        font-size: 14px;
    }

    .portal-sidebar {
        width: min(340px, 92vw);
        max-height: calc(100vh - 76px);
    }

    .portal-main {
        padding: 18px 12px 28px;
    }
}


/* =========================================================
   KODVISION SHARED PORTAL DESIGN
   Used by onboarding, KNMS, SIM Registry, VTU, Travel, etc.
   ========================================================= */

:root {
    --portal-success: #176b35;
    --portal-success-bg: #eaf8ef;
    --portal-warning: #805600;
    --portal-warning-bg: #fff6df;
    --portal-danger: #9d2525;
    --portal-danger-bg: #fff0f0;
    --portal-info: #124d91;
    --portal-info-bg: #eef5ff;
    --portal-card-radius: 12px;
    --portal-card-shadow: 0 3px 18px rgba(15, 35, 65, 0.06);
}

/* Standard page heading */
.portal-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0 0 24px;
}

.portal-page-header h1 {
    margin: 0 0 8px;
    color: var(--portal-navy);
    font-size: clamp(24px, 3vw, 32px);
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.portal-page-header p {
    margin: 0;
    color: var(--portal-muted);
    font-size: 15px;
    line-height: 1.65;
}

/* Shared white content card */
.portal-card {
    min-width: 0;
    margin: 0 0 22px;
    padding: 24px;
    background: #fff;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-card-radius);
    box-shadow: var(--portal-card-shadow);
}

.portal-card h2 {
    margin: 0 0 16px;
    color: var(--portal-navy);
    font-size: 21px;
    line-height: 1.4;
}

.portal-card h3 {
    color: var(--portal-navy);
    line-height: 1.4;
}

.portal-card p {
    line-height: 1.65;
}

/* Shared notice and feedback messages */
.portal-alert {
    margin: 0 0 20px;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.portal-alert-success {
    color: var(--portal-success);
    background: var(--portal-success-bg);
    border-color: #c8ead2;
}

.portal-alert-warning {
    color: var(--portal-warning);
    background: var(--portal-warning-bg);
    border-color: #f1dfaa;
}

.portal-alert-error {
    color: var(--portal-danger);
    background: var(--portal-danger-bg);
    border-color: #f2cccc;
}

.portal-alert-info {
    color: var(--portal-info);
    background: var(--portal-info-bg);
    border-color: #cfe0f8;
}

/* Shared primary and secondary actions */
.portal-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 11px 16px;
    border: 1px solid var(--portal-blue);
    border-radius: 7px;
    background: var(--portal-blue);
    color: #fff;
    font: inherit;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.portal-action:hover {
    background: var(--portal-navy);
    border-color: var(--portal-navy);
    color: #fff;
}

.portal-action-secondary {
    background: #fff;
    color: var(--portal-blue);
}

.portal-action-secondary:hover {
    background: #eef5ff;
    color: var(--portal-navy);
}

/* Shared empty, unavailable and error-page presentation */
.portal-system-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 65vh;
    padding: 24px 0;
}

.portal-system-card {
    width: 100%;
    max-width: 620px;
    padding: clamp(24px, 5vw, 42px);
    background: #fff;
    border: 1px solid var(--portal-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(15, 35, 65, 0.08);
    text-align: center;
}

.portal-system-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: #e8f1ff;
    color: var(--portal-navy);
    font-size: 30px;
    font-weight: 800;
}

.portal-system-card h1 {
    margin: 0 0 12px;
    color: var(--portal-navy);
    font-size: clamp(24px, 4vw, 32px);
    line-height: 1.25;
}

.portal-system-card p {
    margin: 0 0 22px;
    color: var(--portal-muted);
    font-size: 16px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.portal-system-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.portal-system-reference {
    margin-top: 22px !important;
    font-size: 13px !important;
}

/* Shared data status labels */
.portal-status {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 20px;
    background: #eef2f7;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.portal-status-success {
    background: var(--portal-success-bg);
    color: var(--portal-success);
}

.portal-status-warning {
    background: var(--portal-warning-bg);
    color: var(--portal-warning);
}

.portal-status-danger {
    background: var(--portal-danger-bg);
    color: var(--portal-danger);
}

.portal-status-info {
    background: var(--portal-info-bg);
    color: var(--portal-info);
}

/* Responsive spacing for shared components */
@media (max-width: 600px) {
    .portal-card {
        padding: 17px;
        margin-bottom: 16px;
    }

    .portal-card h2 {
        font-size: 19px;
    }

    .portal-system-page {
        min-height: 55vh;
        padding: 12px 0;
    }

    .portal-system-card {
        border-radius: 12px;
    }

    .portal-system-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .portal-system-actions .portal-action {
        width: 100%;
    }

    .portal-page-header {
        margin-bottom: 18px;
    }
}



/* KODVISION v1.50: consistent, readable shared navigation on every portal page. */
:root { --portal-sidebar-width: 292px; }
.portal-sidebar {
  width: var(--portal-sidebar-width) !important;
  min-width: var(--portal-sidebar-width) !important;
  flex: 0 0 var(--portal-sidebar-width) !important;
  box-sizing: border-box;
}
.portal-sidebar *, .portal-sidebar *::before, .portal-sidebar *::after { box-sizing: border-box; }
.portal-nav { padding: 16px 12px 24px !important; }
.portal-nav-link {
  min-height: 50px !important; padding: 12px 13px !important;
  gap: 12px !important; font-size: 17px !important;
  line-height: 1.45 !important; font-weight: 650 !important;
}
.portal-nav-icon { width: 25px !important; flex: 0 0 25px !important; font-size: 21px !important; }
.portal-nav-group { margin: 5px 0 !important; }
.portal-submenu { padding: 5px 0 10px 26px !important; }
.portal-sub-link {
  min-height: 42px !important; padding: 10px 11px !important;
  font-size: 15px !important; line-height: 1.45 !important; font-weight: 550 !important;
}
.portal-coming-soon { font-size: 12px !important; }
.portal-sidebar-footer { font-size: 14px !important; }
.portal-main { min-width: 0; }
.portal-main p, .portal-main li { font-size: 15px; line-height: 1.6; }
.portal-main label { font-size: 14px; }
.portal-main input, .portal-main select, .portal-main textarea, .portal-main button { font-size: 14px; }
.portal-main table { font-size: 14px; }
@media (max-width: 900px) {
  .portal-sidebar { width: min(310px, 88vw) !important; min-width: 0 !important; flex-basis: auto !important; }
  .portal-nav-link { min-height: 50px !important; font-size: 17px !important; }
  .portal-sub-link { min-height: 42px !important; font-size: 15px !important; }
}
@media (max-width: 480px) {
  .portal-nav { padding: 12px 10px 20px !important; }
  .portal-nav-link { font-size: 16px !important; }
  .portal-sub-link { font-size: 14px !important; }
}


/* KODVISION DASHBOARD-MATCHED SHARED SIDEBAR — v1.0
   Keep the shared sidebar visually identical on every portal page.
   Page content styles remain independent. */
#portal-sidebar {
    box-sizing: border-box !important;
    position: sticky !important;
    top: 70px !important;
    align-self: flex-start !important;
    width: 252px !important;
    min-width: 252px !important;
    max-width: 252px !important;
    flex: 0 0 252px !important;
    height: calc(100vh - 70px) !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
    background: #06265A !important;
    color: #d5e3fa !important;
    border: 0 !important;
    box-shadow: 5px 0 22px rgba(7,33,78,.08) !important;
    scrollbar-color: #355789 #06265A !important;
}
#portal-sidebar * { box-sizing: border-box; }
#portal-sidebar .portal-nav {
    width: 100% !important;
    min-width: 0 !important;
    padding: 18px 13px 24px !important;
}
#portal-sidebar .portal-nav-link {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
    min-height: 42px !important;
    margin: 3px 0 !important;
    padding: 10px 12px !important;
    border: 0 !important;
    border-radius: 9px !important;
    background: transparent !important;
    color: #d5e3fa !important;
    text-align: left !important;
    text-decoration: none !important;
    font-family: inherit !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}
#portal-sidebar .portal-nav-icon {
    width: 22px !important;
    min-width: 22px !important;
    flex: 0 0 22px !important;
    text-align: center !important;
    font-size: 17px !important;
    color: #9fc5ff !important;
}
#portal-sidebar .portal-nav-link:hover,
#portal-sidebar .portal-sub-link:hover,
#portal-sidebar .portal-service-heading:hover,
#portal-sidebar .portal-service-link:hover {
    background: rgba(255,255,255,.1) !important;
    color: #fff !important;
}
#portal-sidebar .portal-nav-link.is-active {
    background: linear-gradient(100deg,#0B70F0,#0756D9) !important;
    color: #fff !important;
    box-shadow: 0 6px 14px rgba(0,0,0,.16) !important;
    font-weight: 700 !important;
}
#portal-sidebar .portal-nav-link.is-active .portal-nav-icon { color: #fff !important; }
#portal-sidebar .portal-submenu,
#portal-sidebar .portal-service-items {
    min-width: 0 !important;
    padding: 5px 0 9px 16px !important;
    margin-left: 22px !important;
    border-left: 1px solid rgba(255,255,255,.16) !important;
}
#portal-sidebar .portal-sub-link,
#portal-sidebar .portal-service-link {
    display: block !important;
    min-width: 0 !important;
    padding: 8px 10px !important;
    border-radius: 7px !important;
    background: transparent !important;
    color: #c4d5ee !important;
    text-decoration: none !important;
    font-family: inherit !important;
    font-size: 12px !important;
    line-height: 1.45 !important;
    overflow-wrap: anywhere !important;
}
#portal-sidebar .portal-service-heading {
    padding: 9px 10px !important;
    border-radius: 8px !important;
    color: #d5e3fa !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    font-weight: 650 !important;
}
#portal-sidebar .portal-service-heading::before { color: #9fc5ff !important; }
#portal-sidebar .portal-nav-group { margin: 5px 0 !important; }
#portal-sidebar .portal-nav-group > summary::after { color: #9fc5ff !important; }
#portal-sidebar .portal-sidebar-footer {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    margin: 12px !important;
    margin-top: auto !important;
    padding: 15px !important;
    border: 1px solid rgba(255,255,255,.15) !important;
    border-radius: 12px !important;
    background: linear-gradient(145deg,rgba(11,112,240,.28),rgba(255,255,255,.04)) !important;
    color: #fff !important;
    font-size: 10px !important;
    line-height: 1.5 !important;
}
#portal-sidebar .portal-sidebar-footer strong { color: #fff !important; font-size: 12px !important; letter-spacing: .3px; }
#portal-sidebar .portal-sidebar-footer span { color: #c5d8f5 !important; font-size: 10px !important; }
@media (max-width: 900px) {
    #portal-sidebar {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: min(310px,88vw) !important;
        min-width: 0 !important;
        max-width: none !important;
        flex: 0 0 auto !important;
        height: auto !important;
        max-height: calc(100vh - 76px) !important;
        display: none !important;
        z-index: 1000 !important;
        box-shadow: 8px 8px 24px rgba(15,35,65,.25) !important;
    }
    #portal-sidebar.is-open { display: flex !important; }
    #portal-sidebar .portal-nav { padding: 14px 10px 18px !important; }
    #portal-sidebar .portal-nav-link { min-height: 42px !important; font-size: 13px !important; }
}
@media (max-width: 480px) {
    #portal-sidebar { width: min(310px,92vw) !important; max-height: calc(100vh - 76px) !important; }
}



/* ==========================================================
   KODVISION — HEAD OFFICE INVENTORY COMMAND CENTRE
   Presentation layer only; existing PHP permissions and data
   calculations remain authoritative.
========================================================== */

.operations-overview {
    margin: 28px 0 32px;
    padding: 28px;
    border: 1px solid #e5eaf2;
    border-radius: 18px;
    background: #f6f8fc;
    color: #17243a;
    box-shadow: none;
}
.operations-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}
.operations-eyebrow,
.operations-module-tag,
.activity-overview-label {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.1px;
}
.operations-heading h2 {
    margin: 7px 0;
    color: #14233b;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -.6px;
}
.operations-heading p,
.operations-section-heading p {
    max-width: 720px;
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.7;
}
.operations-live-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border: 1px solid #dce5ef;
    border-radius: 30px;
    background: #fff;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.operations-live-label > span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0d9488;
}
.operations-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}
.operations-kpi-card {
    min-width: 0;
    padding: 20px;
    border: 1px solid #e6ebf3;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(15, 23, 42, .035);
}
.operations-kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}
.operations-kpi-icon {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 11px;
    background: #eef2ff;
    color: #4056a1;
    font-size: 20px;
    font-weight: 800;
}
.kpi-available .operations-kpi-icon { background: #dcfce7; color: #15803d; }
.kpi-assigned .operations-kpi-icon { background: #dbeafe; color: #1d4ed8; }
.kpi-activity .operations-kpi-icon { background: #fef3c7; color: #b45309; }
.operations-kpi-card > strong {
    display: block;
    margin: 14px 0 5px;
    color: #17243a;
    font-size: clamp(25px, 3vw, 34px);
    font-weight: 850;
    letter-spacing: -1px;
    overflow-wrap: anywhere;
}
.operations-kpi-card > small { color: #8491a4; font-size: 11px; }
.operations-distribution-panel {
    padding: 23px;
    margin-bottom: 28px;
    border: 1px solid #e6ebf3;
    border-radius: 15px;
    background: #fff;
}
.operations-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
}
.operations-section-heading h3 {
    margin: 0 0 5px;
    color: #17243a;
    font-size: 17px;
    font-weight: 800;
}
.operations-distribution-content {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: center;
    gap: 35px;
}
.operations-distribution-chart { display: flex; justify-content: center; align-items: center; }
.operations-donut {
    --available: 0%;
    --assigned: 0%;
    width: 180px;
    height: 180px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(
        #16a34a 0 var(--available),
        #3b82f6 var(--available) calc(var(--available) + var(--assigned)),
        #cbd5e1 calc(var(--available) + var(--assigned)) 100%
    );
    position: relative;
}
.operations-donut::before {
    content: "";
    position: absolute;
    width: 125px;
    height: 125px;
    border-radius: 50%;
    background: #fff;
}
.operations-donut-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.operations-donut-inner strong { color: #17243a; font-size: 25px; font-weight: 850; }
.operations-donut-inner span { margin-top: 3px; color: #8491a4; font-size: 11px; }
.operations-distribution-legend { display: grid; gap: 0; }
.distribution-legend-item {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    padding: 15px 0;
    border-bottom: 1px solid #edf0f5;
}
.distribution-legend-item:last-child { border-bottom: 0; }
.legend-indicator { width: 10px; height: 10px; border-radius: 3px; }
.available-indicator { background: #16a34a; }
.assigned-indicator { background: #3b82f6; }
.neutral-indicator { background: #cbd5e1; }
.distribution-legend-item strong { display: block; color: #334155; font-size: 13px; }
.distribution-legend-item small { display: block; margin-top: 3px; color: #94a3b8; font-size: 11px; }
.distribution-legend-item > b { color: #17243a; font-size: 18px; }
.operations-chart-disclaimer { margin: 15px 0 0; color: #94a3b8; font-size: 10px; line-height: 1.6; }
.module-section-heading { margin-bottom: 16px; }
.operations-module-count {
    padding: 7px 11px;
    border-radius: 20px;
    background: #e9eef8;
    color: #4056a1;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}
.operations-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 17px;
    margin-top: 0;
    align-items: stretch;
}
.operations-stat {
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 21px;
    border: 1px solid #e5eaf2;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(15, 23, 42, .035);
}
.operations-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 1px solid #edf0f5;
}
.operations-stat-header h3 { margin: 6px 0 0; color: #17243a; font-size: 17px; font-weight: 800; }
.operations-module-symbol {
    display: grid;
    width: 39px;
    height: 39px;
    place-items: center;
    border-radius: 11px;
    background: #eff3ff;
    color: #4056a1;
    font-size: 20px;
}
.operations-module-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 17px 0;
}
.operations-module-total span { color: #64748b; font-size: 12px; font-weight: 600; }
.operations-module-total strong { color: #17243a; font-size: 25px; font-weight: 850; }
.operations-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 19px;
}
.operations-stat-grid > div { padding: 13px; border-radius: 10px; background: #f8fafc; }
.operations-stat-grid span { display: block; color: #64748b; font-size: 11px; }
.operations-stat-grid strong { display: block; margin-top: 6px; font-size: 21px; font-weight: 850; }
.stat-available { color: #15803d; }
.stat-assigned { color: #2563eb; }
.inventory-comparison {
    margin: 0 0 18px;
    padding: 15px;
    border: 1px solid #edf0f5;
    border-radius: 11px;
    background: #fff;
}
.inventory-comparison-heading { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 15px; }
.inventory-comparison-heading strong { color: #334155; font-size: 12px; }
.inventory-comparison-heading span { color: #94a3b8; font-size: 10px; }
.inventory-bar-row {
    display: grid;
    grid-template-columns: 72px minmax(30px, 1fr) 50px;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
}
.inventory-bar-label { color: #64748b; font-size: 11px; }
.inventory-bar-track { height: 8px; overflow: hidden; border-radius: 10px; background: #edf1f6; }
.inventory-bar-fill { display: block; height: 100%; border-radius: inherit; }
.inventory-bar-fill.is-available { background: #16a34a; }
.inventory-bar-fill.is-assigned { background: #3b82f6; }
.inventory-bar-row > strong { color: #334155; font-size: 11px; text-align: right; }
.operations-detail-block { padding: 14px 0; border-top: 1px solid #edf0f5; }
.operations-detail-block h4 { margin: 0 0 10px; color: #475569; font-size: 12px; font-weight: 800; }
.operations-product-status { display: flex; flex-wrap: wrap; gap: 7px; }
.operations-product-status > span,
.operations-movement-types > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 9px;
    border: 1px solid #e8edf4;
    border-radius: 7px;
    background: #f8fafc;
    color: #64748b;
    font-size: 10px;
}
.operations-product-status strong,
.operations-movement-types strong { color: #17243a; font-weight: 800; }
.operations-activity-block {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 13px;
    padding: 15px;
    border-radius: 10px;
    background: #f8fafc;
}
.activity-block-label { color: #64748b; font-size: 10px; font-weight: 800; letter-spacing: .4px; }
.operations-activity-block > strong { color: #17243a; font-size: 20px; font-weight: 850; }
.operations-activity-block small { color: #8491a4; font-size: 11px; line-height: 1.6; }
.operations-movement-types { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 5px; }
.operations-module-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding: 13px 15px;
    border: 1px solid #dce5f5;
    border-radius: 9px;
    background: #f5f8ff;
    color: #3154a1 !important;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none !important;
    transition: background .2s, border-color .2s;
}
.operations-module-link:hover { border-color: #9eb4e7; background: #eaf0ff; }
.operations-activity-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 13px;
    margin-top: 22px;
}
.operations-activity-overview > div {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 18px;
    border: 1px solid #e5eaf2;
    border-radius: 12px;
    background: #fff;
}
.operations-activity-overview strong { color: #17243a; font-size: 25px; font-weight: 850; }
.operations-activity-overview small { color: #8491a4; font-size: 10px; line-height: 1.5; }
.operations-empty {
    padding: 28px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #fff;
    text-align: center;
}
.operations-empty strong { color: #334155; font-size: 15px; }
.operations-empty p,
.operations-error p { margin: 7px 0 0; color: #8491a4; font-size: 12px; line-height: 1.6; }
.operations-error {
    margin: 18px 0;
    padding: 15px;
    border: 1px solid #fed7aa;
    border-radius: 9px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 12px;
}
.operations-note {
    margin-top: 20px;
    padding: 13px 15px;
    border-left: 3px solid #64748b;
    border-radius: 5px;
    background: #fff;
    color: #64748b;
    font-size: 11px;
    line-height: 1.7;
}
@media (max-width: 1050px) {
    .operations-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1050px) { .operations-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
    .operations-overview { padding: 17px; border-radius: 13px; }
    .operations-heading { flex-direction: column; gap: 12px; }
    .operations-heading h2 { font-size: 21px; }
    .operations-kpi-card { padding: 14px; }
    .operations-distribution-content { grid-template-columns: 1fr; gap: 18px; }
    .operations-donut { width: 155px; height: 155px; }
    .operations-donut::before { width: 108px; height: 108px; }
    .operations-stats { grid-template-columns: 1fr; }
    .operations-activity-overview { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
    .operations-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .operations-kpi-top { font-size: 10px; }
    .operations-kpi-icon { width: 29px; height: 29px; }
    .operations-kpi-card > strong { font-size: 23px; }
    .inventory-bar-row { grid-template-columns: 63px minmax(20px, 1fr) 42px; gap: 6px; }
    .inventory-comparison-heading { flex-direction: column; }
}


/* KODVISION INVENTORY COMMAND CENTRE — v2 responsive module cards.
   The dashboard's final inline stylesheet is authoritative for dashboard.php. */
#operations-overview .operations-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
#operations-overview .operations-stat {
    min-width: 0;
    display: flex;
    flex-direction: column;
}
@media (max-width: 760px) {
    #operations-overview .operations-stats {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

/* =====================================================
   KODVISION SIDEBAR — FINAL FONT SIZE OVERRIDE
   This block must remain at the very bottom of portal.css.
===================================================== */

/* Main sidebar menu */
#portal-sidebar .portal-nav-link {
    font-size: 16px !important;
    line-height: 1.55 !important;
    font-weight: 650 !important;
    min-height: 48px !important;
}

/* Main menu icons */
#portal-sidebar .portal-nav-icon {
    font-size: 20px !important;
}

/* Submenu links */
#portal-sidebar .portal-sub-link {
    font-size: 15px !important;
    line-height: 1.6 !important;
    font-weight: 500 !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

/* Service category headings */
#portal-sidebar .portal-service-heading {
    font-size: 15px !important;
    line-height: 1.55 !important;
    font-weight: 650 !important;
}

/* Service links */
#portal-sidebar .portal-service-link {
    font-size: 14px !important;
    line-height: 1.6 !important;
}

/* Sidebar footer */
#portal-sidebar .portal-sidebar-footer {
    font-size: 12px !important;
    line-height: 1.6 !important;
}

#portal-sidebar .portal-sidebar-footer strong {
    font-size: 14px !important;
}

#portal-sidebar .portal-sidebar-footer span {
    font-size: 12px !important;
}

/* Maintain readable sizes on mobile */
@media (max-width: 900px) {
    #portal-sidebar .portal-nav-link {
        font-size: 16px !important;
    }

    #portal-sidebar .portal-sub-link {
        font-size: 15px !important;
    }

    #portal-sidebar .portal-service-heading {
        font-size: 15px !important;
    }

    #portal-sidebar .portal-service-link {
        font-size: 14px !important;
    }
}
