@import url("et-components.css");

/* ============================================================================
   ET01 "Earth" Theme — WaselOne Unified Design Language
   ----------------------------------------------------------------------------
   Source of truth: UI-Design/ET01 (INSPINIA Bootstrap 5 admin template).
   This file centralises the ET01 visual language (tokens, typography, spacing,
   sizing, borders, radii, shadows, icons, animations, interaction states) and
   maps it onto the WaselOne "Earth" brand palette (emerald + corporate navy).

   Loaded LAST (after app-local stylesheets) so it forms the single shared
   design authority for every WaselOne front-end (Platform Admin, Organization
   Portal, ETWhatsApp console and the marketing site).

   Prefixes covered:
     - .et-* / .et-crud-*   reusable component library classes
     - generic Bootstrap-ish primitives (.btn, .card, .table, .form-*, .modal …)
     - .admin-shell / .platform-* / .org-* / .wa-*  navigation shells
   ============================================================================ */

/* ----------------------------------------------------------------------------
   1. Design tokens
   ---------------------------------------------------------------------------- */
:root {
    /* --- ET01 raw palette (verbatim from ET01 app.min.css) --- */
    --et01-blue: #1c84c6;
    --et01-indigo: #6b5eae;
    --et01-pink: #ff679b;
    --et01-red: #ed5565;
    --et01-orange: #fd7e14;
    --et01-yellow: #f8ac59;
    --et01-green: #0acf97;
    --et01-teal: #1ab394;
    --et01-cyan: #23c6c8;
    --et01-gray: #8a969c;
    --et01-gray-100: #f6f7fb;
    --et01-gray-200: #eef2f7;
    --et01-gray-300: #e7e9eb;
    --et01-gray-400: #ced4da;
    --et01-gray-500: #a1a9b1;
    --et01-gray-600: #8a969c;
    --et01-gray-700: #6c757d;
    --et01-gray-800: #343a40;
    --et01-gray-900: #313a46;
    --et01-body-bg: #f1f2f7;
    --et01-body-color: #4c4c5c;
    --et01-border: #e7e9eb;
    --et01-border-soft: #eef2f7;
    --et01-radius: 0.3rem;
    --et01-radius-sm: 0.25rem;
    --et01-radius-lg: 0.4rem;
    --et01-shadow: 0 1px 4px 0 rgba(130, 143, 163, 0.15);
    --et01-shadow-md: 0 4px 12px rgba(130, 143, 163, 0.18);
    --et01-shadow-lg: 0 0.25rem 1rem rgba(76, 76, 92, 0.2);
    --et01-font: "Plus Jakarta Sans", "Open Sans", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --et01-font-arabic: "WaselOne", "Tajawal", "Segoe UI", Tahoma, sans-serif;
    --et01-font-size: 0.9375rem;
    --et01-line-height: 1.55;

    /* --- Earth brand (unchanged brand identity) --- */
    --et-primary: #087A4F;
    --et-primary-hover: #06623F;
    --et-primary-active: #044E32;
    --et-primary-soft: #E8F5E9;
    --et-on-primary: #ffffff;
    --et-navy: #0b192c;
    --et-navy-dark: #060e18;

    /* --- Semantic surfaces / borders / text (aligned to ET01) --- */
    --et-bg: var(--et01-body-bg);
    --et-surface: #ffffff;
    --et-surface-muted: var(--et01-gray-100);
    --et-surface-raised: #ffffff;
    --et-border: var(--et01-border);
    --et-border-strong: var(--et01-gray-400);
    --et-heading: var(--et-navy);
    --et-text: #0F172A;
    --et-text-muted: #334155;
    --et-text-soft: #475569;
    /* Placeholder hint text: clearly lighter than labels and typed values, so empty fields never look filled. */
    --et-placeholder: #9AA5B5;

    /* --- Status (ET01 hues, Earth-tuned) --- */
    --et-success: #0acf97;
    --et-success-soft: #daf8ef;
    --et-warning: #f8ac59;
    --et-warning-soft: #fef3e6;
    --et-danger: #ed5565;
    --et-danger-soft: #fce6e8;
    --et-info: #23c6c8;
    --et-info-soft: #def6f7;

    /* --- Radii (ET01 scale) --- */
    --et-radius-sm: 0.25rem;
    --et-radius-md: 0.3rem;
    --et-radius-lg: 0.4rem;
    --et-radius-xl: 0.6rem;
    --et-radius-pill: 50rem;

    /* --- Elevation (ET01) --- */
    --et-shadow-sm: 0 1px 3px rgba(130, 143, 163, 0.12);
    --et-shadow-md: var(--et01-shadow);
    --et-shadow-lg: var(--et01-shadow-lg);

    /* --- Focus ring (ET01 uses soft teal) --- */
    --et-focus-ring: 0 0 0 0.18rem rgba(16, 185, 129, 0.25);
    --et-focus-outline: 0.15rem solid var(--et-primary);
    --et-ring: var(--et-focus-ring);

    /* --- Motion (ET01 durations) --- */
    --et-duration-fast: 120ms;
    --et-duration: 200ms;
    --et-duration-slow: 320ms;
    --et-ease: cubic-bezier(0.4, 0, 0.2, 1);

    /* --- Typography aliases --- */
    --et-font-family: var(--et01-font);
    --et-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --et-text-xs: 0.78rem;
    --et-text-sm: 0.85rem;
    --et-text-base: var(--et01-font-size);
    --et-text-lg: 1.02rem;
    --et-text-xl: 1.22rem;
    --et-text-2xl: 1.5rem;
    --et-text-3xl: 1.9rem;

    /* --- Spacing grid (ET01 base) --- */
    --et-space-1: 0.25rem;
    --et-space-2: 0.5rem;
    --et-space-3: 0.75rem;
    --et-space-4: 1rem;
    --et-space-5: 1.25rem;
    --et-space-6: 1.5rem;
    --et-space-8: 2rem;
    --et-space-10: 2.5rem;
    --et-space-12: 3rem;

    /* --- Shell metrics aligned to ET01 topbar/sidenav --- */
    --et-shell-topbar-h: 60px;
    --et-shell-sidebar-w: 250px;
    --et-shell-sidebar-collapsed-w: 72px;

    /* --- WaselOne (--rg-*) token bridge so existing app CSS adopts ET01 --- */
    --rg-bg: #f1f5f9;
    --rg-bg-strong: #e2e8f0;
    --rg-surface: #ffffff;
    --rg-surface-muted: #e2e8f0;
    --rg-surface-subtle: #f8fafc;
    --rg-surface-hover: #f1f5f9;
    --rg-surface-raised: #ffffff;
    --rg-border: var(--et-border);
    --rg-border-strong: var(--et-border-strong);
    --rg-heading: var(--et-heading);
    --rg-text: var(--et-text);
    --rg-text-muted: var(--et-text-muted);
    --rg-text-soft: var(--et-text-soft);
    --rg-primary: var(--et-primary);
    --rg-primary-hover: var(--et-primary-hover);
    --rg-primary-active: var(--et-primary-active);
    --rg-primary-soft: var(--et-primary-soft);
    --rg-on-primary: var(--et-on-primary);
    --rg-navy: var(--et-navy);
    --rg-cyan: var(--et-info);
    --rg-success: var(--et-success);
    --rg-success-soft: var(--et-success-soft);
    --rg-warning: var(--et-warning);
    --rg-warning-soft: var(--et-warning-soft);
    --rg-danger: var(--et-danger);
    --rg-danger-soft: var(--et-danger-soft);
    --rg-info: var(--et-info);
    --rg-info-soft: var(--et-info-soft);
    --rg-radius-sm: var(--et-radius-sm);
    --rg-radius-md: var(--et-radius-md);
    --rg-radius-lg: var(--et-radius-lg);
    --rg-radius-xl: var(--et-radius-xl);
    --rg-radius-pill: var(--et-radius-pill);
    --rg-shadow-sm: var(--et-shadow-sm);
    --rg-shadow-md: var(--et-shadow-md);
    --rg-shadow-lg: var(--et-shadow-lg);
    --rg-shadow-overlay: 0 20px 48px -8px rgba(11, 25, 44, 0.32);
    --rg-ring: var(--et-focus-ring);
    --rg-font-sans: var(--et01-font);
    --rg-font-arabic: var(--et01-font-arabic);
    --rg-font-size-xs: var(--et-text-xs);
    --rg-font-size-sm: var(--et-text-sm);
    --rg-font-size-base: var(--et01-font-size);
    --rg-font-size-md: 1rem;
    --rg-font-size-lg: 1.15rem;
    --rg-font-size-xl: 1.35rem;
    --rg-font-size-2xl: 1.6rem;
    --rg-font-size-3xl: 2rem;
    --rg-sidebar-width: var(--et-shell-sidebar-w);
    --rg-sidebar-collapsed-width: var(--et-shell-sidebar-collapsed-w);
    --rg-topbar-height: var(--et-shell-topbar-h);
    --rg-ease: var(--et-ease);
    --rg-fast: 130ms var(--et-ease);
    --rg-slow: 220ms var(--et-ease);

    /* --- ETWhatsApp console (--wa-*) token bridge --- */
    --wa-bg: var(--et-surface-muted);
    --wa-surface: #ffffff;
    --wa-surface-soft: var(--et-surface-muted);
    --wa-border: var(--et-border);
    --wa-border-hover: var(--et-border-strong);
    --wa-text: var(--et-text);
    --wa-text-secondary: var(--et-text-soft);
    --wa-muted: var(--et-text-muted);
    --wa-primary: var(--et-primary);
    --wa-primary-strong: var(--et-primary-active);
    --wa-primary-hover: var(--et-primary-hover);
    --wa-primary-active: var(--et-primary-active);
    --wa-primary-soft: var(--et-primary-soft);
    --wa-primary-border: #a7f3d0;
    --wa-danger: var(--et-danger);
    --wa-danger-soft: var(--et-danger-soft);
    --wa-danger-border: #fecaca;
    --wa-warning: var(--et-warning);
    --wa-warning-soft: var(--et-warning-soft);
    --wa-warning-border: #fde68a;
    --wa-success: var(--et-success);
    --wa-success-soft: var(--et-success-soft);
    --wa-success-border: #a7f3d0;
    --wa-radius: var(--et-radius-md);
    --wa-radius-card: var(--et-radius-lg);
    --wa-radius-modal: var(--et-radius-xl);
    --wa-shadow: var(--et-shadow-sm);
    --wa-shadow-sm: var(--et-shadow-sm);
    --wa-shadow-md: var(--et-shadow-md);
    --wa-shadow-lg: var(--et-shadow-lg);
    --wa-sidebar-width: var(--et-shell-sidebar-w);
    --wa-sidebar-collapsed-width: var(--et-shell-sidebar-collapsed-w);
    --wa-topbar-height: var(--et-shell-topbar-h);

    /* Bootstrap bridge (for pages that still use bootstrap utilities) */
    --bs-primary: var(--et-primary);
    --bs-primary-rgb: 16, 185, 129;
    --bs-border-radius: var(--et-radius-md);
    --bs-body-font-family: var(--et01-font);
    --bs-body-color: var(--et-text);
    --bs-body-bg: var(--et-surface-muted);
}

/* ----------------------------------------------------------------------------
   2. Base + typography
   ---------------------------------------------------------------------------- */
html,
body {
    font-family: var(--et01-font);
    font-size: var(--et01-font-size);
    line-height: var(--et01-line-height);
    color: var(--et-text);
    background-color: var(--et-surface-muted);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

html[dir="rtl"] body,
[dir="rtl"] {
    font-family: var(--et01-font-arabic);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: inherit;
    color: var(--et-heading);
    font-weight: 600;
    line-height: 1.3;
    margin-block: 0 0.5rem;
}

h1, .h1 { font-size: 1.7rem; }
h2, .h2 { font-size: 1.42rem; }
h3, .h3 { font-size: 1.3rem; }
h4, .h4 { font-size: 1.18rem; }
h5, .h5 { font-size: 1.05rem; }
h6, .h6 { font-size: 0.95rem; }

a {
    color: var(--et-primary-hover);
    text-decoration: none;
    transition: color var(--et-duration-fast) var(--et-ease);
}

a:hover { color: var(--et-primary-active); }

small, .text-muted, .text-secondary { color: var(--et-text-muted) !important; }

code, kbd, pre, .et-mono {
    font-family: var(--et-font-mono);
    font-size: 0.82em;
    color: #e83e8c;
}

hr { border: 0; border-top: 1px solid var(--et-border); margin: 1rem 0; }

::selection { background: var(--et-primary-soft); color: var(--et-primary-active); }

/* Consistent focus visibility (WCAG 2.2 AA) */
:focus-visible {
    outline: 0.15rem solid var(--et-primary);
    outline-offset: 2px;
}

/* Subtle ET01-style scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--et01-gray-400) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--et01-gray-400); border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: var(--et01-gray-500); }

/* ----------------------------------------------------------------------------
   3. Buttons  (.btn , .et-btn , .et-crud-btn)
   ---------------------------------------------------------------------------- */
.btn,
.et-btn,
.et-crud-btn,
button.et-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-family: inherit;
    font-size: var(--et01-font-size);
    font-weight: 600;
    line-height: 1.4;
    padding: 0.42rem 0.85rem;
    border: 1px solid transparent;
    border-radius: var(--et-radius-md);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    transition: color var(--et-duration-fast) var(--et-ease),
                background-color var(--et-duration-fast) var(--et-ease),
                border-color var(--et-duration-fast) var(--et-ease),
                box-shadow var(--et-duration-fast) var(--et-ease),
                transform var(--et-duration-fast) var(--et-ease);
}

.btn svg, .et-btn svg, .et-crud-btn svg { flex: 0 0 auto; }

.btn-sm, .et-btn-sm, .et-crud-btn.btn-sm { padding: 0.28rem 0.6rem; font-size: 0.75rem; border-radius: var(--et-radius-sm); }
.btn-lg, .et-btn-lg { padding: 0.6rem 1.1rem; font-size: 0.9rem; border-radius: var(--et-radius-lg); }

.btn:focus-visible,
.et-btn:focus-visible,
.et-crud-btn:focus-visible {
    outline: none;
    box-shadow: var(--et-focus-ring);
}

.btn:active, .et-btn:active, .et-crud-btn:active { transform: translateY(1px); }

/* Primary */
.btn-primary, .et-btn-primary, .et-crud-btn-primary,
.btn.btn-system, .btn-dark {
    background: var(--et-primary);
    border-color: var(--et-primary);
    color: var(--et-on-primary);
}
.btn-primary:hover, .et-btn-primary:hover, .et-crud-btn-primary:hover,
.btn.btn-system:hover, .btn-dark:hover {
    background: var(--et-primary-hover);
    border-color: var(--et-primary-hover);
    color: var(--et-on-primary);
}
.btn-primary:active, .et-btn-primary:active,
.btn.btn-system:active, .btn-dark:active {
    background: var(--et-primary-active);
    border-color: var(--et-primary-active);
}

/* Secondary / soft */
.btn-secondary, .et-btn-secondary, .btn-outline-dark {
    background: var(--et-surface-muted);
    border-color: var(--et-border);
    color: var(--et-heading);
}
.btn-secondary:hover, .et-btn-secondary:hover, .btn-outline-dark:hover {
    background: #e9edf2;
    border-color: var(--et-border-strong);
    color: var(--et-heading);
}

/* Outline */
.btn-outline-primary, .et-btn-outline {
    background: transparent;
    border-color: var(--et-primary);
    color: var(--et-primary-hover);
}
.btn-outline-primary:hover, .et-btn-outline:hover {
    background: var(--et-primary-soft);
    color: var(--et-primary-active);
}

/* Danger */
.btn-danger, .et-btn-danger, .et-crud-btn-danger, .btn-outline-danger {
    background: var(--et-danger);
    border-color: var(--et-danger);
    color: #fff;
}
.btn-danger:hover, .et-btn-danger:hover, .et-crud-btn-danger:hover {
    background: #dc2638;
    border-color: #dc2638;
    color: #fff;
}
.btn-outline-danger { background: transparent; color: var(--et-danger); }
.btn-outline-danger:hover { background: var(--et-danger); color: #fff; }

/* Ghost / muted / link */
.et-btn-ghost, .et-crud-btn-muted, .btn-light, .btn-link {
    background: transparent;
    border-color: transparent;
    color: var(--et-text-muted);
}
.et-btn-ghost:hover, .et-crud-btn-muted:hover, .btn-light:hover, .btn-link:hover {
    background: var(--et-surface-muted);
    color: var(--et-heading);
}
.btn-link { color: var(--et-primary-hover); padding-inline: 0.35rem; }

/* Disabled + loading */
.btn:disabled, .btn.disabled, .et-btn:disabled, .et-crud-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}
.et-btn-busy, .et-crud-btn.is-loading { cursor: progress; }
.btn-icon, .et-crud-icon-btn {
    width: 34px; height: 34px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--et-radius-md);
    border: 1px solid var(--et-border);
    background: var(--et-surface);
    color: var(--et-text-muted);
}
.btn-icon:hover, .et-crud-icon-btn:hover { background: var(--et-surface-muted); color: var(--et-heading); }

.btn-group { display: inline-flex; }
.btn-group > .btn { border-radius: 0; }
.btn-group > .btn:first-child { border-start-start-radius: var(--et-radius-md); border-end-start-radius: var(--et-radius-md); }
.btn-group > .btn:last-child { border-start-end-radius: var(--et-radius-md); border-end-end-radius: var(--et-radius-md); }

/* ----------------------------------------------------------------------------
   4. Cards / panels / widgets
   ---------------------------------------------------------------------------- */
.card, .et-card, .panel, .info-card, .stat-card,
.hero-panel, .et-crud-grid-toolbar, .preview-panel {
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-lg);
    box-shadow: var(--et-shadow-md);
}

.card { display: flex; flex-direction: column; }
.card-header, .et-card-header {
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--et-border);
    background: transparent;
    font-weight: 600;
    color: var(--et-heading);
    border-start-start-radius: var(--et-radius-lg);
    border-start-end-radius: var(--et-radius-lg);
}
.card-body, .et-card-body { padding: 1.1rem; }
.card-footer, .et-card-footer {
    padding: 0.85rem 1.1rem;
    border-top: 1px solid var(--et-border);
    background: transparent;
}
.card-title { font-size: var(--et-text-lg); font-weight: 600; margin: 0; color: var(--et-heading); }

.stat-card { display: flex; align-items: center; gap: 0.85rem; padding: 1rem 1.1rem; }
.stat-card .stat-icon, .stat-icon {
    width: 44px; height: 44px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--et-radius-md);
    background: var(--et-primary-soft);
    color: var(--et-primary-active);
}
.stat-card .stat-label { display: block; font-size: var(--et-text-sm); color: var(--et-text-muted); }
.stat-card .stat-value { display: block; font-size: 1.55rem; font-weight: 700; color: var(--et-heading); line-height: 1.2; }
.stat-card .stat-sub { display: block; font-size: var(--et-text-xs); color: var(--et-text-soft); }
.stat-card.tone-warning .stat-icon { background: var(--et-warning-soft); color: #b3762b; }
.stat-card.tone-danger .stat-icon { background: var(--et-danger-soft); color: #c94856; }
.stat-card.tone-success .stat-icon { background: var(--et-success-soft); color: #09b080; }
.stat-card.tone-info .stat-icon { background: var(--et-info-soft); color: #1ea8aa; }
.stat-card.tone-neutral .stat-icon { background: var(--et-surface-muted); color: var(--et-text-muted); }

/* ----------------------------------------------------------------------------
   5. Page headers
   ---------------------------------------------------------------------------- */
.page-header, .et-crud-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--et-border);
}
.page-header h1, .et-crud-page-header h1 {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 600;
    color: var(--et-heading);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.page-subtitle, .et-crud-page-header .page-subtitle { margin: 0.25rem 0 0; color: var(--et-text-muted); font-size: var(--et-text-base); }
.page-actions, .et-crud-page-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.page-badge {
    display: inline-flex; align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: var(--et-radius-pill);
    background: var(--et-primary-soft);
    color: var(--et-primary-active);
    font-size: var(--et-text-xs);
    font-weight: 700;
}

/* ----------------------------------------------------------------------------
   6. Forms and controls
   ---------------------------------------------------------------------------- */
.form-label, label.form-label, .et-crud-field label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: var(--et-text-sm);
    font-weight: 600;
    color: var(--et-heading);
}
.form-control, .form-select, .et-crud-field input, .et-crud-field textarea,
.et-crud-field select, .et-input, .et-select {
    display: block;
    width: 100%;
    padding: 0.42rem 0.65rem;
    font-family: inherit;
    font-size: var(--et01-font-size);
    line-height: 1.5;
    color: var(--et-text);
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-md);
    transition: border-color var(--et-duration-fast) var(--et-ease),
                box-shadow var(--et-duration-fast) var(--et-ease);
}
.form-control:focus, .form-select:focus,
.et-crud-field input:focus, .et-crud-field textarea:focus, .et-crud-field select:focus {
    border-color: var(--et-primary);
    outline: none;
    box-shadow: var(--et-focus-ring);
}
.form-control::placeholder { color: var(--et-placeholder); opacity: 1; }
.form-control:disabled, .form-control[readonly] {
    background: var(--et-surface-muted);
    color: var(--et-text-muted);
    cursor: not-allowed;
}
textarea.form-control { min-height: 96px; resize: vertical; }

.form-check { display: flex; align-items: center; gap: 0.5rem; padding-inline-start: 0; }
.form-check-input {
    width: 1rem; height: 1rem;
    margin: 0;
    border: 1px solid var(--et-border-strong);
    border-radius: var(--et-radius-sm);
    accent-color: var(--et-primary);
}
.form-check-input:checked { background-color: var(--et-primary); border-color: var(--et-primary); }
.form-check-input:focus { box-shadow: var(--et-focus-ring); }

/* Switch */
.form-switch .form-check-input,
.et-switch {
    width: 2.1rem; height: 1.15rem;
    border-radius: var(--et-radius-pill);
    appearance: none;
    background: var(--et-border-strong);
    position: relative;
    cursor: pointer;
    transition: background var(--et-duration-fast) var(--et-ease);
}
.form-switch .form-check-input:checked, .et-switch:checked { background: var(--et-primary); }
.form-switch .form-check-input::after,
.et-switch::after {
    content: "";
    position: absolute;
    top: 2px; inset-inline-start: 2px;
    width: 0.85rem; height: 0.85rem;
    border-radius: 50%;
    background: #fff;
    transition: transform var(--et-duration-fast) var(--et-ease);
}
.form-switch .form-check-input:checked::after, .et-switch:checked::after { transform: translateX(0.9rem); }
[dir="rtl"] .form-switch .form-check-input:checked::after,
[dir="rtl"] .et-switch:checked::after { transform: translateX(-0.9rem); }

/* Validation states (ET01 subtle) */
.form-control.is-invalid, .is-invalid, .et-crud-field .invalid {
    border-color: var(--et-danger);
}
.is-invalid:focus { box-shadow: 0 0 0 0.18rem rgba(237, 85, 101, 0.22); }
.is-valid { border-color: var(--et-success); }
.validation-message, .invalid-feedback, .et-crud-required {
    display: block;
    margin-top: 0.25rem;
    font-size: var(--et-text-xs);
    color: var(--et-danger);
}
.et-crud-field { display: grid; gap: 0.25rem; margin-bottom: 0.85rem; }

/* Input groups */
.input-group { display: flex; }
.input-group > .form-control { border-radius: 0; }
.input-group > .form-control:first-child { border-start-start-radius: var(--et-radius-md); border-end-start-radius: var(--et-radius-md); }
.input-group > .form-control:last-child { border-start-end-radius: var(--et-radius-md); border-end-end-radius: var(--et-radius-md); }
.input-group-text {
    display: flex; align-items: center;
    padding: 0.42rem 0.65rem;
    background: var(--et-surface-muted);
    border: 1px solid var(--et-border);
    color: var(--et-text-muted);
}

/* ----------------------------------------------------------------------------
   7. Tables / data grids
   ---------------------------------------------------------------------------- */
.table, .et-crud-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--et01-font-size);
    color: var(--et-text);
}
.table thead th, .et-crud-grid thead th {
    text-align: start;
    font-weight: 600;
    font-size: var(--et-text-sm);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--et-text-muted);
    background: var(--et-surface-muted);
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--et-border);
    white-space: nowrap;
}
.table tbody td, .et-crud-grid tbody td {
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--et-border-soft);
    vertical-align: middle;
}
.table tbody tr:hover, .et-crud-grid tbody tr:hover { background: var(--et-surface-muted); }
.table.table-striped tbody tr:nth-of-type(odd) { background: var(--et-surface-muted); }
.table-wrap, .et-crud-grid-wrap { overflow-x: auto; border-radius: var(--et-radius-lg); border: 1px solid var(--et-border); }
.table-wrap .table, .et-crud-grid-wrap .et-crud-grid { border-collapse: collapse; }
.et-crud-grid tbody td .et-crud-cell-value { color: var(--et-text); }
.et-crud-sort-btn { background: none; border: 0; color: inherit; font: inherit; padding: 0; cursor: pointer; }

/* Toolbar / filters above grids */
.et-crud-toolbar, .et-crud-grid-toolbar, .et-crud-filter-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.65rem 0.85rem;
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-lg);
    margin-bottom: 0.75rem;
    box-shadow: var(--et-shadow-sm);
}
.et-crud-search, .et-crud-grid-search, .et-crud-page-size { max-width: 260px; }

/* Pagination */
.et-crud-pager, .pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.6rem 0.2rem 0;
}
.et-crud-pager-controls { display: inline-flex; gap: 0.25rem; }
.et-crud-pager-page, .page-link {
    min-width: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.28rem 0.5rem;
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-sm);
    background: var(--et-surface);
    color: var(--et-text);
    font-size: var(--et-text-sm);
    cursor: pointer;
}
.et-crud-pager-page.is-active, .pagination .active .page-link,
.et-crud-pager-page[aria-current="page"] {
    background: var(--et-primary);
    border-color: var(--et-primary);
    color: #fff;
}
.et-crud-pager-page:hover:not(.is-active), .page-link:hover { background: var(--et-surface-muted); }

/* ----------------------------------------------------------------------------
   8. Badges / status indicators / chips
   ---------------------------------------------------------------------------- */
.badge, .et-badge, .et-crud-status, .status-pill, .nav-badge-pill, .version-chip, .env-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.22rem 0.5rem;
    font-size: var(--et-text-xs);
    font-weight: 600;
    line-height: 1;
    border-radius: var(--et-radius-pill);
    border: 1px solid transparent;
    white-space: nowrap;
}
.et-badge-sm { font-size: 0.66rem; padding: 0.14rem 0.4rem; }
.et-badge-md { font-size: var(--et-text-xs); }
.et-badge-primary, .badge-primary, .et-crud-status-default { background: var(--et-primary-soft); color: var(--et-primary-active); }
.et-badge-success, .badge-success, .et-crud-status-success { background: var(--et-success-soft); color: #09b080; }
.et-badge-warning, .badge-warning, .et-crud-status-warning { background: var(--et-warning-soft); color: #b3762b; }
.et-badge-danger, .badge-danger, .et-crud-status-danger { background: var(--et-danger-soft); color: #c94856; }
.et-badge-info, .badge-info, .et-crud-status-info { background: var(--et-info-soft); color: #1ea8aa; }
.et-badge-neutral, .badge-secondary, .et-crud-status-neutral { background: var(--et-surface-muted); color: var(--et-text-muted); }
.et-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ----------------------------------------------------------------------------
   9. Alerts / notifications / toasts
   ---------------------------------------------------------------------------- */
.alert, .et-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem 0.95rem;
    border: 1px solid var(--et-border);
    border-inline-start-width: 3px;
    border-radius: var(--et-radius-md);
    background: var(--et-surface);
    color: var(--et-text);
    font-size: var(--et01-font-size);
    margin-bottom: 0.85rem;
}
.et-alert-content { flex: 1; min-width: 0; }
.et-alert-title { font-weight: 600; color: var(--et-heading); display: block; }
.et-alert-message { color: var(--et-text-muted); }
.et-alert-close { background: none; border: 0; color: var(--et-text-soft); cursor: pointer; }
.et-alert-info { background: var(--et-info-soft); border-color: var(--et-info); }
.et-alert-success { background: var(--et-success-soft); border-color: var(--et-success); }
.et-alert-warning { background: var(--et-warning-soft); border-color: var(--et-warning); }
.et-alert-error, .et-alert-danger { background: var(--et-danger-soft); border-color: var(--et-danger); }

.toast, .et-toast, .wa-toast {
    min-width: 260px;
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-lg);
    box-shadow: var(--et-shadow-lg);
    padding: 0.75rem 0.95rem;
}

/* ----------------------------------------------------------------------------
   10. Modals — ET01 Side Modal pattern
   ---------------------------------------------------------------------------- */
.et-modal-backdrop, .modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    padding: 0; /* remove app backdrop padding so the panel fits 100% */
    margin: 0;
    background: rgba(11, 25, 44, 0.45);
    backdrop-filter: blur(1px);
    display: flex;
    align-items: stretch;
    justify-content: flex-end; /* side modal: slides in from the inline end */
    animation: et01-fade-in var(--et-duration) var(--et-ease);
}
[dir="rtl"] .et-modal-backdrop,
[dir="rtl"] .modal-backdrop { justify-content: flex-start; }

/* et-crud confirm modal shell = centered dialog host */
.et-crud-modal-shell {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.et-crud-modal-backdrop { position: absolute; inset: 0; background: rgba(11, 25, 44, 0.45); animation: et01-fade-in var(--et-duration) var(--et-ease); }
.et-crud-modal-shell > .et-crud-confirm { position: relative; z-index: 1; }

.et-modal, .modal-card {
    background: var(--et-surface);
    border: 0;
    border-inline-start: 1px solid var(--et-border);
    border-radius: 0;
    box-shadow: var(--et-shadow-lg);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: min(440px, 100%);
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    min-height: 100%;
    margin: 0;
    animation: et01-slide-in-end var(--et-duration-slow) var(--et-ease);
}
/* Bootstrap-native dialogs kept intact (only re-surfaced with ET01 skin) */
.modal-dialog { margin: 1.75rem auto; }
.modal-content { border: 1px solid var(--et-border); border-radius: var(--et-radius-xl); box-shadow: var(--et-shadow-lg); }
.et-modal-sm { width: min(360px, 100%); }
.et-modal-md { width: min(440px, 100%); }
.et-modal-lg { width: min(600px, 100%); }
.et-modal-xl { width: min(760px, 100%); }
.modal-card.sm { width: min(360px, 100%); }
.modal-card.lg { width: min(600px, 100%); }
.modal-card.xl { width: min(760px, 100%); }
[dir="rtl"] .et-modal, [dir="rtl"] .modal-card { animation-name: et01-slide-in-start; }

@keyframes et01-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes et01-slide-in-end { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes et01-slide-in-start { from { transform: translateX(-100%); } to { transform: translateX(0); } }

.et-modal-header, .modal-head, .modal-header, .et-crud-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--et-border);
}
.et-modal-title, .modal-title, .et-crud-modal-title {
    margin: 0;
    font-size: var(--et-text-xl);
    font-weight: 600;
    color: var(--et-heading);
}
.modal-subtitle, .modal-head .modal-subtitle { color: var(--et-text-muted); font-size: var(--et-text-sm); }
.et-modal-close, .modal-close, .btn-close {
    width: 30px; height: 30px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-md);
    background: var(--et-surface-muted);
    color: var(--et-text-muted);
    cursor: pointer;
    transition: background var(--et-duration-fast) var(--et-ease), color var(--et-duration-fast) var(--et-ease);
}
.et-modal-close:hover, .modal-close:hover, .btn-close:hover { background: #e9edf2; color: var(--et-heading); }
.et-modal-body, .modal-body, .et-crud-drawer-body { flex: 1; overflow-y: auto; padding: 1.1rem; }
.modal-body.flush-body { padding: 0; }
.et-modal-footer, .modal-foot, .modal-footer, .et-crud-confirm-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.9rem 1.1rem;
    border-top: 1px solid var(--et-border);
}
.et-crud-confirm { background: var(--et-surface); padding: 1.25rem; border-radius: var(--et-radius-xl); box-shadow: var(--et-shadow-lg); width: min(420px, 100%); }

/* Legacy centered modal opt-in */
.modal-content.et-modal-centered { width: min(520px, 100%); height: auto; border-radius: var(--et-radius-xl); border: 1px solid var(--et-border); }

@media (max-width: 640px) {
    .et-modal, .modal-card, .et-crud-modal-shell, .modal-content { width: 100vw; border-inline-start: 0; }
}

/* ----------------------------------------------------------------------------
   11. Drawers / side panels / popovers  (kept consistent with side modal)
   ---------------------------------------------------------------------------- */
.et-drawer-backdrop, .drawer-backdrop, .et-crud-drawer-backdrop, .scrim {
    position: fixed;
    inset: 0;
    z-index: 1049;
    background: rgba(11, 25, 44, 0.42);
    animation: et01-fade-in var(--et-duration) var(--et-ease);
}
.et-drawer, .drawer, .et-crud-drawer, .user-dropdown-popover {
    background: var(--et-surface);
    box-shadow: var(--et-shadow-lg);
    border: 0;
}
.et-drawer, .drawer, .et-crud-drawer {
    position: fixed;
    inset-block: 0;
    inset-inline-end: 0;
    width: min(440px, 100vw);
    height: 100%;
    box-sizing: border-box;
    margin: 0;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    border-inline-start: 1px solid var(--et-border);
    animation: et01-slide-in-end var(--et-duration-slow) var(--et-ease);
}
.drawer.wide, .et-drawer.wide { width: min(560px, 100vw); }
[dir="rtl"] .et-drawer, [dir="rtl"] .drawer, [dir="rtl"] .et-crud-drawer { animation-name: et01-slide-in-start; }
.et-drawer-backdrop { display: flex; justify-content: flex-end; }
[dir="rtl"] .et-drawer-backdrop { justify-content: flex-start; }

/* et-crud drawer shell = fixed overlay host; panel sits at inline end */
.et-crud-drawer-shell {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    justify-content: flex-end;
}
[dir="rtl"] .et-crud-drawer-shell { justify-content: flex-start; }
.et-crud-drawer-backdrop { position: absolute; inset: 0; z-index: 0; }
.et-crud-drawer-shell > .et-crud-drawer { position: relative; z-index: 1; }

.et-drawer-header, .drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--et-border); }
.et-crud-drawer > header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--et-border); }
.et-crud-drawer > header h2 { margin: 0; font-size: var(--et-text-xl); font-weight: 600; color: var(--et-heading); }
.et-drawer-title, .drawer-title { margin: 0; font-size: var(--et-text-xl); font-weight: 600; color: var(--et-heading); }
.drawer-sub, .et-drawer-sub { color: var(--et-text-muted); font-size: var(--et-text-sm); margin-top: 0.15rem; }
.et-drawer-body, .drawer-body { flex: 1; overflow-y: auto; padding: 1.1rem; }
.drawer-foot, .et-crud-drawer > footer { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; padding: 0.9rem 1.1rem; border-top: 1px solid var(--et-border); }

.popover, .et-popover {
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-lg);
    box-shadow: var(--et-shadow-lg);
    padding: 0.6rem 0.75rem;
    font-size: var(--et01-font-size);
}

/* ----------------------------------------------------------------------------
   12. Dropdown menus (ET01 top-bar / user menu)
   ---------------------------------------------------------------------------- */
.dropdown-menu, .et-dropdown-menu {
    min-width: 190px;
    padding: 0.35rem;
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-lg);
    box-shadow: var(--et-shadow-lg);
    font-size: var(--et01-font-size);
    animation: et01-pop var(--et-duration-fast) var(--et-ease);
}
@keyframes et01-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dropdown-item, .et-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.42rem 0.6rem;
    border-radius: var(--et-radius-md);
    color: var(--et-text);
    font-weight: 500;
    background: none;
    border: 0;
    text-align: start;
    cursor: pointer;
    transition: background var(--et-duration-fast) var(--et-ease), color var(--et-duration-fast) var(--et-ease);
}
.dropdown-item:hover, .et-dropdown-item:hover { background: var(--et-surface-muted); color: var(--et-heading); }
.dropdown-item.active, .dropdown-item:active { background: var(--et-primary-soft); color: var(--et-primary-active); }
.dropdown-item.danger { color: var(--et-danger); }
.dropdown-item.danger:hover { background: var(--et-danger-soft); }
.dropdown-divider, .et-dropdown-divider { height: 1px; margin: 0.3rem 0; background: var(--et-border); }

/* ----------------------------------------------------------------------------
   13. Tabs / accordion
   ---------------------------------------------------------------------------- */
.tab-container {
    display: block !important;
    border-bottom: none !important;
}
.et-tabs, .nav-tabs, .tabs, .tabs-bar, .et-tab-list, .family-tabs, .node-popup-tabs, [role="tablist"] {
    display: flex;
    gap: 6px;
    padding: 6px 8px 0 8px;
    background: #E2E8F0;
    border: 1px solid #CBD5E1;
    border-bottom: 2px solid var(--et-border, #CBD5E1);
    border-radius: 8px 8px 0 0;
    flex-wrap: wrap;
    align-items: flex-end;
}
.et-tab, .et-tab-header, .nav-tabs .nav-link, .nav-pills .nav-link, .tab, .family-tab-btn, .node-popup-tab, [role="tab"] {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.52rem 1rem;
    border: 1px solid #94A3B8 !important;
    border-bottom: none !important;
    border-radius: 6px 6px 0 0 !important;
    background: #CBD5E1 !important;
    color: #1E293B !important;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background var(--et-duration-fast) var(--et-ease), color var(--et-duration-fast) var(--et-ease), border-color var(--et-duration-fast) var(--et-ease);
}
.et-tab:hover, .et-tab-header:hover, .nav-tabs .nav-link:hover, .nav-pills .nav-link:hover, .tab:hover, .family-tab-btn:hover, .node-popup-tab:hover, [role="tab"]:hover {
    background: #B8C4D4 !important;
    color: #0F172A !important;
}
.et-tab-active, .et-tab-header.et-tab-active, .nav-tabs .nav-link.active, .nav-pills .nav-link.active, .tab.active, .family-tab-btn.active, .node-popup-tab.active, [role="tab"][aria-selected="true"], [role="tab"].active {
    background: #FFFFFF !important;
    color: var(--et-primary, #087A4F) !important;
    border-color: var(--et-primary, #087A4F) !important;
    border-bottom: 3px solid var(--et-primary, #087A4F) !important;
    font-weight: 700 !important;
    box-shadow: 0 -2px 6px rgba(8, 122, 79, 0.08);
}
.et-tab-body, .tab-content { padding-top: 1rem; }

.accordion-item { border: 1px solid var(--et-border); border-radius: var(--et-radius-lg); overflow: hidden; margin-bottom: 0.5rem; background: var(--et-surface); }
.accordion-button {
    width: 100%; text-align: start;
    padding: 0.8rem 1rem;
    background: var(--et-surface);
    border: 0;
    color: var(--et-heading);
    font-weight: 600;
    cursor: pointer;
}
.accordion-button:not(.collapsed) { background: var(--et-primary-soft); color: var(--et-primary-active); }
.accordion-body { padding: 0.9rem 1rem; border-top: 1px solid var(--et-border); }

/* ----------------------------------------------------------------------------
   14. Breadcrumbs
   ---------------------------------------------------------------------------- */
.et-breadcrumbs, .breadcrumbs, .breadcrumb, .wa-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
    font-size: var(--et-text-sm);
    color: var(--et-text-muted);
    margin: 0;
    padding: 0;
    background: none;
}
.et-breadcrumb-list, .et-breadcrumbs ol { display: flex; align-items: center; gap: 0.3rem; list-style: none; margin: 0; padding: 0; }
.et-breadcrumb-item, .breadcrumb-item, .breadcrumbs a { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--et-text-muted); }
.et-breadcrumb-item a:hover, .breadcrumbs a:hover { color: var(--et-primary-hover); }
.et-breadcrumb-current span, .breadcrumb-item.active, .breadcrumbs .current, [aria-current="page"] { color: var(--et-heading); font-weight: 600; }
.et-breadcrumb-separator, .breadcrumb-separator, .separator { color: var(--et-text-soft); margin-inline: 0.1rem; }

/* ----------------------------------------------------------------------------
   15. Skeletons / loaders / progress / spinners
   ---------------------------------------------------------------------------- */
.et-skeleton, .wa-skeleton, .skeleton {
    position: relative;
    overflow: hidden;
    background: var(--et-surface-muted);
    border-radius: var(--et-radius-md);
}
.et-skeleton::after, .skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.65), transparent);
    animation: et01-shimmer 1.6s infinite;
}
@keyframes et01-shimmer { 100% { transform: translateX(100%); } }
.et-crud-skeleton-row, .et-crud-skeleton-cell { background: var(--et-surface-muted); border-radius: var(--et-radius-sm); }

.spinner, .et-spinner, .et-crud-spinner, .spinner-border {
    width: 1.2rem; height: 1.2rem;
    border: 2px solid var(--et-border-strong);
    border-top-color: var(--et-primary);
    border-radius: 50%;
    animation: et01-spin 0.7s linear infinite;
}
@keyframes et01-spin { to { transform: rotate(360deg); } }
.et-spinner { display: inline-block; }
.et-crud-loading-overlay, .et-loading-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(1px);
    z-index: 5;
}
.et-crud-loading-host, .et-loading-host { position: relative; }

.et-progress-track, .progress {
    height: 0.45rem;
    background: var(--et-surface-muted);
    border-radius: var(--et-radius-pill);
    overflow: hidden;
}
.et-progress-fill, .progress-bar { height: 100%; background: var(--et-primary); border-radius: inherit; transition: width var(--et-duration) var(--et-ease); }
.et-progress-indeterminate .et-progress-fill { width: 40%; animation: et01-indeterminate 1.2s infinite; }
@keyframes et01-indeterminate { 0% { margin-inline-start: -40%; } 100% { margin-inline-start: 100%; } }

/* ----------------------------------------------------------------------------
   16. Tooltips
   ---------------------------------------------------------------------------- */
.et-tooltip, .tooltip {
    position: absolute;
    z-index: 1080;
    max-width: 260px;
    padding: 0.35rem 0.55rem;
    font-size: var(--et-text-xs);
    color: #fff;
    background: var(--et-navy);
    border-radius: var(--et-radius-sm);
    box-shadow: var(--et-shadow-md);
    pointer-events: none;
}

/* ----------------------------------------------------------------------------
   17. Empty / error / offline states
   ---------------------------------------------------------------------------- */
.state, .et-empty-state, .et-crud-empty, .et-error-state, .et-offline-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    text-align: center;
    padding: 2.4rem 1.25rem;
    color: var(--et-text-muted);
}
.state.compact { padding: 1.2rem 0.75rem; }
.state-icon, .et-crud-empty-icon, .et-error-icon, .et-offline-icon {
    width: 52px; height: 52px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--et-primary-soft);
    color: var(--et-primary-active);
}
.state-title, .et-error-title, .et-offline-title { font-weight: 600; font-size: var(--et-text-lg); color: var(--et-heading); }
.state-message, .et-error-message, .et-offline-message { font-size: var(--et-text-base); }

/* ----------------------------------------------------------------------------
   18. Navigation shell — Platform Admin / Organization Portal / ET01 mapping
   ---------------------------------------------------------------------------- */
.admin-shell { display: flex; min-height: 100vh; background: var(--et-surface-muted); }

.sidebar, .platform-sidebar, .org-sidebar {
    width: var(--et-shell-sidebar-w);
    flex: 0 0 var(--et-shell-sidebar-w);
    background: var(--et-navy);
    color: var(--et01-gray-400);
    display: flex;
    flex-direction: column;
    transition: width var(--et-duration) var(--et-ease), flex-basis var(--et-duration) var(--et-ease);
}
.admin-shell.sidebar-collapsed .sidebar { width: var(--et-shell-sidebar-collapsed-w); flex-basis: var(--et-shell-sidebar-collapsed-w); }

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: var(--et-shell-topbar-h);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: #fff; text-decoration: none; }
.brand-mark-wrap {
    width: 34px; height: 34px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--et-radius-md);
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.brand-logo-img { width: 100%; height: 100%; object-fit: contain; }
.brand-name { font-size: 1rem; font-weight: 700; color: #fff; line-height: 1.1; }
.brand-highlight { color: var(--et-primary); }
.brand-sub { display: block; font-size: var(--et-text-xs); color: var(--et01-gray-500); }

.nav-scroll { flex: 1; overflow-y: auto; padding: 0.75rem 0.6rem; }
.nav-group { margin-bottom: 0.9rem; }
.nav-group-label {
    padding: 0.3rem 0.65rem;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--et01-gray-600);
}
.nav-item, .side-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.65rem;
    margin: 0.1rem 0;
    border-radius: var(--et-radius-md);
    color: var(--et01-gray-400);
    font-size: var(--et01-font-size);
    font-weight: 500;
    text-decoration: none;
    transition: background var(--et-duration-fast) var(--et-ease), color var(--et-duration-fast) var(--et-ease);
}
.nav-item:hover, .side-nav-link:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-item.active, .nav-item[aria-current="page"], .side-nav-link.active {
    background: var(--et-primary);
    color: #fff;
}
.nav-icon { display: inline-flex; flex: 0 0 auto; }
.nav-text, .menu-text { flex: 1; min-width: 0; }
.nav-badge-pill { background: var(--et-warning); color: #3a2a12; }

/* --- ET01 side navigation (titles, circular menu icons, collapsible sub-menus) --- */
.nav-scroll .side-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.nav-scroll .side-nav .sub-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.15rem; }

.side-nav-title {
    padding: 0.85rem 0.65rem 0.35rem;
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--et01-gray-600);
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
}
.side-nav-title:first-child { padding-top: 0.25rem; }

.side-nav .side-nav-item { padding: 0; }
.side-nav-link {
    width: 100%;
    box-sizing: border-box;
    text-align: start;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-family: inherit;
}
.side-nav-toggle { justify-content: flex-start; }

.side-nav .side-nav-item .menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    transition: background var(--et-duration-fast) var(--et-ease);
}
.side-nav .side-nav-item .side-nav-link:hover .menu-icon { background: rgba(255, 255, 255, 0.16); }
.side-nav .side-nav-item .side-nav-link.active .menu-icon,
.side-nav-item.active > .side-nav-link .menu-icon { background: rgba(255, 255, 255, 0.22); color: #fff; }

.side-nav .menu-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.menu-arrow {
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    margin-inline-start: auto;
    border-right: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: rotate(-45deg);
    opacity: 0.65;
    transition: transform var(--et-duration) var(--et-ease);
}
.side-nav-item.active > .side-nav-link .menu-arrow { transform: rotate(45deg); opacity: 1; }
[dir="rtl"] .menu-arrow { transform: rotate(135deg); }
[dir="rtl"] .side-nav-item.active > .side-nav-link .menu-arrow { transform: rotate(45deg); }

.nav-collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--et-duration) var(--et-ease); }
.nav-collapse > .sub-menu { overflow: hidden; min-height: 0; }
.nav-collapse.open { grid-template-rows: 1fr; }

.side-nav .sub-menu { padding-inline-start: 0.4rem; margin-top: 0.1rem; }
.side-nav .sub-menu .side-nav-link {
    padding-inline-start: 2.1rem;
    font-size: var(--et-text-sm);
    font-weight: 500;
    color: var(--et01-gray-500);
}
.side-nav .sub-menu .side-nav-link:hover { color: #fff; }
.side-nav .sub-menu .side-nav-link.active { background: var(--et-primary); color: #fff; }

.side-nav-badge {
    flex: 0 0 auto;
    margin-inline-start: auto;
    padding: 0.05rem 0.4rem;
    border-radius: var(--et-radius-pill);
    background: var(--et-warning);
    color: #3a2a12;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.4;
}

/* Collapsed sidebar: icons only */
.admin-shell.sidebar-collapsed .side-nav-title,
.admin-shell.sidebar-collapsed .side-nav .menu-text,
.admin-shell.sidebar-collapsed .menu-arrow,
.admin-shell.sidebar-collapsed .side-nav-badge { display: none; }
.admin-shell.sidebar-collapsed .side-nav .side-nav-link { justify-content: center; padding-inline: 0; }
.admin-shell.sidebar-collapsed .side-nav .nav-collapse { display: none; }

.sidebar-foot {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: var(--et-text-xs);
    color: var(--et01-gray-500);
}
.version-chip { background: rgba(255, 255, 255, 0.1); color: #fff; }

.main-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar, .platform-topbar, .org-topbar, .wa-topbar, .app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: var(--et-shell-topbar-h);
    padding-inline: 1.1rem;
    background: var(--et-surface);
    border-bottom: 1px solid var(--et-border);
    box-shadow: 0 1px 0 rgba(130, 143, 163, 0.08);
    position: sticky;
    top: 0;
    z-index: 40;
}
.topbar-left, .topbar-right, .wa-topbar-title, .wa-topbar-actions { display: flex; align-items: center; gap: 0.6rem; }
.icon-btn, .wa-icon-button, .topbar-link {
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid transparent;
    border-radius: var(--et-radius-md);
    background: transparent;
    color: var(--et-text-muted);
    cursor: pointer;
    transition: background var(--et-duration-fast) var(--et-ease), color var(--et-duration-fast) var(--et-ease);
}
.icon-btn:hover, .wa-icon-button:hover, .topbar-link:hover { background: var(--et-surface-muted); color: var(--et-heading); }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; }
.theme-toggle svg, .theme-toggle i { transition: transform var(--et-duration) var(--et-ease); }
.theme-toggle:hover svg, .theme-toggle:hover i { transform: rotate(-18deg); }
html.dark .theme-toggle, [data-theme="dark"] .theme-toggle { color: var(--et-warning); }

.topbar-actions, .topbar-icon-group { display: inline-flex; align-items: center; gap: 0.35rem; }
.user-menu-wrapper { position: relative; display: inline-flex; align-items: center; }
.user-menu-trigger, .wa-user-menu, .wa-account-pill, .org-pill, .lang-switcher-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.32rem 0.62rem;
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-pill);
    background: var(--et-surface);
    color: var(--et-text);
    cursor: pointer;
    transition: background var(--et-duration-fast) var(--et-ease), border-color var(--et-duration-fast) var(--et-ease), color var(--et-duration-fast) var(--et-ease);
}
.user-menu-trigger:hover, .wa-user-menu:hover, .lang-switcher-pill:hover, .org-pill:hover { background: var(--et-surface-muted); }
.user-menu-trigger.active { background: var(--et-primary-soft); border-color: var(--et-primary); color: var(--et-primary-active); }
.user-avatar, .avatar, .wa-user-avatar, .dropdown-avatar {
    width: 32px; height: 32px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--et-primary);
    color: #fff;
    font-weight: 700;
    font-size: var(--et-text-sm);
}
.user-name, .wa-user-copy strong { font-weight: 600; color: var(--et-heading); }
.user-role, .wa-user-copy small { color: var(--et-text-muted); font-size: var(--et-text-xs); }
.user-dropdown-popover {
    position: absolute;
    inset-block-start: calc(100% + 0.5rem);
    inset-inline-end: 0;
    min-width: 240px;
    padding: 0.5rem;
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-lg);
    box-shadow: var(--et-shadow-lg);
    animation: et01-pop var(--et-duration-fast) var(--et-ease);
    z-index: 60;
}
.dropdown-user-header { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem; }
.dropdown-name { font-weight: 600; color: var(--et-heading); display: block; }
.dropdown-email { font-size: var(--et-text-xs); color: var(--et-text-muted); display: block; }
.breadcrumb, .breadcrumbs { color: var(--et-text-muted); font-size: var(--et-text-sm); }

/* ET01 native shell class aliases (for direct ET01 markup adoption) */
.wrapper { display: flex; min-height: 100vh; }
.sidenav { width: var(--et-shell-sidebar-w); background: var(--et-surface); border-inline-end: 1px solid var(--et-border); }
.sidenav-menu { padding: 0.75rem 0.6rem; }

/* ----------------------------------------------------------------------------
   18b. Shell supplements (banners, pills, visibility helpers)
   ---------------------------------------------------------------------------- */
.sidebar-collapse-btn {
    width: 30px; height: 30px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--et-radius-md);
    background: rgba(255, 255, 255, 0.06);
    color: var(--et01-gray-400);
    cursor: pointer;
    transition: background var(--et-duration-fast) var(--et-ease), color var(--et-duration-fast) var(--et-ease);
}
.sidebar-collapse-btn:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.brand-info { display: flex; flex-direction: column; min-width: 0; }
.sidebar-foot-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-divider { width: 1px; height: 22px; background: var(--et-border); margin-inline: 0.35rem; }
.dropdown-chevron { color: var(--et-text-soft); transition: transform var(--et-duration-fast) var(--et-ease); }
.user-menu-trigger.active .dropdown-chevron { transform: rotate(180deg); }
.dropdown-user-details { display: flex; flex-direction: column; min-width: 0; }
.dropdown-org-badge {
    display: inline-flex; align-items: center; gap: 0.25rem;
    margin-top: 0.2rem; padding: 0.1rem 0.4rem;
    font-size: var(--et-text-xs); font-weight: 600;
    background: var(--et-primary-soft); color: var(--et-primary-active);
    border-radius: var(--et-radius-pill);
}
.dropdown-items { display: flex; flex-direction: column; gap: 0.1rem; }

.env-badge, .badge.env-dev, .badge.env-staging, .badge.env-prod {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.22rem 0.5rem; font-size: var(--et-text-xs); font-weight: 700;
    border-radius: var(--et-radius-pill);
}
.env-dev { background: var(--et-info-soft); color: #1ea8aa; }
.env-staging { background: var(--et-warning-soft); color: #b3762b; }
.env-prod { background: var(--et-success-soft); color: #09b080; }

.org-switcher-container, .branch-switcher-container, .culture-switcher { display: inline-flex; align-items: center; }
.org-pill {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-pill);
    background: var(--et-surface);
    color: var(--et-text);
    font-size: var(--et-text-sm);
}
.lang-label { font-weight: 600; }
.plan-pill {
    display: inline-flex; align-items: center;
    padding: 0.22rem 0.55rem;
    font-size: var(--et-text-xs); font-weight: 700;
    border-radius: var(--et-radius-pill);
    background: var(--et-primary-soft); color: var(--et-primary-active);
}
.plan-pill.trial { background: var(--et-warning-soft); color: #b3762b; }

.support-context-banner, .incident-banner, .offline-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.5rem 1rem;
    font-size: var(--et-text-sm);
    color: #fff;
}
.support-context-banner { background: var(--et-navy); }
.incident-banner { background: var(--et-warning); color: #3a2a12; }
.incident-banner.incident-critical, .incident-banner.incident-error { background: var(--et-danger); color: #fff; }
.incident-banner.incident-warning { background: var(--et-warning); color: #3a2a12; }
.incident-banner.incident-info { background: var(--et-info); color: #083a3a; }
.offline-banner { background: var(--et-gray-800); color: #fff; justify-content: center; }
.support-banner-content { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.support-pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--et-primary); animation: et01-pulse 1.4s infinite; }
@keyframes et01-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.btn-dismiss { background: none; border: 0; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; }

.auth-loading-screen { background: var(--et-surface-muted) !important; }
.page-body, .platform-content, .org-content { padding: 1.35rem; flex: 1; min-width: 0; }

.desktop-only { display: inline-flex; }
.mobile-only { display: none !important; }
@media (max-width: 992px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: inline-flex !important; }
    .sidebar-collapse-btn { display: none; }
}

/* ----------------------------------------------------------------------------
   18c. ETWhatsApp console shell (.wa-*) — unified Earth navy sidebar
   ---------------------------------------------------------------------------- */
.wa-sidebar {
    background: var(--et-navy);
    border-inline-end: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--et01-gray-400);
}
.wa-sidebar-header { border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.wa-sidebar-logo { color: #fff; }
.wa-sidebar-logo-mark { background: var(--et-primary); color: #fff; border-radius: var(--et-radius-md); }
.wa-sidebar-logo-text strong { color: #fff; }
.wa-sidebar-logo-text small, .wa-sidebar-status-text { color: var(--et01-gray-500); }
.wa-sidebar-collapse-toggle, .wa-sidebar-close {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--et-radius-md);
    background: rgba(255, 255, 255, 0.06);
    color: var(--et01-gray-400);
    cursor: pointer;
}
.wa-sidebar-collapse-toggle:hover, .wa-sidebar-close:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.wa-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--et01-gray-600); }
.wa-status-dot.is-online { background: var(--et-primary); }
.wa-menu-group-title { color: var(--et01-gray-600); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.35rem 0.6rem; display: flex; align-items: center; gap: 0.5rem; }
.wa-sidebar .wa-menu-link {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.5rem 0.65rem; margin: 0.1rem 0;
    border-radius: var(--et-radius-md);
    color: var(--et01-gray-400);
    font-size: var(--et01-font-size); font-weight: 500;
    text-decoration: none;
    transition: background var(--et-duration-fast) var(--et-ease), color var(--et-duration-fast) var(--et-ease);
}
.wa-sidebar .wa-menu-link:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.wa-sidebar .wa-menu-link.active { background: var(--et-primary); color: #fff; }
.wa-menu-icon { display: inline-flex; width: 1.15rem; justify-content: center; flex: 0 0 auto; }
.wa-menu-text { flex: 1; min-width: 0; }
.wa-menu-badge { background: var(--et-warning); color: #3a2a12; border-radius: var(--et-radius-pill); padding: 0.1rem 0.4rem; font-size: var(--et-text-xs); font-weight: 700; }
.wa-sidebar-footer { border-top: 1px solid rgba(255, 255, 255, 0.1); }
.wa-collapse-button {
    display: flex; align-items: center; gap: 0.6rem; width: 100%;
    padding: 0.5rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--et-radius-md);
    background: rgba(255, 255, 255, 0.06);
    color: var(--et01-gray-400);
    cursor: pointer;
}
.wa-collapse-button:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.wa-skeleton { background: rgba(255, 255, 255, 0.1); }
.wa-overlay { position: fixed; inset: 0; z-index: 40; background: rgba(11, 25, 44, 0.45); border: 0; }
.wa-content { padding: 1.35rem; }
.wa-topbar h1 { margin: 0; font-size: 1.15rem; font-weight: 600; color: var(--et-heading); }
.wa-mobile-menu-button, .wa-desktop-collapse-button {
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid transparent; border-radius: var(--et-radius-md);
    background: transparent; color: var(--et-text-muted); cursor: pointer;
}
.wa-mobile-menu-button:hover, .wa-desktop-collapse-button:hover { background: var(--et-surface-muted); color: var(--et-heading); }
.wa-notification-dot { position: absolute; top: 6px; inset-inline-end: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--et-danger); }
.wa-icon-button { position: relative; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: var(--et-radius-md); background: transparent; color: var(--et-text-muted); cursor: pointer; }
.wa-icon-button:hover { background: var(--et-surface-muted); color: var(--et-heading); }
.wa-logout-button {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-md);
    background: var(--et-surface);
    color: var(--et-text);
    font-weight: 600;
    cursor: pointer;
}
.wa-logout-button:hover { background: var(--et-surface-muted); color: var(--et-heading); }

/* ----------------------------------------------------------------------------
   19. Login / auth / error pages
   ---------------------------------------------------------------------------- */
.login-layout, .auth-layout, .auth-shell-layout { background: var(--et-surface-muted); }
.auth-shell-layout { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-container { width: 100%; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.login-card, .auth-card, .error-card, .et-auth-card {
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-xl);
    box-shadow: var(--et-shadow-lg);
    padding: 1.75rem;
    width: 100%;
    max-width: 420px;
    position: relative;
}
.login-top-bar { display: flex; justify-content: flex-end; margin-bottom: 0.5rem; }
.login-header { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.35rem; margin-bottom: 1.25rem; }
.login-brand-lockup { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.login-logo-img { width: 42px; height: 42px; object-fit: contain; }
.login-brand-text { font-size: 1.25rem; font-weight: 700; color: var(--et-heading); }
.login-brand-highlight { color: var(--et-primary); }
.login-brand-badge {
    display: inline-flex; align-items: center;
    padding: 0.15rem 0.5rem; border-radius: var(--et-radius-pill);
    background: var(--et-primary-soft); color: var(--et-primary-active);
    font-size: var(--et-text-xs); font-weight: 700;
}
.login-brand-header { display: flex; align-items: center; gap: 0.6rem; }
.login-title { margin: 0.5rem 0 0; font-size: 1.35rem; font-weight: 700; color: var(--et-heading); }
.login-subtitle { margin: 0; color: var(--et-text-muted); font-size: var(--et-text-base); }
.login-card-header { margin-bottom: 1rem; }
.login-card-title { margin: 0; font-size: var(--et-text-xl); font-weight: 600; color: var(--et-heading); }
.login-card-sub { margin: 0.15rem 0 0; color: var(--et-text-muted); font-size: var(--et-text-sm); }
.login-actions { margin-top: 1.35rem; }
.login-footer-copy { margin-top: 1.25rem; text-align: center; color: var(--et-text-soft); font-size: var(--et-text-xs); }
.login-submit, .auth-submit {
    width: 100%;
    min-height: 42px;
    background: var(--et-primary);
    border: 1px solid var(--et-primary);
    color: #fff;
    border-radius: var(--et-radius-md);
    font-weight: 600;
    cursor: pointer;
}
.login-submit:hover, .auth-submit:hover { background: var(--et-primary-hover); border-color: var(--et-primary-hover); }
.login-input-shell { border: 1px solid var(--et-border); border-radius: var(--et-radius-md); background: var(--et-surface); }
.login-input-shell:focus-within { border-color: var(--et-primary); box-shadow: var(--et-focus-ring); }

/* ----------------------------------------------------------------------------
   19b. Admin app component families
   ---------------------------------------------------------------------------- */
/* --- KPI / stat grids --- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--et-space-4); margin-bottom: var(--et-space-4); }
.kpi-card {
    display: flex; flex-direction: column; gap: 0.25rem;
    padding: 1.1rem 1.25rem;
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-lg);
    box-shadow: var(--et-shadow-md);
}
.kpi-title { font-size: var(--et-text-sm); font-weight: 600; color: var(--et-text-muted); text-transform: uppercase; letter-spacing: 0.02em; }
.kpi-value { font-size: 1.95rem; font-weight: 700; color: var(--et-heading); line-height: 1.15; }
.kpi-sub { font-size: var(--et-text-xs); color: var(--et-text-soft); }

/* --- Cards --- */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--et-border); }
.card-head .card-title { display: inline-flex; align-items: center; gap: 0.45rem; }
.data-shell { background: var(--et-surface); border: 1px solid var(--et-border); border-radius: var(--et-radius-lg); box-shadow: var(--et-shadow-md); overflow: hidden; }
.data-shell:has(.node-actions-popover), .card:has(.node-actions-popover), .canonical-table-wrap:has(.node-actions-popover), .table-responsive:has(.node-actions-popover) { overflow: visible !important; }

/* --- Canonical tables --- */
.canonical-table-wrap, .table-responsive { width: 100%; overflow-x: auto; border-radius: var(--et-radius-lg); }
.canonical-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--et01-font-size); }
.canonical-table thead th {
    text-align: start;
    padding: 0.6rem 0.9rem;
    background: var(--et-surface-muted);
    color: var(--et-text-muted);
    font-size: var(--et-text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--et-border);
    white-space: nowrap;
}
.canonical-table tbody td { padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--et-border-soft); color: var(--et-text); vertical-align: middle; }
.canonical-table tbody tr:hover { background: var(--et-surface-muted); }
.canonical-table .cell-strong { font-weight: 600; color: var(--et-heading); }
.canonical-table .actions-col, .canonical-table th.actions-col { width: 1%; white-space: nowrap; text-align: end; }
.canonical-table .numeric-col { text-align: end; font-variant-numeric: tabular-nums; }
.mono, .font-monospace { font-family: var(--et-font-mono); font-size: 0.85em; color: var(--et-heading); }

/* --- Empty states (canonical) --- */
.canonical-empty-state, .empty-state, .empty-state-view {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.6rem; text-align: center; padding: 2.5rem 1.25rem; color: var(--et-text-muted);
}
.empty-icon-wrap {
    width: 56px; height: 56px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--et-primary-soft);
    color: var(--et-primary-active);
}

/* --- Paginator --- */
.paginator-wrapper { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; padding: 0.75rem 0.25rem 0; }
.paginator-summary { color: var(--et-text-muted); font-size: var(--et-text-sm); }
.paginator-controls { display: inline-flex; align-items: center; gap: 0.6rem; }
.paginator-buttons { display: inline-flex; gap: 0.25rem; }
.paginator-btn {
    min-width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 0.45rem;
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-sm);
    background: var(--et-surface);
    color: var(--et-text);
    font-size: var(--et-text-sm); font-weight: 600;
    cursor: pointer;
    transition: background var(--et-duration-fast) var(--et-ease), border-color var(--et-duration-fast) var(--et-ease), color var(--et-duration-fast) var(--et-ease);
}
.paginator-btn:hover:not(:disabled):not(.active) { background: var(--et-surface-muted); border-color: var(--et-border-strong); }
.paginator-btn.active { background: var(--et-primary); border-color: var(--et-primary); color: #fff; }
.paginator-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.paginator-ellipsis { display: inline-flex; align-items: center; padding: 0 0.25rem; color: var(--et-text-soft); }
.paginator-select, .paginator-size-select select {
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-sm);
    background: var(--et-surface);
    color: var(--et-text);
    font-size: var(--et-text-sm);
}

/* --- Tabs --- */
.tab-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.15rem; padding: 0 0.35rem;
    border-radius: var(--et-radius-pill);
    background: rgba(15, 23, 42, 0.12); color: #0F172A;
    font-size: var(--et-text-xs); font-weight: 700;
}
.tab.active .tab-badge, [role="tab"].active .tab-badge { background: var(--et-primary-soft); color: var(--et-primary-active); }
.tab-content { padding-top: 1rem; }

/* --- Status badges --- */
.status-badge {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.22rem 0.5rem;
    border-radius: var(--et-radius-pill);
    background: var(--et-surface-muted); color: var(--et-text-muted);
    font-size: var(--et-text-xs); font-weight: 700;
}

/* --- Forms --- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--et-space-4); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--et-space-3); }
.form-group, .field { display: grid; gap: 0.3rem; margin-bottom: var(--et-space-3); }
.field-label, .form-group > label { font-size: var(--et-text-sm); font-weight: 600; color: var(--et-heading); }
.input-text {
    width: 100%;
    padding: 0.42rem 0.65rem;
    font-family: inherit; font-size: var(--et01-font-size);
    color: var(--et-text);
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-md);
    transition: border-color var(--et-duration-fast) var(--et-ease), box-shadow var(--et-duration-fast) var(--et-ease);
}
.input-text:focus { border-color: var(--et-primary); outline: none; box-shadow: var(--et-focus-ring); }
.form-hint { font-size: var(--et-text-xs); color: var(--et-text-soft); }
.required-indicator, .required-star { color: var(--et-danger); font-weight: 700; }
.optional { color: var(--et-text-soft); font-size: var(--et-text-xs); font-style: italic; }

/* Toggle switch */
.switch-container { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.switch-slider {
    position: relative;
    width: 2.1rem; height: 1.15rem;
    border-radius: var(--et-radius-pill);
    background: var(--et-border-strong);
    transition: background var(--et-duration-fast) var(--et-ease);
    flex: 0 0 auto;
}
.switch-slider::after {
    content: ""; position: absolute; top: 2px; inset-inline-start: 2px;
    width: 0.85rem; height: 0.85rem; border-radius: 50%;
    background: #fff; transition: transform var(--et-duration-fast) var(--et-ease);
}
.switch-container input:checked + .switch-slider,
.switch-slider.is-on, .switch-slider.active { background: var(--et-primary); }
.switch-container input:checked + .switch-slider::after,
.switch-slider.is-on::after, .switch-slider.active::after { transform: translateX(0.9rem); }
[dir="rtl"] .switch-container input:checked + .switch-slider::after,
[dir="rtl"] .switch-slider.is-on::after { transform: translateX(-0.9rem); }

/* --- Toolbars / filter chips --- */
.toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.6rem; flex-wrap: wrap;
    padding: 0.7rem 0.9rem;
    background: var(--et-surface);
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-lg);
    box-shadow: var(--et-shadow-sm);
    margin-bottom: 0.85rem;
}
.toolbar-actions, .toolbar-filters { display: inline-flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.toolbar-search { max-width: 280px; }
.filter-chip {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--et-border);
    border-radius: var(--et-radius-pill);
    background: var(--et-surface);
    color: var(--et-text-muted);
    font-size: var(--et-text-sm); font-weight: 600;
    cursor: pointer;
    transition: background var(--et-duration-fast) var(--et-ease), border-color var(--et-duration-fast) var(--et-ease), color var(--et-duration-fast) var(--et-ease);
}
.filter-chip:hover { background: var(--et-surface-muted); color: var(--et-heading); }
.filter-chip.active { background: var(--et-primary-soft); border-color: var(--et-primary); color: var(--et-primary-active); }

/* --- Alerts --- */
.alert-heading { display: block; font-weight: 700; margin-bottom: 0.15rem; color: inherit; }

/* --- Extra button variants (admin) --- */
.btn-block { width: 100%; display: flex; }
.btn-xs { padding: 0.18rem 0.45rem; font-size: 0.7rem; border-radius: var(--et-radius-sm); }
.btn-ghost {
    background: transparent; border-color: transparent; color: var(--et-text-muted);
}
.btn-ghost:hover { background: var(--et-surface-muted); color: var(--et-heading); }
.btn-outline {
    background: transparent; border-color: var(--et-border-strong); color: var(--et-text);
}
.btn-outline:hover { background: var(--et-surface-muted); border-color: var(--et-border-strong); color: var(--et-heading); }
.btn-danger-soft { background: var(--et-danger-soft); border-color: transparent; color: #c94856; }
.btn-danger-soft:hover { background: #fbd5d9; color: #b0353f; }
.btn-success-soft { background: var(--et-success-soft); border-color: transparent; color: #09b080; }
.btn-success-soft:hover { background: #c8f4e7; color: #078e66; }
.btn-exit-support { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.25); color: #fff; }
.btn-exit-support:hover { background: rgba(255, 255, 255, 0.24); color: #fff; }

/* --- Onboarding progress --- */
.onboarding-steps-container { display: grid; gap: 0.75rem; }
.onboarding-progress-bar { height: 0.5rem; background: var(--et-surface-muted); border-radius: var(--et-radius-pill); overflow: hidden; }
.onboarding-progress-fill { height: 100%; background: var(--et-primary); border-radius: inherit; transition: width var(--et-duration) var(--et-ease); }

.bg-white { background: var(--et-surface) !important; }
.shadow-sm { box-shadow: var(--et-shadow-sm) !important; }

/* ----------------------------------------------------------------------------
   20. Utilities
   ---------------------------------------------------------------------------- */
.et-skip-link {
    position: absolute;
    inset-block-start: -60px;
    inset-inline-start: 0.5rem;
    z-index: 2000;
    padding: 0.5rem 0.9rem;
    background: var(--et-primary);
    color: #fff;
    border-radius: var(--et-radius-md);
    transition: inset-block-start var(--et-duration-fast) var(--et-ease);
}
.et-skip-link:focus { inset-block-start: 0.5rem; }
.et-crud-sr-only, .visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

/* ----------------------------------------------------------------------------
   20b. Dark theme (opt-in: html.dark / [data-theme="dark"] / body.dark)
   The same component rules drive both modes — only the tokens below change.
   ---------------------------------------------------------------------------- */
html.dark, [data-theme="dark"], body.dark {
    color-scheme: dark;

    /* Earth dark surfaces */
    --et-bg: #0b1220;
    --et-surface: #111c2e;
    --et-surface-muted: #0b1220;
    --et-surface-raised: #16233a;
    --et01-border: #1f2e45;
    --et01-border-soft: #1a273b;
    --et-border: #1f2e45;
    --et-border-soft: #1a273b;
    --et-border-strong: #2c3e5c;
    --et-heading: #e8eef6;
    --et-text: #c7d2e0;
    --et-text-muted: #CBD5E1;
    --et-text-soft: #94A3B8;
    --et-placeholder: #5F6E84;
    --et-primary-soft: rgba(16, 185, 129, 0.16);
    --et-success-soft: rgba(16, 185, 129, 0.16);
    --et-warning-soft: rgba(245, 158, 11, 0.18);
    --et-danger-soft: rgba(239, 68, 68, 0.18);
    --et-info-soft: rgba(6, 182, 212, 0.18);
    --et-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --et-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.45);
    --et-shadow-lg: 0 20px 48px -8px rgba(0, 0, 0, 0.6);
    --et-focus-ring: 0 0 0 0.18rem rgba(16, 185, 129, 0.32);

    /* App token parity (--rg-*) */
    --rg-bg: #0b1220;
    --rg-bg-strong: #0e1726;
    --rg-surface: #111c2e;
    --rg-surface-muted: #18263e;
    --rg-surface-subtle: #152238;
    --rg-surface-hover: #1e2f4d;
    --rg-surface-raised: #16233a;
    --rg-border: #1f2e45;
    --rg-border-strong: #2c3e5c;
    --rg-heading: #e8eef6;
    --rg-text: #c7d2e0;
    --rg-text-muted: #CBD5E1;
    --rg-text-soft: #94A3B8;
    --rg-neutral-soft: #16233a;
    --rg-primary-soft: rgba(16, 185, 129, 0.16);
    --rg-success-soft: rgba(16, 185, 129, 0.16);
    --rg-warning-soft: rgba(245, 158, 11, 0.18);
    --rg-danger-soft: rgba(239, 68, 68, 0.18);
    --rg-info-soft: rgba(6, 182, 212, 0.18);
    --rg-cyan-soft: rgba(6, 182, 212, 0.16);
    --rg-sidebar-bg: #060e18;
    --rg-sidebar-accent: #04090f;
    --rg-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --rg-shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.55);
    --rg-shadow-lg: 0 20px 48px -8px rgba(0, 0, 0, 0.6);
    --rg-shadow-overlay: 0 28px 70px -12px rgba(0, 0, 0, 0.7);
    --rg-ring: 0 0 0 3px rgba(16, 185, 129, 0.3);

    /* Console token parity (--wa-*) */
    --wa-bg: #0b1220;
    --wa-surface: #111c2e;
    --wa-surface-soft: #0e1726;
    --wa-border: #1f2e45;
    --wa-border-hover: #2c3e5c;
    --wa-text: #c7d2e0;
    --wa-text-secondary: #aebdd0;
    --wa-muted: #CBD5E1;
    --wa-primary-soft: rgba(16, 185, 129, 0.16);
    --wa-danger-soft: rgba(239, 68, 68, 0.18);
    --wa-warning-soft: rgba(245, 158, 11, 0.18);
    --wa-success-soft: rgba(16, 185, 129, 0.16);
    --wa-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --wa-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --wa-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    --wa-shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.55);

    /* Bootstrap bridge */
    --bs-body-color: #c7d2e0;
    --bs-body-bg: #0b1220;
}
html.dark body, [data-theme="dark"] body, body.dark {
    background-color: var(--et-surface-muted);
    color: var(--et-text);
}
html.dark input, html.dark select, html.dark textarea, html.dark button,
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea, [data-theme="dark"] button {
    color-scheme: dark;
}
html.dark .bg-white, [data-theme="dark"] .bg-white { background: var(--et-surface) !important; }
/* Navy sidebar stays navy in dark mode for brand continuity */
html.dark .sidebar, html.dark .platform-sidebar, html.dark .org-sidebar, html.dark .wa-sidebar,
[data-theme="dark"] .sidebar, [data-theme="dark"] .platform-sidebar, [data-theme="dark"] .org-sidebar, [data-theme="dark"] .wa-sidebar {
    background: #060e18;
}
/* Native controls in dark */
html.dark ::-webkit-scrollbar-thumb, [data-theme="dark"] ::-webkit-scrollbar-thumb { background: #2c3e5c; }

/* ----------------------------------------------------------------------------
   21. Reduced motion
   ---------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ----------------------------------------------------------------------------
   22. Responsive shell behaviour
   ---------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .sidebar, .platform-sidebar, .org-sidebar {
        position: fixed;
        inset-block: 0;
        inset-inline-start: 0;
        z-index: 60;
        transform: translateX(-100%);
        box-shadow: var(--et-shadow-lg);
    }
    [dir="rtl"] .sidebar, [dir="rtl"] .platform-sidebar, [dir="rtl"] .org-sidebar { transform: translateX(100%); inset-inline-start: auto; inset-inline-end: 0; }
    .sidebar.open, .admin-shell.nav-open .sidebar { transform: translateX(0); }
    .main-pane { width: 100%; }
    .scrim { display: block; }
}
@media (max-width: 640px) {
    .topbar, .platform-topbar, .org-topbar, .wa-topbar { padding-inline: 0.75rem; }
    .user-meta, .wa-user-copy { display: none; }
}

/* ----------------------------------------------------------------------------
   23. EtLookupSelect Topmost & Stacking Context Guarantees
   ---------------------------------------------------------------------------- */
.et-lookup-container.et-lookup-is-open {
    position: relative !important;
    z-index: 100050 !important;
}

.modal-body:has(.et-lookup-is-open),
.et-modal-body:has(.et-lookup-is-open),
.modal-content:has(.et-lookup-is-open),
.et-crud-drawer-body:has(.et-lookup-is-open),
.compact-filter-bar:has(.et-lookup-is-open),
.filter-group:has(.et-lookup-is-open),
.filter-bar-controls:has(.et-lookup-is-open) {
    overflow: visible !important;
    position: relative;
    z-index: 100050 !important;
}


/* ----------------------------------------------------------------------------
   24. Unified Tabs, Skeletons, Dark Tables & Font Inheritance
   ---------------------------------------------------------------------------- */
html.dark :is(.et-tabs, .nav-tabs, .tabs, .tabs-bar, .et-tab-list, .family-tabs, .node-popup-tabs, [role="tablist"]),
[data-theme="dark"] :is(.et-tabs, .nav-tabs, .tabs, .tabs-bar, .et-tab-list, .family-tabs, .node-popup-tabs, [role="tablist"]) {
    background: #0D1526 !important;
    border-color: #23355A !important;
}

html.dark :is(.et-tab, .et-tab-header, .nav-tabs .nav-link, .nav-pills .nav-link, .tab, .family-tab-btn, .node-popup-tab, [role="tab"]),
[data-theme="dark"] :is(.et-tab, .et-tab-header, .nav-tabs .nav-link, .nav-pills .nav-link, .tab, .family-tab-btn, .node-popup-tab, [role="tab"]) {
    background: #1E293B !important;
    color: #CBD5E1 !important;
    border: 1px solid #334B7D !important;
    border-bottom: none !important;
    border-radius: 6px 6px 0 0 !important;
}

html.dark :is(.et-tab, .et-tab-header, .nav-tabs .nav-link, .nav-pills .nav-link, .tab, .family-tab-btn, .node-popup-tab, [role="tab"]):hover,
[data-theme="dark"] :is(.et-tab, .et-tab-header, .nav-tabs .nav-link, .nav-pills .nav-link, .tab, .family-tab-btn, .node-popup-tab, [role="tab"]):hover {
    background: #283753 !important;
    color: #F8FAFC !important;
}

html.dark :is(.et-tab-active, .et-tab-header.et-tab-active, .nav-tabs .nav-link.active, .nav-pills .nav-link.active, .tab.active, .family-tab-btn.active, .node-popup-tab.active, [role="tab"][aria-selected="true"], [role="tab"].active),
[data-theme="dark"] :is(.et-tab-active, .et-tab-header.et-tab-active, .nav-tabs .nav-link.active, .nav-pills .nav-link.active, .tab.active, .family-tab-btn.active, .node-popup-tab.active, [role="tab"][aria-selected="true"], [role="tab"].active) {
    background: #112A26 !important;
    color: #34D399 !important;
    border: 1px solid #10B981 !important;
    border-bottom: 3px solid #10B981 !important;
    font-weight: 700 !important;
    box-shadow: 0 -2px 8px rgba(16, 185, 129, 0.18) !important;
}

html.dark .tab-badge, [data-theme="dark"] .tab-badge {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #E2E8F0 !important;
}

/* Single Shared Font Family Enforcement Across All Inputs, Placeholders & Lookups */
input, select, textarea, button,
input::placeholder, textarea::placeholder,
.form-control, .form-control::placeholder,
.input-text, .input-text::placeholder,
.et-lookup-container, .et-lookup-pill-box, .et-lookup-input, .et-lookup-input::placeholder,
.et-lookup-dropdown-menu, .et-lookup-card-title, .et-lookup-card-subtitle, .et-lookup-field-label {
    font-family: inherit !important;
}

html[dir="rtl"] :is(body, input, select, textarea, button, input::placeholder, textarea::placeholder, .form-control, .form-control::placeholder, .et-lookup-container, .et-lookup-input, .et-lookup-input::placeholder, .et-lookup-dropdown-menu, .nav-group-header, .nav-group-title, .nav-item),
[dir="rtl"] :is(input, select, textarea, button, input::placeholder, textarea::placeholder, .form-control, .form-control::placeholder, .et-lookup-container, .et-lookup-input, .et-lookup-input::placeholder, .et-lookup-dropdown-menu, .nav-group-header, .nav-group-title, .nav-item) {
    font-family: var(--et01-font-arabic) !important;
}

html[dir="ltr"] :is(body, input, select, textarea, button, input::placeholder, textarea::placeholder, .form-control, .form-control::placeholder, .et-lookup-container, .et-lookup-input, .et-lookup-input::placeholder, .et-lookup-dropdown-menu, .nav-group-header, .nav-group-title, .nav-item),
[dir="ltr"] :is(input, select, textarea, button, input::placeholder, textarea::placeholder, .form-control, .form-control::placeholder, .et-lookup-container, .et-lookup-input, .et-lookup-input::placeholder, .et-lookup-dropdown-menu, .nav-group-header, .nav-group-title, .nav-item) {
    font-family: var(--et01-font) !important;
}

/* Bootstrap & Custom Table Dark Mode Parity */
html.dark .table, [data-theme="dark"] .table {
    --bs-table-bg: transparent !important;
    --bs-table-color: var(--et-text) !important;
    --bs-table-border-color: var(--et-border) !important;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.03) !important;
    --bs-table-hover-bg: rgba(255, 255, 255, 0.05) !important;
    color: var(--et-text) !important;
    border-color: var(--et-border) !important;
}
html.dark .table > :not(caption) > * > *,
[data-theme="dark"] .table > :not(caption) > * > * {
    background-color: transparent !important;
    color: var(--et-text) !important;
    border-bottom-color: var(--et-border) !important;
}
html.dark .table thead th,
[data-theme="dark"] .table thead th {
    background-color: var(--rg-surface-subtle, #152238) !important;
    color: var(--et-text-muted) !important;
    border-bottom-color: var(--et-border) !important;
}
html.dark .bg-light, [data-theme="dark"] .bg-light {
    background-color: var(--rg-surface-subtle, #152238) !important;
    color: var(--et-text) !important;
}

/* Structured Page Skeletons (EtPageSkeleton) */
.et-page-skeleton {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    padding: 0.25rem 0;
}
.et-skeleton-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
.et-skeleton-kpi-card,
.et-skeleton-panel-card {
    background: var(--et-surface, #ffffff);
    border: 1px solid var(--et-border, #e2e8f0);
    border-radius: 10px;
    padding: 1.15rem 1.25rem;
    box-shadow: var(--et-shadow-sm);
}
.et-skeleton-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}
.et-skeleton-table-shell {
    background: var(--et-surface, #ffffff);
    border: 1px solid var(--et-border, #e2e8f0);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--et-shadow-sm);
}
.et-skeleton-table-header {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 1rem;
    padding: 0.85rem 1.15rem;
    background: var(--rg-surface-subtle, #f8fafc);
    border-bottom: 1px solid var(--et-border, #e2e8f0);
}
.et-skeleton-th {
    height: 12px;
    width: 70%;
    border-radius: 4px;
}
.et-skeleton-table-body {
    display: flex;
    flex-direction: column;
}
.et-skeleton-tr {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 1rem;
    padding: 0.9rem 1.15rem;
    border-bottom: 1px solid var(--et-border, #e2e8f0);
    align-items: center;
}
.et-skeleton-tr:last-child {
    border-bottom: none;
}
.et-skeleton-td,
.et-skeleton-line {
    display: block;
    height: 14px;
    border-radius: 6px;
}
.et-skeleton-shimmer {
    position: relative;
    overflow: hidden;
    background: #E2E8F0;
}
.et-skeleton-shimmer::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
    animation: et01-shimmer 1.5s infinite;
}
html.dark .et-skeleton-shimmer,
[data-theme="dark"] .et-skeleton-shimmer,
html.dark .et-crud-skeleton-cell,
[data-theme="dark"] .et-crud-skeleton-cell {
    background: #1E293B !important;
}
html.dark .et-skeleton-shimmer::after,
[data-theme="dark"] .et-skeleton-shimmer::after {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent) !important;
}

/* Single placeholder colour for every text field in every app (inputs, textareas, lookups). Invalid fields override it in red. */
input::placeholder, textarea::placeholder, .form-control::placeholder, .input-text::placeholder, .et-lookup-input::placeholder {
    color: var(--et-placeholder, #9AA5B5);
    opacity: 1;
}
