/*
 * admin-theme.css
 * Applies the Datya design system to the MVC application.
 * Overrides NiceAdmin (style.css) with the Datya brand colours / fonts.
 */

/* ── Google Fonts (also referenced in _Layout) ─────────────────────── */
/* Karina (brand) is self-hosted from the supplied TTF so the exact brand face
   is used; Poppins/Inter/Nunito still come from Google. @import must precede
   other rules, so the @font-face for Karina follows it below. */
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Inter:wght@300;400;500;600&family=Nunito:wght@300;400;500;600;700;800&display=swap');

@font-face {
    font-family: 'Karina';
    src: url('/fonts/Karina.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ── Design Tokens ──────────────────────────────────────────────────── */
:root {
    --pu:  #5b4fcf;
    --pdk: #4a3fb8;
    --plt: #7b6fd8;
    --pale:#edeafb;
    --vh:  #2d1b69;
    --or:  #e8653a;
    --olt: #f07a50;
    --tl:  #3abfb1;
    --ic:  #5b4fcf;
    --gc:  #2daa88;
    --rc:  #e05252;
    --td:  #1a1a2e;
    --tb:  #4a4a6a;
    --tm:  #7a7a9a;
    --bd:  #e8e6f0;
    --bg:  #f8f7ff;
    --sh:  0 4px 20px rgba(91,79,207,.12);
    --sl:  0 12px 40px rgba(91,79,207,.18);
    --r:   14px;
    --rl:  22px;
    --rs:  8px;
    /* Bootstrap 5 colour overrides */
    --bs-primary:         #5b4fcf;
    --bs-primary-rgb:     91,79,207;
    --bs-body-font-family:'Inter', sans-serif;
    --bs-body-color:      #2d2d2d;
    --bs-body-bg:         #f8f7ff;
    --bs-border-color:    #e8e6f0;
    --bs-border-radius:   14px;
    --bs-border-radius-sm:8px;
    --bs-border-radius-lg:22px;
    --bs-link-color:      #5b4fcf;
    --bs-link-hover-color:#4a3fb8;
    --surface: #fff;
}

/* ── Theme accent presets ───────────────────────────────────────────────
   Toggled via body[data-accent] by admin-theme-switcher.js. Recolors
   every element that reads --pu/--pdk/--plt/--pale (buttons, links, active
   nav state, badges, icons) app-wide — this is most of the accent colour
   in the UI, since admin-theme.css uses these tokens throughout. */
body[data-accent="blue"]   { --pu:#2f6fed; --pdk:#2456bd; --plt:#6fa1ff; --pale:#e8f0fe; --vh:#173a80; --bs-primary:#2f6fed; --bs-primary-rgb:47,111,237; --bs-link-color:#2f6fed; --bs-link-hover-color:#2456bd; }
body[data-accent="green"]  { --pu:#1f9d6b; --pdk:#177d55; --plt:#4fc290; --pale:#e5f7ee; --vh:#0f5238; --bs-primary:#1f9d6b; --bs-primary-rgb:31,157,107; --bs-link-color:#1f9d6b; --bs-link-hover-color:#177d55; }
body[data-accent="orange"] { --pu:#e0692f; --pdk:#bb5322; --plt:#f0a066; --pale:#fdf0e6; --vh:#7a3512; --bs-primary:#e0692f; --bs-primary-rgb:224,105,47;  --bs-link-color:#e0692f; --bs-link-hover-color:#bb5322; }
body[data-accent="rose"]   { --pu:#d84a7c; --pdk:#b23a63; --plt:#ec83a8; --pale:#fbe9f0; --vh:#7a1f42; --bs-primary:#d84a7c; --bs-primary-rgb:216,74,124;  --bs-link-color:#d84a7c; --bs-link-hover-color:#b23a63; }

/* ── Dark mode ─────────────────────────────────────────────────────────
   Toggled via body[data-mode="dark"]. --surface (see :root above) is the
   single token nearly every card/toolbar/list surface in this file reads
   for its background — overriding it here is what makes .data-card,
   .dashboard-card, .project-card, .tb-search, dep-rows, rb-stat-cards,
   the theme panel, sidebar, and user menu all go dark together. The
   blocks below layer on top for the pieces that don't use --surface:
   Bootstrap's own component defaults (modals, dropdowns, accordions,
   pagination, form checks) which ship with hardcoded light colours in
   bootstrap.min.css, plus a few page-specific bits that used literal
   hex instead of tokens. The Dashboard/Analysis "ap-*" table system and
   the public landing page keep their own independent palettes and are
   out of scope here — see dashboard.css for the Dashboard page itself. */
body[data-mode="dark"] {
    --td:#f0f0f7; --tb:#c7c7d8; --tm:#9797ad; --bd:#33334a; --bg:#131320;
    --pale:rgba(255,255,255,.06);
    --surface:#1c1c2c;
    --sh:0 4px 20px rgba(0,0,0,.35); --sl:0 12px 40px rgba(0,0,0,.5);
    --bs-body-color:#e6e6f0; --bs-body-bg:#131320; --bs-border-color:#33334a;
}
body[data-mode="dark"] { color:#e6e6f0; }

/* App shell pieces that don't read --surface (rgba/opacity effects) */
body[data-mode="dark"] .da-navbar { background:rgba(28,28,44,.97) !important; }
body[data-mode="dark"] .da-footer { color:var(--tm); }
body[data-mode="dark"] .sidebar-nav .nav-link:hover,
body[data-mode="dark"] .da-dd-item:hover,
body[data-mode="dark"] .card-dropdown a:hover { background:rgba(255,255,255,.06) !important; }

/* Form controls (inputs, selects, textareas) */
body[data-mode="dark"] .form-control,
body[data-mode="dark"] .form-select,
body[data-mode="dark"] textarea.form-control,
body[data-mode="dark"] #main.main .form-control,
body[data-mode="dark"] #main.main .form-select,
body[data-mode="dark"] .tb-search,
body[data-mode="dark"] .tb-select,
body[data-mode="dark"] .db-select {
    background: var(--surface) !important;
    color: #e6e6f0 !important;
    border-color: var(--bd) !important;
}
body[data-mode="dark"] .form-control::placeholder,
body[data-mode="dark"] .tb-search input::placeholder { color: var(--tm); }
body[data-mode="dark"] .form-control:disabled,
body[data-mode="dark"] .form-select:disabled { background: rgba(255,255,255,.03) !important; color: var(--tm) !important; }
/* Native calendar/time picker follows dark mode too */
body[data-mode="dark"] input[type="date"],
body[data-mode="dark"] input[type="datetime-local"],
body[data-mode="dark"] input[type="time"],
body[data-mode="dark"] input[type="month"],
body[data-mode="dark"] input[type="week"] { color-scheme: dark; }
/* Checkboxes / radios / range / switches (Bootstrap form-check + native) */
body[data-mode="dark"] .form-check-input,
body[data-mode="dark"] input[type="checkbox"],
body[data-mode="dark"] input[type="radio"] {
    background-color: rgba(255,255,255,.08);
    border-color: var(--bd);
}
body[data-mode="dark"] .form-check-input:checked {
    background-color: var(--pu);
    border-color: var(--pu);
}

/* Modals — Bootstrap ships these with a hardcoded white background */
body[data-mode="dark"] .modal-content {
    background: var(--surface);
    color: #e6e6f0;
    border-color: var(--bd);
}
body[data-mode="dark"] .modal-header,
body[data-mode="dark"] .modal-footer { border-color: var(--bd); }
body[data-mode="dark"] .modal-title { color: #f0f0f7; }
body[data-mode="dark"] .btn-close { filter: invert(1) grayscale(1); }

/* Dropdown menus (Bootstrap default + card-dropdown context menus) */
body[data-mode="dark"] .dropdown-menu,
body[data-mode="dark"] .card-dropdown {
    background: var(--surface) !important;
    border-color: var(--bd) !important;
    color: #e6e6f0;
}
body[data-mode="dark"] .dropdown-item,
body[data-mode="dark"] .card-dropdown a { color: #c7c7d8; }
body[data-mode="dark"] .dropdown-item:hover,
body[data-mode="dark"] .dropdown-item:focus { background: rgba(255,255,255,.06); color: #f0f0f7; }
body[data-mode="dark"] .dropdown-divider { border-color: var(--bd); }

/* Accordions (Manage.cshtml sections, View/ViewLN response tables) */
body[data-mode="dark"] .accordion-item {
    background: var(--surface);
    border-color: var(--bd);
    color: #e6e6f0;
}
body[data-mode="dark"] .accordion-button {
    background: var(--surface);
    color: #e6e6f0;
}
body[data-mode="dark"] .accordion-button:not(.collapsed) {
    background: rgba(91,79,207,.12);
    color: #fff;
}
body[data-mode="dark"] .accordion-button::after { filter: invert(1) grayscale(1); }
body[data-mode="dark"] .accordion-body { background: var(--surface); color: #e6e6f0; }

/* Tables — swap the light-on-light stripe/hover tints for dark equivalents */
body[data-mode="dark"] #main.main .table tbody tr:nth-child(odd) { background: rgba(255,255,255,.03) !important; }
body[data-mode="dark"] #main.main .table tbody tr:hover { background: rgba(91,79,207,.14) !important; }
body[data-mode="dark"] #main.main .table tbody td { color: #c7c7d8; }
body[data-mode="dark"] .table > :not(caption) > * > * { color: inherit; }
body[data-mode="dark"] .table-bordered,
body[data-mode="dark"] .table-secondary { border-color: var(--bd) !important; }
body[data-mode="dark"] .table-secondary { background: rgba(255,255,255,.05) !important; color: #e6e6f0 !important; }
body[data-mode="dark"] .bg-light { background: rgba(255,255,255,.05) !important; color: #e6e6f0; }

/* Pagination */
body[data-mode="dark"] .pagination .page-link {
    background: var(--surface);
    border-color: var(--bd);
    color: #c7c7d8;
}
body[data-mode="dark"] .pagination .page-item.disabled .page-link { background: rgba(255,255,255,.03); color: var(--tm); }

/* Alerts (Bootstrap default light backgrounds) */
body[data-mode="dark"] .alert-success { background: rgba(45,170,136,.15); color: #7fe0c0; border-color: rgba(45,170,136,.3); }
body[data-mode="dark"] .alert-danger  { background: rgba(224,82,82,.15); color: #f3a5a5; border-color: rgba(224,82,82,.3); }
body[data-mode="dark"] .alert-warning { background: rgba(232,101,58,.15); color: #f5b58f; border-color: rgba(232,101,58,.3); }

/* ── Base ───────────────────────────────────────────────────────────── */
body {
    font-family: 'Inter', sans-serif;
    color: #2d2d2d;
    background: var(--bg);
    line-height: 1.6;
}

h1,h2,h3,h4,h5,h6 {
    font-family: 'Poppins', sans-serif;
    color: var(--td);
}

a { color: var(--pu); }
a:hover { color: var(--pdk); }

.qb, .brand-font {
    font-family: 'Karina', cursive !important;
    font-style: normal !important;
    letter-spacing: .01em;
}

/* ── Navbar ─────────────────────────────────────────────────────────── */
.da-navbar {
    background: rgba(255,255,255,.97) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--bd) !important;
    box-shadow: none !important;
    transition: box-shadow .3s;
    height: 62px;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.da-navbar.scrolled {
    box-shadow: var(--sh) !important;
}

.da-navbar .navbar-brand {
    font-family: 'Karina', cursive;
    font-size: 1.7rem;
    color: var(--pu) !important;
    line-height: 1;
    padding: 0;
    text-decoration: none;
}

.da-navbar .nav-link {
    color: var(--tb) !important;
    font-size: .875rem;
    font-weight: 500;
}

.da-navbar .nav-link:hover { color: var(--pu) !important; }

/* Navbar action buttons */
.btn-outline-da {
    font-size: .875rem;
    font-weight: 600;
    color: var(--pu) !important;
    padding: 7px 18px;
    border-radius: 6px;
    border: 1.5px solid var(--pu) !important;
    background: transparent !important;
    transition: all .2s;
    text-decoration: none;
}
.btn-outline-da:hover {
    background: var(--pu) !important;
    color: #fff !important;
}

.btn-da-cta {
    background: var(--pu) !important;
    color: #fff !important;
    padding: 8px 22px;
    border-radius: 6px;
    font-size: .875rem;
    font-weight: 600;
    border: none;
    box-shadow: 0 3px 12px rgba(91,79,207,.3);
    transition: background .2s, transform .15s;
    text-decoration: none;
}
.btn-da-cta:hover {
    background: var(--pdk) !important;
    transform: translateY(-1px);
    color: #fff !important;
}

/* Upgrade pill */
.upgrade-btn {
    font-size: .72rem;
    font-weight: 700;
    color: var(--or) !important;
    border: 1.5px solid var(--or);
    border-radius: 100px;
    padding: 4px 14px;
    transition: all .2s;
    background: transparent;
    text-decoration: none;
    white-space: nowrap;
}
.upgrade-btn:hover {
    background: var(--or);
    color: #fff !important;
}

/* ── Theme selector (accent colour + light/dark mode) ────────────────── */
.theme-wrap { position: relative; }
.theme-trigger {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 8px;
    border: 1px solid var(--bd); background: transparent; color: var(--tb);
    cursor: pointer; font-size: 1rem; position: relative;
    transition: border-color .15s ease, color .15s ease;
}
.theme-trigger:hover,
.theme-trigger.show { border-color: var(--pu); color: var(--pu); }
.theme-panel {
    display: none; position: absolute; right: 0; top: 44px; width: 230px;
    background: var(--surface); border: 1px solid var(--bd); border-radius: 12px;
    box-shadow: var(--sl); padding: 16px; z-index: 1030;
}
.theme-panel.open { display: block; }
.theme-panel .tp-label {
    font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; color: var(--tm); margin-bottom: 10px;
}
.theme-panel .tp-label:not(:first-child) { margin-top: 16px; }
.tp-swatches { display: flex; gap: 10px; }
.tp-swatch {
    width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
    border: 2px solid transparent; padding: 0;
    display: flex; align-items: center; justify-content: center; color: #fff; font-size: .75rem;
    transition: transform .15s ease;
}
.tp-swatch:hover { transform: scale(1.08); }
.tp-swatch.selected { border-color: var(--td); }
.tp-swatch[data-accent="purple"] { background: #5b4fcf; }
.tp-swatch[data-accent="blue"]   { background: #2f6fed; }
.tp-swatch[data-accent="green"]  { background: #1f9d6b; }
.tp-swatch[data-accent="orange"] { background: #e0692f; }
.tp-swatch[data-accent="rose"]   { background: #d84a7c; }
.tp-modes { display: flex; gap: 8px; }
.tp-mode-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 10px 6px; border: 1.5px solid var(--bd); border-radius: 9px;
    background: transparent; color: var(--tb); cursor: pointer; font-size: .72rem;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.tp-mode-btn.selected { border-color: var(--pu); color: var(--pu); background: var(--pale); }

/* ── User dropdown trigger ──────────────────────────────────────────── */
.da-user-trigger {
    display:      inline-flex;
    align-items:  center;
    gap:          .42rem;
    padding:      .3rem .65rem .3rem .38rem;
    border-radius: 20px;
    border:       1.5px solid rgba(91,79,207,.2);
    background:   rgba(91,79,207,.04);
    cursor:       pointer;
    font-family:  'Inter', sans-serif;
    font-size:    .88rem;
    font-weight:  600;
    color:        var(--tb);
    transition:   background .2s, border-color .2s;
    white-space:  nowrap;
    line-height:  1;
}
.da-user-trigger::after { display: none !important; }
.da-user-trigger:hover,
.da-user-trigger.show {
    background:   rgba(91,79,207,.09);
    border-color: var(--pu);
    color:        var(--pu);
}

.da-user-avatar {
    width:          28px;
    height:         28px;
    border-radius:  50%;
    background:     linear-gradient(135deg, var(--pu) 0%, var(--plt) 100%);
    color:          #fff;
    display:        flex;
    align-items:    center;
    justify-content: center;
    flex-shrink:    0;
    box-shadow:     0 2px 6px rgba(91,79,207,.3);
}

.da-user-name {
    max-width:     120px;
    overflow:      hidden;
    text-overflow: ellipsis;
    white-space:   nowrap;
}

.da-chevron {
    opacity:    .55;
    transition: transform .2s;
    flex-shrink: 0;
}
.da-user-trigger.show .da-chevron { transform: rotate(180deg); }

/* ── User dropdown menu ─────────────────────────────────────────────── */
.da-user-menu {
    background:    var(--surface) !important;
    border:        1px solid rgba(91,79,207,.12) !important;
    border-radius: 12px !important;
    padding:       .4rem !important;
    box-shadow:    0 8px 30px rgba(91,79,207,.15) !important;
    min-width:     170px !important;
    margin-top:    .4rem !important;
}

.da-dd-item {
    display:       flex !important;
    align-items:   center !important;
    gap:           .55rem !important;
    font-family:   'Inter', sans-serif;
    font-size:     .875rem !important;
    font-weight:   500 !important;
    padding:       .45rem .8rem !important;
    border-radius: 7px !important;
    color:         var(--tb) !important;
    background:    none;
    border:        none;
    width:         100%;
    text-align:    left;
    cursor:        pointer;
    text-decoration: none;
    transition:    background .15s;
}
.da-dd-item svg { opacity: .65; flex-shrink: 0; }
.da-dd-item:hover {
    background: var(--pale) !important;
    color:      var(--pu) !important;
}
.da-dd-item:hover svg { opacity: 1; }

.da-signout-item {
    color: #d93025 !important;
}
.da-signout-item svg { color: #d93025; }
.da-signout-item:hover {
    background: rgba(217,48,37,.07) !important;
    color:      #b5271c !important;
}

/* ── Subscription plan badge (small, next to user trigger) ─────────── */
.da-nav-plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: .74rem;
    font-weight: 600;
    color: var(--pu);
    background: var(--pale);
    border: 1.5px solid rgba(91,79,207,.18);
    border-radius: 100px;
    padding: 6px 12px;
    line-height: 1.2;
    transition: background .15s, border-color .15s, box-shadow .15s;
}
.da-nav-plan-badge:hover,
.da-nav-plan-badge:focus {
    background: rgba(91,79,207,.14);
    border-color: rgba(91,79,207,.32);
    color: var(--pu);
    box-shadow: 0 2px 10px rgba(91,79,207,.15);
}
.da-nav-plan-badge i.bi {
    font-size: .8rem;
}
.da-nav-plan-badge::after {
    margin-left: 0;
    vertical-align: 0;
    opacity: .7;
}
.da-nav-plan-badge[aria-expanded="true"] {
    background: rgba(91,79,207,.14);
    border-color: rgba(91,79,207,.32);
}

/* ── Data Collection App button (topbar, leftmost of the right-side cluster) ──
   Uses --tl (teal) rather than --pu (purple, reserved for plan/branding)
   so this reads as a distinct action at a glance: purple = your
   subscription, teal = jump to the field data-collection app. --tl is
   the same teal already used for "view"/data-oriented actions elsewhere
   (.qi-btn.qi-view, .dashboard-card.tl) and isn't remapped by the accent
   switcher, so it stays a stable, recognizable "data" color in every theme.
   Solid gradient fill (rather than the outline style used by the plan
   badge) so it's the first thing the eye catches — it's the button staff
   use most, to jump out and actually collect data. */
.da-userview-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: 'Poppins', sans-serif;
    font-size: .78rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--tl), #2a9d94);
    border: none;
    border-radius: 100px;
    padding: 7px 16px;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(58,191,177,.35);
    transition: transform .15s, box-shadow .15s;
}
.da-userview-btn i.bi {
    font-size: .85rem;
}
.da-userview-btn:hover,
.da-userview-btn:focus {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(58,191,177,.45);
    text-decoration: none;
}

/* Legacy selectors kept for graceful fallback */
.user-hello { display: none; }
.logout-btn { display: none; }

/* Toggle sidebar icon */
.toggle-sidebar-btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    font-size: 1.3rem;
    color: var(--pu);
    transition: background .18s ease, color .18s ease;
}
.toggle-sidebar-btn:hover { background: var(--pale); }

/* User View button — mirrors client-side .admin_view_btn */
.userview-btn {
    display:         inline-flex;
    align-items:     center;
    gap:             .35rem;
    font-size:       .8rem;
    font-weight:     600;
    color:           var(--pu) !important;
    background:      rgba(91,79,207,.08);
    border:          1.5px solid rgba(91,79,207,.22);
    border-radius:   6px;
    padding:         .3rem .75rem;
    cursor:          pointer;
    white-space:     nowrap;
    text-decoration: none !important;
    line-height:     1;
    transition:      background .2s ease, color .2s ease,
                     border-color .2s ease, transform .15s ease;
}
.userview-btn svg { flex-shrink: 0; }
.userview-btn:hover {
    background:    var(--pu) !important;
    color:         #fff !important;
    border-color:  var(--pu);
    transform:     translateY(-1px);
}
.userview-btn:active { transform: scale(.96); }

/* ══════════════════════════════════════════════════════════════════════
   SIDEBAR  — light override of NiceAdmin style.css
   (was a dark-purple gradient in an earlier pass; the real wireframe
   uses a light sidebar matching the rest of the app's surface/bg tokens)
   ══════════════════════════════════════════════════════════════════════ */

/* Container — values match the wireframe's .custom-sidebar exactly */
#sidebar {
    background: var(--surface) !important;
    border-right: 1px solid var(--bd) !important;
    padding: 16px 10px !important;
    top: 62px !important;           /* matches .da-navbar height exactly */
}

/* ── Section headings ─────────────────────────────────────────────── */
#sidebar .nav-heading {
    color: var(--tm) !important;
    font-size: .68rem !important;
    font-weight: 700 !important;
    letter-spacing: .08em !important;
    text-transform: uppercase !important;
    margin: 16px 10px 8px !important;
    padding: 0 !important;
}

/* ── CRITICAL: Reset <li> background — site.css bleeds .nav-item.active
       background-color:#dbebfc onto the <li> element itself.           ── */
#sidebar .sidebar-nav .nav-item,
#sidebar .sidebar-nav .nav-item.active {
    background: transparent !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

/* ── All nav-link states (override NiceAdmin .collapsed & default) ─── */
#sidebar .sidebar-nav .nav-link,
#sidebar .sidebar-nav .nav-link.collapsed {
    display: flex !important;
    align-items: center !important;
    color: var(--tb) !important;
    background: transparent !important;
    border-radius: 8px !important;
    margin: 0 0 2px !important;
    padding: 9px 10px !important;
    font-size: .86rem !important;
    font-weight: 500 !important;
    border: none !important;
    gap: 10px !important;
    transition: background .18s ease, color .18s ease !important;
    text-decoration: none !important;
}

/* SVG icon images — natural dark fill at lower opacity, fixed size */
#sidebar .sidebar-nav .nav-link img:not(.chevron-icon) {
    opacity: .55 !important;
    transition: opacity .18s !important;
    flex-shrink: 0;
    width: 16px !important;
    height: 16px !important;
}

/* ── Hover ────────────────────────────────────────────────────────── */
#sidebar .sidebar-nav .nav-link:hover,
#sidebar .sidebar-nav .nav-link.collapsed:hover {
    background: var(--pale) !important;
    color: var(--pu) !important;
}
#sidebar .sidebar-nav .nav-link:hover img:not(.chevron-icon),
#sidebar .sidebar-nav .nav-link.collapsed:hover img:not(.chevron-icon) {
    opacity: .85 !important;
}

/* ── Active — solid purple pill, white text/icon for contrast ───────── */
#sidebar .sidebar-nav .nav-item.active > .nav-link,
#sidebar .sidebar-nav .nav-link.active {
    background: var(--pu) !important;
    color: #fff !important;
}
#sidebar .sidebar-nav .nav-item.active > .nav-link img,
#sidebar .sidebar-nav .nav-link.active img {
    filter: brightness(0) invert(1) !important;
    opacity: 1 !important;
}
#sidebar .sidebar-nav .nav-item.active > .nav-link:hover,
#sidebar .sidebar-nav .nav-link.active:hover {
    background: var(--pdk) !important;
}

/* ── Expanded state — sub-menu open ──────────────────────────────── */
#sidebar .sidebar-nav .nav-link:not(.collapsed) {
    background: var(--pale) !important;
    color: var(--pu) !important;
}
#sidebar .sidebar-nav .nav-link:not(.collapsed) img { opacity: .85 !important; }

/* Chevron rotation */
#sidebar .sidebar-nav .nav-link .chevron-icon {
    margin-left: auto !important;
    opacity: .7;
    width: 11px !important;
    height: 11px !important;
    transition: transform .22s ease, opacity .18s !important;
}
#sidebar .sidebar-nav .nav-link:not(.collapsed) .chevron-icon {
    transform: rotate(180deg);
    opacity: .9;
}

/* ── Sub-nav (collapse content) — flat, no wrapper card, matching wireframe ── */
#sidebar .nav-content {
    list-style: none !important;
    padding-left: 28px !important;
    margin: 2px 0 6px !important;
}

/* Reset sub-nav <li> backgrounds too */
#sidebar .nav-content .nav-item,
#sidebar .nav-content .nav-item.active {
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

#sidebar .nav-content a {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    color: var(--tb) !important;
    font-size: .82rem !important;
    padding: 6px 10px !important;
    border-radius: 8px !important;
    margin: 0 -10px !important;
    border: none !important;
    transition: background .18s ease, color .18s ease !important;
    text-decoration: none !important;
}
/* Sub-nav hover */
#sidebar .nav-content a:hover {
    color: var(--pu) !important;
    background: var(--pale) !important;
}
/* Sub-nav active — same pale/purple treatment as hover, since the wireframe
   (a static mock) never needed to define a "currently selected" sub-item state */
#sidebar .nav-content .nav-item.active > a,
#sidebar .nav-content a.active {
    color: var(--pu) !important;
    background: var(--pale) !important;
}
/* Sub-nav dot icons */
#sidebar .nav-content img {
    opacity: .5 !important;
    transition: opacity .18s !important;
    flex-shrink: 0;
}
#sidebar .nav-content a:hover img,
#sidebar .nav-content .nav-item.active > a img,
#sidebar .nav-content a.active img {
    opacity: .85 !important;
}

/* ── Main area ──────────────────────────────────────────────────────── */
body.has-sidebar #main { background: var(--bg); }
.section.register     { background: var(--bg); }

/* ── Authenticated #main — sidebar offset + no inner padding ────────── */
#main.main {
    padding:    0 !important;
    margin-top: 62px !important;       /* matches .da-navbar height  */
    min-height: calc(93vh - 62px);
    transition: margin-left .3s ease;
}

/* Sidebar slide transition (applied via CSS so it works even without JS) */
#sidebar {
    transition: left .3s ease !important;
}

/* ── Desktop ≥1200px — sidebar visible by default; collapses on demand ── */
@media (min-width: 1200px) {
    #sidebar                          { left: 0 !important;      width: 224px !important; }
    #main.main                        { margin-left: 224px !important; }

    /* User explicitly collapsed the sidebar */
    body.sidebar-collapsed #sidebar   { left: -224px !important; }
    body.sidebar-collapsed #main.main { margin-left: 0 !important; }
}

/* ── Mobile / tablet <1200px — sidebar hidden by default; opens on demand ── */
@media (max-width: 1199px) {
    #sidebar                   { left: -224px !important; width: 224px !important; }
    #main.main                 { margin-left: 0 !important; }
    body.sidebar-open #sidebar { left: 0 !important; }
}

/* ── Content section — top-aligned with breathing room ──────────────
   Removes the login-style vertical centering that all Create views
   inherit via justify-content-center on the flex-column section.     */
#main.main .section,
#main.main .section.register {
    padding:          20px 24px !important;
    justify-content:  flex-start !important;  /* top-align, not center  */
    align-items:      stretch    !important;  /* fill full width        */
    min-height:       unset      !important;  /* don't force 100vh      */
}

/* Remove the extra top margin cards carry in these views */
#main.main .section .card.mt-4,
#main.main .section .card.mt-3 {
    margin-top: 0 !important;
}

/* Strip any inner .container that caps content width —
   covers both .section > .container and .card-body > .container  */
#main.main .section > .container,
#main.main .section.register > .container,
#main.main .card-body > .container {
    max-width:     none !important;
    padding-left:  0    !important;
    padding-right: 0    !important;
    width:         100% !important;
}

/* Normalize form-group margin (m-3 = 1rem all sides → bottom-only)   */
#main.main .form-group.m-3 {
    margin: 0 0 16px 0 !important;
}

/* Reset col-sm-2 label widths — they are too narrow inside full-width forms */
#main.main .col-sm-2.col-form-label,
#main.main .col-sm-4.col-form-label {
    width: auto  !important;
    flex:  none  !important;
    padding-left: 0 !important;
}

/* Neutralise legacy percentage-based padding helpers */
.custom-left-padding { padding-left: 0 !important; }
.custom-padding-top  { padding-top:  0 !important; }
.custom-padding-left { padding-left: 0 !important; }

/* Unauthenticated pages (no sidebar): strip any sidebar offset */
#main:not(.main) {
    margin-left:  0 !important;
    margin-top:   0 !important;
    padding-left: 0 !important;
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn-primary {
    background-color: var(--pu) !important;
    border-color: var(--pu) !important;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    border-radius: 8px;
}
.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--pdk) !important;
    border-color: var(--pdk) !important;
    transform: translateY(-1px);
}

.btn-success {
    background-color: var(--gc) !important;
    border-color: var(--gc) !important;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    border-radius: 8px;
}
.btn-warning {
    background-color: var(--or) !important;
    border-color: var(--or) !important;
    color: #fff !important;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    border-radius: 8px;
}
.btn-warning:hover {
    background-color: var(--olt) !important;
    border-color: var(--olt) !important;
    color: #fff !important;
}
.btn-info {
    background-color: var(--tl) !important;
    border-color: var(--tl) !important;
    color: #fff !important;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    border-radius: 8px;
}
.btn-info:hover { color: #fff !important; }

.btn-danger {
    background-color: var(--rc) !important;
    border-color: var(--rc) !important;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    border-radius: 8px;
}

/* btn-dark → re-skin with the brand purple so all Create/Add buttons match */
.btn-dark {
    background-color: var(--pu) !important;
    border-color:     var(--pu) !important;
    color: #fff !important;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    border-radius: 8px;
    transition: background-color .2s, transform .15s;
}
.btn-dark:hover,
.btn-dark:focus {
    background-color: var(--pdk) !important;
    border-color:     var(--pdk) !important;
    color: #fff !important;
    transform: translateY(-1px);
}
.btn-dark:active {
    transform: translateY(0) scale(.98);
}

/* Orange CTA (landing page style) */
.btn-orange {
    background: var(--or);
    color: #fff;
    border: none;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    border-radius: 8px;
    padding: 13px 26px;
    box-shadow: 0 6px 24px rgba(232,101,58,.45);
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.btn-orange:hover {
    background: var(--olt);
    color: #fff;
    transform: translateY(-2px);
}

/* ── Cards ──────────────────────────────────────────────────────────── */
.card {
    border: 1px solid var(--bd) !important;
    border-radius: var(--r) !important;
    box-shadow: var(--sh) !important;
    transition: transform .2s, box-shadow .2s;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--sl) !important;
}
.card-header {
    background: rgba(91,79,207,.05) !important;
    border-bottom: 1px solid var(--bd) !important;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: var(--td);
}

/* ── Forms ──────────────────────────────────────────────────────────── */
.form-control,
.form-select {
    border: 1.5px solid var(--bd);
    border-radius: var(--rs);
    font-family: 'Nunito', sans-serif;
    color: var(--td);
    background: var(--surface);
    transition: border-color .2s;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--pu);
    box-shadow: 0 0 0 3px rgba(91,79,207,.08);
    background: var(--surface);
}
.form-label,
.col-form-label,
#main.main .form-group label {
    font-family: 'Poppins', sans-serif;
    font-size: .78rem;
    font-weight: 600;
    color: var(--tb);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 6px;
    display: block;
}

/* ── Full input styling for all form-controls inside #main ──── */
#main.main .form-control,
#main.main .form-select {
    border: 1.5px solid var(--bd) !important;
    border-radius: var(--rs) !important;
    background: var(--surface) !important;
    color: var(--td) !important;
    font-family: 'Nunito', sans-serif !important;
    font-size: .9rem !important;
    padding: 10px 14px !important;
    transition: border-color .2s, box-shadow .2s !important;
    width: 100%;
}
#main.main .form-control:focus,
#main.main .form-select:focus {
    border-color: var(--pu) !important;
    box-shadow: 0 0 0 3px rgba(91,79,207,.08) !important;
    background: var(--surface) !important;
    outline: none !important;
}
#main.main .form-control::placeholder { color: #bbb8cc !important; }
#main.main textarea.form-control      { resize: vertical; min-height: 42px; }

/* Bootstrap floating labels (the account pages: Change password, Email, ...): the label sits inside the box, so
   the rules above must not show the placeholder under it or pull the text up into it. */
#main.main .form-floating > .form-control {
    height: calc(3.5rem + 3px);
    min-height: calc(3.5rem + 3px);
    padding: 1.625rem .85rem .5rem !important;
    line-height: 1.25;
}
#main.main .form-floating > .form-control::placeholder { color: transparent !important; }
#main.main .form-floating > label {
    padding: 1.05rem .85rem;
    margin-bottom: 0;
    display: flex;
    align-items: flex-start;
    color: var(--tb);
}
#main.main .form-floating > .form-control:focus ~ label,
#main.main .form-floating > .form-control:not(:placeholder-shown) ~ label {
    transform: scale(.85) translateY(-.6rem) translateX(.15rem);
    color: var(--pu);
}
#main.main .form-floating > label::after { background: transparent !important; }

/* ── Pagination ─────────────────────────────────────────────────────── */
.pagination .page-link {
    color: var(--pu);
    border-color: var(--bd);
    font-family: 'Poppins', sans-serif;
    font-size: .8rem;
    font-weight: 500;
    transition: all .2s;
}
.pagination .page-link:hover {
    background: var(--pale);
    border-color: var(--pu);
    color: var(--pdk);
}
.pagination .page-item.active .page-link {
    background-color: var(--pu) !important;
    border-color:     var(--pu) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(91,79,207,.3);
}
.pagination .page-item.disabled .page-link {
    color: var(--tm);
    border-color: var(--bd);
    background: transparent;
}

/* ══════════════════════════════════════════════════════════════════════
   TABLES  —  mirrors the React app's survey_table / user_form_response
   ══════════════════════════════════════════════════════════════════════ */

/* ── Card wrapper (matches React's .user_form_par) ─────────────────── */
#main.main .card {
    border:        1px solid rgba(0,0,0,.06) !important;
    border-radius: 12px !important;
    background:    var(--surface);
    box-shadow:    0 10px 35px rgba(0,0,0,.06) !important;
    transition:    box-shadow .25s ease;
}
#main.main .card:hover {
    box-shadow: 0 14px 45px rgba(0,0,0,.08) !important;
}
#main.main .card-body {
    padding: 1.25rem 1.5rem !important;
}
#main.main .card-title {
    font-family: 'Poppins', sans-serif;
    font-size:   1.1rem;
    font-weight: 700;
    color:       var(--td);
    margin-bottom: .25rem;
}

/* ── Base table reset ───────────────────────────────────────────────── */
#main.main .table {
    width:           100%;
    border-collapse: collapse;
    font-size:       .9rem;
    margin-top:      .5rem;
    background:      transparent !important;
}

/* ── Header ─────────────────────────────────────────────────────────── */
#main.main .table thead {
    background: rgba(91,79,207,.05);
}
#main.main .table thead th {
    padding:        .85rem .75rem;
    font-family:    'Poppins', sans-serif;
    font-size:      .72rem;
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color:          var(--tm);
    border-bottom:  1px solid rgba(0,0,0,.06) !important;
    border-top:     none !important;
    background:     transparent !important;
    white-space:    nowrap;
}

/* ── Body rows ──────────────────────────────────────────────────────── */
#main.main .table tbody tr {
    transition:    background .2s ease;
    border-bottom: 1px solid rgba(0,0,0,.045);
    background:    transparent !important;  /* kill Bootstrap striping  */
}
/* subtle alternating rows (replaces .table-striped) */
#main.main .table tbody tr:nth-child(odd) {
    background: rgba(0,0,0,.018) !important;
}
#main.main .table tbody tr:hover {
    background: rgba(91,79,207,.05) !important;
}

/* ── Body cells ─────────────────────────────────────────────────────── */
#main.main .table tbody td {
    padding:        .85rem .75rem;
    border-bottom:  none !important;
    color:          var(--tb);
    vertical-align: middle;
    font-size:      .875rem;
}

/* ── Action icon buttons (manage column) ────────────────────────────── */
#main.main .table tbody td a:not(.da-edit-link):not(.da-view-link):not(.da-delete-link):not(.assign-pill) {
    display:         inline-flex;
    align-items:     center;
    justify-content: center;
    width:           32px;
    height:          32px;
    border-radius:   7px;
    transition:      background .2s ease, transform .15s ease, box-shadow .15s ease;
    text-decoration: none;
    color:           var(--tb);
}
#main.main .table tbody td a:not(.da-edit-link):not(.da-view-link):not(.da-delete-link):not(.assign-pill):hover {
    transform: translateY(-2px);
}
#main.main .table tbody td a:not(.da-edit-link):not(.da-view-link):not(.da-delete-link):not(.assign-pill):active {
    transform: scale(.9);
}
/* View link — blue */
#main.main .table tbody td a[title="View"],
#main.main .table tbody td a .bi-eye,
#main.main .table tbody td a img[src*="eye"] {
    color: #3865d1;
}
#main.main .table tbody td a[title="View"]:hover {
    background:  rgba(56,101,209,.12);
    box-shadow:  0 4px 8px rgba(56,101,209,.15);
    color:       #3865d1;
}
/* Edit link — green */
#main.main .table tbody td a[title="Edit"],
#main.main .table tbody td a img[src*="pen"] {
    color: #10b981;
}
#main.main .table tbody td a[title="Edit"]:hover {
    background: rgba(16,185,129,.12);
    box-shadow: 0 4px 8px rgba(16,185,129,.15);
}
/* Delete link — red */
#main.main .table tbody td a[title="Delete"],
#main.main .table tbody td a img[src*="trash"] {
    color: #ef4444;
}
#main.main .table tbody td a[title="Delete"]:hover {
    background: rgba(239,68,68,.12);
    box-shadow: 0 4px 8px rgba(239,68,68,.15);
}
/* SVG action icons: non-interactive, allow inline filter/opacity */
#main.main .table tbody td a img {
    pointer-events: none;
}

/* ── "View" text links in Responses table ───────────────────────────── */
#main.main .table tbody td a.me-4 {
    width:     auto;
    padding:   4px 10px;
    font-size: .8rem;
    font-weight: 600;
    border-radius: 6px;
    color: #3865d1;
    gap: 5px;
}
#main.main .table tbody td a.me-4:hover {
    background: rgba(56,101,209,.1);
    transform:  translateY(-1px);
}

/* ── Responsive table (uses data-cell attribute already in views) ─────
   At ≤768 px: hide thead, stack each cell as a labelled row.          */
@media (max-width: 768px) {
    #main.main .table-responsive .table thead tr {
        display: none;
    }
    #main.main .table-responsive .table tbody tr {
        display:       block;
        margin-bottom: .75rem;
        border:        1px solid rgba(0,0,0,.07);
        border-radius: 8px;
        background:    var(--surface) !important;
        box-shadow:    0 2px 8px rgba(0,0,0,.05);
        padding:       .5rem 0;
    }
    #main.main .table-responsive .table tbody tr:nth-child(odd) {
        background: var(--surface) !important;
    }
    #main.main .table-responsive .table tbody td {
        display:               grid;
        grid-template-columns: 16ch auto;
        padding:               .4rem 1rem;
        border-bottom:         none !important;
        font-size:             .85rem;
    }
    #main.main .table-responsive .table tbody td::before {
        content:     attr(data-cell) " :";
        font-weight: 600;
        color:       var(--tm);
        font-size:   .75rem;
        text-transform: uppercase;
        letter-spacing: .04em;
        align-self: center;
    }
    #main.main .table-responsive .table tbody td:first-child { padding-top: .85rem; }
    #main.main .table-responsive .table tbody td:last-child  { padding-bottom: .85rem; }
    /* action buttons — show inline on mobile */
    #main.main .table-responsive .table tbody td a {
        width:  28px;
        height: 28px;
    }
}

/* ── Badges ─────────────────────────────────────────────────────────── */
.badge.bg-primary  { background-color: var(--pu) !important; }
.badge.bg-success  { background-color: var(--gc) !important; }
.badge.bg-warning  { background-color: var(--or) !important; }
.badge.bg-danger   { background-color: var(--rc) !important; }
.badge.bg-info     { background-color: var(--tl) !important; }

/* ── Tag pill utility ───────────────────────────────────────────────── */
.da-tag {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--pu);
    background: rgba(91,79,207,.08);
    padding: 5px 14px;
    border-radius: 100px;
    margin-bottom: 14px;
}

/* ── Section header ─────────────────────────────────────────────────── */
.section-header {
    text-align: center;
    margin-bottom: 48px;
}
.section-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(1.4rem,2.2vw,1.8rem);
    font-weight: 700;
    color: var(--td);
    margin-bottom: 10px;
}
.section-header h2 span { color: var(--pu); }
.section-header p {
    font-size: .875rem;
    color: var(--tm);
    max-width: 64ch;
    margin: 0 auto;
}

/* ── Alerts ─────────────────────────────────────────────────────────── */
.alert-primary {
    background: var(--pale);
    border-color: rgba(91,79,207,.3);
    color: var(--vh);
}

/* ── Pagetitle (NiceAdmin) ──────────────────────────────────────────── */
.pagetitle h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--td);
    margin: 0 0 6px;
}
.pagetitle .breadcrumb-item a { color: var(--pu); }
.pagetitle .breadcrumb-item.active { color: var(--tm); }

/* ── Breadcrumb-nav (the wireframe's own clean breadcrumb, used instead
   of Bootstrap's .breadcrumb component on list/index pages) ──────────── */
.breadcrumb-nav { font-size: .82rem; color: var(--tm); margin-bottom: 8px; }
.breadcrumb-nav a { color: var(--pu); }

/* ── Pagetitle with header action buttons (e.g. Manage Profile's Download
   Data / Delete Account) — a scoped modifier so the plain .pagetitle used
   everywhere else stays a simple block header. ────────────────────────── */
.pagetitle-with-actions { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pagetitle-actions { display: flex; gap: 10px; flex-shrink: 0; }
@media (max-width: 640px) { .pagetitle-with-actions { flex-direction: column; align-items: stretch !important; } }

/* ── Manage Profile (Identity area) — Areas/Identity/Pages/Account/Manage/Index.cshtml ── */
.pf-sections { display: flex; flex-direction: column; gap: 20px; }
.pf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.pf-section { height: 100%; min-width: 0; }
.pf-section .data-card { height: 100%; }
.pf-section .form-card-body { height: 100%; display: flex; flex-direction: column; }
.pf-section .form-card-body > form { display: flex; flex-direction: column; flex: 1; }
@media (max-width: 900px) { .pf-row { grid-template-columns: 1fr; } }

.pf-email-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--bd); border-radius: 9px; margin-bottom: 20px; }
.pf-email-row i { color: var(--tm); }
.pf-email-row span { font-size: .88rem; color: var(--td); font-weight: 600; flex: 1; }
.pf-verified { display: inline-flex; align-items: center; gap: 5px; font-size: .7rem; font-weight: 700; color: var(--gc); background: rgba(45,170,136,.1); padding: 4px 10px; border-radius: 100px; }
.pf-unverified { display: inline-flex; align-items: center; gap: 5px; font-size: .7rem; font-weight: 700; color: var(--or); background: rgba(232,101,58,.1); padding: 4px 10px; border-radius: 100px; }

.pf-2fa-status { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--bg); border: 1px solid var(--bd); border-radius: 9px; margin-bottom: 20px; }
.pf-badge-off, .pf-badge-on { font-size: .72rem; font-weight: 700; padding: 5px 12px; border-radius: 100px; white-space: nowrap; }
.pf-badge-off { background: rgba(122,122,154,.12); color: var(--tm); }
.pf-badge-on { background: rgba(45,170,136,.12); color: var(--gc); }
.pf-2fa-status .grow { flex: 1; }
.pf-2fa-status .grow strong { display: block; font-size: .9rem; color: var(--td); margin-bottom: 2px; }
.pf-2fa-status .grow span { font-size: .8rem; color: var(--tm); }
.pf-recovery { background: var(--pale); border: 1px dashed rgba(91,79,207,.35); border-radius: 9px; padding: 14px 16px; margin-bottom: 20px; }
.pf-recovery strong { font-size: .85rem; color: var(--pu); display: block; margin-bottom: 4px; }
.pf-recovery span { font-size: .8rem; color: var(--tb); }

/* ── Dashboard stat cards ───────────────────────────────────────────── */
.dashboard-card {
    background: var(--surface);
    border: 1px solid var(--bd);
    border-radius: var(--r);
    box-shadow: var(--sh);
    padding: 18px 20px;
    transition: transform .2s, box-shadow .2s;
    position: relative;
    overflow: hidden;
}
.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--pu);
}
.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--sl);
}
.dashboard-card .card-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: rgba(91,79,207,.1);
    color: var(--pu);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 10px;
}
.dashboard-card .card-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--tm);
    margin-bottom: 4px;
}
.dashboard-card .card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--td);
    line-height: 1;
}

/* ── Section header row (e.g. "Your Projects" + New Project button) ──── */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-head h5 { font-size: 1.05rem; font-weight: 700; margin: 0; }

/* ── Project card ───────────────────────────────────────────────────── */
.project-card {
    background: var(--surface);
    border: 1px solid var(--bd);
    border-radius: var(--r);
    box-shadow: var(--sh);
    padding: 16px 16px 14px;
    transition: transform .2s, box-shadow .2s;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.project-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--pu), var(--plt));
}
.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sl);
}
.project-card .da-tag {
    font-size: .64rem;
    padding: 2px 9px;
    margin-bottom: 6px;
}
.project-card .project-name {
    font-family: 'Poppins', sans-serif;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--td);
    line-height: 1.25;
    margin-bottom: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card-menu-wrap { position: relative; flex-shrink: 0; }
.card-menu-btn { background: none; border: none; color: var(--tm); font-size: 1.1rem; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.card-menu-btn:hover { background: var(--pale); color: var(--pu); }
.card-dropdown {
    display: none; position: absolute; right: 0; top: 26px; background: var(--surface); border: 1px solid var(--bd);
    border-radius: 8px; box-shadow: var(--sl); min-width: 150px; z-index: 5; overflow: hidden;
}
.card-dropdown.open { display: block; }
.card-dropdown a { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: .82rem; color: var(--tb); text-decoration: none; }
.card-dropdown a:hover { background: var(--pale); color: var(--pu); }
.card-dropdown a.danger:hover { background: #fdecec; color: var(--rc); }
body[data-mode="dark"] .card-dropdown a:hover { background: rgba(255,255,255,.06); }

.project-card .project-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    color: var(--tm);
    margin: 7px 0 12px;
    flex-grow: 1;
}

/* Compact project-card action buttons — intentionally scoped under .project-card so
   they never affect the app-wide .btn-primary/.btn-warning/.btn-outline-secondary
   styles used on every other page. Bootstrap's .btn-sm still reads oversized next to
   this card's tighter padding/typography, hence a dedicated small pill style here.
   flex:1 1 0 + nowrap keeps all 2-3 buttons on a single row at any card width instead
   of the "Responses" button wrapping onto its own line and inflating card height. */
.project-card .card-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
}
.project-card .card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    min-width: 0;
    gap: 4px;
    padding: 6px 5px;
    border-radius: 7px;
    border: 1.5px solid transparent;
    font-family: 'Poppins', sans-serif;
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: transform .15s ease, background-color .15s ease, color .15s ease, border-color .15s ease;
}
.project-card .card-action:hover {
    transform: translateY(-1px);
    text-decoration: none;
}
.project-card .card-action i {
    font-size: .78rem;
    line-height: 1;
    flex-shrink: 0;
}
.project-card .card-action.action-primary {
    background: var(--pu);
    color: #fff;
}
.project-card .card-action.action-primary:hover { background: var(--pdk); color: #fff; }

    .project-card .card-action.action-collect {
        background: rgba(91,79,207,.08);
        color: var(--pu);
        border-color: var(--bd);
    }
        .project-card .card-action.action-collect:hover {
            background: rgba(91,79,207,.08);
            color: var(--pu);
            border-color: var(--pu);
        }

    .project-card .card-action.action-responses {
        background: rgba(91,79,207,.08);
        color: var(--pu);
        border-color: var(--bd);
    }

.project-card .card-action.action-responses:hover {
    background: rgba(91,79,207,.08);
    color: var(--pu);
    border-color: var(--pu);
}

    .project-card .card-action.action-outline {
        background: rgba(91,79,207,.08);
        color: var(--pu);
        border-color: var(--bd);
    }
        .project-card .card-action.action-outline:hover {
            background: rgba(91,79,207,.08);
            color: var(--pu);
            border-color: var(--pu);
        }

@media (max-width: 420px) {
    .project-card .card-action {
        font-size: .66rem;
        padding: 6px 5px;
        gap: 3px;
    }
    .project-card .card-action i { font-size: .74rem; }
}

/* ── Footer ─────────────────────────────────────────────────────────── */
.da-footer {
    background: var(--surface);
    color: var(--tm);
    border-top: 1px solid var(--bd);
    padding: 10px 24px;
    font-family: 'Inter', sans-serif;
    font-size: .8rem;
    text-align: center;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 12px;
}
.da-footer .qf-brand {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: var(--td);
    letter-spacing: .01em;
}
.da-footer .qf-brand i { font-size: .85rem; color: var(--plt); }
.da-footer .qf-sep { opacity: .35; }
.da-footer .qf-version {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .03em;
    color: var(--tm);
    background: var(--pale);
    border: 1px solid var(--bd);
    padding: 2px 10px;
    border-radius: 100px;
}
@media (max-width: 576px) {
    .da-footer { padding: 16px 16px; font-size: .74rem; }
}

/* ── Back to top ────────────────────────────────────────────────────── */
#btt {
    position: fixed;
    bottom: 28px; right: 28px;
    width: 46px; height: 46px;
    border-radius: 50%;
    background: var(--pu);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 18px rgba(91,79,207,.45);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .3s, transform .3s;
    z-index: 998;
}
#btt.show { opacity: 1; transform: translateY(0); }
#btt:hover { background: var(--pdk); transform: translateY(-3px); }
#btt svg { width: 20px; height: 20px; stroke: #fff; stroke-width: 2.5; fill: none; }

/* ── Animations ─────────────────────────────────────────────────────── */
.fade-in { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }
.fade-in.d1 { transition-delay: .08s; }
.fade-in.d2 { transition-delay: .16s; }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity .65s ease, transform .65s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: .1s; }
.reveal-d2 { transition-delay: .2s; }
.reveal-d3 { transition-delay: .3s; }
.reveal-d4 { transition-delay: .4s; }

/* ── Landing page sections ──────────────────────────────────────────── */

/* Hero */
.lp-hero {
    padding-top: 62px;
    background: linear-gradient(135deg, #1e0f5c 0%, #2d1b69 35%, #3d2580 65%, #4a2d8a 100%);
    min-height: 520px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.lp-hero::before {
    content: '';
    position: absolute;
    width: 700px; height: 700px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(107,90,205,.35) 0%, transparent 70%);
    top: -200px; right: -150px;
    pointer-events: none;
}
.lp-hero::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232,101,58,.2) 0%, transparent 70%);
    bottom: -100px; left: 5%;
    pointer-events: none;
}
.lp-hero-eyebrow {
    font-size: .9rem;
    font-weight: 400;
    letter-spacing: .02em;
    color: rgba(255,255,255,.65);
    margin-bottom: 12px;
}
.lp-hero-title {
    font-family: 'Karina', cursive;
    font-size: clamp(3rem,6vw,4.5rem);
    font-weight: 400;
    color: #fff;
    line-height: 1;
    margin-bottom: 16px;
}
.lp-hero-tagline {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(1.1rem,2.2vw,1.4rem);
    font-weight: 600;
    color: rgba(255,255,255,.9);
    margin-bottom: 18px;
}
.lp-hero-desc {
    font-size: .9rem;
    color: rgba(255,255,255,.65);
    line-height: 1.75;
    max-width: 46ch;
    margin-bottom: 36px;
}
.lp-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--or);
    color: #fff;
    padding: 14px 28px;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: .95rem;
    box-shadow: 0 6px 24px rgba(232,101,58,.45);
    transition: all .2s;
    border: none;
    text-decoration: none;
}
.lp-hero-btn:hover {
    background: var(--olt);
    color: #fff;
    transform: translateY(-2px);
}

/* Mockup display */
.lp-mockup {
    background: linear-gradient(160deg, #0d0525 0%, #1a0e4f 50%, #2d1b69 100%);
    border-radius: 10px;
    border: 2.5px solid rgba(255,255,255,.22);
    padding: 24px;
    display: flex; align-items: center; justify-content: center;
    aspect-ratio: 16/9;
    position: relative; overflow: hidden;
}
.lp-mockup::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(107,90,205,.28), transparent 65%);
}
.lp-mockup-inner { text-align: center; position: relative; z-index: 1; }
.lp-mockup-inner .ql {
    font-family: 'Karina', cursive;
    font-size: 1.8rem;
    color: #fff;
    display: block;
    margin-bottom: 8px;
}
.lp-mockup-inner p { font-size: .6rem; color: rgba(255,255,255,.6); }
.lp-mockup-bars { display: flex; gap: 4px; margin-top: 10px; justify-content: center; }
.lp-mockup-bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,.25); }
.lp-mockup-bar.active { background: var(--or); }

/* Feature section */
.lp-features { padding: 80px 0; background: var(--bg); position: relative; overflow: hidden; }
.lp-features::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg,#0d052a,#2d1b69,#4a3fb8,#5b4fcf,#7b6fd8,#a095e8,#7b6fd8,#5b4fcf,#2d1b69,#0d052a);
}
.blob-bg {
    position: absolute; border-radius: 50%; filter: blur(70px);
    pointer-events: none; opacity: .22;
}

/* Feature card */
.lp-feature-card {
    background: #fff;
    border-radius: var(--r);
    padding: 24px 22px;
    border: 1px solid var(--bd);
    box-shadow: var(--sh);
    transition: transform .2s, box-shadow .2s;
    position: relative; overflow: hidden;
    height: 100%;
}
.lp-feature-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.lp-feature-card:hover { transform: translateY(-4px); box-shadow: var(--sl); }
.lp-feature-card.blue::before  { background: var(--ic); }
.lp-feature-card.orange::before{ background: var(--or); }
.lp-feature-card.red::before   { background: var(--rc); }
.lp-feature-card.green::before { background: var(--gc); }
.lp-feature-card.teal::before  { background: var(--tl); }
.lp-feature-icon {
    width: 44px; height: 44px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; margin-bottom: 14px;
}
.blue  .lp-feature-icon { background: rgba(91,79,207,.1);  }
.orange.lp-feature-icon,
.lp-feature-card.orange .lp-feature-icon { background: rgba(232,101,58,.1); }
.red   .lp-feature-icon { background: rgba(224,82,82,.1);  }
.green .lp-feature-icon { background: rgba(45,170,136,.1); }
.teal  .lp-feature-icon { background: rgba(58,191,177,.1); }
.lp-feature-card h5 {
    font-family: 'Poppins', sans-serif;
    font-size: .9rem; font-weight: 700;
    color: var(--td); margin-bottom: 12px;
}
.lp-feature-card ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.lp-feature-card ul li {
    font-size: .8rem; color: #1a1a1a;
    display: flex; gap: 7px; align-items: flex-start;
}
.lp-feature-card ul li::before { content: '•'; color: var(--pu); font-weight: 700; flex-shrink: 0; }

/* Why section */
.lp-why {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--vh) 0%, #1e2640 100%);
    color: #fff;
    position: relative; overflow: hidden;
}
.lp-why::before {
    content: '';
    position: absolute; top: -200px; right: -200px;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(91,79,207,.3), transparent);
    border-radius: 50%;
    pointer-events: none;
}
.lp-why-card {
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--rl);
    padding: 32px 24px;
    text-align: center;
    transition: all .25s;
}
.lp-why-card:hover {
    background: rgba(91,79,207,.18);
    border-color: rgba(107,90,205,.45);
    transform: translateY(-4px);
}
.lp-why-card .icon { font-size: 2.5rem; margin-bottom: 18px; display: block; }
.lp-why-card h4 { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 1rem; color: #fff; margin-bottom: 10px; }
.lp-why-card p  { font-size: .85rem; color: rgba(255,255,255,.5); line-height: 1.65; margin: 0; }

/* Pricing section */
.lp-pricing { padding: 100px 0; background: #fff; position: relative; overflow: hidden; }
.lp-pricing::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg,#0d052a,#2d1b69,#4a3fb8,#5b4fcf,#7b6fd8,#a095e8,#7b6fd8,#5b4fcf,#2d1b69,#0d052a);
}
.price-card {
    border-radius: var(--r);
    border: 1.5px solid rgba(91,79,207,.18);
    background: var(--pale);
    display: flex; flex-direction: column;
    position: relative;
    transition: transform .2s, box-shadow .2s;
    overflow: visible;
    height: 100%;
}
.price-card:hover { transform: translateY(-4px); box-shadow: var(--sl); }
.price-card .badge-popular {
    position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
    background: var(--or); color: #fff;
    padding: 4px 18px; border-radius: 100px;
    font-family: 'Poppins', sans-serif; font-size: .68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .07em; white-space: nowrap;
    box-shadow: 0 4px 14px rgba(232,101,58,.45); z-index: 3;
}
.price-card-header {
    padding: 20px 16px 14px; text-align: center;
    background: rgba(91,79,207,.08);
    border-bottom: 1px solid rgba(91,79,207,.12);
    border-radius: var(--r) var(--r) 0 0;
}
.price-card-header .plan-name {
    font-family: 'Poppins', sans-serif; font-size: .85rem; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase; color: var(--pu);
    margin-bottom: 4px;
}
.price-card-header .plan-desc {
    font-size: .68rem; color: var(--tm); line-height: 1.4; min-height: 2.8em;
}
.price-amount {
    padding: 14px 16px 10px; text-align: center;
    background: rgba(91,79,207,.05);
    border-bottom: 1px solid rgba(91,79,207,.1);
}
.price-amount .amount {
    font-family: 'Poppins', sans-serif; font-size: 1.55rem; font-weight: 800;
    line-height: 1; color: var(--pu);
}
.price-amount .period { font-size: .68rem; color: var(--tm); margin-top: 3px; }
.price-features {
    padding: 14px 16px 18px; flex: 1;
    display: flex; flex-direction: column;
}
.price-features ul { list-style: none; padding: 0; margin: 0 0 16px; flex: 1; display: flex; flex-direction: column; gap: 7px; }
.price-features ul li { font-size: .75rem; color: var(--tb); display: flex; gap: 7px; align-items: flex-start; line-height: 1.4; }
.price-features ul li::before { content: '✓'; color: var(--pu); font-weight: 700; flex-shrink: 0; font-size: .7rem; margin-top: 1px; }
.price-btn {
    display: block; width: 100%; text-align: center;
    padding: 10px 12px; border-radius: 8px;
    font-family: 'Poppins', sans-serif; font-weight: 700; font-size: .8rem;
    cursor: pointer; border: 2px solid var(--pu); color: var(--pu);
    background: #fff; transition: all .2s;
    text-transform: uppercase; letter-spacing: .05em;
    margin-top: auto; text-decoration: none;
}
.price-btn:hover { background: var(--pu); color: #fff; }

/* Pro plan */
.price-card.pro {
    background: linear-gradient(160deg, #2d1b69 0%, #4a3fb8 100%);
    border-color: var(--plt);
    box-shadow: 0 8px 32px rgba(91,79,207,.28);
}
.price-card.pro .price-card-header { background: rgba(255,255,255,.08); border-bottom-color: rgba(255,255,255,.12); }
.price-card.pro .plan-name { color: #fff; }
.price-card.pro .plan-desc { color: rgba(255,255,255,.65); }
.price-card.pro .price-amount { background: rgba(255,255,255,.06); border-bottom-color: rgba(255,255,255,.1); }
.price-card.pro .amount { color: #fff; }
.price-card.pro .period { color: rgba(255,255,255,.6); }
.price-card.pro .price-features ul li { color: rgba(255,255,255,.85); }
.price-card.pro .price-features ul li::before { color: rgba(255,255,255,.7); }
.price-card.pro .price-btn {
    background: var(--or); border-color: var(--or); color: #fff;
    box-shadow: 0 4px 14px rgba(232,101,58,.4);
}
.price-card.pro .price-btn:hover { background: var(--olt); border-color: var(--olt); }

/* CTA section */
.lp-cta {
    padding: 80px 0;
    background: var(--pale);
    border-top: 1px solid var(--bd);
    text-align: center;
}
.lp-cta h2 { font-family: 'Poppins', sans-serif; font-size: clamp(1.6rem,3vw,2.4rem); font-weight: 700; color: var(--td); margin-bottom: 16px; }
.lp-cta h2 span { color: var(--pu); }
.lp-cta p { font-size: .95rem; color: var(--tb); max-width: 52ch; margin: 0 auto 32px; }

/* ══════════════════════════════════════════════════════════════════════
   FORM LAYOUT  —  Create / Edit page design system
   ══════════════════════════════════════════════════════════════════════ */

/* ── Max-width wrapper ─────────────────────────────────────────────── */
.da-form-wrap {
    max-width: 900px;
    margin: 0;
}

/* Wider variant — for forms with many fields/sections that need more
   breathing room (Project Settings, Form Configuration) */
.da-form-wrap-wide {
    max-width: 1180px;
    margin: 0;
}

/* ── Card header with icon + title + subtitle ──────────────────────── */
.da-form-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 26px;
}

.da-form-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--pale);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pu);
    flex-shrink: 0;
}

.da-form-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--td);
    margin: 0 0 2px;
    line-height: 1.3;
}

.da-form-subtitle {
    font-size: .85rem;
    color: var(--tm);
    margin: 0;
}

/* ── Footer with Cancel + Submit buttons ───────────────────────────── */
.da-form-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding-top: 22px;
    border-top: 1px solid var(--bd);
    margin-top: 28px;
}

/* ── Sub-unit rows (UnitType Create / Edit) ────────────────────────── */
.da-subunit-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.da-subunit-add {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--pu);
    border: 1.5px dashed rgba(91, 79, 207, .4);
    background: rgba(91, 79, 207, .03);
    border-radius: var(--rs);
    padding: 6px 14px;
    cursor: pointer;
    transition: background .2s, border-color .2s;
    margin-top: 6px;
}
.da-subunit-add:hover {
    background: var(--pale);
    border-color: var(--pu);
}

/* Suppress the card hover lift on form cards */
.da-form-wrap .card:hover {
    transform: none !important;
    box-shadow: 0 10px 35px rgba(0,0,0,.06) !important;
}

/* ══════════════════════════════════════════════════════════════════════
   CUSTOM BUTTONS  —  Filter / Export / primary / secondary actions
   ══════════════════════════════════════════════════════════════════════ */

/* Shared base for all custom_* buttons */
.custom_info_btn,
.custom_success_btn,
.custom_primary_btn,
.custom_secondary_btn,
.custom_danger_btn {
    display:         inline-flex;
    align-items:     center;
    gap:             .35rem;
    font-family:     'Poppins', sans-serif;
    font-size:       .8rem;
    font-weight:     600;
    padding:         .38rem .85rem;
    border-radius:   7px;
    border:          none;
    cursor:          pointer;
    white-space:     nowrap;
    text-decoration: none;
    line-height:     1;
    transition:      background .18s ease, transform .15s ease, box-shadow .15s ease;
}
.custom_info_btn:hover,
.custom_success_btn:hover,
.custom_primary_btn:hover,
.custom_secondary_btn:hover,
.custom_danger_btn:hover {
    transform: translateY(-1px);
}
.custom_info_btn:active,
.custom_success_btn:active,
.custom_primary_btn:active,
.custom_secondary_btn:active,
.custom_danger_btn:active {
    transform: scale(.96);
}

/* Filter — teal */
.custom_info_btn {
    background: var(--tl);
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(58,191,177,.25);
}
.custom_info_btn:hover {
    background: #2da89e;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(58,191,177,.35);
}

/* Export — green */
.custom_success_btn {
    background: var(--gc);
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(45,170,136,.25);
}
.custom_success_btn:hover {
    background: #259872;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(45,170,136,.35);
}

/* Primary edit action — purple */
.custom_primary_btn {
    background: var(--pu);
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(91,79,207,.25);
}
.custom_primary_btn:hover {
    background: var(--pdk);
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(91,79,207,.35);
}

/* Secondary / back — outlined neutral */
.custom_secondary_btn {
    background: transparent;
    color: var(--tb) !important;
    border: 1.5px solid var(--bd);
}
.custom_secondary_btn:hover {
    background: var(--pale);
    border-color: var(--pu);
    color: var(--pu) !important;
}

/* ══════════════════════════════════════════════════════════════════════
   RECORD CARD  —  Details page card structure
   ══════════════════════════════════════════════════════════════════════ */

.record-card {
    border: 1px solid var(--bd);
    border-radius: var(--r);
    overflow: hidden;
    margin-bottom: 1rem;
}

.record-card-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1.1rem;
    background: rgba(91,79,207,.05);
    border-bottom: 1px solid var(--bd);
    font-family: 'Poppins', sans-serif;
    font-size: .85rem;
    font-weight: 600;
    color: var(--td);
}
.record-card-header i { color: var(--pu); }

.record-card-body {
    padding: 1.25rem 1.5rem;
}

/* ── dl.row label/value pair styling ──────────────────────────────── */
.record-card-body dl.row dt {
    font-family: 'Poppins', sans-serif;
    font-size: .74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--tm);
    padding-top: .55rem;
    padding-bottom: .55rem;
}
.record-card-body dl.row dd {
    font-size: .9rem;
    color: var(--td);
    padding-top: .55rem;
    padding-bottom: .55rem;
    border-bottom: 1px solid rgba(0,0,0,.045);
}
.record-card-body dl.row dd:last-child { border-bottom: none; }

.record-card-footer {
    padding: .85rem 1.5rem;
    border-top: 1px solid var(--bd);
    background: rgba(0,0,0,.018);
}

.form-actions {
    display: flex;
    gap: .6rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Danger / delete action — red */
.custom_danger_btn {
    background: var(--rc);
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(224,82,82,.25);
}
.custom_danger_btn:hover {
    background: #c94343;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(224,82,82,.35);
}

/* Disabled state — shared by all custom_* buttons (e.g. bulk-action buttons
   before any row is selected) */
.custom_info_btn:disabled,
.custom_success_btn:disabled,
.custom_primary_btn:disabled,
.custom_secondary_btn:disabled,
.custom_danger_btn:disabled {
    background: var(--bd) !important;
    color: var(--tm) !important;
    box-shadow: none !important;
    cursor: not-allowed;
    transform: none !important;
}

/* ── Table action buttons (Edit / Details / Delete in index pages) ─── */
.da-edit-link,
.da-view-link,
.da-delete-link {
    display:         inline-flex;
    align-items:     center;
    gap:             .3rem;
    font-size:       .78rem;
    font-weight:     600;
    padding:         .28rem .65rem;
    border-radius:   6px;
    text-decoration: none !important;
    white-space:     nowrap;
    transition:      background .18s ease, transform .14s ease;
}
.da-edit-link:hover,
.da-view-link:hover,
.da-delete-link:hover {
    transform: translateY(-1px);
}
.da-edit-link {
    color: #10b981 !important;
    background: rgba(16,185,129,.08);
    border: 1px solid rgba(16,185,129,.2);
}
.da-edit-link:hover {
    background: rgba(16,185,129,.18);
}
.da-view-link {
    color: #3865d1 !important;
    background: rgba(56,101,209,.08);
    border: 1px solid rgba(56,101,209,.2);
}
.da-view-link:hover {
    background: rgba(56,101,209,.18);
}
.da-delete-link {
    color: var(--rc) !important;
    background: rgba(224,82,82,.08);
    border: 1px solid rgba(224,82,82,.2);
}
.da-delete-link:hover {
    background: rgba(224,82,82,.18);
}

/* ── Shared filter accordion (Response + Master pages) ────────────────
   Themes the "Search & Filter" accordion shell shared by _LevelsPartial,
   _LevelsResponsePartial, and _LevelsUnitSearchPartial. Applied once here so
   every page using those partials inherits it automatically. */
#filterAccordion .accordion-item {
    border: 1px solid var(--bd);
    border-radius: var(--r);
    box-shadow: var(--sh);
    overflow: hidden;
}
#filterAccordion .accordion-header {
    background: var(--pale);
}
#filterAccordion .accordion-button {
    background: var(--pale);
    color: var(--pdk);
    padding: .85rem 1.1rem;
    font-size: .92rem;
    letter-spacing: .01em;
    gap: .55rem;
}
/* These partials never render Bootstrap's own ".collapsed" class in their initial
   markup (only aria-expanded), so ":not(.collapsed)" would match unconditionally on
   first paint — use the aria-expanded attribute instead, which is always accurate,
   both on initial render and after Bootstrap's JS toggles it on open/close. */
#filterAccordion .accordion-button[aria-expanded="true"] {
    background: var(--pu);
    color: #fff;
    box-shadow: none;
}
#filterAccordion .accordion-button:focus {
    box-shadow: none;
}
#filterAccordion .accordion-button .filter-icon {
    flex-shrink: 0;
    color: var(--pu);
    transition: color .15s ease;
}
#filterAccordion .accordion-button[aria-expanded="true"] .filter-icon {
    color: #fff;
}
/* Recolor Bootstrap's built-in chevron (a background-image caret) to match the
   header's text color in both states, instead of Bootstrap's default gray/dark. */
#filterAccordion .accordion-button::after {
    filter: invert(28%) sepia(54%) saturate(1900%) hue-rotate(230deg) brightness(90%);
}
#filterAccordion .accordion-button[aria-expanded="true"]::after {
    filter: brightness(0) invert(1);
}
#filterAccordion .accordion-body {
    padding: 1.1rem 1.15rem 1rem;
    background: var(--surface);
}
#filterAccordion .accordion-body label,
#filterAccordion .accordion-body .filter-field-label {
    font-size: .68rem;
    font-weight: 700;
    color: var(--tm);
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: .3rem;
    display: block;
}
#filterAccordion .form-select,
#filterAccordion .form-control {
    border-color: var(--bd);
    font-size: .85rem;
}
#filterAccordion .form-select:focus,
#filterAccordion .form-control:focus {
    border-color: var(--plt);
    box-shadow: 0 0 0 .2rem rgba(91,79,207,.12);
}

/* ═══════════════════════════════════════════════════════════════════════
   HOME PAGE — stat cards, setup guide, project grid
   Only Views/Home/Index.cshtml uses these (relocated from an inline
   <style> block so the Razor view stays markup-only).
   ═══════════════════════════════════════════════════════════════════════ */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 0 0 24px; }
@media (max-width: 991px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575px) { .stats-row { grid-template-columns: 1fr; } }
.dashboard-card.gc .card-icon { background: rgba(45,170,136,.12); color: var(--gc); }
.dashboard-card.or .card-icon { background: rgba(232,101,58,.12); color: var(--or); }
.dashboard-card.tl .card-icon { background: rgba(58,191,177,.12); color: var(--tl); }
.card-trend { font-size: .74rem; color: var(--gc); margin-top: 6px; }

/* Fluid variant of .stats-row - for rows with a variable/smaller card count
   (e.g. SuperAdmin Home's KPI and plan-breakdown rows) so cards stretch to fill
   the full row instead of leaving an empty gap when there are fewer than 4. */
.stats-row-fluid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 0 0 24px; }
.stats-row-fluid .dashboard-card { padding: 24px 26px; }
.stats-row-fluid .card-icon { width: 46px; height: 46px; font-size: 1.35rem; }
.stats-row-fluid .card-value { font-size: 1.9rem; }

/* Setup guide — collapsed banner (shown once at least one project exists) */
.setup-banner {
    display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--bd);
    border-radius: var(--r); box-shadow: var(--sh); padding: 12px 18px; margin-bottom: 24px;
}
.setup-ring { position: relative; width: 38px; height: 38px; flex-shrink: 0; }
.setup-ring svg { transform: rotate(-90deg); }
.setup-ring .track { stroke: var(--bd); }
.setup-ring .fill { stroke: var(--pu); stroke-linecap: round; }
.setup-ring .pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .6rem; font-weight: 700; color: var(--pu); }
.setup-banner .grow strong { font-size: .88rem; color: var(--td); }
.setup-banner .grow div.sub { font-size: .78rem; color: var(--tm); }
.btn-resume { font-size: .8rem; font-weight: 600; color: var(--pu); border: 1.5px solid var(--pu); border-radius: 7px; padding: 6px 14px; background: transparent; white-space: nowrap; cursor: pointer; }
.btn-resume:hover { background: var(--pu); color: #fff; }

/* DIA feature banner — home dashboard call-out for the AI Form Builder */
.dia-banner {
    display: flex; align-items: center; gap: 14px;
    background: linear-gradient(135deg, rgba(34,211,238,.10), rgba(91,79,207,.10)), var(--surface);
    border: 1px solid var(--bd); border-left: 3px solid #22d3ee;
    border-radius: var(--r); box-shadow: var(--sh); padding: 14px 18px; margin-bottom: 24px;
}
.dia-banner .dia-emblem {
    width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
    box-shadow: 0 0 10px rgba(34,211,238,.5); background: #06182e;
}
.dia-banner .dia-emblem img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dia-banner .grow { flex: 1 1 auto; min-width: 0; }
.dia-banner .grow strong { font-size: .92rem; color: var(--td); }
.dia-banner .grow div.sub { font-size: .78rem; color: var(--tm); margin-top: 2px; }
.dia-cta {
    font-size: .82rem; font-weight: 600; color: #fff; white-space: nowrap; cursor: pointer;
    border: none; border-radius: 8px; padding: 8px 16px; text-decoration: none;
    background: linear-gradient(135deg, #22d3ee 0%, var(--pu) 100%);
    box-shadow: 0 2px 8px rgba(34,211,238,.35);
}
.dia-cta:hover { filter: brightness(1.06); color: #fff; }
@media (max-width: 640px) {
    .dia-banner { flex-wrap: wrap; }
    .dia-banner .grow { flex-basis: calc(100% - 58px); }
    .dia-cta { width: 100%; text-align: center; }
}

/* DIA sidebar nav badge — tiny "AI" pill next to the DIA menu label */
.dia-nav-badge {
    margin-left: auto; align-self: center; font-size: .58rem; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase; color: #fff;
    padding: 1px 6px; border-radius: 6px;
    background: linear-gradient(135deg, #22d3ee 0%, var(--pu) 100%);
}

/* Project grid — plain CSS grid (matches wireframe exactly, no Bootstrap
   row/col gutter machinery, which bled the grid 8px past the container
   edges that everything else on the page sits flush against). */
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1199px) { .project-grid:not(.list-view) { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 767px)  { .project-grid:not(.list-view) { grid-template-columns: 1fr; } }

/* Project grid list-view — one full-width row per project, internal content
   laid out horizontally (name/tag+badge, mini-stats, progress, actions,
   last-updated all side by side) instead of the grid view's stacked card.
   Every segment below gets an explicit flex-basis so they sit next to each
   other cleanly instead of overlapping — the earlier attempt at this
   overlapped because only .project-card's own direction was flipped while
   its children (and .card-body-main's own children) kept their column
   sizing, so everything collapsed to its content width in the same row. */
.project-grid.list-view { display: flex; flex-direction: column; gap: 12px; }
.project-grid.list-view .project-card {
    flex-direction: row; align-items: center; gap: 22px; padding: 16px 22px;
}
.project-grid.list-view .card-body-main {
    display: flex; flex-direction: row; align-items: center; gap: 22px; flex: 1 1 auto; min-width: 0;
}
.project-grid.list-view .card-body-main > div:first-child { flex: 0 0 220px; min-width: 0; }
.project-grid.list-view .mini-stats {
    flex: 0 0 auto; border: none; margin: 0; padding: 0; gap: 18px; max-width: none;
}
.project-grid.list-view .mini-stat { flex: 0 0 auto; border-right: 1px dashed var(--bd); padding: 0 14px; }
.project-grid.list-view .mini-stat:last-child { border-right: none; }
.project-grid.list-view .progress-track { flex: 0 0 90px; margin: 0; }
.project-grid.list-view .card-actions { flex: 0 0 auto; width: auto; }
.project-grid.list-view .last-updated { flex: 0 0 auto; margin-top: 0 !important; white-space: nowrap; }
@media (max-width: 991px) {
    /* Not enough room for a single row below tablet width — fall back to the
       card's normal stacked layout, just full-width, rather than squeezing
       five flex segments into a narrow viewport. */
    .project-grid.list-view .project-card { flex-direction: column; align-items: stretch; }
    .project-grid.list-view .card-body-main { flex-direction: column; align-items: stretch; }
    .project-grid.list-view .card-body-main > div:first-child { flex: 0 0 auto; }
    .project-grid.list-view .mini-stats { flex: 0 0 auto; }
}

/* Mini stats + progress inside a project card */
.mini-stats { display: flex; gap: 0; padding: 10px 0; border-top: 1px dashed var(--bd); border-bottom: 1px dashed var(--bd); margin: 10px 0; }
.mini-stat { flex: 1; text-align: center; border-right: 1px dashed var(--bd); }
.mini-stat:last-child { border-right: none; }
.mini-stat .num { font-size: .95rem; font-weight: 700; color: var(--td); }
.mini-stat .lbl { font-size: .64rem; color: var(--tm); text-transform: uppercase; letter-spacing: .04em; }
.progress-track { height: 6px; border-radius: 3px; background: var(--bd); overflow: hidden; margin-bottom: 10px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--pu), var(--tl)); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.status-dot.active { background: var(--gc); }
.status-dot.draft { background: var(--or); }
.last-updated { font-size: .68rem; color: var(--tm); white-space: nowrap; }

/* ═══════════════════════════════════════════════════════════════════════
   LIST TOOLBAR — shared search / status-filter / sort / view-toggle
   Used by: Home (project cards), Projects Index, QuestionForm Index
   ═══════════════════════════════════════════════════════════════════════ */
.list-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.tb-search { flex: 1; min-width: 200px; max-width: 280px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--bd); border-radius: 8px; padding: 7px 12px; }
.tb-search input { border: none; outline: none; font-size: .85rem; width: 100%; background: transparent; color: var(--td); }
.tb-search i { color: var(--tm); }
.tb-select { font-size: .83rem; border: 1px solid var(--bd); border-radius: 8px; padding: 7px 10px; background: var(--surface); color: var(--tb); }
.tb-count { font-size: .8rem; color: var(--tm); white-space: nowrap; }
.view-toggle { display: flex; border: 1px solid var(--bd); border-radius: 8px; overflow: hidden; }
.view-toggle button { border: none; background: var(--surface); padding: 7px 10px; color: var(--tm); cursor: pointer; }
.view-toggle button.active { background: var(--pale); color: var(--pu); }

/* ═══════════════════════════════════════════════════════════════════════
   INDEX-PAGE FOUNDATION — collapsible filter card, sortable-header table
   affordance, idx-actions-bar, form-footer button family. Ported verbatim
   (same class names) from the wireframes' own <style> blocks so
   every index page (Projects, Forms, Responses, every Masters entity,
   PopulationType, Users, Designation, ...) can reuse one definition
   instead of duplicating it per page.
   ═══════════════════════════════════════════════════════════════════════ */
.idx-actions-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.idx-title { font-size: 1.3rem; font-weight: 700; margin: 0 0 2px; font-family: 'Poppins', sans-serif; color: var(--td); }

.filter-card { background: var(--surface); border: 1px solid var(--bd); border-radius: var(--r); box-shadow: var(--sh); margin-bottom: 14px; overflow: hidden; }
.filter-toggle {
    display: flex; align-items: center; gap: .55rem; width: 100%; padding: 12px 16px; background: none; border: none;
    text-align: left; font-size: .86rem; font-weight: 600; color: var(--td); cursor: pointer; transition: background .15s ease;
}
.filter-toggle:hover { background: var(--bg); }
.filter-toggle.expanded { background: var(--pale); color: var(--pu); border-bottom: 1px solid var(--bd); }
.filter-chevron { margin-left: auto; transition: transform .25s ease; opacity: .5; }
.filter-toggle.expanded .filter-chevron { transform: rotate(180deg); opacity: 1; }
.filter-body { display: none; padding: 14px 16px 16px; }
.filter-body.show { display: block; }
.filter-row { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; }
.filter-group { flex: 1 1 170px; min-width: 170px; }
.filter-group label { font-size: .7rem; font-weight: 600; color: var(--tm); margin-bottom: 5px; display: block; text-transform: uppercase; letter-spacing: .04em; }
.filter-select { width: 100%; font-size: .84rem; border: 1.5px solid var(--bd); border-radius: var(--rs); padding: 8px 10px; color: var(--tb); background: var(--surface); font-family: 'Inter', sans-serif; cursor: pointer; }
.filter-select:focus { outline: none; border-color: var(--pu); box-shadow: 0 0 0 3px var(--pale); }
.filter-select:disabled { background: var(--bg); color: var(--tm); cursor: not-allowed; }
.filter-search { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--bd); border-radius: var(--rs); padding: 8px 10px; background: var(--surface); line-height: 1.2; }
.filter-search input { border: none; outline: none; font-size: .84rem; width: 100%; background: transparent; color: var(--td); line-height: 1.2; }
.filter-search i { color: var(--tm); font-size: .84rem; line-height: 1.2; }
.filter-search-clear-inline {
    display: none; align-items: center; border: none; background: none; padding: 0;
    color: var(--tm); cursor: pointer; font-size: .84rem; line-height: 1.2; flex-shrink: 0;
}
.filter-search-clear-inline.show { display: flex; }
.filter-search-clear-inline:hover { color: var(--rc); }
.filter-actions { display: flex; gap: 8px; flex: 0 0 auto; }
/* The Levels filter (State/District/Block/CityTownVillage/Unit) can carry up to 4
   dropdowns plus Search — a touch narrower than the global .filter-group so the
   CityTownVillage row (State+District+Block+Urban/Rural+Search+actions) fits on
   one line at typical desktop widths instead of wrapping. */
.levels-filter-row .filter-group { flex: 1 1 140px; min-width: 140px; }

/* Sortable-header affordance layered on top of the existing .table styling
   (#main.main .table already handles zebra striping/hover/row-icon colouring
   elsewhere in this file) — .qtable only adds the header sort-icon look used
   by the wireframes' list pages. Applying the "qtable" class alongside the
   existing "table" class is enough; no other .qtable rules are needed since
   the base table already matches. */
.qtable thead th.sortable { cursor: pointer; user-select: none; }
.qtable thead th.sortable i { margin-left: 4px; opacity: .4; font-size: .7rem; }
.qtable thead th.sortable:hover { color: var(--pu); }

/* Organization list (Organization/Index.cshtml) — org type shown as a small
   subtext line under the org name instead of its own column */
.qt-org-type { font-size: .72rem; color: var(--tm); margin-top: 2px; }

/* Roles list (RoleMaster/Index.cshtml) — Id + Role Name cell styling */
.role-id { color: var(--tm); font-weight: 600; }
.role-name-text { font-weight: 600; color: var(--td); }

/* Manage Roles checklist (Designation/ManageRoles.cshtml) */
.role-select-all {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 4px 14px;
    border-bottom: 1px solid var(--bd); margin-bottom: 6px;
}
.role-select-all label { display: flex; align-items: center; gap: 9px; font-size: .86rem; font-weight: 600; color: var(--tb); cursor: pointer; }
.role-select-all span.count { font-size: .78rem; color: var(--tm); font-weight: 500; }
.role-group { margin-bottom: 18px; }
.role-group:last-child { margin-bottom: 0; }
.role-group-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--tm); margin: 0 0 8px 4px; }
.role-check-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.role-check-row:hover { background: var(--pale); }
body[data-mode="dark"] .role-check-row:hover { background: rgba(255,255,255,.04); }
.role-check-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--pu); cursor: pointer; flex-shrink: 0; }
.role-check-row span { font-size: .86rem; color: var(--td); font-weight: 500; }

/* Manage Roles matrix (module x action grid) */
.role-matrix thead th { vertical-align: middle; }
.role-matrix-col-header { padding: 6px 4px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--tm); }
.role-matrix input[type="checkbox"] {
    width: 17px; height: 17px; accent-color: var(--pu); cursor: pointer; flex-shrink: 0;
    appearance: none; -webkit-appearance: none; background: #fff;
    /* var(--bd) (#e8e6f0) is nearly the same tone as the white table background —
       an unchecked box all but disappeared against it. var(--tm) is dark enough to
       read as a clear outline while still looking "unchecked" rather than filled. */
    border: 1.5px solid var(--tm); border-radius: 4px; margin: 0;
    transition: border-color .15s, box-shadow .15s;
}
.role-matrix input[type="checkbox"]:hover {
    border-color: var(--pu);
}
.role-matrix input[type="checkbox"]:focus-visible {
    outline: none; box-shadow: 0 0 0 3px rgba(91,79,207,.25);
}
.role-matrix input[type="checkbox"]:checked {
    background: var(--pu); border-color: var(--pu);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3.5 8.5 6.5 11.5 12.5 4.5'/%3E%3C/svg%3E");
    background-size: 12px 12px; background-position: center; background-repeat: no-repeat;
}
body[data-mode="dark"] .role-matrix input[type="checkbox"] { background-color: rgba(255,255,255,.06); border-color: var(--tm); }
.role-matrix td .text-muted { color: var(--tm); opacity: .5; }

/* Form-footer button family (Create/Edit/Delete pages) — plain Bootstrap
   btn-secondary/btn-dark today. Base "btn-da" + a color modifier, exactly
   as the wireframes' own markup combines them (class="btn-da btn-primary-da"). */
.btn-da {
    display: inline-flex; align-items: center; gap: 7px; font-size: .85rem; font-weight: 600;
    padding: 9px 18px; border-radius: 9px; border: 1.5px solid transparent; cursor: pointer;
    white-space: nowrap; line-height: 1.3; text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.btn-da i { font-size: .95rem; }
.btn-da:hover { transform: translateY(-1px); }
.btn-primary-da, .btn-primary-da.btn-da { background: var(--pu); color: #fff; border-color: var(--pu); box-shadow: 0 2px 10px rgba(91,79,207,.25); }
.btn-primary-da:hover, .btn-primary-da:focus { background: var(--pdk); border-color: var(--pdk); color: #fff; box-shadow: 0 6px 16px rgba(91,79,207,.35); }
.btn-secondary-da, .btn-secondary-da.btn-da { background: var(--surface); color: var(--tb); border-color: var(--bd); }
.btn-secondary-da:hover, .btn-secondary-da:focus { background: var(--pale); color: var(--pu); border-color: var(--pale); }
.btn-danger-da, .btn-danger-da.btn-da { background: var(--rc); color: #fff; border-color: var(--rc); }
.btn-danger-da:hover, .btn-danger-da:focus { background: #c93f3f; border-color: #c93f3f; color: #fff; }
.btn-danger-da:disabled, .btn-danger-da.disabled { opacity: .5; cursor: not-allowed; transform: none; }
/* Outline-danger variant — for a "dangerous but not yet confirmed" toolbar state (RecycleBin bulk purge) */
.btn-danger-outline-da, .btn-danger-outline-da.btn-da { background: var(--surface); color: var(--rc); border-color: #f3c9c9; }
.btn-danger-outline-da:hover, .btn-danger-outline-da:focus { background: #fdecec; border-color: var(--rc); }
.btn-danger-outline-da:disabled, .btn-danger-outline-da.disabled { opacity: .45; cursor: not-allowed; transform: none; }
/* Small size modifier — compact toolbar buttons (RecycleBin filter bar/bulk toolbar) */
.btn-sm-da { padding: 7px 14px; font-size: .79rem; border-radius: 7px; }
.btn-sm-da:disabled { opacity: .45; cursor: not-allowed; transform: none; }
/* Standalone use (no .btn-da base class on the element) still gets full sizing. */
a.btn-primary-da, button.btn-primary-da,
a.btn-secondary-da, button.btn-secondary-da,
a.btn-danger-da, button.btn-danger-da,
a.btn-export-da, button.btn-export-da {
    display: inline-flex; align-items: center; gap: 7px; font-size: .85rem; font-weight: 600;
    padding: 9px 18px; border-radius: 9px; cursor: pointer; white-space: nowrap; line-height: 1.3;
    /* Base rule above only sets border-COLOR per variant — native <button> elements
       (unlike <a>) get the browser's own default border-width/style (2px outset)
       otherwise, which is what was rendering instead of the wireframe's clean
       flat 1.5px border. */
    border-width: 1.5px;
    border-style: solid;
}

/* Export (CSV) button — list-page filter bar, green to distinguish from primary/secondary actions */
.btn-export-da { background: var(--gc); color: #fff; border: none; }
.btn-export-da:hover, .btn-export-da:focus { background: #248a70; color: #fff; }
.btn-export-da i { font-size: .95rem; }

/* ═══════════════════════════════════════════════════════════════════════
   SHARED CONFIRM MODAL — one instance reused sitewide in place of native
   confirm() (delete confirmations, Publish confirmation, etc.); see
   showConfirmModal() in _Layout.cshtml. Centered icon + title + message,
   no Bootstrap header/footer divider bars.
   ═══════════════════════════════════════════════════════════════════════ */
#appConfirmModal .confirm-modal-content {
    border-radius: 16px; border: none; box-shadow: 0 20px 60px rgba(30,15,92,.18);
    padding: 30px 26px 24px; text-align: center; position: relative;
}
#appConfirmModal .confirm-modal-close { position: absolute; top: 14px; right: 14px; }
#appConfirmModal .confirm-modal-icon {
    width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(224,82,82,.12); color: var(--rc); font-size: 1.5rem; flex-shrink: 0;
}
#appConfirmModal .confirm-modal-icon.confirm-modal-icon-primary { background: var(--pale); color: var(--pu); }
#appConfirmModal .confirm-modal-title { font-family: 'Poppins', sans-serif; font-size: 1.05rem; font-weight: 700; color: var(--td); margin: 0 0 8px; }
#appConfirmModal .confirm-modal-body { font-size: .88rem; color: var(--tm); margin-bottom: 24px; line-height: 1.5; }
#appConfirmModal .confirm-modal-foot { display: flex; justify-content: center; gap: 10px; }

/* ═══════════════════════════════════════════════════════════════════════
   STATUS BADGE — shared pill for list-page status columns
   (Projects: active/inactive · Forms: published/draft)
   ═══════════════════════════════════════════════════════════════════════ */
.status-badge {
    display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 600;
    padding: 3px 11px; border-radius: 20px; white-space: nowrap;
}
.status-badge .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.status-badge.active,
.status-badge.published { background: rgba(45,170,136,.12); color: #1f7a5f; }
.status-badge.active .dot,
.status-badge.published .dot { background: var(--gc); }
.status-badge.inactive { background: rgba(122,122,154,.12); color: var(--tm); }
.status-badge.inactive .dot { background: var(--tm); }
.status-badge.draft { background: rgba(232,101,58,.12); color: #b6491f; }
.status-badge.draft .dot { background: var(--or); }

/* ═══════════════════════════════════════════════════════════════════════
   STATUS TOGGLE ROW — Active/Inactive switch on Create/Edit forms
   (Projects/Create.cshtml, Projects/Edit.cshtml)
   ═══════════════════════════════════════════════════════════════════════ */
.status-toggle-row {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
    padding: 14px 16px; background: var(--bg); border: 1px solid var(--bd); border-radius: 10px;
}
.status-toggle-text .label-main { font-size: .87rem; font-weight: 600; color: var(--tb); display: flex; align-items: center; gap: 8px; }
.status-toggle-text .label-sub { font-size: .78rem; color: var(--tm); margin-top: 3px; max-width: 38ch; }
.status-badge-live { display: inline-flex; align-items: center; gap: 5px; font-size: .68rem; font-weight: 700; padding: 2px 9px; border-radius: 100px; }
.status-badge-live .dot { width: 6px; height: 6px; border-radius: 50%; }
.status-badge-live.active { background: rgba(45,170,136,.12); color: var(--gc); }
.status-badge-live.active .dot { background: var(--gc); }
.status-badge-live.inactive { background: var(--pale); color: var(--tm); }
.status-badge-live.inactive .dot { background: var(--tm); }

.qf-switch { position: relative; display: inline-block; width: 42px; height: 23px; flex-shrink: 0; }
.qf-switch input { opacity: 0; width: 0; height: 0; }
.qf-switch .slider { position: absolute; cursor: pointer; inset: 0; background: var(--bd); border-radius: 100px; transition: .2s; }
.qf-switch .slider::before { content: ""; position: absolute; width: 17px; height: 17px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.qf-switch input:checked + .slider { background: var(--gc); }
.qf-switch input:checked + .slider::before { transform: translateX(19px); }
.qf-switch input:focus-visible + .slider { outline: 2px solid var(--pu); outline-offset: 2px; }

/* ═══════════════════════════════════════════════════════════════════════
   DATA CARD — standard wrapper for list/table & settings pages
   ═══════════════════════════════════════════════════════════════════════ */
.data-card { position: relative; background: var(--surface); border: 1px solid var(--bd); border-radius: var(--r); box-shadow: var(--sh); }
.data-card .form-card-body { padding: 32px 34px; }
.data-card .table-card-body { padding: 8px 8px 4px; }

/* ── Project name cell (Projects/Index.cshtml) — small folder icon + name ── */
.qt-project-name { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--td); }
.qt-project-icon {
    width: 32px; height: 32px; border-radius: 8px; background: var(--pale); color: var(--pu);
    display: flex; align-items: center; justify-content: center; font-size: .95rem; flex-shrink: 0;
}

/* ── Project Settings pill (Projects/Index.cshtml "Add"/"Edit" action) ──
   Also declared with the #main.main .table tbody td a... prefix to beat
   the generic table-cell-icon-button rule (width/height:32px, border-radius:7px)
   in the "Action icon buttons (manage column)" section further down this file —
   without it, that higher-specificity rule squeezes this pill into a 32px square
   and its icon+label overflow the border (same issue .add-section-button had). */
.settings-pill,
#main.main .table tbody td a.settings-pill {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    width: auto !important; height: auto !important; font-size: .78rem; font-weight: 600;
    padding: 6px 13px; border-radius: 100px !important; cursor: pointer; white-space: nowrap; text-decoration: none;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.settings-pill.add,
#main.main .table tbody td a.settings-pill.add { border: 1.5px solid var(--bd); color: var(--tb) !important; background: var(--surface); }
.settings-pill.add:hover,
#main.main .table tbody td a.settings-pill.add:hover { border-color: var(--pu); color: var(--pu) !important; background: var(--pale); }
.settings-pill.edit,
#main.main .table tbody td a.settings-pill.edit { background: var(--pale); color: var(--pu) !important; border: 1.5px solid transparent; }
.settings-pill.edit:hover,
#main.main .table tbody td a.settings-pill.edit:hover { background: var(--pu); color: #fff !important; transform: none; }

/* ── Pagination bar (Projects/Index.cshtml — client-side pager) ── */
.qpagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 14px 12px 6px; border-top: 1px solid var(--bd); margin-top: 6px; }
.qpagination .qp-info { font-size: .8rem; color: var(--tm); }
.qpagination .qp-pages { display: flex; gap: 6px; }
.qpagination .qp-pages button {
    width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--bd); background: var(--surface);
    color: var(--tb); font-size: .8rem; cursor: pointer; transition: all .15s ease;
}
.qpagination .qp-pages button:hover:not(:disabled):not(.active) { border-color: var(--pu); color: var(--pu); background: var(--pale); }
.qpagination .qp-pages button.active { background: var(--pu); border-color: var(--pu); color: #fff; }
.qpagination .qp-pages button:disabled { opacity: .4; cursor: not-allowed; }
/* Server-side paging links (Users, Audit Log): same look as the buttons above. */
.qpagination .qp-pages a.qp-link {
    display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 6px;
    border-radius: 7px; border: 1px solid var(--bd); background: var(--surface); color: var(--tb); font-size: .8rem; text-decoration: none;
}
.qpagination .qp-pages a.qp-link:hover:not(.active) { border-color: var(--pu); color: var(--pu); background: var(--pale); }
.qpagination .qp-pages a.qp-link.active { background: var(--pu); border-color: var(--pu); color: #fff; }

/* ═══════════════════════════════════════════════════════════════════════
   FORM SECTIONS — grouped fields + conditional reveal (Project Settings)
   ═══════════════════════════════════════════════════════════════════════ */
.f-section { padding-top: 22px; margin-top: 22px; border-top: 1px dashed var(--bd); }
.f-section:first-child { padding-top: 0; margin-top: 0; border-top: none; }
.f-section-title {
    display: flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; color: var(--pu); margin-bottom: 16px;
}
.f-group { margin-bottom: 22px; }
.f-row { display: flex; gap: 18px; flex-wrap: wrap; }
.f-row > .f-group { flex: 1 1 220px; }
.f-conditional { display: none; opacity: 0; transform: translateY(-6px); transition: opacity .2s ease, transform .2s ease; }
.f-conditional.show { display: block; opacity: 1; transform: translateY(0); }

/* Shared "you need a Unit first" notice - QuestionForm/Create.cshtml and (as .fb-unit-notice,
   a formbuilder.css-local copy) FormBuilder's ChoosePath/Builder pages. */
.unit-required-notice { display:flex; align-items:flex-start; gap:.6rem; background:var(--pale); border:1px solid var(--bd); border-radius:10px; padding:.7rem .85rem; margin-bottom:1.25rem; font-size:.8rem; line-height:1.5; color:var(--td); }
.unit-required-notice i { color:var(--pu); font-size:.95rem; margin-top:2px; }
.unit-required-notice a { color:var(--pu); font-weight:700; text-decoration:underline; }

/* Shared "this looks like a typo of an existing name" caution - shown on the Create/Edit
   page itself, before the record is saved, with a button to confirm and save anyway. */
.similar-name-warning { display:flex; align-items:flex-start; gap:.6rem; background:rgba(232,101,58,.08); border:1px solid rgba(232,101,58,.25); border-radius:10px; padding:.7rem .85rem; margin-bottom:1.25rem; font-size:.82rem; line-height:1.5; color:var(--tb); }
.similar-name-warning i { color:var(--or); font-size:.95rem; margin-top:2px; flex-shrink:0; }

/* Phase builder table — ProjectSetting/Create.cshtml, Edit.cshtml (#myTable/#incRow/.deleteRow
   keep their existing ids/classes for ~/js/da-project-settings.js; these are additive skins). */
.phase-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.phase-table th { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--tm); text-align: left; padding: 8px 10px; background: var(--bg); border-bottom: 1px solid var(--bd); }
.phase-table td { padding: 8px 10px; vertical-align: top; border-bottom: 1px solid var(--bd); }
.phase-table tr:last-child td { border-bottom: none; }
.phase-remove {
    width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--bd); background: var(--surface);
    color: var(--tm); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: .85rem;
}
.phase-remove:hover { border-color: var(--rc); color: var(--rc); background: #fdecec; }
.phase-add-link {
    display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--pu);
    background: var(--pale); border: 1.5px dashed rgba(91,79,207,.35); border-radius: 9px; padding: 8px 16px; cursor: pointer;
    text-decoration: none;
}
.phase-add-link:hover { background: var(--pu); color: #fff; border-style: solid; }

/* Question-form select + inline "create a new form instead" link —
   ProjPopTypeSettings/Create.cshtml (Seed Profile / Respondent Form selects). */
.formselect-row { display: flex; align-items: flex-end; gap: 10px; }
.formselect-row .f-group { flex: 1; margin-bottom: 0; }
.add-form-link {
    display: inline-flex; align-items: center; gap: 6px; font-size: .79rem; font-weight: 600; color: var(--pu);
    background: var(--pale); border: 1.5px dashed rgba(91,79,207,.35); border-radius: 9px; padding: 9px 14px;
    white-space: nowrap; cursor: pointer; height: 41px; text-decoration: none;
}
.add-form-link:hover { background: var(--pu); color: #fff; border-style: solid; }

/* Step indicator — Forms Create/Edit/Additional (formconfiguration). Purely a visual
   "step N of 4" cue; steps are plain labels, not links (no page exists for step 4 yet). */
.form-steps { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 28px; }
.fs-step { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; max-width: 150px; }
.fs-circle { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .82rem; font-weight: 700; border: 2px solid var(--bd); background: var(--surface); color: var(--tm); }
.fs-step.active .fs-circle { border-color: var(--pu); background: var(--pu); color: #fff; }
.fs-step.done .fs-circle { border-color: var(--gc); background: var(--gc); color: #fff; }
.fs-label { font-size: .74rem; font-weight: 600; color: var(--tm); text-align: center; }
.fs-step.active .fs-label { color: var(--pu); }
.fs-line { flex: 1; height: 2px; background: var(--bd); margin: 0 -20px; position: relative; top: -18px; max-width: 80px; }
.fs-line.done { background: var(--gc); }

/* ── Labelled inputs (Create/Edit Form) ─────────────────────── */
.f-label {
    display: flex; align-items: baseline; justify-content: space-between;
    font-size: .84rem; font-weight: 600; color: var(--tb); margin-bottom: 7px;
}
.f-label .f-optional { font-size: .72rem; font-weight: 500; color: var(--tm); text-transform: none; }
.f-hint { font-size: .76rem; color: var(--tm); margin-top: 6px; }
.f-count { font-size: .74rem; color: var(--tm); font-weight: 500; }
.f-count.warn { color: var(--or); font-weight: 600; }

.form-control-da, .form-select-da {
    width: 100%; border: 1.5px solid var(--bd); border-radius: 9px; padding: 10px 14px;
    font-size: .9rem; color: var(--td); background: var(--surface); font-family: 'Inter', sans-serif;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control-da::placeholder { color: var(--tm); }
.form-control-da:focus, .form-select-da:focus {
    outline: none; border-color: var(--pu); box-shadow: 0 0 0 3px rgba(91, 79, 207, .14);
}
.form-select-da { cursor: pointer; }
.form-control-da.error, .form-select-da.error { border-color: var(--rc); }
.form-control-da:disabled, .form-select-da:disabled { background: var(--bg); color: var(--tm); cursor: not-allowed; }
.f-error { display: none; font-size: .78rem; color: var(--rc); margin-top: 6px; align-items: center; gap: 5px; }
.f-error.show { display: flex; }

/* Sizing/spacing to match the wireframe's .f-error, applied alongside the
   framework's own text-danger/small classes so asp-validation-for's normal
   show/hide toggling (via jquery.validate.unobtrusive) is untouched. */
.f-error-text { font-size: .78rem; margin-top: 6px; display: block; }

/* ── Checkbox row + link-with-button row (Share Form) ──────────────── */
.qform-check-row { display: flex; align-items: center; gap: 8px; font-size: .87rem; color: var(--tb); font-weight: 500; }
.qform-check-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--pu); cursor: pointer; flex-shrink: 0; }
/* ── Shareable link row (SharedFormLink/FormShare.cshtml) ──────────── */
.share-link-row { display: flex; gap: 10px; align-items: flex-start; }
.share-link-row .form-control-da { flex: 1; resize: none; }
.share-copy-btn { flex-shrink: 0; white-space: nowrap; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.share-copy-btn.copied { background: var(--gc) !important; border-color: var(--gc) !important; color: #fff !important; }

.share-qr-wrap { display: flex; align-items: center; gap: 16px; }
.share-qr-wrap #shareQrCode { border: 1px solid var(--bd); border-radius: 8px; background: #fff; padding: 8px; line-height: 0; }

/* ── Read-only meta strip (Edit Form — surfaces CreatedDate/Status) ── */
.meta-strip {
    display: flex; flex-wrap: wrap; gap: 6px 24px; background: var(--bg); border: 1px solid var(--bd);
    border-radius: 10px; padding: 12px 16px; margin-bottom: 22px; font-size: .8rem; color: var(--tm);
}

/* ── Form Type — selectable cards (Additional Configuration) ──────── */
.ftype-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ftype-option {
    display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border: 1.5px solid var(--bd);
    border-radius: 11px; background: var(--surface); cursor: pointer; transition: all .15s ease; margin: 0;
}
.ftype-option:hover { border-color: var(--plt); background: var(--pale); }
.ftype-option.selected { border-color: var(--pu); background: var(--pale); }
.ftype-option input { margin-top: 3px; accent-color: var(--pu); width: 16px; height: 16px; cursor: pointer; flex-shrink: 0; }
.ftype-option .ftype-label { font-size: .87rem; font-weight: 700; color: var(--td); }
.ftype-option .ftype-desc { font-size: .76rem; color: var(--tm); margin-top: 2px; }

/* ── Language checkboxes + table (Additional Configuration) ───────── */
.lang-checks { display: flex; flex-wrap: wrap; gap: 14px; }
.lang-check {
    display: flex; align-items: center; gap: 7px; font-size: .85rem; color: var(--tb); background: var(--surface);
    border: 1.5px solid var(--bd); border-radius: 8px; padding: 8px 14px; cursor: pointer; margin: 0;
}
.lang-check input { accent-color: var(--pu); width: 15px; height: 15px; cursor: pointer; }
.lang-check.checked { border-color: var(--pu); color: var(--pu); font-weight: 600; }

.lang-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.lang-table th {
    font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--tm);
    text-align: left; padding: 9px 12px; background: var(--bg); border-bottom: 1px solid var(--bd);
}
.lang-table td { padding: 9px 12px; vertical-align: middle; border-bottom: 1px solid var(--bd); font-size: .86rem; color: var(--tb); }
.lang-table tr:last-child td { border-bottom: none; }
.lang-pill { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 100px; background: var(--pale); color: var(--pu); }
.meta-strip .item { display: flex; align-items: center; gap: 6px; }
.meta-strip i { color: var(--pu); }
.meta-strip strong { color: var(--tb); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════════
   TABLE EMPTY STATE — shared "no results" block for list pages
   ═══════════════════════════════════════════════════════════════════════ */
.table-empty-state { padding: 48px 20px; text-align: center; }
.table-empty-state .icon-circle {
    width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 14px; display: flex;
    align-items: center; justify-content: center; background: var(--pale); color: var(--pu); font-size: 1.4rem;
}
.table-empty-state h6 { font-weight: 700; color: var(--td); margin-bottom: 4px; }
.table-empty-state p { font-size: .85rem; color: var(--tm); margin-bottom: 14px; }

/* ═══════════════════════════════════════════════════════════════════════
   DELETE WORKFLOW — dependency stepper, shared by Projects/Delete.cshtml
   and QuestionForm/Delete.cshtml (previously duplicated inline in both)
   ═══════════════════════════════════════════════════════════════════════ */
.del-stepper { display: flex; flex-direction: column; margin: 0 0 24px; }
.del-step { display: flex; gap: 14px; position: relative; padding-bottom: 20px; }
.del-step:last-child { padding-bottom: 0; }
.del-step-line {
    position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px;
    background: var(--bd);
}
.del-step.done .del-step-line { background: #2daa88; }
.del-step:last-child .del-step-line { display: none; }
.del-step-circle {
    flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 700; border: 2px solid var(--bd);
    color: var(--tm); background: var(--surface); z-index: 1;
}
.del-step.done .del-step-circle    { background: #2daa88; border-color: #2daa88; color: #fff; }
.del-step.current .del-step-circle { background: var(--pu); border-color: var(--pu); color: #fff; box-shadow: 0 0 0 4px var(--pale); }
.del-step-body  { padding-top: 4px; min-width: 0; }
.del-step-title { font-weight: 600; font-size: .92rem; color: var(--td); }
.del-step.upcoming .del-step-title { color: var(--tm); font-weight: 500; }
.del-step.current .del-step-title  { color: var(--pu); }
.del-step-desc  { font-size: .8rem; color: var(--tm); margin-top: 2px; }
.del-step-tag {
    display: inline-block; font-size: .65rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    color: var(--pu); background: var(--pale); padding: 2px 8px; border-radius: 20px; margin-left: 8px;
    vertical-align: 1px;
}
.del-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 26px; flex-wrap: wrap; }
.del-header h5 { margin: 0 0 3px; font-size: 1.1rem; font-weight: 700; }
.del-header p { margin: 0; font-size: .85rem; color: var(--tm); }
.del-back-link {
    font-size: .8rem; font-weight: 600; color: var(--tm); text-decoration: none;
    display: inline-flex; align-items: center; gap: 5px;
}
.del-back-link:hover { color: var(--pu); }
/* Still used by QuestionForm/Delete.cshtml — Projects/Delete.cshtml itself
   now uses .del-list-empty (matching the wireframe) instead. */
.del-success-banner {
    display: flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 500;
    color: #1f7a5f; background: rgba(45,170,136,.1); border-radius: 8px; padding: 12px 14px; margin-bottom: 18px;
}
.del-list-empty {
    display: none; text-align: center; padding: 30px 10px; color: var(--tm); font-size: .87rem;
    border: 1.5px dashed var(--bd); border-radius: 10px; margin-bottom: 22px;
}
.del-list-empty.show { display: block; }
.del-list-empty i { font-size: 1.4rem; color: var(--gc); display: block; margin-bottom: 8px; }
.del-lock-hint { font-size: .78rem; color: var(--tm); display: inline-flex; align-items: center; gap: 5px; }
.del-footer { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; }
.del-recycle-note { text-align: right; margin-top: 10px; }
.del-recycle-note span { font-size: .78rem; color: var(--tm); display: inline-flex; align-items: center; gap: 5px; }
/* Still used by QuestionForm/Delete.cshtml's .card.del-page-card wrapper —
   Projects/Delete.cshtml itself was migrated to .da-form-wrap-wide below. */
.del-page-card { max-width: 1180px; }

/* Projects/Delete.cshtml — dependent-forms row list */
.dep-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.dep-row {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    padding: 14px 16px; border: 1px solid var(--bd); border-radius: 10px; background: var(--surface);
    transition: box-shadow .15s ease, border-color .15s ease;
}
.dep-row.pending { border-left: 3px solid #e8653a; }
.dep-row.clear   { border-left: 3px solid #2daa88; }
/* Recycle Bin retention states — reuse the same row shell */
.dep-row.expired { border-left: 3px solid #e05252; }
.dep-row.soon    { border-left: 3px solid #e8653a; }
.dep-row.ok      { border-left: 3px solid #2daa88; }
.dep-row:hover   { box-shadow: 0 2px 10px rgba(91,79,207,.08); border-color: var(--pale); }
.dep-row-main  { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dep-row-icon  {
    flex-shrink: 0; width: 38px; height: 38px; border-radius: 9px; background: var(--pale);
    display: flex; align-items: center; justify-content: center; color: var(--pu); font-size: 17px;
}
.dep-row-title { font-weight: 600; color: var(--td); font-size: .92rem; }
.dep-row-meta  { font-size: .78rem; color: var(--tm); margin-top: 2px; }
.dep-row-side  { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dep-pill {
    font-size: .7rem; font-weight: 700; padding: 3px 11px; border-radius: 20px; white-space: nowrap;
}
.dep-pill.clear   { background: rgba(45,170,136,.12); color: #1f7a5f; }
.dep-pill.pending { background: rgba(232,101,58,.12); color: #b6491f; }
/* Recycle Bin retention states + record-type tag — reuse the same pill shell */
.dep-pill.ok      { background: rgba(45,170,136,.12); color: #1f7a5f; }
.dep-pill.soon    { background: rgba(232,101,58,.12); color: #b6491f; }
.dep-pill.expired { background: rgba(224,82,82,.12); color: #c23f3f; }
.dep-pill.type    { background: rgba(91,79,207,.1); color: var(--pu); margin-left: 8px; }
.dep-row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dep-btn-outline        { color: var(--pu); border-color: var(--pale); background: var(--surface); }
.dep-btn-outline:hover  { background: var(--pale); color: var(--pdk); }
.dep-btn-outline:disabled { opacity: .45; cursor: not-allowed; }
.dep-btn-danger         { color: var(--rc); border-color: #f3c9c9; background: var(--surface); }
.dep-btn-danger:hover   { background: #fdecec; color: #c23f3f; }
@media (max-width: 560px) {
    .dep-row { flex-direction: column; align-items: flex-start; }
    .dep-row-side { width: 100%; justify-content: space-between; }
}

/* QuestionForm/Delete.cshtml — response/section dependency stat cards */
.dep-stat-card {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px;
    padding: 16px 18px; border: 1px solid var(--bd); border-radius: 10px; background: var(--surface); margin-bottom: 22px;
}
.dep-stat-card.pending { border-left: 3px solid #e8653a; }
.dep-stat-card.clear   { border-left: 3px solid #2daa88; }
.dep-stat-label { font-size: .78rem; color: var(--tm); margin-bottom: 2px; }
.dep-stat-value { font-size: 1.5rem; font-weight: 700; color: var(--td); }
.dep-section-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dep-section-chip {
    display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 500;
    padding: 4px 10px; border-radius: 20px; background: #f4f3fa; color: #4a3fb8; white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════
   SIMPLE DELETE CONFIRMATION — standalone records with no dependents
   (ViewData/Delete.cshtml). Lighter-weight than the stepper/dep-row
   workflow above, which is reserved for records with dependent children.
   ═══════════════════════════════════════════════════════════════════════ */
.del-summary { border: 1px solid var(--bd); border-radius: 12px; overflow: hidden; margin-bottom: 22px; }
.del-summary-row { display: flex; justify-content: space-between; gap: 14px; padding: 12px 16px; font-size: .86rem; }
.del-summary-row + .del-summary-row { border-top: 1px solid var(--bd); }
.del-summary-label { color: var(--tm); font-weight: 600; }
.del-summary-value { color: var(--td); font-weight: 600; text-align: right; }
.role-level-pill { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 700; padding: 4px 11px; border-radius: 100px; background: rgba(91,79,207,.1); color: var(--pu); }
.role-designation-text { font-weight: 600; color: var(--td); }
.user-fullname { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--td); }
.user-avatar-sm { width: 30px; height: 30px; border-radius: 50%; background: var(--pale); color: var(--pu); display: flex; align-items: center; justify-content: center; font-size: .8rem; flex-shrink: 0; }
.sex-badge { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; color: var(--tb); }
.assign-pill {
    display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; padding: 6px 13px;
    border-radius: 100px; border: 1.5px solid var(--bd); color: var(--tb); background: var(--surface); white-space: nowrap;
    text-decoration: none;
}
.assign-pill:hover { border-color: var(--pu); color: var(--pu); background: var(--pale); }
.active-badge { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; }
.active-badge .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.active-badge.yes { color: #2daa88; } .active-badge.yes .dot { background: #2daa88; }
.active-badge.no  { color: var(--tm); } .active-badge.no .dot  { background: var(--tm); }

.del-warning-note {
    display: flex; align-items: flex-start; gap: 10px; background: rgba(224,82,82,.08);
    border: 1px solid rgba(224,82,82,.25); border-radius: 10px; padding: 12px 14px;
    font-size: .82rem; color: var(--tb); margin-bottom: 24px;
}
.del-warning-note i { color: #e05252; font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.del-warning-note strong { color: #e05252; }

/* ── Read-only phase/population-type table (Projects/View.cshtml) ── */
.phase-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.phase-table th {
    font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--tm);
    text-align: left; padding: 8px 10px; background: var(--bg); border-bottom: 1px solid var(--bd);
}
.phase-table td { padding: 8px 10px; vertical-align: top; border-bottom: 1px solid var(--bd); font-size: .85rem; color: var(--tb); }
.phase-table tr:last-child td { border-bottom: none; }
.phase-empty { text-align: center; color: var(--tm); font-size: .83rem; padding: 16px; border: 1.5px dashed var(--bd); border-radius: 9px; }

/* ── Read-only KPI mini-cards + sections list (Forms/View.cshtml) ── */
.rv-stats { display: flex; gap: 12px; margin-bottom: 4px; flex-wrap: wrap; }
.rv-stat { flex: 1; min-width: 130px; background: var(--bg); border: 1px solid var(--bd); border-radius: var(--rs); padding: 14px 16px; }
.rv-stat .num { font-size: 1.4rem; font-weight: 800; color: var(--pu); font-family: 'Poppins', sans-serif; }
.rv-stat .lbl { font-size: .78rem; color: var(--tm); font-weight: 600; }

.sec-table { width: 100%; border-collapse: collapse; }
.sec-table th { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--tm); text-align: left; padding: 9px 12px; background: var(--bg); border-bottom: 1px solid var(--bd); }
.sec-table td { padding: 9px 12px; vertical-align: middle; border-bottom: 1px solid var(--bd); font-size: .86rem; color: var(--tb); }
.sec-table tr:last-child td { border-bottom: none; }
.sec-num { color: var(--tm); font-weight: 700; width: 40px; }

/* ═══════════════════════════════════════════════════════════════════════
   ICON ACTION BUTTONS (.qi-btn) — colored icon buttons for table rows
   Uses <i class="bi bi-*"> (inherits CSS color) instead of <img src=".svg">
   (an external image can't inherit the page's color, so those always
   render in the SVG's own default black regardless of surrounding CSS —
   this is the fix for the Responses table's plain-black view/delete icons)
   ═══════════════════════════════════════════════════════════════════════ */
.qi-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px; font-size: .9rem;
    border: 1px solid var(--bd); background: var(--surface); color: var(--tb);
    position: relative; flex-shrink: 0;
    text-decoration: none; transition: all .15s ease;
}
.qi-btn:hover { transform: translateY(-2px); }
.qi-btn:active { transform: scale(.9); }
/* Custom tooltip (native title attribute rendered via ::after/::before) —
   matches the wireframe's .qi-btn[title]:hover treatment used throughout
   the app's other icon-button families (e.g. .db-icon-btn). */
.qi-btn[title]:hover::after {
    content: attr(title); position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%);
    background: var(--td); color: #fff; font-size: .68rem; font-weight: 600; padding: 4px 8px; border-radius: 6px;
    white-space: nowrap; box-shadow: 0 4px 10px rgba(0,0,0,.18); pointer-events: none; z-index: 5;
}
.qi-btn[title]:hover::before {
    content: ''; position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%);
    border: 4px solid transparent; border-top-color: var(--td); pointer-events: none; z-index: 5;
}
.qi-btn.qi-view { color: var(--tl) !important; border-color: rgba(58,191,177,.3); }
.qi-btn.qi-view:hover { border-color: var(--tl); color: var(--tl) !important; background: rgba(58,191,177,.1); }
.qi-btn.qi-edit { color: var(--pu) !important; border-color: var(--pale); }
.qi-btn.qi-edit:hover { border-color: var(--pu); color: var(--pu) !important; background: var(--pale); }
.qi-btn.qi-delete { color: var(--rc) !important; border-color: #f6d5d5; }
.qi-btn.qi-delete:hover { border-color: var(--rc); color: var(--rc) !important; background: #fdecec; }
.qi-btn.qi-share { color: var(--tl) !important; border: none; background: none; }
.qi-btn.qi-share:hover { background: rgba(58,191,177,.12); box-shadow: 0 4px 8px rgba(58,191,177,.15); }
.qi-btn.qi-manage { color: var(--or) !important; border-color: rgba(232,101,58,.3); }
.qi-btn.qi-manage:hover { border-color: var(--or); color: var(--or) !important; background: rgba(232,101,58,.1); }
.qt-actions { display: flex; align-items: center; gap: 6px; }

/* ── Project tag (Forms/Index.cshtml "Project" column) ── */
.qt-project-tag {
    display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; color: var(--tm);
    max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
}
.qt-project-tag i { flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════════════
   LEGACY ICON/LINK BUTTONS (.custom_link_btn / .custom_delete_icon /
   .add-section-button) — previously unstyled selectors used across many
   list/form pages (Project Settings phases, Population Types, etc.).
   Brought in line with the .qi-btn icon-button treatment above.
   ═══════════════════════════════════════════════════════════════════════ */
.custom_link_btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 7px; color: var(--tm) !important;
    text-decoration: none; cursor: pointer;
    transition: background .2s ease, color .2s ease, transform .15s ease;
}
.custom_link_btn:hover { background: var(--pale); color: var(--pu) !important; transform: translateY(-2px); }
.custom_link_btn:active { transform: scale(.9); }
.custom_link_btn img { opacity: .8; }
.custom_link_btn:hover img { opacity: 1; }

.custom_delete_icon.custom_link_btn,
a.custom_delete_icon { color: #ef4444 !important; }
.custom_delete_icon.custom_link_btn:hover,
a.custom_delete_icon:hover { background: rgba(239,68,68,.12) !important; color: #ef4444 !important; }

/* Move-up/down arrow icon buttons (QuestionForm/Manage.cshtml row reorder) —
   overrides the legacy orange/tan site.css styling with the same neutral
   icon-button treatment as .custom_link_btn above. */
.custom_arrow_btn,
.custom_arrow_rd__btn {
    background: transparent !important;
    border: none !important;
    display: inline-flex !important; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 7px; padding: 0 !important;
    color: var(--tm);
    transition: background .2s ease, color .2s ease, transform .15s ease;
}
.custom_arrow_btn:hover,
.custom_arrow_rd__btn:hover {
    background: var(--pale) !important;
    color: var(--pu);
    transform: translateY(-1px) !important;
}

.add-section-button,
#main.main .table tbody td a.add-section-button {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    width: auto !important; height: auto !important;
    font-size: .8rem; font-weight: 600; color: var(--pu) !important;
    background: var(--pale); padding: 5px 14px; border-radius: 100px !important;
    text-decoration: none; transition: background .2s ease, color .2s ease;
}
.add-section-button:hover,
#main.main .table tbody td a.add-section-button:hover { background: var(--pu); color: #fff !important; transform: none; }

/* ═══════════════════════════════════════════════════════════════════════
   REPORT ADMIN — Areas/Admin/Views/ViewData/Index.cshtml
   (relocated from an inline <style> block)
   ═══════════════════════════════════════════════════════════════════════ */
.sql-cell { max-width: 200px; }
.sql-preview {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--tm);
    white-space: pre-wrap;
    word-break: break-all;
}
.sql-full {
    display: none;
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--tm);
    white-space: pre-wrap;
    word-break: break-all;
}
.sql-toggle {
    font-size: 0.7rem;
    cursor: pointer;
    color: var(--pu);
    background: none;
    border: none;
    padding: 0;
    line-height: 1.2;
    display: block;
    margin-top: 2px;
}
.sql-toggle:hover { text-decoration: underline; }
.ra-header { margin-bottom: 4px; }
.ra-header h2 { font-size: 1.15rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 8px; }
.ra-header p { font-size: .85rem; color: var(--tm); margin: 4px 0 0; }
.type-tag { font-size: .78rem; color: var(--tb); white-space: nowrap; }
.ra-report-name { font-weight: 600; color: var(--td); white-space: nowrap; }
.ra-title { color: var(--tm); white-space: nowrap; }

/* ── UnitType Index — name/status pills ──────────────────────────────── */
.unittype-name-text { font-weight: 600; color: var(--td); }
.pill { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 700; padding: 4px 11px; border-radius: 100px; }
.pill-yes { background: rgba(45,170,136,.12); color: var(--gc); }
.pill-no { background: rgba(122,122,154,.12); color: var(--tm); }
.pill-active { background: rgba(45,170,136,.12); color: var(--gc); }
.pill-inactive { background: rgba(224,82,82,.1); color: var(--rc); }
/* Read-only SQL block (ViewData Details) */
.sql-mono-view {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; font-size: .82rem; color: var(--tb);
    background: var(--bg); border: 1.5px solid var(--bd); border-radius: 9px; padding: 10px 14px;
    white-space: pre-wrap; word-break: break-word; margin: 0;
}
body[data-mode="dark"] .sql-mono-view { color: #c7c7d8; }

/* Shared by both dependency components above (.dep-row-actions and .dep-stat-card use it) */
.dep-btn, .dep-btn-outline, .dep-btn-danger {
    display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600;
    padding: 7px 12px; border-radius: 7px; text-decoration: none; white-space: nowrap; border: 1px solid transparent;
    transition: background .15s ease, color .15s ease;
}
.dep-btn { font-size: .8rem; padding: 8px 14px; border-color: var(--pale); color: var(--pu); background: var(--surface); }
.dep-btn:hover { background: var(--pale); color: var(--pdk); }

/* ═══════════════════════════════════════════════════════════════════════
   RECYCLE BIN — Areas/Admin/Views/RecycleBin/Index.cshtml
   (relocated from an inline <style> block; reuses .dep-list/.dep-row/
   .dep-pill/.dep-btn from the DELETE WORKFLOW section above for the item
   rows themselves — only the stat/filter/bulk-toolbar chrome is new here)
   ═══════════════════════════════════════════════════════════════════════ */
.rb-stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.rb-stat-card {
    flex: 1 1 150px; padding: 14px 16px; border: 1px solid var(--bd); border-radius: var(--r); background: var(--surface);
    box-shadow: var(--sh);
}
.rb-stat-value { font-size: 1.5rem; font-weight: 700; color: var(--td); line-height: 1.1; }
.rb-stat-label { font-size: .78rem; color: var(--tm); margin-top: 4px; }
.rb-stat-card.warn .rb-stat-value { color: var(--or); }

.rb-filter-bar {
    display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
    padding: 14px 16px; border: 1px solid var(--bd); border-radius: var(--r); background: var(--surface); margin-bottom: 20px;
    box-shadow: var(--sh);
}
.rb-filter-field { display: flex; flex-direction: column; gap: 4px; min-width: 160px; }
.rb-filter-field label { font-size: .72rem; font-weight: 700; color: var(--tm); text-transform: uppercase; letter-spacing: .03em; }
.rb-filter-field select, .rb-filter-field input {
    font-size: .84rem; padding: 8px 10px; border: 1.5px solid var(--bd); border-radius: var(--rs); color: var(--tb); background: var(--surface);
}
.rb-filter-field select:focus, .rb-filter-field input:focus { outline: none; border-color: var(--pu); box-shadow: 0 0 0 3px var(--pale); }

.rb-bulk-toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 11px 16px; border: 1px solid var(--bd); border-radius: var(--r); background: var(--surface); margin-bottom: 14px;
    box-shadow: var(--sh);
}
.rb-bulk-left { display: flex; align-items: center; gap: 10px; }
.rb-bulk-left label { font-size: .84rem; font-weight: 600; color: var(--tb); display: flex; align-items: center; gap: 8px; cursor: pointer; }
.rb-bulk-left input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--pu); cursor: pointer; }
.rb-bulk-toolbar .form-check-label { font-size: .84rem; font-weight: 600; color: var(--tb); }
.rb-bulk-actions { display: flex; gap: 8px; }
.rb-row-check { flex-shrink: 0; width: 18px; height: 18px; cursor: pointer; accent-color: var(--pu); }

/* Recycle Bin Restore action — green outline, distinct from the purple
   .dep-btn-outline used by Projects/Delete's dependent-forms list */
.dep-btn-outline.rb-restore-btn { color: var(--gc); border-color: rgba(45,170,136,.3); }
.dep-btn-outline.rb-restore-btn:hover { background: rgba(45,170,136,.1); color: #1f7a5f; }

.rb-empty {
    text-align: center; padding: 56px 16px; color: var(--tm); background: var(--surface);
    border: 1.5px dashed var(--bd); border-radius: var(--r);
}
.rb-empty i { font-size: 2.2rem; color: var(--bd); display: block; margin-bottom: 10px; }

/* Bulk Restore/Delete result — one item per line instead of a single run-on
   paragraph, so a batch of 20+ skipped items stays scannable. */
.rb-purge-fail-list {
    list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto;
    border: 1px solid var(--bd); border-radius: var(--rs); background: var(--bg);
}
.rb-purge-fail-list li {
    padding: 8px 12px; font-size: .82rem; line-height: 1.4;
    border-bottom: 1px solid var(--bd);
}
.rb-purge-fail-list li:last-child { border-bottom: none; }
.rb-purge-fail-list li strong { display: block; color: var(--td); font-weight: 600; }
.rb-purge-fail-list li span { display: block; color: var(--tm); }
body[data-mode="dark"] .rb-filter-bar,
body[data-mode="dark"] .rb-bulk-toolbar { background: var(--bg); }
@media (max-width: 560px) {
    .rb-filter-bar .rb-filter-field { min-width: 0; flex: 1 1 100%; }
}

/* ═══════════════════════════════════════════════════════════════════════
   DASHBOARD ANALYSIS PAGE — Areas/Dashboard/Views/Analysis/Index.cshtml
   (relocated from an inline <style> block; all rules are uniquely
   ".ap-" prefixed so they are safe to load globally)
   ═══════════════════════════════════════════════════════════════════════ */
.ap-filter-card   { background:var(--surface); border:1px solid var(--bd); border-radius:12px; padding:18px 22px; box-shadow:var(--sh); }
.ap-filter-label  { font-size:10px; font-weight:700; color:var(--tm); letter-spacing:.08em; text-transform:uppercase; display:flex; align-items:center; gap:5px; margin-bottom:5px; }
.ap-filter-label i{ font-size:12px; color:var(--pu); }

.ap-sum-card      { background:var(--surface); border:1px solid var(--bd); border-radius:12px; padding:14px 16px; display:flex; align-items:center; gap:12px; box-shadow:var(--sh); transition:box-shadow .15s,transform .15s; }
.ap-sum-card:hover{ box-shadow:var(--sl); transform:translateY(-1px); }
.ap-sum-icon      { width:38px; height:38px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.ap-sum-num       { font-size:22px; font-weight:600; color:var(--td); line-height:1; }
.ap-sum-lbl       { font-size:11px; color:var(--tm); margin-top:3px; }

.ap-plan-card     { background:var(--surface); border:1px solid var(--bd); border-radius:14px; overflow:hidden; box-shadow:var(--sh); }
.ap-page-head     { display:flex; align-items:center; justify-content:space-between; padding:12px 20px; background:linear-gradient(90deg, var(--pale), var(--bg)); border-bottom:1px solid var(--bd); cursor:pointer; user-select:none; }
.ap-page-title    { display:flex; align-items:center; gap:10px; font-size:13px; font-weight:600; color:var(--pdk); }
.ap-page-badge    { font-size:11px; font-weight:600; background:var(--pu); color:#fff; padding:2px 9px; border-radius:20px; }

.ap-thead         { display:grid; grid-template-columns:34px 52px minmax(0,2.6fr) 116px 156px 54px 68px 128px; min-width:778px; background:var(--bg); border-bottom:1.5px solid var(--bd); }
.ap-th            { font-size:10px; font-weight:700; color:var(--tm); padding:10px 10px; letter-spacing:.08em; text-transform:uppercase; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:flex; align-items:center; }

.ap-sec-div       { display:grid; grid-template-columns:34px 52px minmax(0,2.6fr) 116px 156px 54px 68px 128px; min-width:778px; border-top:1px solid var(--bd); }
.ap-sec-cell      { grid-column:1/-1; display:flex; align-items:center; gap:9px; padding:8px 14px; background:var(--pale); }
.ap-sec-dot       { width:9px; height:9px; border-radius:3px; flex-shrink:0; }
.ap-sec-name      { font-size:11px; font-weight:600; color:var(--pdk); }
.ap-sec-badge     { font-size:10px; background:var(--pale); color:var(--pu); border:1px solid var(--plt); padding:1px 7px; border-radius:4px; font-weight:500; }

.ap-row           { display:grid; grid-template-columns:34px 52px minmax(0,2.6fr) 116px 156px 54px 68px 128px; min-width:778px; border-top:1px solid var(--bd); transition:background .1s; }
.ap-row:hover     { background:var(--bg); }
.ap-row.ap-row-selected { background:var(--pale); }
.ap-td            { padding:11px 10px; display:flex; align-items:center; font-size:12px; color:var(--td); min-width:0; overflow:hidden; }
.ap-chk           { width:14px; height:14px; cursor:pointer; accent-color:var(--pu); }

.ap-bulkbar       { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:9px 16px; background:var(--pale); border-bottom:1px solid var(--bd); font-size:12px; color:var(--pdk); font-weight:600; }
.ap-bulkbar .btn  { font-size:11.5px; padding:5px 12px; }
.ap-td-id         { color:var(--tm); font-size:12px; font-weight:500; }
.ap-td-main       { flex-direction:column; align-items:flex-start; justify-content:center; gap:2px; }
.ap-var-name      { font-size:12px; font-weight:500; color:var(--td); line-height:1.4; }
.ap-var-meta      { font-family:ui-monospace,monospace; font-size:10px; color:var(--tm); line-height:1.4; }

.ap-type-pill     { display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:600; padding:3px 10px; border-radius:6px; color:#fff; letter-spacing:.02em; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ap-ai-pill       { display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:500; background:var(--pale); color:var(--pu); border:1px solid var(--plt); padding:3px 9px; border-radius:6px; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ap-manual-pill   { display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:500; background:var(--bg); color:var(--tm); border:1px solid var(--bd); padding:3px 9px; border-radius:6px; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ap-check         { color:var(--pu); font-size:16px; font-weight:700; }
.ap-status-icon   { display:inline-flex; align-items:center; justify-content:center; width:24px; height:24px; border-radius:50%; font-size:13px; flex-shrink:0; }
.ap-status-icon.active   { background:rgba(45,170,136,.12); color:var(--gc); }
.ap-status-icon.inactive { background:var(--bg); color:var(--tm); }
.ap-row.ap-row-inactive { opacity:.62; }
.ap-row.ap-row-inactive:hover { opacity:.85; }
.ap-act-btn       { width:28px; height:28px; display:flex; align-items:center; justify-content:center; border-radius:7px; cursor:pointer; color:var(--tm); transition:all .15s; border:1px solid transparent; background:none; }
.ap-act-btn:hover { background:var(--pale); color:var(--pu); border-color:var(--plt); }

.ap-footer        { display:flex; align-items:center; justify-content:space-between; padding:10px 16px; border-top:1px solid var(--bd); background:var(--bg); }
.ap-footer-ai     { display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:500; background:linear-gradient(90deg, var(--pale), var(--bg)); color:var(--pu); border:1px solid var(--plt); padding:4px 10px; border-radius:20px; }
.ap-empty         { padding:56px 20px; display:flex; flex-direction:column; align-items:center; gap:14px; text-align:center; }
.ap-empty-ring    { width:56px; height:56px; border-radius:16px; background:linear-gradient(135deg, var(--pale), var(--bg)); border:2px solid var(--plt); display:flex; align-items:center; justify-content:center; }
.ap-loading       { padding:48px 20px; display:flex; flex-direction:column; align-items:center; gap:14px; }
.ap-spinner       { width:28px; height:28px; border:3px solid var(--pale); border-top-color:var(--pu); border-radius:50%; animation:ap-spin .75s linear infinite; }
@keyframes ap-spin { to { transform:rotate(360deg); } }
.ap-tab           { font-size:12px; font-weight:500; padding:5px 13px; border-radius:20px; border:1.5px solid var(--bd); cursor:pointer; color:var(--tm); background:var(--surface); transition:all .15s; white-space:nowrap; }
.ap-tab:hover     { border-color:var(--plt); color:var(--pu); background:var(--pale); }
.ap-tab.active    { background:var(--pu); color:#fff; border-color:var(--pu); box-shadow:0 2px 8px rgba(91,79,207,.25); }
.ap-search        { display:flex; align-items:center; gap:8px; border:1.5px solid var(--bd); border-radius:10px; padding:0 12px; background:var(--surface); transition:border-color .15s; }
.ap-search:focus-within { border-color:var(--pu); box-shadow:0 0 0 3px var(--pale); }
.ap-search i      { color:var(--plt); font-size:14px; }
.ap-search input  { border:none; background:transparent; font-size:12px; color:var(--td); padding:7px 0; outline:none; width:160px; }
.ap-search input::placeholder { color:var(--tm); }

/* Generated/Draft status badge — explicit single-line sizing. The parent header row's
   align-items utility previously had a typo (align-items-flex-start, not a real Bootstrap
   class) which fell back to the default "stretch", stretching this badge to match the
   height of the two-line title+subtitle block beside it. */
.ap-status-badge { display:inline-flex; align-items:center; white-space:nowrap; line-height:1.2; padding:4px 10px; }

/* The table's columns are fixed-width (CSS Grid) so long "Type"/"Creation type" pill
   text truncates with an ellipsis instead of overlapping the next column (see
   .ap-td/.ap-type-pill above) rather than reflowing. On narrow screens the grid itself
   can't shrink below its column minimums, so let the wrapper scroll horizontally
   instead of squeezing the row layout or clipping content unreadably. */
#tableWrap { overflow-x:auto; }

/* ── Analysis Assistant (floating button + side panel) ───────────────────
   Previously all inline `style="..."` with hardcoded hex (#667eea/#764ba2
   etc.) — invisible to both dark mode and accent-color switching since
   inline styles never read the CSS custom properties. Token-based now, so
   both propagate automatically. JS still drives the open/close animation
   directly via element.style.right/.transform/.display — untouched here. */
.ai-fab-btn {
    position: fixed; bottom: 90px; right: 28px; width: 52px; height: 52px; border-radius: 50%;
    background: linear-gradient(135deg, var(--pu), var(--vh)); color: #fff; border: none;
    box-shadow: 0 4px 16px rgba(91,79,207,.5); z-index: 1050;
    transition: transform .2s, box-shadow .2s; cursor: pointer;
}
.ai-fab-btn:hover { box-shadow: 0 6px 20px rgba(91,79,207,.6); }
.ai-chat-panel {
    position: fixed; top: 0; right: -440px; width: 420px; height: 100vh; background: var(--surface);
    box-shadow: -4px 0 24px rgba(0,0,0,.12); z-index: 1045;
    transition: right .3s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column;
    border-left: 1px solid var(--bd);
}
.ai-chat-header { background: linear-gradient(135deg, var(--pu), var(--vh)); }
.ai-chat-header-icon { width: 36px; height: 36px; background: rgba(255,255,255,.2); }
.ai-chat-clear-btn {
    background: rgba(255,255,255,.15); border: none; border-radius: .375rem; padding: 4px 8px;
    color: #fff; font-size: .72rem; cursor: pointer; line-height: 1.2;
}
.ai-messages { background: var(--bg); scroll-behavior: smooth; }
.ai-msg-avatar { width: 30px; height: 30px; background: linear-gradient(135deg, var(--pu), var(--vh)); margin-top: 2px; }
.ai-msg-bubble {
    background: var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.07); max-width: calc(100% - 42px);
    font-size: .85rem; line-height: 1.5; color: var(--td);
}
.ai-suggestions-bar { background: var(--bg); border-color: var(--bd) !important; }
.ai-suggestion {
    font-size: .72rem; padding: .2rem .55rem; border-radius: .375rem;
    border: 1px solid var(--bd); background: var(--surface); color: var(--tb); cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.ai-suggestion:hover { background: var(--pale); color: var(--pu); border-color: var(--plt); }
.ai-chat-input-bar { background: var(--surface); border-color: var(--bd) !important; }
.ai-chat-textarea {
    resize: none; font-size: .85rem; border-right: none; flex: 1 1 auto; min-width: 0; width: 1%;
}
.ai-chat-send-btn {
    background: linear-gradient(135deg, var(--pu), var(--vh)); color: #fff; border: none;
    border-radius: 0 .375rem .375rem 0; flex: 0 0 auto;
}
.ai-chat-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 1040; transition: opacity .3s; }

/* Dynamically-created chat message elements (appendMessage() in Analysis/Index.cshtml) */
.ai-msg-avatar-el { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
.ai-msg-avatar-user { background: var(--bg); color: var(--tm); }
.ai-msg-avatar-assistant { background: linear-gradient(135deg, var(--pu), var(--vh)); }

/* ── DIA identity for the Analysis & Dashboard assistants ──────────────────
   These chat assistants are the same DIA (Data Intelligence Assistant) as the
   Form Builder's — give them the shared DIA avatar + glow instead of the plain
   "stars" icon, so the product has one assistant identity everywhere. The
   inner <i class="bi bi-stars"> placeholders are hidden under the avatar. */
.ai-fab-orb {
    display: inline-block; vertical-align: middle;
    width: 34px; height: 34px; border-radius: 50%;
    background: #06182e url('../img/dia-avatar.webp') center/cover no-repeat;
    box-shadow: 0 0 9px rgba(34,211,238,.6);
}
.ai-chat-header-icon,
.ai-msg-avatar,
.ai-msg-avatar-assistant {
    background: #06182e url('../img/dia-avatar.webp') center/cover no-repeat !important;
    box-shadow: 0 0 7px rgba(34,211,238,.45);
}
.ai-chat-header-icon > i,
.ai-msg-avatar > i,
.ai-msg-avatar-assistant > i { display: none !important; }
.ai-msg-bubble-el { max-width: calc(100% - 42px); font-size: .85rem; line-height: 1.5; padding: .5rem .75rem; border-radius: .75rem; box-shadow: 0 1px 4px rgba(0,0,0,.07); }
.ai-msg-bubble-user { background: linear-gradient(135deg, var(--pu), var(--vh)); color: #fff; border-bottom-right-radius: .2rem; }
.ai-msg-bubble-assistant { background: var(--surface); color: var(--td); border-bottom-left-radius: .2rem; }
.ai-note-applied {
    font-size: .75rem; color: #1f7a5f; background: rgba(45,170,136,.1); border: 1px solid rgba(45,170,136,.3);
    border-radius: .5rem; padding: .4rem .6rem; max-width: calc(100% - 42px);
}
.ai-note-skipped {
    font-size: .75rem; color: #b6491f; background: rgba(232,101,58,.1); border: 1px solid rgba(232,101,58,.3);
    border-radius: .5rem; padding: .4rem .6rem; max-width: calc(100% - 42px);
}
.ai-note-delete-confirm {
    font-size: .8rem; background: rgba(224,82,82,.06); border: 1px solid rgba(224,82,82,.25);
    border-radius: .6rem; padding: .6rem .75rem; max-width: calc(100% - 42px); color: var(--td);
}
body[data-mode="dark"] .ai-note-applied { color: #7fe0c0; }
body[data-mode="dark"] .ai-note-skipped { color: #f5b58f; }

/* Analysis toolbar CTAs + numbered onboarding steps — same token swap as above */
.ap-btn-generate {
    background: linear-gradient(135deg, var(--pu), var(--pdk)); color: #fff; border: none;
    padding: 9px 18px; border-radius: 10px; font-size: 13px; font-weight: 600;
    box-shadow: 0 2px 8px rgba(91,79,207,.3);
}
.ap-btn-new-item {
    background: var(--pale); color: var(--pdk); border: 1.5px solid var(--plt);
    padding: 9px 14px; border-radius: 10px; font-size: 13px; font-weight: 600;
}
.ap-step-badge {
    width: 20px; height: 20px; border-radius: 50%; background: var(--pale); color: var(--pu);
    font-size: 11px; font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════════════
   FORMS LIST PAGE — Areas/ManageQuestions/Views/QuestionForm/Index.cshtml
   (relocated from an inline <style> block)
   ═══════════════════════════════════════════════════════════════════════ */
.dropdown-menu { min-width: 9rem !important; }
.share-dropdown-item {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    white-space: nowrap !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
.share-dropdown-item img { flex-shrink: 0 !important; display: inline-block !important; }

/* Form Designer — per the wireframe this uses the exact same shared
   .btn-da structure (padding/radius/font-size) as every other toolbar
   action, differing only in colour (teal --tl instead of purple --pu), so
   the two adjacent actions read as one consistent button family while
   staying visually distinct (Form Designer = the AI-assisted way to build
   a form). Structural sizing now comes from .btn-da (see the standalone
   a./button. rule below for markup that omits the .btn-da class). */
.btn-form-designer {
    background: var(--tl); color: #fff; border-color: var(--tl);
    box-shadow: 0 2px 10px rgba(58,191,177,.25);
}
.btn-form-designer:hover, .btn-form-designer:focus {
    background: #2f9f93; border-color: #2f9f93; color: #fff;
    box-shadow: 0 6px 16px rgba(58,191,177,.35);
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSES FILTER CARD — Views/Shared/Levels/_LevelsResponsePartial.cshtml
   (used by IndexOwner/IndexUser). A standalone card (its own #responsesFilterCard,
   not the shared #filterAccordion Masters pages use) matching the wireframe's
   Search & Filter panel — toggle button + collapsible body, not a Bootstrap accordion.
   ═══════════════════════════════════════════════════════════════════════ */
.rp-filter-card {
    background: var(--surface); border: 1px solid var(--bd); border-radius: var(--r);
    box-shadow: var(--sh); margin-bottom: 18px; overflow: visible;
}
.rp-filter-toggle {
    display: flex; align-items: center; gap: .55rem; width: 100%; padding: 12px 16px;
    background: none; border: none; text-align: left; font-size: .875rem; font-weight: 600;
    color: var(--td); cursor: pointer; transition: background .15s ease; border-radius: var(--r) var(--r) 0 0;
}
.rp-filter-toggle:hover { background: var(--bg); }
.rp-filter-toggle.expanded { background: var(--pale); color: var(--pu); border-bottom: 1px solid var(--bd); }
.rp-filter-chevron { margin-left: auto; transition: transform .25s ease; opacity: .5; }
.rp-filter-toggle.expanded .rp-filter-chevron { transform: rotate(180deg); opacity: 1; }
.rp-filter-body { display: none; padding: 14px 16px 16px; }
.rp-filter-body.show { display: block; }
.rp-filter-row { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; }
.rp-filter-row > div { flex: 1 1 150px; min-width: 150px; }
.rp-filter-label {
    font-size: .7rem; font-weight: 600; color: var(--tm); margin-bottom: 5px;
    display: block; text-transform: uppercase; letter-spacing: .05em;
}
.filter-select, .filter-input {
    width: 100%; font-size: .84rem; border: 1px solid var(--bd); border-radius: var(--rs);
    padding: 8px 10px; color: var(--tb); background: var(--surface); font-family: 'Inter', sans-serif;
}
.filter-select:focus, .filter-input:focus { outline: none; border-color: var(--pu); box-shadow: 0 0 0 3px var(--pale); }
.filter-select:disabled { background: var(--bg); color: var(--tm); cursor: not-allowed; }
.filter-input::placeholder { color: var(--tm); }

/* Clear (x) icon inside the Search field — hidden until there's text to clear */
.filter-search-wrap { position: relative; }
.filter-search-wrap .filter-input { padding-right: 30px; }
.filter-search-wrap input[type="search"]::-webkit-search-cancel-button { display: none; }
.filter-search-clear {
    display: none; position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    border: none; background: none; padding: 0; color: var(--tm); font-size: .95rem; cursor: pointer; line-height: 1;
}
.filter-search-clear.show { display: block; }
.filter-search-clear:hover { color: var(--rc); }

/* Icon-only actions (Reset/Export) — sit inline with the field grid, at the end
   of the row, instead of taking up space with text labels. flex:0 0 auto keeps
   them a fixed compact width so they don't compete with the fields for space. */
.rp-filter-row > .rp-filter-actions { display: flex; align-items: end; gap: 8px; flex: 0 0 auto; min-width: 0; }
.rp-icon-btn {
    display: flex; align-items: center; justify-content: center; width: 38px; height: 38px;
    border-radius: var(--rs); cursor: pointer; font-size: 1rem; position: relative; flex-shrink: 0;
    transition: all .15s ease; border: 1px solid var(--bd); background: var(--surface); color: var(--tb);
    text-decoration: none;
}
.rp-icon-btn:hover { background: var(--pale); color: var(--pu); border-color: var(--pu); }
.rp-icon-btn[title]:hover::after {
    content: attr(title); position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%);
    background: var(--td); color: #fff; font-size: .68rem; font-weight: 600; padding: 4px 8px; border-radius: 6px;
    white-space: nowrap; box-shadow: 0 4px 10px rgba(0,0,0,.18); pointer-events: none; z-index: 5;
}
.rp-icon-btn[title]:hover::before {
    content: ''; position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%);
    border: 4px solid transparent; border-top-color: var(--td); pointer-events: none; z-index: 5;
}
.rp-apply-btn { background: var(--pu); color: #fff; border-color: var(--pu); box-shadow: 0 3px 10px rgba(91,79,207,.25); }
.rp-apply-btn:hover { background: var(--pdk); border-color: var(--pdk); color: #fff; }
.rp-reset-btn { border: 1.5px solid var(--bd) !important; color: var(--pu); background: var(--surface); }
.rp-reset-btn:hover { background: var(--pale); border-color: var(--pu) !important; }

/* Export dropdown */
.rp-export-wrap { position: relative; }
.rp-export-menu {
    display: none; position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface);
    border: 1px solid var(--bd); border-radius: var(--rs); box-shadow: var(--sl); min-width: 130px; z-index: 20; overflow: hidden;
}
.rp-export-menu.open { display: block; }
.rp-export-menu a {
    display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 9px 14px;
    font-size: .83rem; color: var(--tb); background: none; border: none; cursor: pointer; text-decoration: none;
}
.rp-export-menu a:hover { background: var(--pale); color: var(--pu); }
.rp-export-menu i.bi-file-earmark-excel { color: var(--gc); }
.rp-export-menu i.bi-file-earmark-text { color: var(--tl); }
.rp-export-menu i.bi-file-earmark-bar-graph { color: var(--or); }
.rp-export-trigger i { color: var(--gc); }

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSES TABLE + PAGINATION — IndexOwner.cshtml / IndexUser.cshtml
   ═══════════════════════════════════════════════════════════════════════ */
.rtable-scroll { overflow-x: auto; }
.rtable { width: 100%; min-width: 760px; border-collapse: collapse; }
.rtable thead th {
    font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--tm);
    text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--bd); white-space: nowrap;
}
.rtable tbody tr { border-bottom: 1px solid var(--bd); transition: background .12s ease; }
.rtable tbody tr:last-child { border-bottom: none; }
.rtable tbody tr:nth-child(odd) { background: rgba(91,79,207,.015); }
.rtable tbody tr:hover { background: var(--pale); }
.rtable tbody td { padding: 12px 16px; font-size: .85rem; color: var(--tb); vertical-align: middle; }
.rtable input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--pu); cursor: pointer; }
.rt-project-tag { font-size: .85rem; color: var(--tb); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.rt-project-tag i { color: var(--tm); }
.rt-lang-chip {
    font-size: .72rem; font-weight: 600; color: var(--tb); background: var(--bg); border: 1px solid var(--bd);
    padding: 3px 10px; border-radius: 100px; white-space: nowrap;
}

/* Boxed, separated pagination buttons (instead of Bootstrap's joined pill bar) —
   shared by every page using Views/Shared/_pagerView.cshtml, so this also polishes
   Users/Roles/Masters list pagination the same way. */
.qpagination-wrap {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
    gap: 10px; padding: 14px 4px 4px; margin-top: 6px; border-top: 1px solid var(--bd);
}
.qpagination-wrap .qp-info { font-size: .8rem; color: var(--tm); }
.qpagination-wrap .pagination { margin: 0; }
.qpagination-wrap .page-item { margin: 0 3px; }
.qpagination-wrap .page-link {
    border-radius: 7px !important; min-width: 34px; text-align: center; padding: 6px 10px;
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSE VIEW (ViewLN.cshtml / View.cshtml) — read-only per-section
   answer cards, replacing the raw Bootstrap accordion shell. Each section's
   Q&A table keeps every existing column (QD No/Question/QuestionType/
   Value/Text) — only the surrounding chrome changes.
   ═══════════════════════════════════════════════════════════════════════ */
.ans-section { border: 1px solid var(--bd); border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.ans-section:last-child { margin-bottom: 0; }
.ans-section-title {
    font-size: .84rem; font-weight: 700; color: var(--td); background: var(--bg);
    padding: 11px 16px; border-bottom: 1px solid var(--bd); display: flex; align-items: center; gap: 8px;
}
.ans-section-title .ans-section-no {
    display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
    border-radius: 50%; background: var(--pale); color: var(--pu); font-size: .74rem; font-weight: 700; flex-shrink: 0;
}
body[data-mode="dark"] .ans-section-title { background: rgba(255,255,255,.04); }
.ans-table { width: 100%; border-collapse: collapse; }
.ans-table thead th {
    font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--tm);
    text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--bd); white-space: nowrap;
}
.ans-table tbody tr { border-bottom: 1px dashed var(--bd); }
.ans-table tbody tr:last-child { border-bottom: none; }
.ans-table tbody td { padding: 11px 16px; font-size: .85rem; color: var(--tb); vertical-align: top; }
.ans-table tbody td:first-child { color: var(--tm); font-weight: 600; white-space: nowrap; }
.ans-table .ans-q { color: var(--td); font-weight: 600; }
.ans-table .ans-type-chip {
    display: inline-flex; font-size: .7rem; font-weight: 600; color: var(--tb); background: var(--bg);
    border: 1px solid var(--bd); padding: 2px 9px; border-radius: 100px; white-space: nowrap;
}
.ans-subform { margin: 4px 16px 12px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--bd); border-radius: 9px; }
.ans-subform-label { font-size: .72rem; font-weight: 700; color: var(--pu); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.ans-subform-row-label { font-size: .78rem; font-weight: 600; color: var(--tb); margin: 8px 0 4px; }

/* ═══════════════════════════════════════════════════════════════════════
   SHARED LOADING ANIMATIONS (from wireframes) — page navigation progress
   bar, table skeleton shimmer, and button loading spinner. Global so any
   page/partial can opt in just by adding the markup/classes below.
   ═══════════════════════════════════════════════════════════════════════ */

/* Page navigation progress bar — #pageProgress lives once in _Layout.cshtml */
.page-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0%;
    background: linear-gradient(90deg, var(--pu), var(--tl)); z-index: 9999;
    opacity: 0; transition: width .25s ease, opacity .2s ease; box-shadow: 0 0 8px rgba(91,79,207,.5);
}
.page-progress.active { opacity: 1; }

/* Table skeleton — masks a table/grid briefly while its data loads via AJAX */
.table-skeleton {
    position: absolute; inset: 0; background: var(--surface); z-index: 5; padding: 20px;
    display: flex; flex-direction: column; gap: 16px; transition: opacity .3s ease;
}
.table-skeleton.hide { opacity: 0; pointer-events: none; }
.table-skeleton .sk-row {
    height: 16px; border-radius: 6px;
    background: linear-gradient(90deg, var(--bg) 25%, var(--bd) 37%, var(--bg) 63%);
    background-size: 400% 100%; animation: sk-shimmer 1.4s ease infinite;
}
@keyframes sk-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* Button loading spinner — shown on submit/delete buttons while a request is in flight */
.btn-spinner {
    width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff;
    border-radius: 50%; display: inline-block; animation: btn-spin .65s linear infinite;
}
.btn-secondary-da .btn-spinner, .btn-danger-da .btn-spinner {
    border-color: rgba(74,74,106,.3); border-top-color: var(--tb);
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn-loading { opacity: .85; cursor: wait !important; pointer-events: none; }

/* User menu header: who is signed in, their organization and role (_LoginPartial). */
.da-user-menu-head { padding: 8px 14px 6px; min-width: 220px; }
.da-user-menu-head .da-umh-name { font-weight: 700; font-size: .86rem; color: var(--td); }
.da-user-menu-head .da-umh-org { font-size: .78rem; color: var(--pu); font-weight: 600; margin-top: 2px; }
.da-user-menu-head .da-umh-role { font-size: .72rem; color: var(--tm); margin-top: 1px; }
