/* ------------------------------------------------------------------ */
/* ABC operations system — global styles                                */
/* ------------------------------------------------------------------ */
:root {
    --abc-primary: #012970;
    --abc-primary-dark: #001a4d;
    --abc-accent:  #4154f1;
    --abc-sidebar-bg: #ffffff;
    --abc-sidebar-w: 250px;
    --abc-topbar-h: 56px;
}

html, body { height: 100%; }
body.abc-app {
    background: #f6f9ff;
    font-family: "Open Sans","Segoe UI",Roboto,Helvetica,Arial,sans-serif;
    color: #222;
}

/* ---------------- Topbar ---------------- */
#abc-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--abc-topbar-h);
    background: var(--abc-primary);
    color: #fff;
    z-index: 1030;
}
#abc-topbar a, #abc-topbar .dropdown-toggle { color: #fff; }
/* Dropdown menu items sit on a white background — restore default dark text */
#abc-topbar .dropdown-menu .dropdown-item { color: #212529; }
#abc-topbar .dropdown-menu .dropdown-item:hover,
#abc-topbar .dropdown-menu .dropdown-item:focus { color: #1e2125; background-color: #e9ecef; }
#abc-topbar .avatar-circle {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--abc-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

/* ---------------- Sidebar ---------------- */
#abc-sidebar {
    position: fixed;
    top: var(--abc-topbar-h);
    bottom: 0;
    left: 0;
    width: var(--abc-sidebar-w);
    background: var(--abc-sidebar-bg);
    border-right: 1px solid #e5e9f5;
    overflow-y: auto;
    z-index: 1020;
    transition: transform .25s ease;
}
body.abc-sidebar-collapsed #abc-sidebar { transform: translateX(-100%); }
.abc-nav ul { padding: 8px 8px; }
.abc-nav li { margin-bottom: 2px; }
.abc-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 6px;
    color: #444;
    font-weight: 500;
    text-decoration: none;
    font-size: 14px;
}
.abc-link i { color: var(--abc-accent); }
.abc-link:hover { background: #eef2ff; color: var(--abc-primary); }
.abc-link.active { background: var(--abc-primary); color: #fff; }
.abc-link.active i { color: #fff; }
.abc-link.abc-group .bi-chevron-down { transition: transform .15s; font-size: 12px; }
.abc-link.abc-group.collapsed .bi-chevron-down { transform: rotate(-90deg); }
.abc-subnav { padding-left: 32px !important; margin-top: 2px; }
.abc-sublink {
    display: block;
    padding: 6px 10px;
    color: #555;
    text-decoration: none;
    font-size: 13.5px;
    border-radius: 4px;
}
.abc-sublink:hover { background: #eef2ff; color: var(--abc-primary); }
.abc-sublink.active { background: #dbe3ff; color: var(--abc-primary); font-weight: 600; }

/* ---------------- Main content ---------------- */
#abc-main {
    margin-top: var(--abc-topbar-h);
    margin-left: var(--abc-sidebar-w);
    min-height: calc(100vh - var(--abc-topbar-h) - 52px);
    transition: margin-left .25s ease;
}
body.abc-sidebar-collapsed #abc-main { margin-left: 0; }

#abc-footer {
    margin-left: var(--abc-sidebar-w);
    border-top: 1px solid #e5e9f5;
    background: #fff;
    transition: margin-left .25s ease;
}
body.abc-sidebar-collapsed #abc-footer { margin-left: 0; }

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

/* ---------------- Cards & UI helpers ---------------- */
.card { border: 1px solid #e5e9f5; box-shadow: 0 1px 2px rgba(1,41,112,.06); }
.card-header { background: #fbfcff; border-bottom: 1px solid #eef0fa; font-weight: 600; }
.btn-primary, .btn-primary:focus { background: var(--abc-primary); border-color: var(--abc-primary); }
.btn-primary:hover { background: var(--abc-primary-dark); border-color: var(--abc-primary-dark); }
.page-title { font-size: 22px; font-weight: 600; color: var(--abc-primary); margin: 0 0 16px 0; }
.page-title small { color: #666; font-weight: 400; font-size: 14px; }
table.table thead { background: #f3f6fc; color: #023; font-size: 13.5px; }
table.table th, table.table td { vertical-align: middle; }
.search-bar { background: #fff; padding: 12px; border: 1px solid #e5e9f5; border-radius: 6px; margin-bottom: 16px; }

/* Login page */
body.abc-login {
    background: linear-gradient(135deg, #4154f1 0%, #012970 100%);
    color: #fff;
}
.login-card {
    width: 100%; max-width: 420px;
    background: #fff; color: #333;
    border-radius: 10px;
    padding: 32px;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
}

/* Progress bars for uploads */
.upload-progress { height: 10px; margin-top: 6px; }

/* Print */
@media print {
    #abc-topbar, #abc-sidebar, #abc-footer, .no-print { display: none !important; }
    #abc-main { margin: 0 !important; }
    body.abc-app { background: #fff; }
}

/* ------------------------------------------------------------------ */
/* abc-v3 additions                                                   */
/* ------------------------------------------------------------------ */
.abc-section-label {
    padding: 14px 16px 4px;
    font-size: 11px;
    letter-spacing: .04em;
    color: #8a93b0;
    text-transform: uppercase;
    font-weight: 700;
}

/* Login page */
body.abc-login {
    min-height: 100vh;
    background: linear-gradient(135deg, #012970 0%, #4154f1 100%);
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 12px;
    padding: 32px 32px 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,.15);
}

/* Page title (used by dashboard / list pages) */
.page-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 16px;
    color: var(--abc-primary, #012970);
}
.page-title small {
    font-size: 13px;
    font-weight: normal;
    color: #6c757d;
    margin-left: 8px;
}

/* Leaflet sometimes needs an explicit height when used inside cards */
.leaflet-map { height: 480px; width: 100%; }

/* Dts-style status pills compatibility */
.badge.bg-info  { color: #fff; }
