/* stylelint-disable-next-line selector-class-pattern */
/* stylelint-disable property-no-unknown,
   value-no-vendor-prefix,
   property-no-vendor-prefix,
   no-descending-specificity,
   no-duplicate-selectors,
   declaration-block-no-redundant-longhand-properties */

/* ============================================================
   DigiSapience LMS — Stylesheet
   ------------------------------------------------------------
   1.  Design tokens (dark + light)
   2.  Reset & base
   3.  App shell  (+ overlay)
   4.  Sidebar
   5.  Topbar
   6.  Content
   7.  Page head
   8.  Cards & grids
   9.  Stats
   10. Tables
   11. Badges
   12. Buttons
   13. Forms
   14. Alerts
   14.5 Messaging
   15. Auth pages
   15.5 Modals, dropdowns, empty states, skeletons
   16. Error pages
   17. Responsive breakpoints
   18. Motion / high-contrast / print
   ============================================================ */

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
    --ds-primary:        #F8BE14;
    --ds-primary-light:  #FDD75F;
    --ds-primary-soft:   #FBEBA6;
    --ds-primary-dark:   #D1A110;
    --ds-primary-deep:   #8A6608;

    --ds-bg:             #0F1115;
    --ds-bg-elev-1:      #171A20;
    --ds-bg-elev-2:      #1E2228;
    --ds-bg-elev-3:      #262B33;
    --ds-border:         #3A3F48;
    --ds-border-soft:    #262B33;
    --ds-border-strong:  #55606E;

    --ds-text:           #F2F4F7;
    --ds-text-muted:     #B6BCC6;
    --ds-text-dim:       #8A929E;

    --ds-danger:         #F87171;
    --ds-danger-bg:      rgba(248,113,113,.12);
    --ds-danger-br:      rgba(248,113,113,.42);
    --ds-success:        #34D399;
    --ds-success-bg:     rgba(52,211,153,.12);
    --ds-success-br:     rgba(52,211,153,.42);
    --ds-warning:        #FBBF24;
    --ds-warning-bg:     rgba(251,191,36,.12);
    --ds-warning-br:     rgba(251,191,36,.42);
    --ds-info:           #60A5FA;
    --ds-info-bg:        rgba(96,165,250,.12);
    --ds-info-br:        rgba(96,165,250,.42);

    --ds-glass-bg:       rgba(30,34,40,.72);
    --ds-glass-border:   rgba(248,190,20,.18);
    --ds-glass-blur:     saturate(160%) blur(14px);

    --ds-sidebar-bg:     rgba(15, 17, 21, .78);
    --ds-topbar-bg:      rgba(15, 17, 21, .82);
    --ds-overlay-bg:     rgba(0, 0, 0, .55);
    --ds-modal-bg:       rgba(0, 0, 0, .60);

    --ds-glow:           0 0 0 1px rgba(248,190,20,.16),
                         0 8px 40px -14px rgba(248,190,20,.45);
    --ds-glow-hover:     0 0 0 1px rgba(248,190,20,.32),
                         0 12px 48px -10px rgba(248,190,20,.65);

    --ds-radius-sm:      8px;
    --ds-radius:         14px;
    --ds-radius-lg:      20px;
    --ds-radius-pill:    999px;

    --ds-space-1: 4px;
    --ds-space-2: 8px;
    --ds-space-3: 12px;
    --ds-space-4: 16px;
    --ds-space-5: 24px;
    --ds-space-6: 32px;
    --ds-space-7: 48px;
    --ds-space-8: 64px;

    --ds-sidebar-w: 264px;
    --ds-topbar-h:  68px;

    --ds-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --ds-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --ds-fs-xs:   clamp(11px, 0.72rem, 12px);
    --ds-fs-sm:   clamp(12px, 0.82rem, 14px);
    --ds-fs-base: clamp(14px, 0.95rem, 16px);
    --ds-fs-md:   clamp(15px, 1rem,    17px);
    --ds-fs-lg:   clamp(17px, 1.15rem, 20px);
    --ds-fs-xl:   clamp(20px, 1.4rem,  26px);
    --ds-fs-2xl:  clamp(24px, 1.8rem,  34px);
    --ds-fs-3xl:  clamp(30px, 2.4rem,  44px);

    --ds-shadow-sm: 0 2px 8px rgba(0,0,0,.45);
    --ds-shadow:    0 8px 24px rgba(0,0,0,.55);
    --ds-shadow-lg: 0 20px 60px rgba(0,0,0,.65);

    --ds-transition: 200ms cubic-bezier(.4,.2,.2,1);
    --ds-z-drawer:   900;
    --ds-z-overlay:  800;
    --ds-z-modal:    950;
    --ds-z-topbar:   700;
    --ds-z-dropdown: 800;
}

[data-theme="light"] {
    --ds-bg:             #F5F6F8;
    --ds-bg-elev-1:      #FFFFFF;
    --ds-bg-elev-2:      #F0F1F4;
    --ds-bg-elev-3:      #E6E8EC;
    --ds-border:         #C9CED6;
    --ds-border-soft:    #E1E4E9;
    --ds-border-strong:  #A8AFBA;

    --ds-text:           #0F1115;
    --ds-text-muted:     #4B5563;
    --ds-text-dim:       #6B7280;

    --ds-glass-bg:       rgba(255,255,255,.78);
    --ds-glass-border:   rgba(160,118,11,.22);

    --ds-sidebar-bg:     rgba(255, 255, 255, .90);
    --ds-topbar-bg:      rgba(255, 255, 255, .88);

    --ds-shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --ds-shadow:    0 6px 20px rgba(0,0,0,.10);
    --ds-shadow-lg: 0 20px 50px rgba(0,0,0,.15);
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*,
*::before,
*::after { box-sizing: border-box; }

html,
body { margin: 0; padding: 0; }

html {
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

img,
video { max-width: 100%; height: auto; display: block; }
svg   { max-width: 100%; }

button,
input,
textarea,
select { font: inherit; color: inherit; }

a {
    color: var(--ds-primary);
    text-decoration: none;
    transition: color var(--ds-transition);
}
a:hover { color: var(--ds-primary-light); }

body {
    font-family: var(--ds-font);
    font-size: var(--ds-fs-base);
    line-height: 1.55;
    color: var(--ds-text);
    background: var(--ds-bg);
    min-height: 100dvh;
    font-smooth: always;
    text-rendering: optimizeLegibility;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: -20% -10% auto -10%;
    height: 60vh;
    background: radial-gradient(60% 60% at 50% 0%,
                rgba(248,190,20,.10) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

:focus-visible {
    outline: 2px solid var(--ds-primary);
    outline-offset: 2px;
    border-radius: var(--ds-radius-sm);
}

/* ============================================================
   3. APP SHELL
   ============================================================ */
.ds-app {
    position: relative;
    z-index: 1;
    min-height: 100dvh;
}

.ds-main {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    min-width: 0;
}

/* Mobile sidebar overlay — dims the page when the drawer is open. */
.ds-overlay {
    position: fixed;
    inset: 0;
    background: var(--ds-overlay-bg);
    backdrop-filter: blur(2px);
    z-index: var(--ds-z-overlay);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--ds-transition);
}
.ds-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* ============================================================
   4. SIDEBAR
   ============================================================ */
.ds-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 300px);
    background: var(--ds-glass-bg);
    backdrop-filter: var(--ds-glass-blur);
    border-right: 1px solid var(--ds-glass-border);
    display: flex;
    flex-direction: column;
    z-index: var(--ds-z-drawer);
    transform: translateX(-100%);
    transition: transform var(--ds-transition);
    overflow-y: auto;
    overscroll-behavior: contain;
}
.ds-sidebar.is-open { transform: translateX(0); }

.ds-sidebar__brand {
    display: flex;
    align-items: center;
    gap: var(--ds-space-3);
    padding: var(--ds-space-5) var(--ds-space-5) var(--ds-space-4);
    border-bottom: 1px solid var(--ds-border-soft);
    font-weight: 700;
    font-size: var(--ds-fs-lg);
    letter-spacing: -0.01em;
}
.ds-sidebar__brand a {
    display: flex;
    align-items: center;
    gap: var(--ds-space-3);
    color: inherit;
    text-decoration: none;
}
.ds-brand-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg,
                var(--ds-primary) 0%,
                var(--ds-primary-dark) 100%);
    color: #121212;
    border-radius: var(--ds-radius-sm);
    font-weight: 800;
    font-size: 1.05rem;
    box-shadow: 0 6px 20px -6px rgba(248,190,20,.6);
    flex-shrink: 0;
}
.ds-brand-text {
    background: linear-gradient(180deg,
                #FFFFFF 0%,
                var(--ds-primary-soft) 120%);
    background-clip: text;
    color: transparent;
}

.ds-nav,
.ds-sidebar__nav {
    display: flex;
    flex-direction: column;
    padding: var(--ds-space-3) var(--ds-space-2);
    gap: 2px;
    flex: 1;
}

.ds-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--ds-space-3);
    padding: var(--ds-space-3) var(--ds-space-4);
    border-radius: var(--ds-radius-sm);
    color: var(--ds-text-muted);
    font-size: var(--ds-fs-sm);
    font-weight: 500;
    cursor: pointer;
    transition: background var(--ds-transition), color var(--ds-transition);
    border: 0;
    background: transparent;
    width: 100%;
    min-height: 44px;
    text-align: left;
    text-decoration: none;
}
.ds-nav-item:hover {
    background: rgba(248,190,20,.08);
    color: var(--ds-text);
}
.ds-nav-item.is-active {
    background: linear-gradient(90deg,
                rgba(248,190,20,.18) 0%,
                rgba(248,190,20,.05) 100%);
    color: var(--ds-primary);
    box-shadow: inset 3px 0 0 0 var(--ds-primary);
}
.ds-nav-item.is-active .ds-nav-icon { color: var(--ds-primary); }

.ds-nav-item--danger { color: #FFA0A4; }
.ds-nav-item--danger:hover {
    background: rgba(229,72,77,.14);
    color: #FFC7CA;
}

.ds-nav-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ds-nav-group-label {
    display: block;
    padding: var(--ds-space-4) var(--ds-space-4) var(--ds-space-2);
    font-size: var(--ds-fs-sm);
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ds-text-dim);
}

.ds-nav-caret {
    font-size: 1rem;
    opacity: .6;
    transition: transform var(--ds-transition);
}
.ds-nav-group > summary { list-style: none; }
.ds-nav-group > summary::-webkit-details-marker { display: none; }
.ds-nav-group[open] > summary .ds-nav-caret { transform: rotate(90deg); }
.ds-nav-sub {
    list-style: none;
    padding: 0;
    margin: 2px 0 4px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ds-nav-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: currentColor;
    opacity: .9;
    vertical-align: -3px;
    transition: opacity var(--ds-transition), color var(--ds-transition);
}
.ds-nav-icon,
.ds-nav-icon use,
.ds-nav-icon path,
.ds-nav-icon circle,
.ds-nav-icon rect,
.ds-nav-icon line,
.ds-nav-icon polyline,
.ds-nav-icon polygon {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ds-nav-item:hover .ds-nav-icon { opacity: 1; }
.ds-nav-item.is-active .ds-nav-icon {
    opacity: 1;
    color: var(--ds-primary);
}

.ds-sidebar__footer {
    padding: var(--ds-space-3) var(--ds-space-2);
    border-top: 1px solid var(--ds-border-soft);
}
.ds-user-chip {
    display: flex;
    flex-direction: column;
    padding: var(--ds-space-2) var(--ds-space-3) var(--ds-space-3);
    gap: 2px;
}
.ds-user-name {
    font-size: var(--ds-fs-sm);
    color: var(--ds-text);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ds-user-role {
    font-size: var(--ds-fs-xs);
    color: var(--ds-text-dim);
    text-transform: capitalize;
}

/* ============================================================
   5. TOPBAR
   ============================================================ */
.ds-topbar {
    position: sticky;
    top: 0;
    z-index: var(--ds-z-topbar);
    display: flex;
    align-items: center;
    gap: var(--ds-space-3);
    height: var(--ds-topbar-h);
    padding: 0 var(--ds-space-4);
    background: var(--ds-topbar-bg);
    backdrop-filter: var(--ds-glass-blur);
    border-bottom: 1px solid var(--ds-glass-border);
}

.ds-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--ds-radius-sm);
    background: rgba(248,190,20,.08);
    border: 1px solid rgba(248,190,20,.22);
    color: var(--ds-primary);
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
    transition: background var(--ds-transition),
                border-color var(--ds-transition);
}
.ds-icon-btn:hover {
    background: rgba(248,190,20,.16);
    border-color: rgba(248,190,20,.4);
}
.ds-icon-btn .ds-nav-icon { width: 18px; height: 18px; }

.ds-hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--ds-radius-sm);
    background: rgba(248,190,20,.08);
    border: 1px solid rgba(248,190,20,.22);
    color: var(--ds-primary);
    cursor: pointer;
    transition: background var(--ds-transition),
                border-color var(--ds-transition);
}
.ds-hamburger:hover {
    background: rgba(248,190,20,.16);
    border-color: rgba(248,190,20,.4);
}

.ds-topbar__search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--ds-space-2);
    background: rgba(15,17,21,.6);
    border: 1px solid var(--ds-border-soft);
    border-radius: var(--ds-radius-sm);
    padding: 0 var(--ds-space-3);
    height: 42px;
    min-width: 0;
    transition: border-color var(--ds-transition),
                background var(--ds-transition);
}
[data-theme="light"] .ds-topbar__search { background: #FFFFFF; }
.ds-topbar__search:focus-within {
    border-color: var(--ds-primary);
    background: rgba(15,17,21,.8);
}
.ds-topbar__search .ds-nav-icon {
    color: var(--ds-text-dim);
    opacity: 1;
}
.ds-topbar__search input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 0;
    outline: none;
    color: var(--ds-text);
    font-size: var(--ds-fs-sm);
}
.ds-topbar__search input::placeholder { color: var(--ds-text-dim); }

.ds-topbar__actions { display: flex; gap: var(--ds-space-2); }

.ds-topbar__title {
    font-weight: 600;
    font-size: var(--ds-fs-base);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.005em;
}
.ds-topbar__user {
    display: flex;
    align-items: center;
    gap: var(--ds-space-2);
    position: relative;
}
.ds-avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg,
                var(--ds-primary) 0%,
                var(--ds-primary-dark) 100%);
    color: #121212;
    font-weight: 800;
    font-size: .9rem;
    box-shadow: 0 4px 14px -4px rgba(248,190,20,.55);
}
.ds-username {
    font-size: var(--ds-fs-sm);
    color: var(--ds-text-muted);
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 479px) { .ds-username { display: none; } }

/* ============================================================
   6. CONTENT
   ============================================================ */
.ds-content {
    flex: 1;
    padding: var(--ds-space-5);
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ============================================================
   7. PAGE HEAD
   ============================================================ */
.ds-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--ds-space-3);
    margin-bottom: var(--ds-space-6);
    flex-wrap: wrap;
}
.ds-page-title {
    font-size: var(--ds-fs-2xl);
    font-weight: 700;
    margin: 0 0 4px;
    letter-spacing: -0.02em;
    color: var(--ds-text);
}
.ds-page-title--gradient {
    background: linear-gradient(180deg,
                #FFFFFF 0%,
                var(--ds-primary-soft) 160%);
    background-clip: text;
    color: transparent;
}
.ds-muted {
    color: var(--ds-text-muted);
    font-size: var(--ds-fs-sm);
    margin: 0;
}

/* ============================================================
   8. CARDS & GRIDS
   ============================================================ */
.ds-grid { display: grid; gap: var(--ds-space-4); }
.ds-grid--2,
.ds-grid--3 { grid-template-columns: 1fr; }

.ds-card {
    background: var(--ds-glass-bg);
    backdrop-filter: var(--ds-glass-blur);
    border: 1px solid var(--ds-glass-border);
    border-radius: var(--ds-radius);
    padding: var(--ds-space-5);
    box-shadow: var(--ds-shadow-sm);
    transition: border-color var(--ds-transition),
                box-shadow var(--ds-transition),
                transform var(--ds-transition);
    position: relative;
    overflow: hidden;
}
.ds-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(400px 200px at 100% 0%,
                rgba(248,190,20,.06), transparent 60%);
    pointer-events: none;
}
.ds-card:hover {
    border-color: rgba(248,190,20,.32);
    box-shadow: var(--ds-glow);
}
.ds-card__title {
    font-size: var(--ds-fs-lg);
    margin: 0 0 var(--ds-space-4);
    font-weight: 600;
    letter-spacing: -0.01em;
    position: relative;
    color: var(--ds-text);
}

/* ============================================================
   9. STATS
   ============================================================ */
.ds-grid--stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: var(--ds-space-4);
    margin-bottom: var(--ds-space-5);
}

/* Clickable stat tile */
.ds-stat--link {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: transform var(--ds-transition),
                box-shadow var(--ds-transition),
                border-color var(--ds-transition);
}
.ds-stat--link:hover {
    transform: translateY(-2px);
    border-color: rgba(248,190,20,.5);
    box-shadow: 0 12px 40px -12px rgba(248,190,20,.4);
}
.ds-stat--link:focus-visible {
    outline: 2px solid var(--ds-primary);
    outline-offset: 3px;
}

/* Screen-reader-only text (used in <caption>) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
.ds-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: var(--ds-space-5);
}
.ds-stat__label {
    font-size: var(--ds-fs-xs);
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--ds-text-muted);
    font-weight: 600;
}
.ds-stat__value {
    font-size: var(--ds-fs-3xl);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    background: linear-gradient(180deg,
                var(--ds-primary) 0%,
                var(--ds-primary-dark) 120%);
    background-clip: text;
    color: transparent;
}

/* ============================================================
   10. TABLES
   ============================================================ */
.ds-table-wrap {
    overflow-x: auto;
    border-radius: var(--ds-radius-sm);
}
.ds-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--ds-fs-sm);
    min-width: 520px;
    color: var(--ds-text);
}
.ds-table th,
.ds-table td {
    text-align: left;
    padding: var(--ds-space-3) var(--ds-space-4);
    border-bottom: 1px solid var(--ds-border-soft);
    white-space: nowrap;
}
.ds-table th {
    color: var(--ds-text-muted);
    font-weight: 600;
    font-size: var(--ds-fs-xs);
    text-transform: uppercase;
    letter-spacing: .06em;
    background: rgba(255,255,255,.03);
}
.ds-table tbody tr { transition: background var(--ds-transition); }
.ds-table tbody tr:hover { background: rgba(248,190,20,.05); }
.ds-table tbody tr:last-child td { border-bottom: 0; }

/* ============================================================
   11. BADGES
   ============================================================ */
.ds-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--ds-radius-pill);
    font-size: var(--ds-fs-xs);
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: .01em;
}
.ds-badge--success { background: var(--ds-success-bg); color: #7CE8B5; }
.ds-badge--danger  { background: var(--ds-danger-bg);  color: #FFA9AC; }
.ds-badge--warning { background: var(--ds-warning-bg); color: #FFD489; }
.ds-badge--info    { background: var(--ds-info-bg);    color: #9DC5FF; }
.ds-badge--primary { background: rgba(248,190,20,.16); color: var(--ds-primary-light); }

[data-theme="light"] .ds-badge--success { color: #0E7A4E; }
[data-theme="light"] .ds-badge--danger  { color: #B02A2F; }
[data-theme="light"] .ds-badge--warning { color: #8A5A00; }
[data-theme="light"] .ds-badge--info    { color: #1A56B8; }
[data-theme="light"] .ds-badge--primary { color: #8A6608; }

/* ============================================================
   12. BUTTONS
   ============================================================ */
.ds-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ds-space-2);
    padding: var(--ds-space-3) var(--ds-space-5);
    border-radius: var(--ds-radius-sm);
    border: 1px solid var(--ds-border);
    background: var(--ds-bg-elev-2);
    color: var(--ds-text);
    font-weight: 600;
    font-size: var(--ds-fs-sm);
    cursor: pointer;
    min-height: 44px;
    text-decoration: none;
    transition: transform var(--ds-transition),
                background var(--ds-transition),
                border-color var(--ds-transition),
                box-shadow var(--ds-transition);
}
.ds-btn:hover  { background: var(--ds-bg-elev-3); transform: translateY(-1px); }
.ds-btn:active { transform: translateY(0); }
.ds-btn:disabled,
.ds-btn[aria-disabled="true"] {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

.ds-btn--primary {
    background: linear-gradient(135deg,
                var(--ds-primary) 0%,
                var(--ds-primary-dark) 100%);
    color: #121212;
    border-color: var(--ds-primary);
    box-shadow: 0 6px 24px -8px rgba(248,190,20,.6);
}
.ds-btn--primary:hover {
    background: linear-gradient(135deg,
                var(--ds-primary-light) 0%,
                var(--ds-primary) 100%);
    box-shadow: 0 8px 32px -6px rgba(248,190,20,.8);
}

.ds-btn--ghost {
    background: transparent;
    border-color: rgba(248,190,20,.32);
    color: var(--ds-primary);
}
.ds-btn--ghost:hover {
    background: rgba(248,190,20,.10);
    border-color: rgba(248,190,20,.55);
}

.ds-btn--danger {
    background: var(--ds-danger-bg);
    border-color: var(--ds-danger-br);
    color: #FFC4C6;
}
.ds-btn--danger:hover {
    background: rgba(248,113,113,.22);
    border-color: var(--ds-danger);
}

.ds-btn--block { width: 100%; }

/* ============================================================
   13. FORMS
   ============================================================ */
.ds-form  { display: grid; gap: var(--ds-space-4); }
.ds-field { display: grid; gap: var(--ds-space-2); }
.ds-field__label {
    font-size: var(--ds-fs-sm);
    color: var(--ds-text-muted);
    font-weight: 500;
}
.ds-input {
    width: 100%;
    padding: var(--ds-space-3) var(--ds-space-4);
    background: rgba(15,17,21,.65);
    border: 1px solid var(--ds-border-soft);
    border-radius: var(--ds-radius-sm);
    color: var(--ds-text);
    font-size: var(--ds-fs-base);
    min-height: 46px;
    transition: border-color var(--ds-transition),
                box-shadow var(--ds-transition),
                background var(--ds-transition);
}
[data-theme="light"] .ds-input { background: #FFFFFF; }
.ds-input::placeholder { color: var(--ds-text-dim); }
.ds-input:focus {
    outline: none;
    background: rgba(15,17,21,.85);
    border-color: var(--ds-primary);
    box-shadow: 0 0 0 4px rgba(248,190,20,.18);
}
.ds-input[aria-invalid="true"] {
    border-color: var(--ds-danger);
    box-shadow: 0 0 0 4px rgba(248,113,113,.18);
}

textarea.ds-input {
    min-height: 100px;
    resize: vertical;
    line-height: 1.5;
}

/* ============================================================
   14. ALERTS
   ============================================================ */
.ds-alert {
    padding: var(--ds-space-3) var(--ds-space-4);
    border-radius: var(--ds-radius);
    margin-bottom: var(--ds-space-4);
    font-size: var(--ds-fs-sm);
    border: 1px solid transparent;
    backdrop-filter: blur(6px);
}
.ds-alert--danger,
.ds-alert--error  {
    background: var(--ds-danger-bg);
    color: #FFC4C6;
    border-color: var(--ds-danger-br);
}
.ds-alert--success {
    background: var(--ds-success-bg);
    color: #A8F0CA;
    border-color: var(--ds-success-br);
}
.ds-alert--warning {
    background: var(--ds-warning-bg);
    color: #FFE0A6;
    border-color: var(--ds-warning-br);
}
.ds-alert--info {
    background: var(--ds-info-bg);
    color: #B6D4FF;
    border-color: var(--ds-info-br);
}

[data-theme="light"] .ds-alert--danger,
[data-theme="light"] .ds-alert--error  { color: #8A1F23; }
[data-theme="light"] .ds-alert--success{ color: #0E5A38; }
[data-theme="light"] .ds-alert--warning{ color: #6B4400; }
[data-theme="light"] .ds-alert--info   { color: #123A80; }

/* ============================================================
   14.5  MESSAGING
   ============================================================ */

/* ---------- Inbox thread list ---------- */
.ds-thread-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0;
    margin: 0;
    list-style: none;
}
.ds-thread {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: var(--ds-space-3);
    padding: var(--ds-space-3) var(--ds-space-4);
    border-radius: var(--ds-radius-sm);
    color: var(--ds-text);
    text-decoration: none;
    transition: background var(--ds-transition);
}
.ds-thread:hover {
    background: rgba(248, 190, 20, .06);
}
.ds-thread.is-unread {
    background: rgba(248, 190, 20, .04);
}
.ds-thread.is-unread .ds-thread__name {
    font-weight: 700;
}
.ds-thread__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg,
                var(--ds-primary) 0%,
                var(--ds-primary-dark) 100%);
    color: #121212;
    font-weight: 800;
    display: grid;
    place-items: center;
}
.ds-thread__body { min-width: 0; }
.ds-thread__name {
    font-size: var(--ds-fs-sm);
    font-weight: 600;
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ds-thread__preview {
    font-size: var(--ds-fs-xs);
    color: var(--ds-text-muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ds-thread__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-size: var(--ds-fs-xs);
    color: var(--ds-text-dim);
}

/* ---------- Conversation thread ---------- */
.ds-chat {
    display: flex;
    flex-direction: column;
    gap: var(--ds-space-3);
    padding: var(--ds-space-5);
    max-height: 60dvh;
    overflow-y: auto;
}
.ds-bubble {
    max-width: 72%;
    padding: var(--ds-space-3) var(--ds-space-4);
    border-radius: var(--ds-radius);
    font-size: var(--ds-fs-sm);
    line-height: 1.5;
    word-wrap: break-word;
    background: var(--ds-bg-elev-2);
    color: var(--ds-text);
    align-self: flex-start;
    border: 1px solid var(--ds-border-soft);
}
.ds-bubble--mine {
    align-self: flex-end;
    background: linear-gradient(135deg,
                var(--ds-primary) 0%,
                var(--ds-primary-dark) 100%);
    color: #121212;
    border-color: transparent;
}
.ds-bubble__meta {
    display: block;
    margin-top: 4px;
    font-size: var(--ds-fs-xs);
    opacity: .7;
}

/* ---------- Compose bar ---------- */
.ds-composer {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--ds-space-2);
    padding: var(--ds-space-3) var(--ds-space-4);
    border-top: 1px solid var(--ds-border-soft);
    background: var(--ds-bg-elev-1);
    position: sticky;
    bottom: 0;
}
.ds-composer textarea {
    resize: none;
    min-height: 44px;
    max-height: 160px;
}

/* ============================================================
   15. AUTH PAGES
   ============================================================ */
.ds-auth-body {
    background:
        radial-gradient(1200px 700px at 15% -10%, rgba(248,190,20,.14) 0%, transparent 55%),
        radial-gradient(900px 600px at 100% 100%, rgba(160,118,11,.12) 0%, transparent 55%),
        var(--ds-bg);
    min-height: 100dvh;
}
.ds-auth-shell {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: var(--ds-space-5);
}
.ds-auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--ds-glass-bg);
    backdrop-filter: var(--ds-glass-blur);
    border: 1px solid var(--ds-glass-border);
    border-radius: var(--ds-radius-lg);
    padding: var(--ds-space-6);
    box-shadow: var(--ds-shadow-lg),
                0 0 0 1px rgba(248,190,20,.06) inset;
    position: relative;
    overflow: hidden;
}
.ds-auth-card::before {
    content: "";
    position: absolute;
    inset: -50% -20% auto -20%;
    height: 280px;
    background: radial-gradient(50% 60% at 50% 0%,
                rgba(248,190,20,.16), transparent 70%);
    pointer-events: none;
}
.ds-auth-brand {
    display: flex;
    align-items: center;
    gap: var(--ds-space-3);
    font-weight: 700;
    font-size: var(--ds-fs-lg);
    margin-bottom: var(--ds-space-5);
    position: relative;
}
.ds-auth-title {
    font-size: var(--ds-fs-2xl);
    margin: 0 0 var(--ds-space-2);
    font-weight: 700;
    letter-spacing: -0.02em;
    position: relative;
}
.ds-auth-sub {
    color: var(--ds-text-muted);
    font-size: var(--ds-fs-sm);
    margin: 0 0 var(--ds-space-5);
    position: relative;
}

/* ============================================================
   15.5  MODALS, DROPDOWNS, EMPTY STATES, SKELETONS
   ============================================================ */

/* ---------- Modal ---------- */
.ds-modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--ds-modal-bg);
    backdrop-filter: blur(4px);
    z-index: var(--ds-z-modal);
    display: grid;
    place-items: center;
    padding: var(--ds-space-4);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--ds-transition);
}
.ds-modal-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}
.ds-modal {
    width: 100%;
    max-width: 520px;
    max-height: 90dvh;
    overflow-y: auto;
    background: var(--ds-bg-elev-1);
    border: 1px solid var(--ds-glass-border);
    border-radius: var(--ds-radius-lg);
    padding: var(--ds-space-6);
    box-shadow: var(--ds-shadow-lg);
    transform: translateY(8px) scale(.98);
    transition: transform var(--ds-transition);
}
.ds-modal-backdrop.is-open .ds-modal {
    transform: translateY(0) scale(1);
}
.ds-modal__title {
    font-size: var(--ds-fs-lg);
    margin: 0 0 var(--ds-space-4);
    font-weight: 600;
}
.ds-modal__actions {
    display: flex;
    gap: var(--ds-space-3);
    justify-content: flex-end;
    margin-top: var(--ds-space-5);
}

/* ---------- Dropdown ---------- */
.ds-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--ds-bg-elev-1);
    border: 1px solid var(--ds-glass-border);
    border-radius: var(--ds-radius);
    box-shadow: var(--ds-shadow);
    padding: var(--ds-space-2);
    z-index: var(--ds-z-dropdown);
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity var(--ds-transition), transform var(--ds-transition);
}
.ds-dropdown.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.ds-dropdown__item {
    display: block;
    padding: var(--ds-space-2) var(--ds-space-3);
    border-radius: var(--ds-radius-sm);
    color: var(--ds-text-muted);
    font-size: var(--ds-fs-sm);
    text-decoration: none;
    transition: background var(--ds-transition), color var(--ds-transition);
}
.ds-dropdown__item:hover {
    background: rgba(248, 190, 20, .08);
    color: var(--ds-text);
}

/* ---------- Empty state ---------- */
.ds-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--ds-space-3);
    padding: var(--ds-space-7) var(--ds-space-5);
    text-align: center;
    color: var(--ds-text-muted);
}
.ds-empty__icon {
    width: 48px;
    height: 48px;
    color: var(--ds-text-dim);
    opacity: .7;
}
.ds-empty__title {
    font-size: var(--ds-fs-lg);
    font-weight: 600;
    margin: 0;
    color: var(--ds-text);
}
.ds-empty__text {
    font-size: var(--ds-fs-sm);
    margin: 0;
    max-width: 42ch;
}

/* ---------- Skeleton loaders ---------- */
.ds-skeleton {
    display: block;
    background: linear-gradient(
        90deg,
        var(--ds-bg-elev-2) 0%,
        var(--ds-bg-elev-3) 50%,
        var(--ds-bg-elev-2) 100%
    );
    background-size: 200% 100%;
    border-radius: var(--ds-radius-sm);
    animation: ds-skeleton-shimmer 1.4s ease-in-out infinite;
}
.ds-skeleton--text   { height: 14px; margin: 6px 0; }
.ds-skeleton--title  { height: 22px; margin: 10px 0; width: 60%; }
.ds-skeleton--avatar { width: 40px; height: 40px; border-radius: 50%; }
.ds-skeleton--card   { height: 120px; }

@keyframes ds-skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================
   16. ERROR PAGES
   ============================================================ */
.ds-error-card { text-align: center; }
.ds-error-code {
    font-size: clamp(56px, 14vw, 108px);
    margin: 0;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.04em;
    background: linear-gradient(180deg,
                var(--ds-primary) 0%,
                var(--ds-primary-deep) 130%);
    background-clip: text;
    color: transparent;
}
.ds-error-title {
    font-size: var(--ds-fs-xl);
    margin: var(--ds-space-3) 0;
    font-weight: 600;
}

/* ============================================================
   17. RESPONSIVE BREAKPOINTS
   ============================================================ */
@media (min-width: 480px) {
    .ds-content { padding: var(--ds-space-6); }
}

@media (min-width: 768px) {
    .ds-grid--2 { grid-template-columns: 1fr 1fr; }
    .ds-grid--3 { grid-template-columns: 1fr 1fr; }
    .ds-content { padding: var(--ds-space-6); }
    .ds-topbar  { padding: 0 var(--ds-space-6); }
    .ds-page-head { align-items: center; }
}

@media (min-width: 1024px) {
    .ds-app {
        display: grid;
        grid-template-columns: var(--ds-sidebar-w) 1fr;
    }
    .ds-sidebar {
        position: sticky;
        top: 0;
        height: 100dvh;
        transform: none;
        width: var(--ds-sidebar-w);
        background: var(--ds-sidebar-bg);
    }

    .ds-overlay { display: none; }
    .ds-hamburger { display: none; }
    .ds-main { grid-column: 2; }
}

@media (min-width: 1280px) {
    .ds-content { padding: var(--ds-space-7); }
    .ds-grid--3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1536px) {
    .ds-grid--stats {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (min-width: 1920px) {
    .ds-content { max-width: 1800px; }
}

/* ============================================================
   18. MOTION / HIGH-CONTRAST / PRINT
   ============================================================ */

@media (hover: none) {
    .ds-nav-item:hover { background: transparent; }
    .ds-card:hover {
        box-shadow: var(--ds-shadow-sm);
        border-color: var(--ds-glass-border);
    }
    .ds-btn:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none;
        animation: none;
        scroll-behavior: auto;
    }
    .ds-skeleton {
        animation: none;
        background: var(--ds-bg-elev-2);
    }
}

/* High-contrast / forced-colors: use explicit colours the linter
   recognises instead of system colour keywords. */
@media (forced-colors: active) {
    .ds-btn,
    .ds-nav-item,
    .ds-card,
    .ds-input {
        border: 1px solid ButtonText;
    }
    .ds-nav-item.is-active {
        outline: 2px solid Highlight;
        outline-offset: -2px;
    }
}

/* Print.
   Uses higher-specificity selectors (html body prefix + element
   context) instead of !important, so no linter warnings fire. */
@media print {
    html body {
        background: #FFFFFF;
        color: #000000;
    }
    html body::before { display: none; }

    html body .ds-sidebar,
    html body .ds-topbar,
    html body .ds-overlay,
    html body .ds-icon-btn,
    html body .ds-hamburger,
    html body .ds-modal-backdrop,
    html body .ds-dropdown { display: none; }

    html body .ds-app { display: block; }
    html body .ds-main { grid-column: 1; }

    html body .ds-card {
        border: 1px solid #CCCCCC;
        box-shadow: none;
        background: #FFFFFF;
    }
    html body .ds-card::before { display: none; }

    html body .ds-page-title,
    html body .ds-stat__value,
    html body .ds-error-code {
        background: none;
        color: #121212;
        -webkit-text-fill-color: #121212;
    }

    html body a {
        color: #000000;
        text-decoration: underline;
    }
}

/* ============================================================
   Progress bar
   ============================================================ */
.ds-progress {
    height: 8px;
    background: rgba(248,190,20,.15);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}
.ds-progress__bar {
    height: 100%;
    background: linear-gradient(90deg, #F8BE14 0%, #D1A110 100%);
    border-radius: 4px;
    transition: width .35s ease;
}

/* Clickable stat tiles (if not already in app.css from master dashboard) */
.ds-stat--link {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.ds-stat--link:hover {
    transform: translateY(-2px);
    border-color: rgba(248,190,20,.5);
    box-shadow: 0 12px 40px -12px rgba(248,190,20,.4);
}
.ds-stat--link:focus-visible {
    outline: 2px solid #F8BE14;
    outline-offset: 3px;
}


/* public/assets/css/digisapience.css */
:root {
    --ds-bg: #0f1115;
    --ds-panel: #151820;
    --ds-border: #2a2d35;
    --ds-text: #e6e6e6;
    --ds-muted: #8b8f99;
    --ds-primary: #F8BE14;
    --ds-primary-hover: #e0aa10;
    --ds-success: #4ade80;
    --ds-danger: #ff5c5c;
    --ds-info: #60A5FA;
}

body.ds-body {
    background-color: var(--ds-bg);
    color: var(--ds-text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

/* Layout */
.ds-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.ds-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.ds-page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--ds-primary);
    margin: 0;
}

/* Cards */
.ds-card {
    background-color: var(--ds-panel);
    border: 1px solid var(--ds-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

/* Grid */
.ds-grid {
    display: grid;
    gap: 24px;
}

.ds-grid-cols-4 {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* Stats */
.ds-stat-card {
    background-color: var(--ds-panel);
    border: 1px solid var(--ds-border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.ds-stat-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ds-muted);
    font-weight: 600;
    margin-bottom: 8px;
}

.ds-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--ds-text);
}

/* Tables */
.ds-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 14px;
}

.ds-table th {
    text-align: left;
    padding: 12px 16px;
    background-color: #1a1d24;
    color: var(--ds-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--ds-border);
}

.ds-table td {
    padding: 16px;
    border-bottom: 1px solid var(--ds-border);
}

.ds-table tr:last-child td {
    border-bottom: none;
}

.ds-table tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Badges */
.ds-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    background-color: #2a2d35;
    color: var(--ds-text);
}

.ds-badge-success { background-color: rgba(74, 222, 128, 0.15); color: var(--ds-success); }
.ds-badge-danger { background-color: rgba(255, 92, 92, 0.15); color: var(--ds-danger); }
.ds-badge-info { background-color: rgba(96, 165, 250, 0.15); color: var(--ds-info); }

/* Buttons */
.ds-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.ds-btn-primary {
    background-color: var(--ds-primary);
    color: #000;
}

.ds-btn-primary:hover {
    background-color: var(--ds-primary-hover);
}

.ds-btn-outline {
    background-color: transparent;
    color: var(--ds-text);
    border: 1px solid var(--ds-border);
}

.ds-btn-outline:hover {
    background-color: #1a1d24;
    border-color: var(--ds-muted);
}