/* ARCH / JHU helpdesk customization
 * Built on top of sb-admin.css (uses flex wrapper layout)
 */

:root {
    --jhu-blue: #002d72;
    --jhu-blue-dark: #001e52;
    --jhu-gold: #cfb023;
    --sidebar-width: 250px;
    --navbar-height: 56px;
    --footer-height: 110px;
}

/* Lock body to viewport — no page scroll, only content-wrapper scrolls */
html, body {
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
    margin: 0;
}

.navbar.navbar-expand.navbar-dark.bg-dark.static-top {
    height: var(--navbar-height);
    min-height: var(--navbar-height);
    flex-shrink: 0;
}

/* ------------------------------------------------------------------ */
/* Sidebar — override sb-admin's narrow 90px sidebar                    */
/* ------------------------------------------------------------------ */

.sidebar {
    width: var(--sidebar-width) !important;
    background-color: var(--jhu-blue) !important;
    height: calc(100vh - var(--navbar-height) - var(--footer-height)) !important;
    max-height: calc(100vh - var(--navbar-height) - var(--footer-height)) !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0 !important;
}

.sidebar .nav-item {
    width: 100%;
    margin-bottom: 0 !important;
}

.sidebar .nav-item .nav-link {
    color: #ffffff !important;
    padding: 0.95rem 1rem !important;
    text-align: left !important;
    display: flex !important;
    align-items: center;
    border-left: 3px solid transparent;
    font-size: 1.17rem; /* 1.3x */
}

.sidebar .nav-item .nav-link span {
    font-size: 1.17rem !important; /* 1.3x */
    display: inline !important;
    margin-left: 0.5rem;
}

.sidebar .nav-item .nav-link i {
    width: 1.8rem;
    text-align: center;
    opacity: 0.85;
    font-size: 1.17rem; /* 1.3x default ~0.9rem */
}

.sidebar .nav-item .nav-link:hover,
.sidebar .nav-item.active .nav-link {
    background-color: var(--jhu-blue-dark) !important;
    border-left-color: var(--jhu-gold);
    color: #ffffff !important;
}

/* Sidebar brand (logo area) — white background like ARCH Portal */
.sidebar-brand {
    background-color: #ffffff !important;
    padding: 1.25rem 1rem !important;
    border-bottom: 1px solid #e3e6f0;
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
}

.sidebar-brand a {
    color: var(--jhu-blue) !important;
    text-decoration: none;
    display: flex !important;
    flex-direction: column !important;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0 !important;
}

.sidebar-brand img {
    display: block !important;
    max-height: 90px;
    max-width: 80%;
    width: auto;
    height: auto;
}

.sidebar-brand-text {
    font-size: 1.38rem; /* 1.15 × 1.2 */
    font-weight: 700;
    color: var(--jhu-blue) !important;
    letter-spacing: 1.5px;
    display: block !important;
    text-align: center;
}

/* Sidebar dropdown (Saved Queries) */
.sidebar .nav-item .dropdown-menu {
    position: static !important;
    background-color: var(--jhu-blue-dark) !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    width: 100%;
    box-shadow: none !important;
    transform: none !important;
}

.sidebar .nav-item .dropdown-menu .dropdown-item {
    color: #fff !important;
    padding: 0.5rem 1rem 0.5rem 2.5rem !important;
    font-size: 0.8rem;
    white-space: normal;
}

.sidebar .nav-item .dropdown-menu .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

/* ------------------------------------------------------------------ */
/* Content wrapper — scrolls independently of sidebar                  */
/* ------------------------------------------------------------------ */

#wrapper {
    height: calc(100vh - var(--navbar-height) - var(--footer-height));
    max-height: calc(100vh - var(--navbar-height) - var(--footer-height));
    overflow: hidden;
}

#content-wrapper {
    background-color: #f8f9fc;
    height: calc(100vh - var(--navbar-height) - var(--footer-height));
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
}

.container-fluid {
    padding: 1.5rem;
}

/* Top navbar */
.navbar.navbar-expand {
    background-color: #ffffff;
    border-bottom: 1px solid #e3e6f0;
    padding: 0.5rem 1rem;
}

.navbar-brand,
.navbar-brand.ms-3 {
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #ffffff !important;
}

/* Cards — left-aligned, not centered */
.card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e3e6f0;
    margin-bottom: 1rem;
    margin-left: 0;
    margin-right: auto;
}

.card .card-body {
    text-align: left;
}

.card .card-body h3 {
    font-weight: 600;
    margin-bottom: 0.25rem;
    text-align: left;
}

/* Override Bootstrap row default — ensure cards in rows stack left */
.row > [class*="col-"] > .card {
    width: 100%;
}

/* Tables */
.table { background-color: #fff; }

.table thead.thead-light th,
.table thead.table-light th {
    background-color: #f8f9fc;
    color: #5a5c69;
    font-weight: 600;
    border-bottom: 2px solid #e3e6f0;
}

/* Buttons */
.btn-primary {
    background-color: var(--jhu-blue);
    border-color: var(--jhu-blue);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--jhu-blue-dark);
    border-color: var(--jhu-blue-dark);
}

.btn-outline-primary {
    color: var(--jhu-blue);
    border-color: var(--jhu-blue);
}

.btn-outline-primary:hover {
    background-color: var(--jhu-blue);
    color: #fff;
}

/* ------------------------------------------------------------------ */
/* Login page — ARCH Portal style                                       */
/* ------------------------------------------------------------------ */

.arch-login-card {
    max-width: 1100px;
    border: 1px solid #e3e6f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.arch-login-header {
    font-weight: 600;
}

.arch-login-btn {
    padding: 0.85rem 1.5rem;
    font-size: 1.05rem;
    font-weight: 500;
}

.arch-login-btn-jhu {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.arch-login-btn-schmidt {
    background-color: #6c757d;
    border-color: #6c757d;
}

/* Duty distribution table on My Stats */
.arch-duty-table { max-width: 600px; }

/* Breadcrumb */
.breadcrumb {
    background-color: transparent;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
}

/* Sticky footer (3-column grid, fixed to viewport bottom, full width) */
footer.sticky-footer {
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw !important;
    height: var(--footer-height);
    min-height: var(--footer-height);
    margin: 0 !important;
    padding: 0 !important;
    background: transparent;
    border-top: 1px solid #dee2e6;
    z-index: 1020;
}

.sticky-footer .footer-grid {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: stretch;
    gap: 0;
}
.sticky-footer .footer-col {
    min-width: 0;
    text-align: center;
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.sticky-footer .footer-col-left   { flex: 0 0 var(--sidebar-width); background: #f8f9fc; }
.sticky-footer .footer-col-middle {
    flex: 1 1 0;
    background: #ffffff;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
}
.sticky-footer .footer-col-right  { flex: 0 0 var(--sidebar-width); background: #f8f9fc; }

.sticky-footer .footer-left-title       { line-height: 1.3; margin-bottom: 6px; }
.sticky-footer .footer-left-title-main  { font-size: 0.72rem; font-weight: 600; color: var(--jhu-blue); }
.sticky-footer .footer-left-title-sub   { font-size: 0.62rem; color: #6c757d; }
.sticky-footer .footer-left-icons {
    display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 14px;
}
.sticky-footer .footer-left-icons a {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    color: rgba(0, 45, 114, 0.85); text-decoration: none; font-size: 0.7rem;
    transition: color .15s;
}
.sticky-footer .footer-left-icons a i { font-size: 1rem; }
.sticky-footer .footer-left-icons a:hover { color: var(--jhu-gold); }

.sticky-footer .footer-title { font-size: 0.82rem; font-weight: 600; color: #212529; }
.sticky-footer .footer-subtitle { font-size: 0.72rem; color: #6c757d; margin: 0; }
.sticky-footer .footer-col-middle .reveal-link { color: inherit; text-decoration: none; }
.sticky-footer .footer-col-middle .reveal-link:hover { color: var(--jhu-blue); text-decoration: underline; }
.sticky-footer .footer-col-right { padding: 14px 12px; }
.sticky-footer .arch-footer-links { display: flex; flex-wrap: wrap; justify-content: center; row-gap: 4px; column-gap: 10px; }
.sticky-footer .arch-footer-links a { color: #6c757d; text-decoration: none; font-size: 0.82rem; white-space: nowrap; }
.sticky-footer .arch-footer-links a i { font-size: 0.95em; margin-right: 0.3rem; }
.sticky-footer .arch-footer-links a:hover { color: var(--jhu-blue); text-decoration: underline; }

/* Responsive */
@media (max-width: 768px) {
    :root { --footer-height: auto; }
    .sidebar {
        width: 100% !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        flex-direction: row !important;
        overflow-x: auto;
    }
    #wrapper { height: auto; max-height: none; }
    #content-wrapper { height: auto; }
    footer.sticky-footer {
        position: static !important;
        width: 100% !important;
        height: auto;
    }
    .sticky-footer .footer-grid { flex-direction: column; }
    .sticky-footer .footer-col-left,
    .sticky-footer .footer-col-right { flex: 1 1 auto; width: 100%; }
    .sticky-footer .footer-col-middle { border-left: 0; border-right: 0; border-top: 1px solid #dee2e6; border-bottom: 1px solid #dee2e6; }
}

/* ------------------------------------------------------------------ */
/* Collapsed sidebar (when fa-bars button is clicked)                  */
/* body.sidebar-toggled + .sidebar.toggled → icon-only mode            */
/* ------------------------------------------------------------------ */

.sidebar.toggled {
    width: 70px !important;
    min-width: 70px !important;
    overflow: visible !important;
}

/* Hide text labels — keep only icons */
.sidebar.toggled .nav-item .nav-link span {
    display: none !important;
}

.sidebar.toggled .nav-item .nav-link {
    justify-content: center !important;
    align-items: center !important;
    padding: 0.75rem 0 !important;
    text-align: center !important;
    display: flex !important;
    width: 100% !important;
}

.sidebar.toggled .nav-item .nav-link i {
    width: 100% !important;
    margin: 0 auto !important;
    font-size: 1.4rem !important;
    text-align: center !important;
    display: block;
}

/* Collapse brand area: hide "ARCH" text, shrink logo */
.sidebar.toggled .sidebar-brand {
    padding: 0.75rem 0.25rem !important;
}

.sidebar.toggled .sidebar-brand img {
    max-height: 36px;
}

.sidebar.toggled .sidebar-brand-text {
    display: none !important;
}

/* Collapse footer: hide brand text/links, keep compact */
.sidebar.toggled .sidebar-footer {
    padding: 0.5rem 0.25rem !important;
}

.sidebar.toggled .sidebar-footer-brand,
.sidebar.toggled .sidebar-footer-links span {
    display: none !important;
}

.sidebar.toggled .sidebar-footer-links {
    flex-direction: column;
    gap: 0.4rem;
}

.sidebar.toggled .sidebar-footer-links a {
    padding: 0.25rem;
    font-size: 0.85rem;
}

/* Dropdown in collapsed sidebar: show absolutely positioned */
.sidebar.toggled .nav-item .dropdown-menu {
    position: absolute !important;
    left: 70px !important;
    top: 0 !important;
    width: 200px;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.2) !important;
}

/* ------------------------------------------------------------------ */
/* Ticket detail header — prominent ID badge + inline status combo      */
/* ------------------------------------------------------------------ */
.ticket-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}
.ticket-id-badge {
    display: inline-block;
    background: var(--jhu-blue);
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    letter-spacing: 0.02em;
    line-height: 1.2;
    white-space: nowrap;
}
.ticket-head-title {
    font-weight: 600;
}
.ticket-status-combo {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.ticket-status-combo select.form-select-sm {
    min-width: 130px;
}

/* ------------------------------------------------------------------ */
/* Follow-ups — collapsible items with category-tinted header          */
/* ------------------------------------------------------------------ */
.fu-list .fu-item {
    border-left: 4px solid var(--fu-color, #d0d7de);
    padding: 0;
    margin-bottom: 0.5rem;
}
.fu-list .fu-item .fu-header {
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    background: color-mix(in srgb, var(--fu-color, #d0d7de) 15%, transparent);
    border-bottom: 1px solid transparent;
    transition: background 0.15s ease;
}
.fu-list .fu-item .fu-header:hover {
    background: color-mix(in srgb, var(--fu-color, #d0d7de) 28%, transparent);
}
.fu-list .fu-item .fu-header:focus-visible {
    outline: 2px solid var(--fu-color, #0366d6);
    outline-offset: -2px;
}
.fu-list .fu-item .fu-title {
    font-size: 1rem;
    font-weight: 600;
}
.fu-list .fu-item .fu-caret {
    transition: transform 0.15s ease;
    margin-right: 0.4rem;
    font-size: 0.8rem;
    color: #57606a;
}
.fu-list .fu-item.fu-collapsed .fu-body {
    display: none;
}
.fu-list .fu-item:not(.fu-collapsed) .fu-header {
    border-bottom-color: color-mix(in srgb, var(--fu-color, #d0d7de) 40%, transparent);
}
.fu-list .fu-item:not(.fu-collapsed) .fu-caret {
    transform: rotate(90deg);
}
.fu-list .fu-item .fu-body {
    padding: 0.75rem 0.9rem 0.5rem;
}
.fu-chips {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.3rem;
}
.fu-chip {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #fff;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    letter-spacing: 0.02em;
}
.fu-chip.fu-nk {
    background: var(--fu-color, #57606a);
}
.fu-chip.fu-ec {
    background: #5a5c69;
}

/* ── Ticket Analytics collapsible section (dashboard.html) ── */
#analytics-details summary {
    display: inline-flex;
    align-items: center;
    gap: .4em;
    cursor: pointer;
}
#analytics-details summary::-webkit-details-marker { display: none; }
#analytics-details[open] .analytics-chevron { transform: rotate(180deg); }

/* ── Ticket priority score badge (ticket.html summary bar) ── */
.priority-score-badge {
    font-size: .75rem;
    padding: .2em .55em;
    border-radius: 4px;
    cursor: default;
    white-space: nowrap;
}

/* ── Follow-up maximize button + modal ── */
.fu-maximize-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--fu-color, #57606a);
    opacity: 0;
    padding: .25rem .4rem;
    border-radius: 4px;
    line-height: 1;
    transition: opacity .15s, background .15s;
    cursor: pointer;
    align-self: center;
}
.fu-item:hover .fu-maximize-btn,
.fu-maximize-btn:focus {
    opacity: 1;
}
.fu-maximize-btn:hover {
    opacity: 1;
    background: rgba(0,0,0,.06);
}
@media (max-width: 767px) {
    .fu-maximize-btn { opacity: 1; }
}
#fu-maximize-modal .modal-body {
    max-height: 75vh;
    overflow-y: auto;
}

/* Match Reports & Statistics table style on /tickets/ list (DataTables-managed).
   Upstream ticket_list.html uses table-sm; override removes the cramped padding
   so rows breathe like the Reports table. */
#ticketTable.table-sm > :not(caption) > * > *,
#ticketTable.dataTable > tbody > tr > td,
#ticketTable.dataTable > thead > tr > th {
    padding: .5rem .75rem;
}
#ticketTable.dataTable thead th {
    background-color: #f8f9fc;
    color: #5a5c69;
    font-weight: 600;
    border-bottom: 2px solid #e3e6f0;
}

/* Time Spent input on ticket respond form */
#id_time_spent {
    max-width: 160px;
}

/* Time Tracking — Top Tickets contributor breakdown */
.tkt-top-ticket-col { min-width: 220px; }
.tkt-contrib-row { font-size: 0.88em; }

/* Dashboard — clean section-header cards + status pills (modern look) */
.dash-sec-hd { display:flex; align-items:center; gap:10px; background:#fbfcfe; border-bottom:1px solid #eef1f5; }
.dash-sec-ic { flex:0 0 auto; width:30px; height:30px; border-radius:8px; background:#eef2ff; color:#3056d3; display:grid; place-items:center; font-size:.85rem; }
.dash-sec-title { font-weight:650; font-size:.95rem; color:#182230; }
.dash-sec-count { margin-left:auto; font-size:.8rem; font-weight:700; color:#2942a8; background:#eef2ff; border-radius:999px; padding:2px 11px; min-width:26px; text-align:center; }
.dash-table { margin-bottom:0; }
.dash-table thead th { border-top:0; font-size:.72rem; text-transform:uppercase; letter-spacing:.04em; color:#8a94a6; font-weight:700; }
.dash-table thead th a { color:#8a94a6 !important; text-decoration:none; }
.dash-table td, .dash-table th { border-left:0; border-right:0; vertical-align:middle; }
.dash-st { display:inline-block; font-size:.72rem; font-weight:650; border-radius:999px; padding:2px 10px; white-space:nowrap; }
.dash-st-1 { background:#fdeceb; color:#b42318; }  /* Open */
.dash-st-2 { background:#fef6e7; color:#b25c00; }  /* Reopened */
.dash-st-3 { background:#e7f6f4; color:#0b7a6e; }  /* Resolved */
.dash-st-4 { background:#eef1f5; color:#5a6672; }  /* Closed */
.dash-st-5 { background:#eef1f5; color:#5a6672; }  /* Duplicate */
.dash-st-6 { background:#eceef2; color:#697586; }  /* Archived */
.dash-st-7 { background:#e7f6f4; color:#0b7a6e; }  /* Mitigated */
.dash-st-8 { background:#ede9fe; color:#6d28d9; }  /* Staged */
.dash-st::before { content:''; display:inline-block; width:6px; height:6px; border-radius:50%; background:currentColor; margin-right:6px; vertical-align:middle; }
/* Dashboard ticket-row cells (mock look) */
.dash-tk { text-decoration:none; }
.dash-tk-id { color:#98a2b3; font-weight:600; font-variant-numeric:tabular-nums; }
.dash-tk-title { color:#3056d3; font-weight:650; }
.dash-tk:hover .dash-tk-title { text-decoration:underline; }
.dash-chip-reply { display:inline-block; margin-left:6px; font-size:.72rem; font-weight:650; color:#0b7a6e; background:#e7f6f4; border-radius:999px; padding:2px 9px; white-space:nowrap; }
.dash-prio { display:inline-block; min-width:24px; text-align:center; font-size:.75rem; font-weight:700; color:#5a6672; background:#eef1f5; border-radius:7px; padding:2px 8px; font-variant-numeric:tabular-nums; }

/* Dashboard KPI tiles (replace legacy green stat cards) + section subtitle */
.dash-tiles { display:grid; grid-template-columns:repeat(3,1fr) 1.4fr; gap:14px; margin-bottom:16px; }
@media (max-width:820px){ .dash-tiles { grid-template-columns:1fr 1fr; } }
.dash-tile { position:relative; overflow:hidden; border-radius:12px; padding:16px 18px 14px; background:#239561; color:#fff; border:1px solid rgba(16,24,40,.06); box-shadow:0 1px 3px rgba(16,24,40,.12); }
.dash-tile .tile-ic { position:absolute; right:-10px; top:-6px; font-size:70px; line-height:1; color:rgba(255,255,255,.26); transform:rotate(12deg); pointer-events:none; }
.dash-tile .rail { display:none; }
.dash-tile .k { position:relative; z-index:1; font-size:12px; color:rgba(255,255,255,.92); font-weight:600; letter-spacing:.02em; text-transform:uppercase; }
.dash-tile .v { position:relative; z-index:1; font-size:30px; font-weight:800; margin-top:4px; letter-spacing:-.02em; color:#fff; font-variant-numeric:tabular-nums; }
.dash-tile a { position:relative; z-index:1; margin-top:10px; padding-top:8px; display:flex; align-items:center; justify-content:space-between; gap:6px; border-top:1px solid rgba(255,255,255,.3); font-size:12.5px; color:#fff; text-decoration:none; font-weight:600; }
.dash-tile a:hover { color:#fff; text-decoration:none; opacity:.9; }
.dash-tile .none { position:relative; z-index:1; margin-top:10px; padding-top:8px; display:block; border-top:1px solid rgba(255,255,255,.3); font-size:12px; color:rgba(255,255,255,.85); }
.dash-tile.mute { background:#239561; color:#fff; border-color:rgba(16,24,40,.06); box-shadow:0 1px 3px rgba(16,24,40,.12); opacity:.9; }
.dash-tile.mute .tile-ic { color:rgba(255,255,255,.2); }
.dash-tile.mute .k { color:rgba(255,255,255,.82); }
.dash-tile.mute .v { color:rgba(255,255,255,.5); font-weight:700; }
.dash-tile.mute .none { border-top-color:rgba(255,255,255,.28); color:rgba(255,255,255,.82); }
.dash-tile.welcome { background:#eef2ff; color:#3a4657; border-color:transparent; box-shadow:none; }
.dash-tile.welcome .tile-ic { display:none; }
.dash-tile.welcome .k { color:#2942a8; }
.dash-tile.welcome p { position:relative; z-index:1; margin:6px 0 0; font-size:12.5px; color:#3a4657; line-height:1.45; }
.dash-sec-tt { display:flex; flex-direction:column; min-width:0; }
.dash-sec-sub { font-size:11.5px; color:#697586; margin-top:1px; font-weight:400; }
