/* ── Global ── */
body { background-color: #f0f2f5; margin: 0; }

/* django-crispy-forms marks every required field's label with this span —
   Bootstrap itself doesn't color it, so without this it's plain body text. */
.asteriskField { color: #dc3545; margin-left: 2px; font-weight: 700; }
.requiredField { font-weight: 600; }

/* IE sheet rating radios (single_ie_form.html / hrbp_ie_form.html).
   Bootstrap's default unchecked ring (#dee2e6) is too faint to spot before
   the first click — darkened so every bubble is clearly visible up front.
   Checked stays Bootstrap's default blue. Size left as-is. */
.ie-rating-radio {
    border-color: #6c757d;
}
.ie-rating-radio:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* ── Sidebar ── */
/* .sidebar {
    width: 230px; height: 100vh; background-color: #1a3a5c;
    position: fixed; top: 0; left: 0; z-index: 100;
    display: flex; flex-direction: column;
} */

.sidebar {
    width: 230px;
    background-color: #1a3a5c;
 
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
 
    z-index: 100;
 
    display: flex;
    flex-direction: column;
 
    min-height: 0;
    overflow: hidden;
    box-sizing: border-box;
}
.sidebar-brand {
    padding: 12px 16px; color: #fff; font-weight: 700;
    font-size: .95rem; border-bottom: 1px solid rgba(255,255,255,.12); letter-spacing: .3px;
    flex: 0 0 auto;
}
/* Only the link list scrolls when it's too tall for the viewport — the
   brand header and footer (incl. Logout) stay pinned in place and are
   always visible, instead of the whole sidebar scrolling and letting
   Logout end up pushed off-screen with no way to reach it. min-height:0
   is what actually lets a flex child shrink below its content size enough
   to scroll — without it this rule is silently ignored. */
/* .sidebar nav {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
} */
.sidebar nav {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* The icon's lower half fades to a dark navy close to the sidebar's own
   background color, so it sits on its own light chip for contrast — the
   "Talent Minds" text next to it is plain white, same as the rest of the
   sidebar, no chip needed. */
.sidebar-brand-logo {
    height: 32px; width: auto; display: block;
    background: #fff; border-radius: 8px; padding: 3px;
}
.sidebar .nav-link {
    color: #9dbbd6; padding: 11px 20px; display: flex; align-items: center;
    gap: 12px; font-size: .88rem; border-left: 3px solid transparent;
    transition: all .18s; text-decoration: none;
}
.sidebar .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; }
.sidebar .nav-link:hover  { color: #fff; background: rgba(255,255,255,.08); border-left-color: #5aabff; }
.sidebar .nav-link.active { color: #fff; background: rgba(255,255,255,.13); border-left-color: #5aabff; }

.sidebar .nav-group-row { display: flex; align-items: stretch; }
.sidebar .nav-group-row .nav-link { flex: 1 1 auto; }
.sidebar .nav-group-toggle {
    background: none; border: none; color: #9dbbd6; padding: 0 18px;
    display: flex; align-items: center; cursor: pointer;
}
.sidebar .nav-group-toggle:hover { color: #fff; }
.sidebar .nav-group-toggle .bi { transition: transform .18s; }
.sidebar .nav-group-toggle[aria-expanded="true"] .bi { transform: rotate(180deg); }
.sidebar .nav-sublink { padding-left: 50px; font-size: .82rem; }
/* .sidebar-footer {
    flex: 0 0 auto; padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,.12);
} */

.sidebar-footer {
    flex: 0 0 auto;
    flex-shrink: 0;
 
    padding: 14px 16px;
 
    border-top: 1px solid rgba(255,255,255,.12);
    background-color: #1a3a5c;
}

/* ── Main wrapper ── */
.main-wrapper { margin-left: 230px; min-height: 100vh; display: flex; flex-direction: column; }
.top-bar {
    background: #fff; padding: 10px 24px; border-bottom: 1px solid #e2e6ea;
    display: flex; align-items: center; justify-content: flex-end;
}
.main-content { padding: 24px; flex: 1; min-width: 0; }

/* ── Responsive layout ── */
/* Sidebar toggle button + close button only ever show below the sidebar
   breakpoint (see the max-width:991.98px block below) — hidden by default
   so desktop keeps the plain always-visible sidebar it always had. */
.sidebar-toggle-btn, .sidebar-close-btn {
    display: none;
    background: none; border: none; padding: 4px 8px; font-size: 1.3rem;
    line-height: 1; cursor: pointer;
}
.sidebar-toggle-btn { color: #1a3a5c; }
.sidebar-close-btn  { color: #fff; }
.sidebar-backdrop {
    display: none;
    position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 99;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: 3px 0 16px rgba(0,0,0,.3);
    }
    .sidebar.show { transform: translateX(0); }
    .sidebar-backdrop.show { display: block; }
    .main-wrapper { margin-left: 0; }
    .sidebar-toggle-btn, .sidebar-close-btn { display: inline-flex; align-items: center; }
    /* Sidebar is an overlay at this width, so the page behind it shouldn't
       scroll while it's open. */
    body.sidebar-open { overflow: hidden; }
}

@media (max-width: 575.98px) {
    .main-content { padding: 14px; }
    .top-bar { padding: 10px 14px; }
    .sidebar { width: 85vw; max-width: 280px; }
}

/* ── Desktop icon-only sidebar collapse (body.sidebar-collapsed) ──
   Separate from the mobile off-canvas toggle above; only takes effect at
   desktop widths since the sidebar is already an overlay below that.
   Labels are hidden via font-size:0 on the link itself rather than
   restructuring every nav-link's markup into icon+span — the icon's own
   font-size is re-asserted below so it stays fully visible. */
@media (min-width: 992px) {
    .sidebar { transition: width .2s ease; }
    .main-wrapper { transition: margin-left .2s ease; }
    body.sidebar-collapsed .sidebar { width: 68px; }
    body.sidebar-collapsed .main-wrapper { margin-left: 68px; }
    body.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 12px 8px; }
    body.sidebar-collapsed .sidebar-brand span { font-size: 0; gap: 0; }
    body.sidebar-collapsed .sidebar-close-btn { display: none; }
    body.sidebar-collapsed .sidebar .nav-link { font-size: 0; justify-content: center; padding: 11px 0; gap: 0; }
    body.sidebar-collapsed .sidebar .nav-link i { font-size: 1.05rem; }
    body.sidebar-collapsed .sidebar .nav-group-row .nav-link { flex: 0 1 auto; }
    body.sidebar-collapsed .sidebar .nav-group-toggle,
    body.sidebar-collapsed .sidebar .nav-sublink,
    body.sidebar-collapsed .sidebar .nav-link .badge {
        display: none;
    }
    body.sidebar-collapsed .sidebar-footer button { font-size: 0; gap: 0; }
    body.sidebar-collapsed .sidebar-footer button i { font-size: 1.05rem; }
    body.sidebar-collapsed .sidebar-footer .nav-label { display: none; }
}

/* Every table gets wrapped in .table-responsive at runtime (see base.html)
   so a wide table scrolls horizontally within itself instead of forcing the
   whole page wider than the viewport. */
.table-responsive { width: 100%; }

/* ── Cards ── */
.card { box-shadow: 0 2px 8px rgba(0,0,0,.08); border: none; border-radius: 10px; }
.card-header { background-color: #1a3a5c; color: #fff; border-radius: 10px 10px 0 0 !important; }

/* ── Buttons ── */
.btn-primary { background-color: #0056b3; border: none; }
.btn-primary:hover { background-color: #004085; }

/* ── Stat cards ── */
.stat-card {
    cursor: pointer; transition: transform .15s, box-shadow .15s;
    text-decoration: none !important; display: block;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.18) !important; }
.stat-card.active-filter { outline: 3px solid #ffc107; outline-offset: 3px; }

/* Django Form Default Input Field Styles */
.card-body form input[type="text"]:not(.input-group *),
.card-body form input[type="password"],
.card-body form input[type="email"],
.card-body form select:not(.input-group *) {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.card-body form input[type="text"]:not(.input-group *):focus,
.card-body form input[type="password"]:focus,
.card-body form input[type="email"]:focus,
.card-body form select:not(.input-group *):focus {
    color: #212529;
    background-color: #fff;
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Stage field rows mix short and long field labels (e.g. "Date of Final
   Offer Shared for Signature to BU Head" next to "Date of Final Offer
   Rolled Out") — a wrapped two-line label pushes that column's input down,
   leaving it out of line with its neighbors'. Bottom-align each column's
   content instead, so the inputs stay level regardless of label length. */
.stage-fields-row > [class*="col-"] {
    display: flex;
}
.stage-fields-row > [class*="col-"] > div {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: 100%;
}
