/* =======================================================================
   LUVEEDU UI LIBRARY - library.css (v1)
   Shared, unified design system for all Luveedu products.
   Source of truth: emailsend.luveedu.com + postman.luveedu.com design.

   VERSIONING
   -----------
   Use the versioned file so upgrades never break markup:
     https://files.luveedu.com/ui-library/css/v1/library.css
     https://files.luveedu.com/ui-library/js/v1/library.js
   When the design evolves, publish library-v2.css / library-v2.js
   with the SAME class names and just bump the version in your <link>/<script>.

   USAGE
   -----
   <link rel="stylesheet" href="https://files.luveedu.com/ui-library/css/v1/library.css">
   <script src="https://files.luveedu.com/ui-library/js/v1/library.js"></script>
   <script src="https://files.luveedu.com/ui-library/js/lucide.min.js"></script>
   <body class="lv-app" data-theme="light|dark">

   Icons: <i data-lucide="name" class="lv-icon"></i> - sized in em, scales
   with the parent font-size. Set a font-size on the container for control.
   ======================================================================= */

/* ------------------------------------------------------------------------
   1. FONTS - Bricolage Grotesque (body) - TASA Orbiter (headings)
   Self-hosted woff2 files in /fonts (no external requests).
   ------------------------------------------------------------------------ */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-stretch: 100%;
  font-display: swap;
  src: url(../../fonts/bricolage-grotesque-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-stretch: 100%;
  font-display: swap;
  src: url(../../fonts/bricolage-grotesque-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-stretch: 100%;
  font-display: swap;
  src: url(../../fonts/bricolage-grotesque-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'TASA Orbiter';
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 100%;
  font-display: swap;
  src: url(../../fonts/tasa-orbiter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'TASA Orbiter';
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 100%;
  font-display: swap;
  src: url(../../fonts/tasa-orbiter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ------------------------------------------------------------------------ */
:root {
    /* Surfaces */
    --lv-bg-canvas: #e2e8ee;
    --lv-bg-shell: #ffffff;
    --lv-bg-surface-1: #ffffff;
    --lv-bg-surface-2: #f8fafc;
    --lv-bg-surface-3: #eef2ff;
    /* Borders */
    --lv-border-muted: #d6deea;
    --lv-border-strong: #c2cedf;
    /* Text */
    --lv-text-primary: #111827;
    --lv-text-secondary: #334155;
    --lv-text-tertiary: #64748b;
    --lv-text-disabled: #94a3b8;
    --lv-text-inverse: #ffffff;
    /* Accent */
    --lv-accent-100: #cdeeff;
    --lv-accent-200: #93c5fd;
    --lv-accent-300: #60a5fa;
    --lv-accent-400: #3b82f6;
    --lv-accent-500: #2563eb;
    --lv-accent-600: #1d4ed8;
    /* Semantic */
    --lv-success-500: #23b36b;
    --lv-warning-500: #f4a31c;
    --lv-danger-500: #dc2626;
    --lv-danger: #dc2626;
    --lv-error-500: #dc2626;
    --lv-focus-ring: #82d8ff;
    --lv-link-default: #1d4ed8;
    --lv-link-hover: #1e40af;
    /* Sidebar (always dark - emailsend standard) */
    --lv-sidebar-bg: #0f172a;
    --lv-sidebar-border: #1e293b;
    --lv-sidebar-text: #cbd5e1;
    --lv-sidebar-text-muted: #64748b;
    --lv-sidebar-group-label: #334155;
    --lv-sidebar-hover-bg: #1e293b;
    --lv-sidebar-active-bg: #1e293b;
    --lv-sidebar-active-icon: #2563eb;
    --lv-sidebar-danger: #f87171;
    --lv-sidebar-danger-hover: #fca5a5;
    /* Spacing */
    --lv-space-2: 8px;
    --lv-space-3: 12px;
    --lv-space-4: 16px;
    --lv-space-5: 20px;
    --lv-space-6: 24px;
    --lv-space-8: 32px;
    /* Radius - 6px standard */
    --lv-radius-xs: 6px;
    --lv-radius-sm: 6px;
    --lv-radius-md: 6px;
    --lv-radius-lg: 6px;
    --lv-radius-xl: 6px;
    --lv-radius-pill: 9999px;
    /* Typography */
    --lv-font-ui: 'Bricolage Grotesque', system-ui, sans-serif;
    --lv-font-heading: 'TASA Orbiter', 'Bricolage Grotesque', system-ui, sans-serif;
    --lv-font-mono: 'Bricolage Grotesque', system-ui, sans-serif;
    /* Shadows */
    --lv-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
    --lv-shadow-md: 0 4px 14px rgba(0, 0, 0, 0.3);
    --lv-shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.38);
    /* Motion */
    --lv-duration-fast: 120ms;
    --lv-duration-base: 180ms;
    --lv-duration-slow: 260ms;
    --lv-easing-standard: cubic-bezier(0.2, 0, 0.2, 1);
    --lv-easing-emphasized: cubic-bezier(0.2, 0.8, 0.2, 1);
}

body[data-theme='dark'] {
    --lv-bg-canvas: #0a0f1a;
    --lv-bg-shell: #0f1627;
    --lv-bg-surface-1: #121c31;
    --lv-bg-surface-2: #18253e;
    --lv-bg-surface-3: #22314d;
    --lv-border-muted: #273753;
    --lv-border-strong: #385070;
    --lv-text-primary: #eaf2ff;
    --lv-text-secondary: #b9c8e5;
    --lv-text-tertiary: #8ba0c4;
    --lv-text-disabled: #62789f;
    --lv-text-inverse: #0a0f1a;
    --lv-accent-200: #9bdeff;
    --lv-accent-300: #65ccff;
    --lv-accent-400: #34bcff;
    --lv-accent-500: #08abf5;
    --lv-accent-600: #008ace;
    --lv-link-default: #65ccff;
    --lv-link-hover: #9bdeff;
}

/* ------------------------------------------------------------------------
   3. RESET + BASE
   ------------------------------------------------------------------------ */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Force the main UI font everywhere (including charts & code surfaces) */
* {
    font-family: var(--lv-font-ui);
}

.apexcharts-text,
.apexcharts-legend-text,
.apexcharts-tooltip,
.apexcharts-title-text,
.apexcharts-subtitle-text {
    font-family: var(--lv-font-ui) !important;
}

html {
    height: 100%;
    font-family: var(--lv-font-ui);
    font-size: 16px;
    color: var(--lv-text-primary);
    background: var(--lv-bg-canvas);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

body {
    min-height: 100%;
    font-family: var(--lv-font-ui);
    font-size: 16px;
    color: var(--lv-text-primary);
    background: var(--lv-bg-canvas);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

body[data-theme='dark'] { background: var(--lv-bg-canvas); }

a { color: var(--lv-link-default); text-decoration: none; }
a:hover { color: var(--lv-link-hover); }

/* -- Headings use TASA Orbiter -- */
h1, h2, h3, h4, h5, h6,
.lv-panel-title,
.lv-card-title,
.lv-stat-value,
.lv-drawer-head h3 {
    font-family: var(--lv-font-heading) !important;
}

.lv-stat-value {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

code, pre, kbd, samp,
.lv-mono { font-family: var(--lv-font-ui); }

/* Focus ring (keyboard) */
:focus-visible {
    outline: 2px solid var(--lv-focus-ring);
    outline-offset: 2px;
}

/* Bare form elements (no class) inherit the UI font + 6px radius */
input,
select,
textarea,
button { font-family: inherit; }

input:not([type='radio']):not([type='checkbox']),
select,
textarea { border-radius: var(--lv-radius-sm); }

/* Page / panel header */
.lv-panel-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--lv-text-primary);
}

.lv-panel-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--lv-text-tertiary);
}

/* ------------------------------------------------------------------------
   4. APP SHELL - body + main container + columns
   ------------------------------------------------------------------------ */
.lv-app {
    display: flex;
    min-height: 100vh;
    width: 100%;
    align-items: stretch;
}

.lv-app-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.lv-main {
    flex: 1;
    min-width: 0;
    padding: 28px 32px 36px;
    background: var(--lv-bg-canvas);
}

body[data-theme='dark'] .lv-main { background: var(--lv-bg-canvas); }

/* -- Grid + columns -- */
.lv-grid { display: grid; gap: var(--lv-space-4); }
.lv-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lv-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lv-grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lv-grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.lv-grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

@media (max-width: 1023px) {
    .lv-grid-cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lv-grid-cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 639px) {
    .lv-grid-cols-3,
    .lv-grid-cols-4,
    .lv-grid-cols-5,
    .lv-grid-cols-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.lv-col-span-2 { grid-column: span 2 / span 2; }
.lv-col-span-3 { grid-column: span 3 / span 3; }
.lv-col-span-4 { grid-column: span 4 / span 4; }

.lv-flex { display: flex; }
.lv-flex-col { display: flex; flex-direction: column; }
.lv-items-center { align-items: center; }
.lv-items-start { align-items: flex-start; }
.lv-items-end { align-items: flex-end; }
.lv-justify-between { justify-content: space-between; }
.lv-justify-end { justify-content: flex-end; }
.lv-justify-center { justify-content: center; }
.lv-flex-1 { flex: 1; min-width: 0; }
.lv-shrink-0 { flex-shrink: 0; }

.lv-gap-1 { gap: 4px; }
.lv-gap-2 { gap: 8px; }
.lv-gap-3 { gap: 12px; }
.lv-gap-4 { gap: 16px; }

/* ------------------------------------------------------------------------
   5. SIDEBAR - always dark (#0f172a) in both themes
   ------------------------------------------------------------------------ */
.lv-sidebar {
    width: 268px;
    flex-shrink: 0;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    background: var(--lv-sidebar-bg);
    border-right: 1px solid var(--lv-sidebar-border);
    overflow: hidden;
}

.lv-sidebar-brand {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--lv-sidebar-border);
    padding: 24px;
}

.lv-sidebar-brand img {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: var(--lv-radius-pill);
    object-fit: cover;
}

.lv-sidebar-brand-name {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
    color: #ffffff;
}

.lv-sidebar-brand-sub {
    margin: 2px 0 0;
    font-size: 12px;
    line-height: 1.25;
    color: var(--lv-sidebar-text-muted);
}

.lv-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    scrollbar-width: thin;
    scrollbar-color: #64748b transparent;
}

.lv-nav-group-label {
    margin: 4px 12px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--lv-sidebar-group-label);
}

.lv-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 2px;
    border-radius: var(--lv-radius-md);
    font-size: 14px;
    color: var(--lv-sidebar-text);
    text-decoration: none;
    cursor: pointer;
    transition: background var(--lv-duration-fast) var(--lv-easing-standard),
                color var(--lv-duration-fast) var(--lv-easing-standard);
}

.lv-nav-link:hover { background: var(--lv-sidebar-hover-bg); color: #ffffff; }

.lv-nav-link.active {
    background: var(--lv-sidebar-active-bg);
    color: #ffffff;
    font-weight: 600;
}

.lv-nav-link.active .lv-icon { color: var(--lv-sidebar-active-icon); }

.lv-sidebar-divider {
    margin: 12px -16px;
    border-top: 1px solid var(--lv-sidebar-border);
}

/* Collapsible submenu (grouped nav links) */
.lv-nav-submenu-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 2px;
    border: none;
    border-radius: var(--lv-radius-md);
    background: transparent;
    color: var(--lv-sidebar-text);
    font-family: var(--lv-font-ui);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background var(--lv-duration-fast) var(--lv-easing-standard),
                color var(--lv-duration-fast) var(--lv-easing-standard);
}

.lv-nav-submenu-btn:hover,
.lv-nav-submenu-btn.open { background: var(--lv-sidebar-hover-bg); color: #ffffff; }

.lv-nav-submenu-btn .lv-chevron {
    flex-shrink: 0;
    color: var(--lv-sidebar-text-muted);
    transition: transform 0.2s ease;
}

.lv-nav-submenu-btn.open .lv-chevron { transform: rotate(180deg); }

.lv-nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.lv-nav-submenu.open { max-height: 500px; }

.lv-nav-submenu-inner {
    margin: 2px 8px 4px;
    padding: 6px 4px;
    border-radius: var(--lv-radius-md);
    background: rgba(30, 41, 59, 0.5);
}

.lv-nav-submenu .lv-nav-link {
    padding: 6px 12px 6px 12px;
    font-size: 12.5px;
    color: var(--lv-sidebar-text-muted);
}

.lv-nav-submenu .lv-nav-link.active {
    color: #ffffff;
}

.lv-sidebar-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--lv-sidebar-border);
}

.lv-sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
}

.lv-sidebar-user-name {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lv-sidebar-user-handle {
    margin: 0;
    font-size: 12px;
    color: var(--lv-sidebar-text-muted);
}

.lv-sidebar-card {
    border: 1px solid var(--lv-sidebar-border);
    background: rgba(30, 41, 59, 0.5);
    border-radius: var(--lv-radius-md);
    padding: 12px;
}

/* ------------------------------------------------------------------------
   6. HEADER - sticky top bar
   ------------------------------------------------------------------------ */
.lv-header {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 68px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: nowrap;
    border-bottom: 1px solid var(--lv-border-muted);
    background: var(--lv-bg-surface-1);
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    flex-shrink: 0;
}

.lv-header-left,
.lv-header-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.lv-header-right > * { flex-shrink: 0; }

/* Mobile brand - logo + name + tagline, shown in the header on phones only */
.lv-header-brand {
    display: none;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    min-width: 0;
}

.lv-header-brand img {
    width: 36px;
    height: 36px;
    border-radius: var(--lv-radius-pill);
    object-fit: cover;
    flex-shrink: 0;
}

.lv-header-brand-name {
    display: block;
    font-family: var(--lv-font-heading);
    font-weight: 700;
    font-size: 14px;
    line-height: 1.1;
    color: var(--lv-text-primary);
    white-space: nowrap;
}

.lv-header-brand-tag {
    display: block;
    font-size: 11px;
    line-height: 1.2;
    color: var(--lv-text-tertiary);
    white-space: nowrap;
}

.lv-header-search {
    min-width: 360px;
    height: 38px;
    border-radius: var(--lv-radius-sm);
    border: 1px solid var(--lv-border-muted);
    background: var(--lv-bg-surface-2);
    color: var(--lv-text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
}

.lv-header-search .lv-icon { font-size: 14px; color: var(--lv-text-secondary); flex-shrink: 0; }

.lv-header-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
}

/* Search inputs in page title areas — white background */
.lv-input-wrap input[type="search"] {
    background: var(--lv-bg-surface-1);
}
    color: var(--lv-text-primary);
    font-size: 14px;
    font-family: var(--lv-font-ui);
}

.lv-header-search input::placeholder { color: var(--lv-text-tertiary); }

body[data-theme='dark'] .lv-header-search {
    border-color: var(--lv-border-muted);
    background: rgba(255, 255, 255, 0.05);
}

/* ------------------------------------------------------------------------
   7. FOOTER + floating save bar
   ------------------------------------------------------------------------ */
.lv-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--lv-border-muted);
    background: var(--lv-bg-surface-1);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.lv-save-bar {
    position: fixed;
    bottom: 24px;
    left: 268px;
    right: 0;
    z-index: 50;
    display: flex;
    justify-content: center;
    padding: 0 16px;
    pointer-events: none;
}

.lv-save-bar-inner {
    pointer-events: auto;
    display: flex;
    width: 100%;
    max-width: 576px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-radius: var(--lv-radius-md);
    border: 1px solid #2d3448;
    background: #1a1f2e;
    padding: 12px 16px;
}

.lv-save-bar-title { margin: 0; font-size: 13px; font-weight: 700; color: #ffffff; }
.lv-save-bar-hint { margin: 0; font-size: 11px; color: #8b95b0; }

/* ------------------------------------------------------------------------
   8. DRAWERS - profile / notifications (right slide-in)
   ------------------------------------------------------------------------ */
.lv-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 18, 0.68);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--lv-duration-base) var(--lv-easing-standard);
    z-index: 40;
}

.lv-drawer-overlay.show { opacity: 1; pointer-events: auto; }

.lv-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 100%;
    height: 100vh;
    background: var(--lv-bg-surface-1);
    border-left: 1px solid var(--lv-border-strong);
    border-radius: 16px 0 0 16px;
    transform: translateX(100%);
    transition: transform var(--lv-duration-base) var(--lv-easing-standard);
    z-index: 45;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lv-drawer.open { transform: translateX(0); }

.lv-drawer-head {
    min-height: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--lv-border-muted);
    background: var(--lv-bg-surface-1);
}

.lv-drawer-head h3 {
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 700;
    color: var(--lv-text-primary);
}

.lv-drawer-body {
    padding: 16px;
    overflow-y: auto;
    display: grid;
    gap: 12px;
    background: var(--lv-bg-surface-2);
}

.lv-drawer-link {
    min-height: 38px;
    border-radius: var(--lv-radius-sm);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--lv-text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: color var(--lv-duration-fast) var(--lv-easing-standard),
                background var(--lv-duration-fast) var(--lv-easing-standard),
                border-color var(--lv-duration-fast) var(--lv-easing-standard);
}

.lv-drawer-link:hover {
    color: var(--lv-text-primary);
    background: var(--lv-bg-surface-2);
    border-color: var(--lv-border-muted);
}

.lv-drawer-link .lv-icon { font-size: 14px; }

.lv-drawer-link.danger {
    color: var(--lv-danger-500);
    font-weight: 600;
    background: transparent;
    border-color: transparent;
}

.lv-drawer-link.danger:hover {
    background: rgba(233, 77, 101, 0.14);
    color: var(--lv-danger-500);
    border-color: transparent;
}

body[data-theme='dark'] .lv-drawer-link.danger {
    color: #f87171;
    background: transparent;
    border-color: transparent;
}

body[data-theme='dark'] .lv-drawer-link.danger:hover {
    background: rgba(248, 113, 113, 0.16);
    color: #f87171;
    border-color: transparent;
}

.lv-drawer-avatar-banner {
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--lv-border-muted);
    background: var(--lv-bg-surface-2);
}

.lv-drawer-avatar { width: 52px; height: 52px; border-radius: var(--lv-radius-sm); object-fit: cover; flex-shrink: 0; }
.lv-drawer-avatar-initial {
    width: 52px; height: 52px; border-radius: var(--lv-radius-sm);
    background: var(--lv-accent-600); color: #ffffff;
    font-size: 20px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.lv-drawer-avatar-name { margin: 0; font-size: 15px; font-weight: 700; color: var(--lv-text-primary); }
.lv-drawer-avatar-email { margin: 3px 0 0; font-size: 12px; color: var(--lv-text-tertiary); word-break: break-all; }

/* Full-width divider between drawer sections (touches left & right edges) */
.lv-drawer-divider {
    border-top: 1px solid var(--lv-border-muted);
}

/* ------------------------------------------------------------------------
   9. FORM ELEMENTS - inputs, selects, textareas, chips, checkbox, radio, toggle
   ------------------------------------------------------------------------ */
.lv-field { margin-bottom: 16px; }

.lv-label {
    display: block;
    margin-bottom: 2px;
    font-size: 12px;
    font-weight: 600;
    color: var(--lv-text-secondary);
}

.lv-label .lv-required { color: var(--lv-danger-500); }

.lv-hint {
    margin: 0 0 6px;
    font-size: 12px;
    color: var(--lv-text-tertiary);
}

.lv-input,
.lv-select,
.lv-textarea {
    display: block;
    width: 100%;
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
    font-family: var(--lv-font-ui);
    color: var(--lv-text-primary);
    background: var(--lv-bg-surface-2);
    border: 1px solid var(--lv-border-muted);
    border-radius: var(--lv-radius-sm);
    outline: none;
    transition: border-color var(--lv-duration-fast) var(--lv-easing-standard);
}

.lv-select { cursor: pointer; }
.lv-select option { background: var(--lv-bg-surface-1); color: var(--lv-text-primary); }

.lv-textarea {
    height: auto;
    min-height: 80px;
    padding: 8px 12px;
    line-height: 1.5;
    resize: vertical;
    background: var(--lv-bg-surface-2);
    outline: 0;
}

.lv-input::placeholder,
.lv-textarea::placeholder { color: var(--lv-text-disabled); }

.lv-input:focus,
.lv-select:focus,
.lv-textarea:focus { border-color: var(--lv-accent-500); }

/* Input with a leading icon - wrap in .lv-input-wrap, icon sized in em (14px) */
.lv-input-wrap { position: relative; }

.lv-input-wrap .lv-icon {
    position: absolute;
    left: 0.9em;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--lv-text-tertiary);
    pointer-events: none;
    z-index: 1;
}

.lv-input-wrap .lv-input,
.lv-input-wrap .lv-select,
.lv-input-wrap input[type="text"],
.lv-input-wrap input[type="email"],
.lv-input-wrap input[type="search"],
.lv-input-wrap input[type="url"],
.lv-input-wrap input[type="password"],
.lv-input-wrap input[type="number"],
.lv-input-wrap select,
.lv-input-wrap textarea {
    padding-left: 2.6em;
}

/* Style bare inputs inside .lv-input-wrap even without .lv-input class */
.lv-input-wrap > input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(.lv-input),
.lv-input-wrap > select:not(.lv-select),
.lv-input-wrap > textarea:not(.lv-textarea) {
    display: block;
    width: 100%;
    height: 36px;
    padding-right: 12px;
    font-size: 13px;
    font-family: var(--lv-font-ui);
    color: var(--lv-text-primary);
    background: var(--lv-bg-surface-2);
    border: 1px solid var(--lv-border-muted);
    border-radius: var(--lv-radius-sm);
    outline: none;
    transition: border-color var(--lv-duration-fast) var(--lv-easing-standard);
}

.lv-input-wrap > input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(.lv-input):focus {
    border-color: var(--lv-accent-500);
}

.lv-input-wrap > input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(.lv-input)::placeholder {
    color: var(--lv-text-disabled);
}

/* Password toggle button inside input-wrap */
.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--lv-text-tertiary);
    cursor: pointer;
    z-index: 2;
    transition: color 0.12s ease, background 0.12s ease;
}

.password-toggle:hover {
    color: var(--lv-text-primary);
    background: var(--lv-bg-surface-2);
}

.password-toggle .lv-icon {
    width: 16px;
    height: 16px;
    pointer-events: none;
}

/* Input with password toggle needs right padding */
.lv-input-wrap .lv-input[type="password"],
.lv-input-wrap input[type="password"] {
    padding-right: 40px;
}

.lv-field-error {
    display: none;
    margin: 6px 0 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--lv-danger-500);
}

.lv-field-error.show { display: block; }

/* Form section (title + description block, emailsend settings standard) */
.lv-form-section {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--lv-border-muted);
    margin-bottom: 20px;
}

.lv-form-section:last-child {
    border-bottom: 0;
    padding-bottom: 0;
    margin-bottom: 0;
}

.lv-form-section-title {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 700;
    color: var(--lv-text-primary);
}

.lv-form-section-desc {
    margin: 0 0 16px;
    font-size: 12px;
    color: var(--lv-text-tertiary);
}

/* Chips / pills (tab pattern) */
.lv-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 12px;
    border-radius: var(--lv-radius-sm);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--lv-font-ui);
    border: 1px solid var(--lv-border-muted);
    background: var(--lv-bg-surface-2);
    color: var(--lv-text-secondary);
    cursor: pointer;
    transition: color var(--lv-duration-fast) var(--lv-easing-standard),
                border-color var(--lv-duration-fast) var(--lv-easing-standard),
                background var(--lv-duration-fast) var(--lv-easing-standard);
}

.lv-chip .lv-icon { font-size: 14px; }
.lv-chip:hover { color: var(--lv-text-primary); }

.lv-chip.active {
    border-color: var(--lv-accent-500);
    background: var(--lv-accent-500);
    color: #ffffff;
}

/* Small chip */
.lv-chip-sm {
    height: 24px;
    padding: 0 10px;
    font-size: 11px;
}

/* Checkbox + radio */
.lv-checkbox,
.lv-radio {
    width: 15px;
    height: 15px;
    border-radius: 3px;
    border: 1px solid var(--lv-border-strong);
    cursor: pointer;
    accent-color: var(--lv-accent-500);
    flex-shrink: 0;
}

.lv-radio { border-radius: var(--lv-radius-pill); }

/* Toggle switch */
.lv-toggle {
    position: relative;
    display: inline-flex;
    cursor: pointer;
    align-items: center;
}

.lv-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.lv-toggle-track {
    width: 36px;
    height: 20px;
    border-radius: var(--lv-radius-pill);
    border: 1px solid var(--lv-border-muted);
    background: var(--lv-bg-surface-2);
    transition: border-color var(--lv-duration-fast), background var(--lv-duration-fast);
}

.lv-toggle-thumb {
    position: absolute;
    left: 2px;
    top: 2px;
    width: 16px;
    height: 16px;
    border-radius: var(--lv-radius-pill);
    background: var(--lv-text-tertiary);
    transition: transform var(--lv-duration-fast), background var(--lv-duration-fast);
}

.lv-toggle input:checked + .lv-toggle-track {
    border-color: var(--lv-accent-500);
    background: var(--lv-accent-500);
}

.lv-toggle input:checked + .lv-toggle-track + .lv-toggle-thumb {
    transform: translateX(16px);
    background: #ffffff;
}

/* ------------------------------------------------------------------------
   10. BUTTONS - primary / secondary / icon-only / text-only / danger
   ------------------------------------------------------------------------ */
.lv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border-radius: var(--lv-radius-sm);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--lv-font-ui);
    color: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background var(--lv-duration-fast) var(--lv-easing-standard),
                color var(--lv-duration-fast) var(--lv-easing-standard),
                border-color var(--lv-duration-fast) var(--lv-easing-standard),
                opacity var(--lv-duration-fast);
    text-decoration: none;
    white-space: nowrap;
}

.lv-btn .lv-icon { font-size: 14px; }
.lv-btn:active { transform: scale(0.98); }
.lv-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.lv-btn-primary {
    background: var(--lv-accent-500);
    border-color: var(--lv-accent-500);
    color: #ffffff;
}
.lv-btn-primary:hover:not(:disabled) { background: var(--lv-accent-400); color: #ffffff; }

.lv-btn-secondary {
    background: var(--lv-bg-surface-1);
    border-color: var(--lv-border-muted);
    color: var(--lv-text-secondary);
}
.lv-btn-secondary:hover:not(:disabled) { background: var(--lv-bg-surface-2); }

.lv-btn-danger {
    background: var(--lv-danger-500);
    border-color: var(--lv-danger-500);
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.25);
}
.lv-btn-danger:hover:not(:disabled) {
    background: #b91c1c;
    border-color: #b91c1c;
}
.lv-btn-danger:active:not(:disabled) { background: #991b1b; border-color: #991b1b; }
.lv-btn-danger:disabled { background: rgba(220, 38, 38, 0.45); border-color: transparent; color: rgba(255,255,255,0.8); }

/* Icon-only button - 36px box, 16px icon */
.lv-btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: var(--lv-radius-sm);
    border: 1px solid var(--lv-border-muted);
    background: var(--lv-bg-surface-1);
    color: var(--lv-text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    transition: background var(--lv-duration-fast) var(--lv-easing-standard),
                color var(--lv-duration-fast) var(--lv-easing-standard),
                border-color var(--lv-duration-fast) var(--lv-easing-standard);
}
.lv-btn-icon:hover:not(:disabled) { background: var(--lv-bg-surface-2); color: var(--lv-text-primary); }
.lv-btn-icon .lv-icon { font-size: 16px; }
.lv-btn-icon:disabled { opacity: 0.55; cursor: not-allowed; }

/* Small icon-only button (table rows) - same height as .lv-btn (36px) */
.lv-btn-icon-sm {
    width: 36px;
    height: 36px;
    font-size: 16px;
}

.lv-btn-icon-sm .lv-icon { font-size: 16px; }

/* Danger icon-only button (delete actions) */
.lv-btn-icon-danger {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #dc2626;
}

.lv-btn-icon-danger:hover:not(:disabled) {
    background: #fee2e2;
    color: #dc2626;
}

/* Text-only button */
.lv-btn-text {
    background: transparent;
    border-color: transparent;
    color: var(--lv-text-tertiary);
    padding: 0 8px;
}
.lv-btn-text:hover:not(:disabled) { color: var(--lv-text-primary); }

/* Sizes */
.lv-btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }
.lv-btn-full { width: 100%; }

/* Shine sweep for primary buttons */
.lv-btn-shine { position: relative; overflow: hidden; }
.lv-btn-shine::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 55%;
    height: 100%;
    background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, 0.38) 50%, transparent 80%);
    transform: skewX(-20deg);
    animation: lv-shine-sweep 2.8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes lv-shine-sweep {
    0% { left: -150%; }
    55%, 100% { left: 160%; }
}

/* Button loading state - add .is-loading, text hides, spinner appears */
.lv-btn.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.lv-btn.is-loading .lv-icon { opacity: 0; }

.lv-btn.is-loading::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: var(--lv-radius-pill);
    border: 2px solid currentColor;
    border-top-color: transparent;
    opacity: 0.75;
    animation: lv-spin 0.7s linear infinite;
}

/* ------------------------------------------------------------------------
   11. ICONS - lucide, em-sized, 2.5 stroke width
   <i data-lucide="name" class="lv-icon lv-icon-sm|md|lg"></i>
   The <i> wrapper becomes inline-flex with a 1em box; the lucide <svg>
   inside fills it (100%). The .lucide class also lands on the wrapper,
   so we never size it - only the svg.
   ------------------------------------------------------------------------ */
.lv-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    color: currentColor;
    vertical-align: middle;
}

.lv-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    stroke-width: 2.5;
}

.lv-icon-sm { width: 0.8em; height: 0.8em; }
.lv-icon-md { width: 1.15em; height: 1.15em; }
.lv-icon-lg { width: 1.6em; height: 1.6em; }

/* ------------------------------------------------------------------------
   12. POPUPS / MODALS
   ------------------------------------------------------------------------ */
.lv-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.lv-modal-overlay.show { display: flex; }

.lv-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    animation: lv-fade-in 0.18s ease;
}

.lv-modal {
    position: relative;
    z-index: 201;
    display: flex;
    flex-direction: column;
    max-height: 88vh;
    width: 100%;
    max-width: 448px;
    overflow: hidden;
    border-radius: var(--lv-radius-md);
    border: 1px solid var(--lv-border-muted);
    background: var(--lv-bg-surface-1);
    animation: lv-modal-pop 0.15s ease;
}

.lv-modal-wide { max-width: 640px; }

.lv-modal-head {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--lv-border-muted);
}

.lv-modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--lv-text-primary);
}

.lv-modal-head .lv-btn-icon,
.lv-drawer-head .lv-btn-icon {
    border-color: transparent;
    background: transparent;
}

.lv-modal-head .lv-btn-icon:hover,
.lv-drawer-head .lv-btn-icon:hover {
    background: var(--lv-bg-surface-2);
    border-color: transparent;
}

.lv-modal-title .lv-icon { font-size: 16px; color: var(--lv-text-secondary); }

.lv-modal-body {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.lv-modal-foot {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--lv-border-muted);
    background: var(--lv-bg-surface-2);
}

/* Confirm modal variant (warning icon box) */
.lv-modal-confirm .lv-modal-head { justify-content: flex-start; }
.lv-modal-title-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--lv-radius-sm);
    background: rgba(244, 163, 28, 0.15);
    color: var(--lv-warning-500);
    font-size: 16px;
}

@keyframes lv-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes lv-modal-pop {
    from { transform: scale(0.96); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ------------------------------------------------------------------------
   13. CARDS - head / body / foot / overlay
   ------------------------------------------------------------------------ */
.lv-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--lv-radius-md);
    border: 1px solid var(--lv-border-muted);
    background: var(--lv-bg-surface-1);
}

.lv-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--lv-border-muted);
}

/* Title/subtitle wrapper expands to push right-side elements (chips, links) to the far right */
.lv-card-head > :nth-child(2) {
    flex: 1;
    min-width: 0;
}

.lv-card-head-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--lv-radius-sm);
    background: var(--lv-accent-500);
    color: #ffffff;
    font-size: 16px;
}

.lv-card-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--lv-text-primary);
}

.lv-card-subtitle {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--lv-text-tertiary);
}

.lv-card-body { padding: 20px; }

.lv-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--lv-border-muted);
    background: var(--lv-bg-surface-2);
}

.lv-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.7);
    border-radius: inherit;
}

.lv-card.is-loading .lv-overlay { display: flex; }
body[data-theme='dark'] .lv-overlay { background: rgba(10, 15, 26, 0.7); }

/* ------------------------------------------------------------------------
   14. TABLES
   ------------------------------------------------------------------------ */
.lv-table-wrap {
    overflow-x: auto;
    background: var(--lv-bg-surface-1);
    border-radius: var(--lv-radius-md);
    border: 1px solid var(--lv-border-muted);
}

.lv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.lv-table thead tr { background: var(--lv-bg-surface-2); }

.lv-table th {
    white-space: nowrap;
    border-bottom: 1px solid var(--lv-border-muted);
    padding: 10px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--lv-text-tertiary);
}

.lv-table td {
    padding: 11px 16px;
    vertical-align: middle;
    font-size: 14px;
    color: var(--lv-text-secondary);
    border-bottom: none;
}

/* Ensure flex containers inside table cells are vertically centered */
.lv-table td.lv-flex,
.lv-table td[class*="lv-flex"] {
    height: 100%;
}

.lv-table tbody tr {
    border-bottom: 1px solid var(--lv-border-muted);
    transition: background 0.1s ease;
}

.lv-table tbody tr:hover { background: var(--lv-bg-surface-2); }
.lv-table tbody tr:last-child { border-bottom: 0; }

/* ------------------------------------------------------------------------
   15. BADGES
   ------------------------------------------------------------------------ */
.lv-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--lv-radius-sm);
    font-size: 11px;
    font-weight: 600;
    font-family: var(--lv-font-ui);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.lv-badge-success { background: #ecfdf5; color: #059669; }
.lv-badge-info    { background: #eff6ff; color: #2563eb; }
.lv-badge-warning { background: #fffbeb; color: #d97706; }
.lv-badge-danger  { background: #fef2f2; color: #dc2626; }
.lv-badge-neutral { background: #f4f4f5; color: #52525b; }

body[data-theme='dark'] .lv-badge-success { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
body[data-theme='dark'] .lv-badge-info    { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
body[data-theme='dark'] .lv-badge-warning { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
body[data-theme='dark'] .lv-badge-danger  { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
body[data-theme='dark'] .lv-badge-neutral { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }

/* -- Solid badges - solid bg + white text (consistent in both themes) -- */
.lv-badge-solid { color: #ffffff; }
.lv-badge-solid-good,
.lv-badge-solid-success { background: #16a34a; color: #ffffff; }
.lv-badge-solid-warning { background: #d97706; color: #ffffff; }
.lv-badge-solid-error   { background: #dc2626; color: #ffffff; }
.lv-badge-solid-info    { background: #2563eb; color: #ffffff; }

/* Small badge */
.lv-badge-sm {
    padding: 1px 6px;
    font-size: 10px;
    border-radius: 4px;
}

/* -- Solid chips - solid bg + white text (same palette as solid badges) -- */
.lv-chip-solid {
    border-color: transparent;
    color: #ffffff;
}
.lv-chip-solid:hover { color: #ffffff; opacity: 0.9; }
.lv-chip-solid-good,
.lv-chip-solid-success { background: #16a34a; }
.lv-chip-solid-warning { background: #d97706; }
.lv-chip-solid-error   { background: #dc2626; }
.lv-chip-solid-info    { background: #2563eb; }

/* ------------------------------------------------------------------------
   16. AVATAR
   ------------------------------------------------------------------------ */
.lv-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--lv-radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
}

.lv-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ------------------------------------------------------------------------
   17. BREADCRUMBS + EMPTY STATES + ACTION MENUS + PAGINATION
   ------------------------------------------------------------------------ */
.lv-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--lv-text-tertiary);
}

.lv-breadcrumb a { color: var(--lv-text-tertiary); text-decoration: none; }
.lv-breadcrumb a:hover { color: var(--lv-text-primary); }
.lv-breadcrumb .lv-icon { font-size: 12px; }
.lv-breadcrumb-sep { color: var(--lv-text-tertiary); font-size: 12px; }

.lv-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    text-align: center;
}

.lv-empty .lv-icon { font-size: 22px; color: var(--lv-text-disabled); margin-bottom: 8px; }
.lv-empty-title { margin: 0; font-size: 14px; font-weight: 600; color: var(--lv-text-secondary); }
.lv-empty-hint { margin: 4px 0 0; font-size: 12px; color: var(--lv-text-tertiary); }

/* Overflow action menu (button with data-lv-action-menu) */
.lv-action-menu {
    position: fixed;
    z-index: 150;
    min-width: 160px;
    padding: 6px;
    border-radius: var(--lv-radius-sm);
    border: 1px solid var(--lv-border-muted);
    background: var(--lv-bg-surface-1);
    display: none;
}

.lv-action-menu.show { display: block; }

.lv-action-menu button,
.lv-action-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border-radius: var(--lv-radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--lv-text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    font-family: var(--lv-font-ui);
    transition: background var(--lv-duration-fast), color var(--lv-duration-fast);
}

.lv-action-menu button:hover,
.lv-action-menu a:hover {
    background: var(--lv-bg-surface-2);
    color: var(--lv-text-primary);
}

.lv-action-menu button.danger,
.lv-action-menu a.danger { color: #dc2626; }
body[data-theme='dark'] .lv-action-menu button.danger,
body[data-theme='dark'] .lv-action-menu a.danger { color: #f87171; }
.lv-action-menu button.danger:hover,
.lv-action-menu a.danger:hover { background: rgba(233, 77, 101, 0.1); }

/* Pagination */
.lv-pagination {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.lv-page-btn {
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--lv-font-ui);
    border-radius: var(--lv-radius-sm);
    border: 1px solid var(--lv-border-muted);
    background: var(--lv-bg-surface-1);
    color: var(--lv-text-secondary);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
}

.lv-page-btn:hover { background: var(--lv-bg-surface-3); }
.lv-page-btn.active { background: var(--lv-accent-500); border-color: var(--lv-accent-500); color: #ffffff; }
.lv-page-ellipsis { padding: 0 2px; color: var(--lv-text-tertiary); }

/* ------------------------------------------------------------------------
   18. NOTIFICATION BADGE (on icon buttons)
   ------------------------------------------------------------------------ */
.lv-notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 16px;
    height: 16px;
    border-radius: var(--lv-radius-pill);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    color: #ffffff;
    background: var(--lv-warning-500);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.lv-notif-badge.show { display: inline-flex; }

/* ------------------------------------------------------------------------
   19. SETTINGS LAYOUT - sidebar tabs + content panes
   ------------------------------------------------------------------------ */
.lv-settings-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 16px;
    padding-bottom: 96px;
}

@media (min-width: 1024px) {
    .lv-settings-layout {
        flex-direction: row;
    }
}

.lv-settings-sidebar {
    flex-shrink: 0;
}

@media (min-width: 1024px) {
    .lv-settings-sidebar {
        width: 208px;
        position: sticky;
        top: 16px;
        align-self: flex-start;
    }
}

.lv-settings-panes {
    min-width: 0;
    width: 100%;
}

@media (min-width: 1024px) {
    .lv-settings-panes {
        max-width: 520px;
    }
}

.lv-settings-tab {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 10px;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    text-align: left;
    font-size: 13px;
    font-family: var(--lv-font-ui);
    font-weight: 500;
    color: var(--lv-text-secondary);
    background: transparent;
    cursor: pointer;
    transition: color 0.12s ease, background 0.12s ease;
}

.lv-settings-tab.active {
    background: var(--lv-accent-500);
    font-weight: 600;
    color: #ffffff;
}

.lv-settings-tab .lv-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ------------------------------------------------------------------------
   20. LOADING - spinner + skeleton shimmer
   ------------------------------------------------------------------------ */
@keyframes lv-spin { to { transform: rotate(360deg); } }

.lv-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: var(--lv-radius-pill);
    border: 2px solid var(--lv-border-muted);
    border-top-color: var(--lv-accent-500);
    animation: lv-spin 0.7s linear infinite;
}

.lv-skel {
    background: linear-gradient(90deg, var(--lv-bg-surface-3) 25%, var(--lv-bg-surface-2) 50%, var(--lv-bg-surface-3) 75%);
    background-size: 200% 100%;
    animation: lv-skel-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--lv-radius-sm);
}

body[data-theme='light'] .lv-skel {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
}

@keyframes lv-skel-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Skeleton table rows */
.lv-skel-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--lv-border-muted);
}

.lv-skel-row:last-child { border-bottom: 0; }

/* ------------------------------------------------------------------------
   20. UTILITIES
   ------------------------------------------------------------------------ */
.lv-hidden { display: none !important; }
.lv-text-sm { font-size: 13px; }
.lv-text-xs { font-size: 11.5px; }
.lv-text-muted { color: var(--lv-text-tertiary); }
.lv-text-danger { color: var(--lv-danger-500); }
.lv-font-mono { font-family: var(--lv-font-mono); }
.lv-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-w-full { width: 100%; }
.lv-mt-1 { margin-top: 4px; }
.lv-mt-2 { margin-top: 8px; }
.lv-mb-1 { margin-bottom: 4px; }
.lv-mb-2 { margin-bottom: 8px; }
.lv-mb-4 { margin-bottom: 16px; }

/* ------------------------------------------------------------------------
   21. RESPONSIVE - <1024px sidebar collapses behind a hamburger, grids
   stack, drawers go full-width; <640px hides the header search and scales
   touch targets for phones.
   ------------------------------------------------------------------------ */

/* Mobile hamburger - hidden on desktop, shown on mobile */
.lv-menu-btn { display: none; }

/* Backdrop behind the mobile sidebar */
.lv-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(5, 10, 18, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--lv-duration-base) var(--lv-easing-standard);
}

.lv-sidebar-overlay.show { opacity: 1; pointer-events: auto; }

@media (max-width: 1023px) {
    body { overflow-x: hidden; }

    .lv-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100dvh;
        transform: translateX(-100%);
        transition: transform var(--lv-duration-base) var(--lv-easing-standard);
        z-index: 60;
    }

    .lv-sidebar.open { transform: translateX(0); }

    .lv-menu-btn { display: inline-flex; }

    .lv-main { padding: 20px 16px 28px; overflow-x: hidden; }

    .lv-header-search { min-width: 0; width: 100%; }
    .lv-header-left { flex: 1; min-width: 0; }
    .lv-header { padding: 0 16px; }

    .lv-grid-cols-2,
    .lv-grid-cols-3,
    .lv-grid-cols-4 { grid-template-columns: 1fr; }

    .lv-col-span-2,
    .lv-col-span-3,
    .lv-col-span-4 { grid-column: span 1 / span 1; }

    .lv-drawer { width: 100%; border-radius: 0; }

    .lv-save-bar { left: 0; }
}

@media (max-width: 639px) {
    /* Hide the header search on phones; show the mobile brand instead */
    .lv-header-search { display: none; }
    .lv-header-brand { display: flex; }
    .lv-header-left { gap: 4px; }

    .lv-header { height: auto; min-height: 68px; flex-wrap: wrap; padding: 10px 14px; }
    .lv-modal { max-width: 100%; }
    .lv-card-head, .lv-modal-head, .lv-modal-foot, .lv-card-foot { padding-left: 16px; padding-right: 16px; }
    .lv-main { padding: 16px 12px 24px; }

    /* 16px inputs prevent iOS Safari auto-zoom on focus */
    .lv-input, .lv-select, .lv-textarea { font-size: 16px; }
    .lv-header-search input { font-size: 16px; }
}

/* ═══════════════════════════════════════════════════════════════
   LEGACY COMPATIBILITY (emailsend app)
   Alias the old --color-* / --sidebar-* / --duration-* tokens to the
   library --lv-* tokens, and provide the behavioral components the app
   still references. Safe to remove when the app fully migrates.
   ═══════════════════════════════════════════════════════════════ */
:root {
  --color-bg-canvas: var(--lv-bg-canvas);
  --color-bg-shell: var(--lv-bg-shell);
  --color-bg-surface-1: var(--lv-bg-surface-1);
  --color-bg-surface-2: var(--lv-bg-surface-2);
  --color-bg-surface-3: var(--lv-bg-surface-3);
  --color-border-muted: var(--lv-border-muted);
  --color-border-strong: var(--lv-border-strong);
  --color-text-primary: var(--lv-text-primary);
  --color-text-secondary: var(--lv-text-secondary);
  --color-text-tertiary: var(--lv-text-tertiary);
  --color-text-disabled: var(--lv-text-disabled);
  --color-text-inverse: var(--lv-text-inverse);
  --color-accent-100: var(--lv-accent-100);
  --color-accent-200: var(--lv-accent-200);
  --color-accent-300: var(--lv-accent-300);
  --color-accent-400: var(--lv-accent-400);
  --color-accent-500: var(--lv-accent-500);
  --color-accent-600: var(--lv-accent-600);
  --color-success-500: var(--lv-success-500);
  --color-warning-500: var(--lv-warning-500);
  --color-danger-500: var(--lv-danger-500);
  --color-danger: var(--lv-danger);
  --color-error-500: var(--lv-error-500);
  --color-focus-ring: var(--lv-focus-ring);
  --color-link-default: var(--lv-link-default);
  --color-link-hover: var(--lv-link-hover);
  --sidebar-bg: var(--lv-sidebar-bg);
  --sidebar-border: var(--lv-sidebar-border);
  --sidebar-text: var(--lv-sidebar-text);
  --sidebar-text-muted: var(--lv-sidebar-text-muted);
  --sidebar-group-label: var(--lv-sidebar-group-label);
  --sidebar-hover-bg: var(--lv-sidebar-hover-bg);
  --sidebar-active-bg: var(--lv-sidebar-active-bg);
  --sidebar-active-icon: var(--lv-sidebar-active-icon);
  --sidebar-danger: var(--lv-sidebar-danger);
  --sidebar-danger-hover: var(--lv-sidebar-danger-hover);
  --duration-fast: var(--lv-duration-fast);
  --duration-base: var(--lv-duration-base);
  --easing-standard: var(--lv-easing-standard);
  --space-2: var(--lv-space-2);
  --space-3: var(--lv-space-3);
  --space-4: var(--lv-space-4);
  --space-5: var(--lv-space-5);
  --space-6: var(--lv-space-6);
  --space-8: var(--lv-space-8);
  --radius-xs: var(--lv-radius-xs);
  --radius-sm: var(--lv-radius-sm);
  --radius-md: var(--lv-radius-md);
  --radius-lg: var(--lv-radius-lg);
  --radius-xl: var(--lv-radius-xl);
  --radius-2xl: var(--lv-radius-xl);
  --radius-pill: var(--lv-radius-pill);
  --font-ui: var(--lv-font-ui);
  --font-heading: var(--lv-font-heading);
  --font-mono: var(--lv-font-mono);
}
body[data-theme='dark'] {
  --color-bg-canvas: var(--lv-bg-canvas);
  --color-bg-shell: var(--lv-bg-shell);
  --color-bg-surface-1: var(--lv-bg-surface-1);
  --color-bg-surface-2: var(--lv-bg-surface-2);
  --color-bg-surface-3: var(--lv-bg-surface-3);
  --color-border-muted: var(--lv-border-muted);
  --color-border-strong: var(--lv-border-strong);
  --color-text-primary: var(--lv-text-primary);
  --color-text-secondary: var(--lv-text-secondary);
  --color-text-tertiary: var(--lv-text-tertiary);
  --color-text-disabled: var(--lv-text-disabled);
  --color-text-inverse: var(--lv-text-inverse);
  --color-accent-100: var(--lv-accent-100);
  --color-accent-200: var(--lv-accent-200);
  --color-accent-300: var(--lv-accent-300);
  --color-accent-400: var(--lv-accent-400);
  --color-accent-500: var(--lv-accent-500);
  --color-accent-600: var(--lv-accent-600);
  --color-success-500: var(--lv-success-500);
  --color-warning-500: var(--lv-warning-500);
  --color-danger-500: var(--lv-danger-500);
  --color-danger: var(--lv-danger);
  --color-error-500: var(--lv-error-500);
  --color-focus-ring: var(--lv-focus-ring);
  --color-link-default: var(--lv-link-default);
  --color-link-hover: var(--lv-link-hover);
}
.hidden { display: none !important; }
.js-action-group { justify-content: flex-end; }
.notice-item { border: 1px solid var(--color-border-muted); background: var(--color-bg-surface-1); border-radius: 6px; padding: 16px; display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.notice-dot { margin-top: 4px; width: 8px; height: 8px; border-radius: 9999px; background: var(--color-accent-500); flex-shrink: 0; }
.notice-dot.is-success { background: var(--color-success-500); }
.notice-dot.is-warning { background: var(--color-warning-500); }
.notice-dot.is-danger { background: var(--color-danger-500); }
.notice-title { margin: 0; font-size: 13px; line-height: 1.45; font-weight: 600; color: var(--color-text-primary); }
.notice-text { margin: 4px 0 0; font-size: 12px; line-height: 1.5; color: var(--color-text-tertiary); }
.notice-date { margin: 4px 0 0; font-size: 10px; color: var(--color-text-disabled); }
.main-content { flex: 1; min-width: 0; padding: 28px 32px 36px; background: var(--color-bg-canvas); }
.js-action-menu {
  min-width: 160px; padding: 4px; background: var(--color-bg-surface-1);
  border-radius: 6px;
  display: flex; flex-direction: column; gap: 2px; z-index: 50;
  border: 1px solid var(--color-border-muted);
}
.js-action-menu button { width: 100%; display: flex; align-items: center; justify-content: flex-start; border: none; background: none; margin: 0; outline: none; box-shadow: none; text-align: left; color: var(--color-text-secondary); transition: background 0.12s ease, color 0.12s ease; }
.js-action-menu button:hover { background: var(--color-bg-surface-3); color: var(--color-text-primary); }
.js-action-menu button.is-danger { color: #dc2626; }
.js-action-menu button.is-danger:hover { background: rgba(220,38,38,0.08); color: #dc2626; }
.ajax-filter-btn { display: inline-flex; align-items: center; gap: 6px; border-radius: 6px; border: 1px solid var(--color-border-muted); background: var(--color-bg-surface-2); color: var(--color-text-primary); padding: 5px 14px; font-size: 14px; font-weight: 500; transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease; cursor: pointer; }
.ajax-filter-btn:hover { background: var(--color-bg-surface-3); }
.ajax-filter-btn.is-active { border-color: var(--color-accent-500); background: var(--color-accent-500); color: #fff; }
.ajax-filter-btn .filter-count { border-radius: 6px; background: var(--color-bg-surface-3); padding: 0 6px; font-size: 10px; font-weight: 700; line-height: 16px; color: var(--color-text-tertiary); }
.ajax-filter-btn.is-active .filter-count { background: rgba(255,255,255,0.25); color: inherit; }
.ajax-table-card { overflow: hidden; border-radius: 6px; border: 1px solid var(--color-border-muted); background: var(--color-bg-surface-1); position: relative; }
.ajax-table-card thead tr { background: var(--color-bg-surface-2); }
.ajax-table-card th { white-space: nowrap; border-bottom: 1px solid var(--color-border-muted); padding: 10px 16px; text-align: left; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-tertiary); }
.ajax-table-card td { padding: 11px 16px; vertical-align: middle; font-size: 14px; color: var(--color-text-secondary); white-space: nowrap; }
.ajax-table-card tbody tr { border-bottom: 1px solid var(--color-border-muted); transition: background 0.1s ease; }
.ajax-table-card tbody tr:hover { background: var(--color-bg-surface-2); }
.ajax-table-card tbody tr:last-child { border-bottom: 0; }
.ajax-table-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--color-border-muted); background: var(--color-bg-surface-2); padding: 12px 20px; font-size: 13px; color: var(--color-text-tertiary); }
.ajax-table-card.is-loading .overflow-x-auto,
.ajax-table-card.is-loading .lv-table-wrap,
.ajax-table-card.is-loading .ajax-table-footer { display: none; }
.ajax-table-loader { position: static; background: var(--color-bg-surface-1); display: block; align-items: initial; justify-content: initial; padding-top: 0; border-radius: 6px; }
.ajax-table-loader.hidden { display: none; }
.skel-table-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--color-border-muted); }
.skel-table-row:last-child { border-bottom: 0; }
.skel-table-head { display: flex; align-items: center; gap: 12px; padding: 13px 16px; margin-bottom: 0; background: var(--color-bg-surface-2); border-bottom: 1px solid var(--color-border-muted); }
.skel { background: linear-gradient(90deg, var(--color-bg-surface-3) 25%, var(--color-bg-surface-2) 50%, var(--color-bg-surface-3) 75%); background-size: 200% 100%; animation: skel-shimmer 1.5s ease-in-out infinite; border-radius: 6px; }
@keyframes skel-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.ajax-pagination { display: inline-flex; align-items: center; gap: 6px; }
.ajax-pagination .page-btn { min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; font-size: 13px; font-weight: 500; border-radius: 6px; border: 1px solid var(--color-border-muted); background: var(--color-bg-surface-1); color: var(--color-text-secondary); transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease; cursor: pointer; }
.ajax-pagination .page-btn:hover { background: var(--color-bg-surface-3); }
.ajax-pagination .page-btn.is-active { background: var(--color-accent-500); border-color: var(--color-accent-500); color: #fff; }
.ajax-pagination .page-ellipsis { padding: 0 2px; color: var(--color-text-tertiary); }
.media-check { opacity: 0; transition: opacity 0.15s ease; }
.media-card:hover .media-check { opacity: 1; }
.media-card.selected .media-check { opacity: 1; background: var(--color-accent-500); border-color: #fff; }
.media-card.selected .media-check svg { opacity: 1 !important; }
.media-card.selected { border-color: var(--color-accent-500); box-shadow: 0 0 0 1px var(--color-accent-500); }
.draft-badge { position: absolute; top: -4px; right: -4px; width: 9px; height: 9px; border-radius: 9999px; background: var(--color-error-500, #ef4444); }
.progress-bar { height: 4px; background: var(--color-bg-surface-3); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--color-accent-500); border-radius: 2px; transition: width 0.4s ease; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.7s linear infinite; display: inline-block; }
@property --flow-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.btn-shine { position: relative; overflow: hidden; }
.btn-shine::after { content: ''; position: absolute; top: 0; left: -150%; width: 55%; height: 100%; background: linear-gradient(105deg, transparent 20%, rgba(255,255,255,.38) 50%, transparent 80%); transform: skewX(-20deg); animation: btn-shine-sweep 2.8s ease-in-out infinite; pointer-events: none; }
@keyframes btn-shine-sweep { 0% { left: -150%; } 55%, 100% { left: 160%; } }
.btn-flow { position: relative; }
.btn-flow::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 2px; background: conic-gradient(from var(--flow-angle), var(--color-accent-500), #ffffff 50deg, var(--color-accent-400) 120deg, var(--color-accent-500) 240deg, var(--color-accent-500)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: btn-flow-rotate 2.4s linear infinite; pointer-events: none; }
@keyframes btn-flow-rotate { to { --flow-angle: 360deg; } }
.card-section { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--color-text-tertiary); padding-bottom: 12px; margin: 0 -24px 18px; padding-left: 24px; padding-right: 24px; border-bottom: 1px solid var(--color-border-muted); }
.ql-container.ql-snow { border: 1px solid var(--color-border-muted) !important; border-top: 0 !important; border-radius: 0 0 6px 6px !important; font-family: var(--lv-font-ui) !important; }
.ql-toolbar.ql-snow { border: 1px solid var(--color-border-muted) !important; border-radius: 6px 6px 0 0 !important; background: var(--color-bg-surface-2); padding: 8px 10px !important; }
.ql-editor { font-family: var(--lv-font-ui) !important; font-size: 14px !important; min-height: 160px; padding: 14px !important; line-height: 1.65; color: var(--color-text-primary); background: var(--color-bg-surface-1); }

/* ═══════════════════════════════════════════════════════════════
   CONSOLE APP (console.luveedu.com)
   Select2 restyle to match lv- form controls, overflow action menus,
   tiny-char-count and legacy form aliases used by public pages.
   ═══════════════════════════════════════════════════════════════ */
.select2-container { z-index: 1060; }
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  height: 36px; min-height: 36px;
  border: 1px solid var(--lv-border-muted);
  border-radius: 6px;
  background: var(--lv-bg-surface-2);
  padding: 0 12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 34px; color: var(--lv-text-primary); font-size: 13px; padding-left: 0;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--lv-text-tertiary); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 34px; }
.select2-container--default .select2-selection--single .select2-selection__clear,
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove { color: var(--lv-text-tertiary); }
.select2-container--default .select2-selection--multiple .select2-selection__choice {
  background: var(--lv-bg-surface-3); border-color: var(--lv-border-muted); border-radius: 4px; color: var(--lv-text-primary); font-size: 12px;
}
.select2-container--default .select2-selection--multiple .select2-selection__rendered { padding: 3px 0; }
.select2-container--default .select2-selection--multiple .select2-selection__choice__display { padding-left: 4px; }
.select2-dropdown { border: 1px solid var(--lv-border-muted); border-radius: 6px; background: var(--lv-bg-surface-1); }
.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1px solid var(--lv-border-muted); border-radius: 6px; background: var(--lv-bg-surface-2); color: var(--lv-text-primary);
}
.select2-container--default .select2-results__option { color: var(--lv-text-secondary); font-size: 13px; }
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: var(--lv-bg-surface-3); color: var(--lv-text-primary); }
.select2-container--default .select2-results__option[aria-selected=true] { background: var(--lv-accent-500); color: #fff; }
body[data-theme='dark'] .select2-container--default .select2-selection--single,
body[data-theme='dark'] .select2-container--default .select2-selection--multiple { background: rgba(255,255,255,0.05); }
body[data-theme='dark'] .select2-dropdown { background: var(--lv-bg-surface-1); }

/* Overflow action menu item (rendered by buildActionMenuItem) */
.lv-action-menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 12px; border-radius: 6px;
  font-size: 13px; font-weight: 500; color: var(--lv-text-secondary);
  background: transparent; border: none; cursor: pointer; text-align: left;
  font-family: var(--lv-font-ui);
  transition: background .12s ease, color .12s ease;
}
.lv-action-menu-item:hover { background: var(--lv-bg-surface-2); color: var(--lv-text-primary); }
.lv-action-menu-item.danger { color: #dc2626; }
body[data-theme='dark'] .lv-action-menu-item.danger { color: #f87171; }
.lv-action-menu-item.danger:hover { background: rgba(233, 77, 101, 0.1); }
.lv-action-menu-item .lv-icon { font-size: 14px; }

/* TinyMCE character counter */
.tiny-char-count { font-size: 11px; color: var(--lv-text-tertiary); padding: 4px 8px; text-align: right; }

/* Legacy form aliases for public pages (pay / invoice) */
.card { border-radius: 6px; border: 1px solid var(--lv-border-muted); background: var(--lv-bg-surface-1); }
.form-label { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 600; color: var(--lv-text-secondary); }
.form-input, .form-select, .form-textarea {
  display: block; width: 100%; height: 36px; padding: 0 12px; font-size: 13px;
  color: var(--lv-text-primary); background: var(--lv-bg-surface-2);
  border: 1px solid var(--lv-border-muted); border-radius: 6px; outline: none;
}
.form-textarea { height: auto; min-height: 80px; padding: 8px 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid transparent; text-decoration: none; font-family: var(--lv-font-ui); }
.btn-primary { background: var(--lv-accent-500); border-color: var(--lv-accent-500); color: #fff; }
.btn-primary:hover { background: var(--lv-accent-400); color: #fff; }
.btn-secondary { background: var(--lv-bg-surface-1); border-color: var(--lv-border-muted); color: var(--lv-text-secondary); }
.btn-secondary:hover { background: var(--lv-bg-surface-2); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }

/* Console dashboard: chart rows stack full-width on tablets/phones */
@media (max-width: 1023px) {
  .lv-dash-grid { grid-template-columns: 1fr !important; }
  .lv-dash-grid .lv-col-span-7,
  .lv-dash-grid .lv-col-span-3,
  .lv-dash-grid .lv-col-span-2 { grid-column: auto; }
}

/* ── Project task board (console projects page) ─────────────── */
.taskboard-grid {
  scroll-behavior: smooth;
}
.taskboard-grid select,
.taskboard-grid input[type="date"] {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.taskboard-grid select:focus,
.taskboard-grid input[type="date"]:focus {
  outline: none;
  border-color: var(--lv-accent-500);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Task action icon buttons (task list rows) */
.task-action-btn {
  width: 1.85rem;
  height: 1.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.task-action-btn .lv-icon { font-size: 14px; }

.task-action-success { border-color: #a7f3d0; background: #ecfdf5; color: #047857; }
.task-action-success:hover { border-color: #6ee7b7; background: #d1fae5; }
.task-action-danger { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.task-action-danger:hover { border-color: #fca5a5; background: #fee2e2; }
.task-action-warn { border-color: #fde68a; background: #fffbeb; color: #b45309; }
.task-action-warn:hover { border-color: #fcd34d; background: #fef3c7; }
.task-action-info { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.task-action-info:hover { border-color: #93c5fd; background: #dbeafe; }

body[data-theme='dark'] .task-action-success { border-color: #065f46; background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
body[data-theme='dark'] .task-action-success:hover { border-color: #10b981; background: rgba(16, 185, 129, 0.25); }
body[data-theme='dark'] .task-action-danger { border-color: #7f1d1d; background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
body[data-theme='dark'] .task-action-danger:hover { border-color: #ef4444; background: rgba(239, 68, 68, 0.25); }
body[data-theme='dark'] .task-action-warn { border-color: #78350f; background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
body[data-theme='dark'] .task-action-warn:hover { border-color: #f59e0b; background: rgba(245, 158, 11, 0.25); }
body[data-theme='dark'] .task-action-info { border-color: #1e3a8a; background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
body[data-theme='dark'] .task-action-info:hover { border-color: #3b82f6; background: rgba(59, 130, 246, 0.25); }

/* ── API Connect page (console api-connect page) ───────────── */
.lv-grid-api {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 1280px) {
  .lv-grid-api { grid-template-columns: 2fr 1fr; }
}
