/*
 * ==========================================================================
 * Et3am Delivery - Custom Filament v3 Theme
 * Application: "إطعام دليفري" - Charitable Food Distribution ERP
 * Direction: RTL-first (Arabic)
 * ==========================================================================
 */

/* --------------------------------------------------------------------------
 * 1. GOOGLE FONTS - Cairo (Arabic-optimized)
 * -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@200;300;400;500;600;700;800;900&display=swap');

/* --------------------------------------------------------------------------
 * 2. CSS CUSTOM PROPERTIES
 * -------------------------------------------------------------------------- */
:root {
    /* Brand Palette */
    --et3am-emerald-50: #ecfdf5;
    --et3am-emerald-100: #d1fae5;
    --et3am-emerald-200: #a7f3d0;
    --et3am-emerald-300: #6ee7b7;
    --et3am-emerald-400: #34d399;
    --et3am-emerald-500: #10b981;
    --et3am-emerald-600: #059669;
    --et3am-emerald-700: #047857;
    --et3am-emerald-800: #065f46;
    --et3am-emerald-900: #064e3b;

    --et3am-teal-500: #14b8a6;
    --et3am-teal-600: #0d9488;
    --et3am-teal-700: #0f766e;
    --et3am-teal-800: #115e59;
    --et3am-teal-900: #134e4a;

    /* Typography */
    --et3am-font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;

    /* Spacing & Radius */
    --et3am-radius-sm: 0.375rem;
    --et3am-radius-md: 0.5rem;
    --et3am-radius-lg: 0.75rem;
    --et3am-radius-xl: 1rem;
    --et3am-radius-2xl: 1.25rem;

    /* Shadows */
    --et3am-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --et3am-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --et3am-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --et3am-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Transitions */
    --et3am-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --et3am-transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --et3am-transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Scrollbar */
    --et3am-scrollbar-width: 6px;
    --et3am-scrollbar-track: #f1f5f9;
    --et3am-scrollbar-thumb: #94a3b8;
    --et3am-scrollbar-thumb-hover: var(--et3am-emerald-500);
}

/* Dark mode custom property overrides */
.dark {
    --et3am-scrollbar-track: #1e293b;
    --et3am-scrollbar-thumb: #475569;
    --et3am-scrollbar-thumb-hover: var(--et3am-emerald-400);
}

/* --------------------------------------------------------------------------
 * 3. BASE TYPOGRAPHY & RTL FOUNDATION
 * -------------------------------------------------------------------------- */
body,
.filament-body,
.fi-body {
    font-family: var(--et3am-font-family) !important;
    direction: rtl;
    text-align: right;
    line-height: 1.6;
}

/* Ensure all Filament text inherits Cairo */
.fi-sidebar,
.fi-topbar,
.fi-main,
.fi-header,
.fi-modal,
.fi-dropdown,
.fi-notification,
.filament-tables-table,
[class*="filament-"],
[class*="fi-"] {
    font-family: var(--et3am-font-family) !important;
}

/* RTL text alignment defaults */
p, h1, h2, h3, h4, h5, h6,
label, span, div, td, th, li {
    text-align: inherit;
}

/* Headings weight adjustment for Arabic readability */
h1, h2, h3, h4, h5, h6,
.fi-header-heading,
.fi-section-header-heading {
    font-weight: 700;
    letter-spacing: 0;
}

/* --------------------------------------------------------------------------
 * 4. LOGIN PAGE
 * -------------------------------------------------------------------------- */

/* Gradient background for the login/auth pages */
.fi-simple-layout {
    background: linear-gradient(135deg, var(--et3am-emerald-700) 0%, var(--et3am-teal-700) 50%, var(--et3am-emerald-900) 100%) !important;
    min-height: 100vh;
    position: relative;
}

/* Subtle pattern overlay on login background */
.fi-simple-layout::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
                      radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Login card styling */
.fi-simple-layout .fi-simple-main-ctn {
    position: relative;
    z-index: 1;
}

.fi-simple-layout .fi-simple-main {
    background: rgba(255, 255, 255, 0.97) !important;
    backdrop-filter: blur(20px);
    border-radius: var(--et3am-radius-2xl) !important;
    box-shadow: var(--et3am-shadow-xl),
                0 0 0 1px rgba(255, 255, 255, 0.1) !important;
    padding: 2.5rem !important;
    max-width: 28rem;
    width: 100%;
    transition: transform var(--et3am-transition-normal),
                box-shadow var(--et3am-transition-normal);
}

.fi-simple-layout .fi-simple-main:hover {
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25),
                0 0 0 1px rgba(255, 255, 255, 0.15) !important;
}

/* Dark mode login card */
.dark .fi-simple-layout .fi-simple-main {
    background: rgba(30, 41, 59, 0.95) !important;
}

/* Logo area above the login form */
.fi-simple-layout .fi-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--et3am-emerald-100);
}

.dark .fi-simple-layout .fi-logo {
    border-bottom-color: rgba(16, 185, 129, 0.2);
}

.fi-simple-layout .fi-logo img,
.fi-simple-layout .fi-logo svg {
    max-height: 5rem;
    height: 5rem !important;
    width: auto;
}

/* Login form heading */
.fi-simple-layout .fi-simple-header-heading {
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    color: var(--et3am-emerald-800);
    text-align: center;
}

.dark .fi-simple-layout .fi-simple-header-heading {
    color: var(--et3am-emerald-300);
}

/* Login form inputs */
.fi-simple-layout .fi-input {
    border-radius: var(--et3am-radius-lg) !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.95rem !important;
    border: 1.5px solid #e2e8f0 !important;
    transition: border-color var(--et3am-transition-fast),
                box-shadow var(--et3am-transition-fast) !important;
}

.fi-simple-layout .fi-input:focus {
    border-color: var(--et3am-emerald-500) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

.dark .fi-simple-layout .fi-input {
    border-color: #334155 !important;
    background-color: #1e293b !important;
}

.dark .fi-simple-layout .fi-input:focus {
    border-color: var(--et3am-emerald-400) !important;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15) !important;
}

/* Login form button */
.fi-simple-layout .fi-btn-primary {
    border-radius: var(--et3am-radius-lg) !important;
    padding: 0.75rem 1.5rem !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    background: linear-gradient(135deg, var(--et3am-emerald-600), var(--et3am-teal-600)) !important;
    border: none !important;
    transition: transform var(--et3am-transition-fast),
                box-shadow var(--et3am-transition-fast),
                opacity var(--et3am-transition-fast) !important;
}

.fi-simple-layout .fi-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4) !important;
    opacity: 0.95;
}

.fi-simple-layout .fi-btn-primary:active {
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
 * 5. SIDEBAR ENHANCEMENTS
 * -------------------------------------------------------------------------- */

/* Sidebar gradient background */
.fi-sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    border-inline-end: 1px solid #e2e8f0;
}

.dark .fi-sidebar {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
    border-inline-end-color: #334155;
}

/* Sidebar navigation items */
.fi-sidebar-item {
    transition: all var(--et3am-transition-fast) !important;
}

.fi-sidebar-item-button {
    border-radius: var(--et3am-radius-md) !important;
    margin-inline: 0.5rem;
    padding: 0.5rem 0.75rem !important;
    transition: background-color var(--et3am-transition-fast),
                color var(--et3am-transition-fast),
                transform var(--et3am-transition-fast) !important;
}

/* Sidebar hover state */
.fi-sidebar-item-button:hover {
    background-color: var(--et3am-emerald-50) !important;
    color: var(--et3am-emerald-700) !important;
}

.dark .fi-sidebar-item-button:hover {
    background-color: rgba(16, 185, 129, 0.1) !important;
    color: var(--et3am-emerald-300) !important;
}

/* Sidebar active item */
.fi-sidebar-item-active .fi-sidebar-item-button,
.fi-sidebar-item-button[aria-current="page"] {
    background-color: var(--et3am-emerald-50) !important;
    color: var(--et3am-emerald-700) !important;
    font-weight: 600 !important;
    border-inline-start: 3px solid var(--et3am-emerald-500) !important;
}

.dark .fi-sidebar-item-active .fi-sidebar-item-button,
.dark .fi-sidebar-item-button[aria-current="page"] {
    background-color: rgba(16, 185, 129, 0.15) !important;
    color: var(--et3am-emerald-300) !important;
    border-inline-start-color: var(--et3am-emerald-400) !important;
}

/* Sidebar active item icon */
.fi-sidebar-item-active .fi-sidebar-item-icon {
    color: var(--et3am-emerald-600) !important;
}

.dark .fi-sidebar-item-active .fi-sidebar-item-icon {
    color: var(--et3am-emerald-400) !important;
}

/* Sidebar group headers */
.fi-sidebar-group-label {
    font-weight: 700 !important;
    font-size: 0.8rem !important;
    color: #64748b !important;
    padding-inline: 1rem;
    margin-bottom: 0.25rem;
    position: relative;
}

.fi-sidebar-group {
    position: relative;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Per-group color accent bars on headers */
.fi-sidebar-group-label::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: #10b981;
    border-radius: 0 2px 2px 0;
}

[dir="rtl"] .fi-sidebar-group-label::before,
.fi-sidebar-group-label::before {
    border-radius: 2px 0 0 2px;
}

/* Per-group accent colors (10 groups) */
.fi-sidebar-group:nth-child(1) .fi-sidebar-group-label::before { background: #10b981; }  /* Today - emerald */
.fi-sidebar-group:nth-child(2) .fi-sidebar-group-label::before { background: #f43f5e; }  /* Donations - rose */
.fi-sidebar-group:nth-child(3) .fi-sidebar-group-label::before { background: #f59e0b; }  /* Procurement - amber */
.fi-sidebar-group:nth-child(4) .fi-sidebar-group-label::before { background: #3b82f6; }  /* Warehouse - blue */
.fi-sidebar-group:nth-child(5) .fi-sidebar-group-label::before { background: #64748b; }  /* Data & Setup - slate */
.fi-sidebar-group:nth-child(6) .fi-sidebar-group-label::before { background: #f97316; }  /* Kitchen - orange */
.fi-sidebar-group:nth-child(7) .fi-sidebar-group-label::before { background: #14b8a6; }  /* Distribution - teal */
.fi-sidebar-group:nth-child(8) .fi-sidebar-group-label::before { background: #8b5cf6; }  /* People - violet */
.fi-sidebar-group:nth-child(9) .fi-sidebar-group-label::before { background: #6366f1; }  /* Finance - indigo */
.fi-sidebar-group:nth-child(10) .fi-sidebar-group-label::before { background: #94a3b8; } /* Settings - gray */

/* Sidebar group divider */
.fi-sidebar-group + .fi-sidebar-group {
    border-top: 1px solid #f1f5f9;
    padding-top: 0.5rem;
}

.dark .fi-sidebar-group + .fi-sidebar-group {
    border-top-color: #1e293b;
}

/* Sidebar expand/collapse all toggle */
.et3am-sidebar-toggle-wrap {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}
.et3am-sidebar-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.4rem 0.5rem;
    border-radius: 0.5rem;
    background: #f0fdf4;
    border: 1px solid #a7f3d0;
    color: #047857;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: Cairo, sans-serif;
}
.et3am-sidebar-toggle:hover {
    background: #dcfce7;
    border-color: #059669;
    color: #065f46;
}
/* Hide toggle when sidebar is collapsed (icon-only mode) */
.fi-sidebar-nav-collapsed-icon .et3am-sidebar-toggle-wrap {
    display: none;
}

/* --------------------------------------------------------------------------
 * 6. DASHBOARD & STAT CARDS
 * -------------------------------------------------------------------------- */

/* Filament stat widgets / cards */
.fi-wi-stats-overview-stat {
    border-radius: var(--et3am-radius-xl) !important;
    transition: transform var(--et3am-transition-normal),
                box-shadow var(--et3am-transition-normal) !important;
    box-shadow: var(--et3am-shadow-sm) !important;
    overflow: hidden;
}

.fi-wi-stats-overview-stat:hover {
    transform: scale(1.02) translateY(-2px);
    box-shadow: var(--et3am-shadow-lg) !important;
}

/* Stat card value */
.fi-wi-stats-overview-stat-value {
    font-weight: 800 !important;
    font-size: 1.75rem !important;
}

/* Stat card description */
.fi-wi-stats-overview-stat-description {
    font-weight: 500 !important;
}

/* Widget cards general */
.fi-wi-card,
.fi-section {
    border-radius: var(--et3am-radius-xl) !important;
    transition: box-shadow var(--et3am-transition-normal) !important;
}

.fi-wi-card:hover,
.fi-section:hover {
    box-shadow: var(--et3am-shadow-md) !important;
}

/* Chart widgets */
.fi-wi-chart {
    border-radius: var(--et3am-radius-xl) !important;
}

/* --------------------------------------------------------------------------
 * 7. TABLE ENHANCEMENTS
 * -------------------------------------------------------------------------- */

/* Table container */
.fi-ta {
    border-radius: var(--et3am-radius-xl) !important;
    overflow: hidden;
}

/* Table header */
.fi-ta-header-cell {
    font-weight: 700 !important;
    font-size: 0.8rem !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b !important;
}

.dark .fi-ta-header-cell {
    color: #94a3b8 !important;
}

/* Table row hover */
.fi-ta-row {
    transition: background-color var(--et3am-transition-fast) !important;
}

.fi-ta-row:hover {
    background-color: var(--et3am-emerald-50) !important;
}

.dark .fi-ta-row:hover {
    background-color: rgba(16, 185, 129, 0.05) !important;
}

/* Table row striping (subtle) */
.fi-ta-row:nth-child(even) {
    background-color: #fafbfc;
}

.dark .fi-ta-row:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

.fi-ta-row:nth-child(even):hover {
    background-color: var(--et3am-emerald-50) !important;
}

.dark .fi-ta-row:nth-child(even):hover {
    background-color: rgba(16, 185, 129, 0.05) !important;
}

/* Table cell padding for RTL comfort */
.fi-ta-cell {
    padding: 0.75rem 1rem !important;
}

/* --------------------------------------------------------------------------
 * 8. BUTTONS
 * -------------------------------------------------------------------------- */

/* General button transitions */
.fi-btn {
    transition: transform var(--et3am-transition-fast),
                box-shadow var(--et3am-transition-fast),
                background-color var(--et3am-transition-fast),
                opacity var(--et3am-transition-fast) !important;
    border-radius: var(--et3am-radius-md) !important;
    font-weight: 600 !important;
}

/* Button hover lift */
.fi-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--et3am-shadow-md) !important;
}

.fi-btn:active {
    transform: translateY(0px) scale(0.97);
    box-shadow: var(--et3am-shadow-sm) !important;
}

/* Primary button emerald gradient */
.fi-btn-primary {
    background: linear-gradient(135deg, var(--et3am-emerald-600), var(--et3am-emerald-500)) !important;
}

.fi-btn-primary:hover {
    background: linear-gradient(135deg, var(--et3am-emerald-700), var(--et3am-emerald-600)) !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35) !important;
}

/* Danger button */
.fi-btn-danger:hover {
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35) !important;
}

/* Icon buttons */
.fi-icon-btn {
    transition: transform var(--et3am-transition-fast),
                background-color var(--et3am-transition-fast),
                color var(--et3am-transition-fast) !important;
    border-radius: var(--et3am-radius-md) !important;
}

.fi-icon-btn:hover {
    transform: scale(1.05);
}

/* --------------------------------------------------------------------------
 * 9. FORM INPUTS
 * -------------------------------------------------------------------------- */

/* General input styling */
.fi-input {
    border-radius: var(--et3am-radius-md) !important;
    transition: border-color var(--et3am-transition-fast),
                box-shadow var(--et3am-transition-fast) !important;
    font-family: var(--et3am-font-family) !important;
}

/* Input focus ring - emerald */
.fi-input:focus,
.fi-input:focus-within {
    border-color: var(--et3am-emerald-500) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12) !important;
    outline: 2px solid transparent !important;
    outline-offset: 2px !important;
}

.dark .fi-input:focus,
.dark .fi-input:focus-within {
    border-color: var(--et3am-emerald-400) !important;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12) !important;
}

/* Input wrapper focus */
.fi-input-wrp:focus-within {
    border-color: var(--et3am-emerald-500) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12) !important;
}

.dark .fi-input-wrp:focus-within {
    border-color: var(--et3am-emerald-400) !important;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12) !important;
}

/* Select inputs */
.fi-select-input,
.fi-select {
    font-family: var(--et3am-font-family) !important;
}

/* Textarea */
textarea.fi-input {
    min-height: 6rem;
}

/* Checkbox and Radio emerald accent */
.fi-checkbox-input:checked,
.fi-radio-input:checked {
    background-color: var(--et3am-emerald-500) !important;
    border-color: var(--et3am-emerald-500) !important;
}

.fi-checkbox-input:focus,
.fi-radio-input:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

/* Toggle emerald */
.fi-toggle-input:checked {
    background-color: var(--et3am-emerald-500) !important;
}

/* --------------------------------------------------------------------------
 * 10. BADGES
 * -------------------------------------------------------------------------- */

.fi-badge {
    border-radius: 9999px !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    padding: 0.2rem 0.65rem !important;
    letter-spacing: 0.02em;
    transition: transform var(--et3am-transition-fast),
                box-shadow var(--et3am-transition-fast) !important;
}

.fi-badge:hover {
    transform: scale(1.05);
}

/* Badge success variant - emerald */
.fi-badge-success {
    background-color: var(--et3am-emerald-100) !important;
    color: var(--et3am-emerald-800) !important;
}

.dark .fi-badge-success {
    background-color: rgba(16, 185, 129, 0.15) !important;
    color: var(--et3am-emerald-300) !important;
}

/* --------------------------------------------------------------------------
 * 11. MODALS & NOTIFICATIONS
 * -------------------------------------------------------------------------- */

/* Modal styling */
.fi-modal-window {
    border-radius: var(--et3am-radius-xl) !important;
    box-shadow: var(--et3am-shadow-xl) !important;
}

/* Notifications */
.fi-notification {
    border-radius: var(--et3am-radius-lg) !important;
    box-shadow: var(--et3am-shadow-lg) !important;
    font-family: var(--et3am-font-family) !important;
    transition: transform var(--et3am-transition-normal),
                opacity var(--et3am-transition-normal) !important;
}

/* Notification success */
.fi-notification-success {
    border-inline-start: 4px solid var(--et3am-emerald-500) !important;
}

/* --------------------------------------------------------------------------
 * 12. TOPBAR / HEADER
 * -------------------------------------------------------------------------- */

.fi-topbar {
    backdrop-filter: blur(12px);
    background-color: rgba(255, 255, 255, 0.85) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.dark .fi-topbar {
    background-color: rgba(15, 23, 42, 0.85) !important;
    border-bottom-color: rgba(51, 65, 85, 0.5);
}

/* Global search */
.fi-global-search-input {
    border-radius: var(--et3am-radius-lg) !important;
    font-family: var(--et3am-font-family) !important;
}

/* --------------------------------------------------------------------------
 * 13. TABS & NAVIGATION
 * -------------------------------------------------------------------------- */

.fi-tabs-tab {
    transition: color var(--et3am-transition-fast),
                border-color var(--et3am-transition-fast),
                background-color var(--et3am-transition-fast) !important;
    font-weight: 600 !important;
    border-radius: var(--et3am-radius-md) var(--et3am-radius-md) 0 0 !important;
}

.fi-tabs-tab:hover {
    color: var(--et3am-emerald-600) !important;
}

.fi-tabs-tab-active {
    color: var(--et3am-emerald-600) !important;
    border-bottom-color: var(--et3am-emerald-500) !important;
}

.dark .fi-tabs-tab-active {
    color: var(--et3am-emerald-400) !important;
    border-bottom-color: var(--et3am-emerald-400) !important;
}

/* --------------------------------------------------------------------------
 * 14. PAGINATION
 * -------------------------------------------------------------------------- */

.fi-pagination-item {
    border-radius: var(--et3am-radius-md) !important;
    transition: all var(--et3am-transition-fast) !important;
}

.fi-pagination-item:hover {
    background-color: var(--et3am-emerald-50) !important;
    color: var(--et3am-emerald-700) !important;
}

.dark .fi-pagination-item:hover {
    background-color: rgba(16, 185, 129, 0.1) !important;
    color: var(--et3am-emerald-300) !important;
}

/* --------------------------------------------------------------------------
 * 15. CUSTOM SCROLLBAR
 * -------------------------------------------------------------------------- */

/* Webkit browsers (Chrome, Edge, Safari) */
::-webkit-scrollbar {
    width: var(--et3am-scrollbar-width);
    height: var(--et3am-scrollbar-width);
}

::-webkit-scrollbar-track {
    background: var(--et3am-scrollbar-track);
    border-radius: var(--et3am-radius-lg);
}

::-webkit-scrollbar-thumb {
    background: var(--et3am-scrollbar-thumb);
    border-radius: var(--et3am-radius-lg);
    transition: background-color var(--et3am-transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--et3am-scrollbar-thumb-hover);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--et3am-scrollbar-thumb) var(--et3am-scrollbar-track);
}

/* Sidebar scrollbar - slightly thinner */
.fi-sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

/* --------------------------------------------------------------------------
 * 16. GENERAL TRANSITIONS & POLISH
 * -------------------------------------------------------------------------- */

/* Smooth transitions on all interactive elements */
a, button, input, select, textarea,
[role="button"],
[role="tab"],
[role="menuitem"] {
    transition: color var(--et3am-transition-fast),
                background-color var(--et3am-transition-fast),
                border-color var(--et3am-transition-fast),
                box-shadow var(--et3am-transition-fast),
                opacity var(--et3am-transition-fast);
}

/* Links in content */
.fi-main a:not(.fi-btn):not(.fi-link):not(.fi-sidebar-item-button) {
    color: var(--et3am-emerald-600);
    text-decoration: none;
    transition: color var(--et3am-transition-fast);
}

.fi-main a:not(.fi-btn):not(.fi-link):not(.fi-sidebar-item-button):hover {
    color: var(--et3am-emerald-800);
    text-decoration: underline;
}

.dark .fi-main a:not(.fi-btn):not(.fi-link):not(.fi-sidebar-item-button) {
    color: var(--et3am-emerald-400);
}

.dark .fi-main a:not(.fi-btn):not(.fi-link):not(.fi-sidebar-item-button):hover {
    color: var(--et3am-emerald-300);
}

/* Card / section hover glow */
.fi-section,
.fi-wi-card {
    position: relative;
}

/* Loading indicator color override */
.fi-loading-indicator {
    color: var(--et3am-emerald-500) !important;
}

/* Selection color */
::selection {
    background-color: rgba(16, 185, 129, 0.2);
    color: inherit;
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid var(--et3am-emerald-500);
    outline-offset: 2px;
    border-radius: var(--et3am-radius-sm);
}

/* --------------------------------------------------------------------------
 * 17. BREADCRUMBS
 * -------------------------------------------------------------------------- */

.fi-breadcrumbs {
    font-size: 0.85rem;
}

.fi-breadcrumbs li {
    transition: color var(--et3am-transition-fast);
}

.fi-breadcrumbs a:hover {
    color: var(--et3am-emerald-600) !important;
}

/* --------------------------------------------------------------------------
 * 18. DROPDOWN MENUS
 * -------------------------------------------------------------------------- */

.fi-dropdown-panel {
    border-radius: var(--et3am-radius-lg) !important;
    box-shadow: var(--et3am-shadow-lg) !important;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.dark .fi-dropdown-panel {
    border-color: #334155;
}

.fi-dropdown-list-item {
    transition: background-color var(--et3am-transition-fast),
                color var(--et3am-transition-fast) !important;
    border-radius: var(--et3am-radius-sm) !important;
    margin: 0.125rem 0.25rem;
}

.fi-dropdown-list-item:hover {
    background-color: var(--et3am-emerald-50) !important;
}

.dark .fi-dropdown-list-item:hover {
    background-color: rgba(16, 185, 129, 0.1) !important;
}

/* --------------------------------------------------------------------------
 * 19. RTL-SPECIFIC OVERRIDES
 * -------------------------------------------------------------------------- */

/* Ensure directional properties are correct for RTL */
[dir="rtl"] .fi-sidebar-item-active .fi-sidebar-item-button,
[dir="rtl"] .fi-sidebar-item-button[aria-current="page"] {
    border-inline-start: 3px solid var(--et3am-emerald-500) !important;
    border-inline-end: none !important;
}

/* RTL notification border */
[dir="rtl"] .fi-notification-success {
    border-inline-start: 4px solid var(--et3am-emerald-500) !important;
    border-inline-end: none !important;
}

/* RTL sidebar group label accent */
[dir="rtl"] .fi-sidebar-group-label::before {
    inset-inline-start: 0;
    inset-inline-end: auto;
}

/* Fix alignment for number inputs in RTL */
input[type="number"] {
    text-align: right;
    direction: ltr;
    unicode-bidi: bidi-override;
}

/* Date/time inputs keep LTR for readability */
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
    direction: ltr;
    text-align: right;
}

/* Phone number fields */
input[type="tel"] {
    direction: ltr;
    text-align: right;
}

/* --------------------------------------------------------------------------
 * 20. INFOLIST / DETAIL PAGES
 * -------------------------------------------------------------------------- */

.fi-in-entry-wrp {
    border-radius: var(--et3am-radius-md);
    transition: background-color var(--et3am-transition-fast);
}

.fi-in-entry-wrp:hover {
    background-color: rgba(241, 245, 249, 0.5);
}

.dark .fi-in-entry-wrp:hover {
    background-color: rgba(30, 41, 59, 0.3);
}

/* --------------------------------------------------------------------------
 * 21. EMPTY STATE
 * -------------------------------------------------------------------------- */

.fi-ta-empty-state {
    padding: 3rem 1rem !important;
}

.fi-ta-empty-state-icon {
    color: var(--et3am-emerald-300) !important;
}

.dark .fi-ta-empty-state-icon {
    color: var(--et3am-emerald-600) !important;
}

/* --------------------------------------------------------------------------
 * 22. PRINT STYLES
 * -------------------------------------------------------------------------- */

@media print {
    /* Hide non-essential UI elements */
    .fi-sidebar,
    .fi-topbar,
    .fi-global-search,
    .fi-breadcrumbs,
    .fi-btn,
    .fi-icon-btn,
    .fi-pagination,
    .fi-ta-header-toolbar,
    .fi-dropdown,
    .fi-notification,
    .fi-footer,
    nav {
        display: none !important;
    }

    /* Full width for main content */
    .fi-main,
    .fi-main-ctn {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0.5rem !important;
    }

    /* Remove shadows and backgrounds */
    .fi-section,
    .fi-wi-card,
    .fi-ta,
    .fi-wi-stats-overview-stat {
        box-shadow: none !important;
        border: 1px solid #d1d5db !important;
    }

    /* Ensure text is black for printing */
    body, p, span, td, th, h1, h2, h3, h4, h5, h6, label, div {
        color: #000 !important;
    }

    /* Table borders for print clarity */
    .fi-ta-row {
        border-bottom: 1px solid #e5e7eb !important;
    }

    .fi-ta-header-cell {
        border-bottom: 2px solid #000 !important;
        color: #000 !important;
    }

    /* Page breaks */
    .fi-section,
    .fi-wi-card {
        page-break-inside: avoid;
    }

    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }

    /* Print header */
    @page {
        margin: 1.5cm;
        size: A4;
    }

    /* Reset backgrounds */
    body {
        background: white !important;
    }

    /* Ensure RTL direction is preserved in print */
    body {
        direction: rtl !important;
        text-align: right !important;
        font-family: var(--et3am-font-family) !important;
    }

    /* Show URLs after links in print */
    .fi-main a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
        font-weight: normal;
    }

    /* Don't show URL for buttons styled as links */
    .fi-main a.fi-btn[href]::after,
    .fi-main a.fi-link[href]::after {
        content: none;
    }
}

/* --------------------------------------------------------------------------
 * 23. RESPONSIVE ADJUSTMENTS
 * -------------------------------------------------------------------------- */

/* Mobile: tighter spacing */
@media (max-width: 768px) {
    .fi-simple-layout .fi-simple-main {
        margin: 1rem;
        padding: 1.5rem !important;
        border-radius: var(--et3am-radius-xl) !important;
    }

    .fi-wi-stats-overview-stat:hover {
        transform: none;
    }

    .fi-ta-cell {
        padding: 0.5rem 0.75rem !important;
    }
}

/* Large screens */
@media (min-width: 1536px) {
    .fi-simple-layout .fi-simple-main {
        max-width: 30rem;
    }
}

/* --------------------------------------------------------------------------
 * 24. LAYOUT HEIGHT FIXES
 * -------------------------------------------------------------------------- */

/* Ensure the body and layout fill full viewport */
.fi-layout {
    min-height: 100vh !important;
}

/* Sidebar: sticky with independent scroll on desktop */
@media (min-width: 1024px) {
    .fi-sidebar {
        position: sticky !important;
        top: 0 !important;
        height: 100vh !important;
        max-height: 100vh !important;
        align-self: flex-start !important;
        overflow: hidden !important;
    }

    .fi-sidebar-nav {
        flex: 1 1 0% !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        overscroll-behavior: contain !important;
        max-height: calc(100vh - 4rem) !important; /* subtract header height */
    }
}

/* Main content area should fill remaining space */
.fi-main-ctn {
    min-height: 100vh;
}

.fi-main {
    min-height: calc(100vh - 4rem);
    padding-bottom: 2rem;
}

/* --------------------------------------------------------------------------
 * 25. PAGE HEADING VISIBILITY (Light Mode)
 * -------------------------------------------------------------------------- */

/* Ensure page headings are always visible */
.fi-header-heading,
.fi-page-header h1,
.fi-header h1 {
    color: #1e293b !important;
}

.dark .fi-header-heading,
.dark .fi-page-header h1,
.dark .fi-header h1 {
    color: #f1f5f9 !important;
}

/* Sidebar item text must be visible in light mode */
.fi-sidebar-item-button .fi-sidebar-item-label {
    color: #475569;
}

.fi-sidebar-item-active .fi-sidebar-item-button .fi-sidebar-item-label {
    color: var(--et3am-emerald-700) !important;
}

/* Sidebar item icons */
.fi-sidebar-item-icon {
    color: #64748b;
}

/* --------------------------------------------------------------------------
 * 26. ANIMATIONS
 * -------------------------------------------------------------------------- */

/* Subtle fade-in for page content */
.fi-main > * {
    animation: et3am-fade-in 0.3s ease-out;
}

@keyframes et3am-fade-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulse animation for loading states */
@keyframes et3am-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.fi-loading-indicator {
    animation: et3am-pulse 1.5s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
 * 27. TAILWIND UTILITY SAFELIST (Classes missing from Filament's compiled CSS)
 * -------------------------------------------------------------------------- */

/* Background colors */
.bg-blue-50 { background-color: #eff6ff; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-green-50 { background-color: #f0fdf4; }
.bg-green-100 { background-color: #dcfce7; }
.bg-red-50 { background-color: #fef2f2; }
.bg-red-100 { background-color: #fee2e2; }
.bg-yellow-50 { background-color: #fefce8; }
.bg-yellow-100 { background-color: #fef9c3; }
.bg-orange-50 { background-color: #fff7ed; }
.bg-purple-50 { background-color: #faf5ff; }
.bg-emerald-50 { background-color: #ecfdf5; }
.bg-emerald-100 { background-color: #d1fae5; }
.bg-teal-50 { background-color: #f0fdfa; }
.bg-indigo-50 { background-color: #eef2ff; }

/* Text colors */
.text-blue-600 { color: #2563eb; }
.text-blue-700 { color: #1d4ed8; }
.text-green-600 { color: #16a34a; }
.text-green-700 { color: #15803d; }
.text-red-600 { color: #dc2626; }
.text-red-700 { color: #b91c1c; }
.text-yellow-600 { color: #ca8a04; }
.text-yellow-700 { color: #a16207; }
.text-orange-600 { color: #ea580c; }
.text-purple-600 { color: #9333ea; }
.text-emerald-600 { color: #059669; }
.text-emerald-700 { color: #047857; }
.text-teal-600 { color: #0d9488; }
.text-indigo-600 { color: #4f46e5; }

/* Border colors */
.border-blue-200 { border-color: #bfdbfe; }
.border-blue-300 { border-color: #93c5fd; }
.border-green-200 { border-color: #bbf7d0; }
.border-green-300 { border-color: #86efac; }
.border-red-200 { border-color: #fecaca; }
.border-red-300 { border-color: #fca5a5; }
.border-yellow-200 { border-color: #fde68a; }
.border-orange-200 { border-color: #fed7aa; }
.border-purple-200 { border-color: #e9d5ff; }
.border-emerald-200 { border-color: #a7f3d0; }
.border-emerald-300 { border-color: #6ee7b7; }
.border-teal-200 { border-color: #99f6e4; }
.border-indigo-200 { border-color: #c7d2fe; }

/* Size utilities (w-12/h-12 missing from Filament's compiled CSS) */
.w-4 { width: 1rem; }
.h-4 { height: 1rem; }
.w-5 { width: 1.25rem; }
.h-5 { height: 1.25rem; }
.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }
.w-8 { width: 2rem; }
.h-8 { height: 2rem; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.w-12 { width: 3rem; }
.h-12 { height: 3rem; }

/* Filament semantic color classes (used in blade views but may not be compiled) */
.text-success-400 { color: #4ade80; }
.text-success-500 { color: #22c55e; }
.text-success-600 { color: #16a34a; }
.text-warning-600 { color: #d97706; }
.text-danger-500 { color: #ef4444; }
.text-primary-500 { color: #10b981; }
.text-primary-600 { color: #059669; }
.text-gray-400 { color: #9ca3af; }

/* Ring colors */
.ring-2 { --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color); box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); }

/* Dark mode overrides for raw Tailwind color classes */
.dark .bg-green-50 { background-color: rgba(34, 197, 94, 0.08); }
.dark .bg-blue-50 { background-color: rgba(59, 130, 246, 0.08); }
.dark .bg-red-50 { background-color: rgba(239, 68, 68, 0.08); }
.dark .bg-yellow-50 { background-color: rgba(234, 179, 8, 0.08); }

/* Font mono for accounting tables */
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

/* Border dashed for empty states */
.border-dashed { border-style: dashed; }

/* File input styling (volunteer upload) */
.file\:mr-4::file-selector-button { margin-right: 1rem; }
.file\:py-2::file-selector-button { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.file\:px-4::file-selector-button { padding-left: 1rem; padding-right: 1rem; }
.file\:rounded-lg::file-selector-button { border-radius: 0.5rem; }
.file\:border-0::file-selector-button { border-width: 0; }
.file\:text-sm::file-selector-button { font-size: 0.875rem; }
.file\:font-semibold::file-selector-button { font-weight: 600; }
.file\:bg-primary-50::file-selector-button { background-color: var(--et3am-emerald-50); }
.file\:text-primary-700::file-selector-button { color: var(--et3am-emerald-700); }

/* Max height with overflow for AI review list */
.max-h-\[70vh\] { max-height: 70vh; }

/* Backdrop filter for blur effects */
.backdrop-blur { backdrop-filter: blur(8px); }

/* Pre formatting for JSON display */
pre { white-space: pre-wrap; word-wrap: break-word; }

/* --------------------------------------------------------------------------
 * 28. CUSTOM PAGE STYLES (blade view specific)
 * -------------------------------------------------------------------------- */

/* Empty state styling for custom pages */
.et3am-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    background: #fff;
    border-radius: 0.75rem;
    border: 2px dashed #e2e8f0;
}

.dark .et3am-empty-state {
    background: #1e293b;
    border-color: #334155;
}

.et3am-empty-state svg {
    width: 3rem;
    height: 3rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.et3am-empty-state h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.et3am-empty-state p {
    font-size: 0.875rem;
    color: #9ca3af;
}

/* Scan input card with primary border */
.et3am-scan-card {
    background: #fff;
    border-radius: 0.75rem;
    border: 2px solid var(--et3am-emerald-500);
    padding: 1.5rem;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.dark .et3am-scan-card {
    background: #1e293b;
}

.et3am-scan-card input[type="text"] {
    font-size: 1.5rem;
    padding: 1rem;
    border: 2px solid #d1d5db;
    border-radius: 0.75rem;
    width: 100%;
}

.et3am-scan-card input[type="text"]:focus {
    border-color: var(--et3am-emerald-500);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
    outline: none;
}

/* Progress bar colors */
.et3am-progress-bar {
    background: #e5e7eb;
    border-radius: 9999px;
    height: 1rem;
    overflow: hidden;
}

.et3am-progress-bar .et3am-progress-fill {
    background: linear-gradient(90deg, var(--et3am-emerald-500), var(--et3am-emerald-400));
    height: 100%;
    border-radius: 9999px;
    transition: width 0.5s ease;
}

/* Stat cards for kitchen/packaging pages */
.et3am-stat-card {
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.dark .et3am-stat-card {
    background: #1e293b;
    border-color: #334155;
}

.et3am-stat-card .et3am-stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    display: block;
}

.et3am-stat-card .et3am-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--et3am-emerald-600);
}

/* Card containers for selection grids */
.et3am-select-card {
    padding: 1rem;
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: border-color 150ms, box-shadow 150ms, transform 150ms;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.dark .et3am-select-card {
    background: #1e293b;
    border-color: #334155;
}

.et3am-select-card:hover {
    border-color: var(--et3am-emerald-500);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* Table containers for blade pages */
.et3am-table-wrap {
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.dark .et3am-table-wrap {
    background: #1e293b;
    border-color: #334155;
}

.et3am-table-wrap table {
    width: 100%;
    font-size: 0.875rem;
}

.et3am-table-wrap thead {
    background: #f9fafb;
}

.dark .et3am-table-wrap thead {
    background: #0f172a;
}

.et3am-table-wrap th {
    padding: 0.75rem 1rem;
    text-align: start;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.et3am-table-wrap td {
    padding: 0.75rem 1rem;
}

.et3am-table-wrap tbody tr {
    border-top: 1px solid #e5e7eb;
}

.dark .et3am-table-wrap tbody tr {
    border-top-color: #334155;
}

.et3am-table-wrap tbody tr:hover {
    background: var(--et3am-emerald-50);
}

/* Picked/complete row highlight */
.et3am-row-complete {
    background-color: #f0fdf4;
}

.dark .et3am-row-complete {
    background-color: rgba(34, 197, 94, 0.06);
}

/* Trial balance specific colors */
.et3am-debit { color: #2563eb; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.et3am-credit { color: #16a34a; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.et3am-negative { color: #dc2626; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.et3am-balanced { color: #16a34a; font-weight: 700; }
.et3am-unbalanced { color: #dc2626; font-weight: 700; }

/* Section header for page sections */
.et3am-section-header {
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.dark .et3am-section-header {
    background: #1e293b;
    border-color: #334155;
}

/* Confidence score bar (AI review) */
.et3am-confidence-bar {
    background: #e5e7eb;
    border-radius: 9999px;
    height: 0.625rem;
    overflow: hidden;
}

.et3am-confidence-high { background: #22c55e; }
.et3am-confidence-medium { background: #f59e0b; }
.et3am-confidence-low { background: #ef4444; }

/* AI review selected card */
.et3am-ai-card-selected {
    border-color: var(--et3am-emerald-500) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Packaging summary box */
.et3am-packaging-summary {
    background: var(--et3am-emerald-50);
    border: 1px solid var(--et3am-emerald-200);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
}

.dark .et3am-packaging-summary {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
}

/* --------------------------------------------------------------------------
 * 29. TOPBAR TOOLS DROPDOWN
 * -------------------------------------------------------------------------- */

.et3am-tools-wrap {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 50;
}

.et3am-tools-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    font-family: var(--et3am-font-family);
    transition: all 0.15s;
}

.et3am-tools-btn:hover {
    background: var(--et3am-emerald-50);
    border-color: var(--et3am-emerald-200);
    color: var(--et3am-emerald-600);
}

.et3am-tools-dropdown {
    position: absolute;
    top: calc(100% + 0.35rem);
    z-index: 9999;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.18), 0 2px 6px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    min-width: 15rem;
    overflow: visible;
}

[dir="rtl"] .et3am-tools-dropdown { right: 0; }
[dir="ltr"] .et3am-tools-dropdown { left: 0; }

.et3am-tools-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    text-align: start;
    text-decoration: none;
    font-family: var(--et3am-font-family);
    transition: background 0.15s;
}

.et3am-tools-item:hover {
    background: var(--et3am-emerald-50);
    color: var(--et3am-emerald-700);
}

/* Calculator */
.et3am-calc-panel {
    border-top: 1px solid #e2e8f0;
    padding: 0.625rem;
}

.et3am-calc-display {
    background: #1e293b;
    color: #fff;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    text-align: right;
    direction: ltr;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 1.15rem;
    font-weight: 700;
    min-height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    overflow: hidden;
}

.et3am-calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.2rem;
}

.et3am-calc-btn {
    padding: 0.45rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    font-family: var(--et3am-font-family);
    transition: opacity 0.1s, transform 0.1s;
}

.et3am-calc-btn:hover {
    opacity: 0.8;
    transform: scale(0.96);
}

.et3am-calc-btn:active {
    transform: scale(0.9);
}

.et3am-calc-btn-wide {
    grid-column: span 2;
}

/* Mobile: hide text, show icon only */
@media (max-width: 640px) {
    .et3am-tools-btn-text {
        display: none;
    }
    .et3am-tools-btn {
        padding: 0.375rem;
    }
    .et3am-tools-dropdown {
        min-width: 13rem;
        right: 0;
        left: auto;
    }
}

/* --------------------------------------------------------------------------
 * 30. REPORT EMPTY STATE (smaller icons)
 * -------------------------------------------------------------------------- */

.et3am-empty-report {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: #fff;
    border-radius: 0.75rem;
    border: 2px dashed #e2e8f0;
}

.dark .et3am-empty-report {
    background: #1e293b;
    border-color: #334155;
}

.et3am-empty-report svg {
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 auto 0.75rem;
    color: #94a3b8;
}

.et3am-empty-report h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #64748b;
    margin: 0 0 0.25rem;
}

.et3am-empty-report p {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 0;
}

/* --------------------------------------------------------------------------
 * 31. MOBILE TOPBAR FIX
 * -------------------------------------------------------------------------- */

/* Prevent topbar from overflowing on mobile (only on small screens) */
@media (max-width: 768px) {
    .fi-topbar nav,
    .fi-topbar > div {
        overflow: hidden;
    }
}

/* On mobile: hide tools button (bottom nav has tools) and role badge */
@media (max-width: 768px) {
    .et3am-topbar-tools {
        display: none !important;
    }

    .et3am-role-badge {
        display: none !important;
    }

    /* Compact language toggle on mobile */
    .et3am-lang-toggle {
        padding-inline: 0.25rem !important;
        gap: 0.125rem !important;
    }

    .et3am-lang-toggle a {
        padding: 0.15rem 0.4rem !important;
        font-size: 0.65rem !important;
    }

    /* Ensure topbar items don't overflow */
    .fi-topbar nav > div,
    .fi-topbar [class*="flex"] {
        flex-shrink: 1;
        min-width: 0;
    }

    /* Ensure the hamburger menu button is always visible */
    .fi-sidebar-open-btn,
    .fi-topbar button[x-on\:click*="sidebar"],
    .fi-topbar .fi-icon-btn:first-child {
        flex-shrink: 0 !important;
    }

    /* Give the sidebar overlay higher z-index than bottom nav */
    .fi-sidebar-close-overlay {
        z-index: 45 !important;
    }

    .fi-sidebar {
        z-index: 50 !important;
    }
}

/* On extra small screens, hide language toggle too */
@media (max-width: 380px) {
    .et3am-lang-toggle {
        display: none !important;
    }
}

/* --------------------------------------------------------------------------
 * 32. MOBILE ENHANCEMENTS
 * -------------------------------------------------------------------------- */

/* Prevent iOS zoom on input focus (font-size must be >= 16px) */
@media (max-width: 768px) {
    input[type="text"],
    input[type="number"],
    input[type="search"],
    input[type="tel"],
    input[type="email"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Larger touch targets for action buttons */
    .fi-ta-actions .fi-btn,
    .fi-ta-actions .fi-icon-btn {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 0.5rem !important;
    }

    /* Larger touch targets for table checkboxes */
    .fi-ta-checkbox-cell .fi-checkbox-input {
        width: 1.25rem !important;
        height: 1.25rem !important;
    }

    /* Stack table actions vertically on small screens */
    .fi-ta-actions {
        flex-direction: column;
        gap: 0.25rem;
    }

    /* Larger pagination buttons */
    .fi-pagination .fi-pagination-item {
        min-width: 40px;
        min-height: 40px;
    }

    /* Make filter dropdowns full-width */
    .fi-ta-header-toolbar {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Sidebar overlay improvements */
    .fi-sidebar-nav {
        padding-bottom: 5rem;
    }

    /* Larger nav items on mobile sidebar */
    .fi-sidebar-item-button {
        min-height: 44px !important;
        padding: 0.625rem 0.75rem !important;
    }

    /* Better form field spacing */
    .fi-fo-field-wrp {
        margin-bottom: 0.75rem;
    }

    /* Larger toggle switches on mobile */
    .fi-toggle-input {
        transform: scale(1.15);
    }
}

/* Extra small phone optimizations */
@media (max-width: 380px) {
    .fi-ta-cell {
        padding: 0.375rem 0.5rem !important;
        font-size: 0.8rem !important;
    }

    .fi-section-content {
        padding: 0.75rem !important;
    }

    .fi-header-heading {
        font-size: 1.1rem !important;
    }
}

/* Touch-friendly scan input */
.et3am-scan-input-mobile {
    font-size: 1.25rem !important;
    padding: 0.875rem 1rem !important;
    min-height: 52px;
    border-radius: 0.75rem;
    border: 2px solid var(--et3am-emerald-400);
    background: #fff;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dark .et3am-scan-input-mobile {
    background: #1e293b;
    color: #fff;
}

.et3am-scan-input-mobile:focus {
    border-color: var(--et3am-emerald-500);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
    outline: none;
}

/* Camera scan button */
.et3am-camera-scan-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    min-height: 48px;
    background: var(--et3am-emerald-600);
    color: #fff;
    border: none;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--et3am-font-family);
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.et3am-camera-scan-btn:hover {
    background: var(--et3am-emerald-700);
}

.et3am-camera-scan-btn:active {
    transform: scale(0.97);
}

.et3am-camera-scan-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Camera preview container */
.et3am-camera-preview {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 3px solid var(--et3am-emerald-500);
    background: #000;
}

.et3am-camera-preview video {
    width: 100%;
    display: block;
}

.et3am-camera-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.et3am-camera-crosshair {
    width: 60%;
    height: 60%;
    border: 2px dashed rgba(16, 185, 129, 0.7);
    border-radius: 0.5rem;
}

/* Bottom quick nav for warehouse operators */
.et3am-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    z-index: 40;
    padding: 0.25rem 0;
    padding-bottom: env(safe-area-inset-bottom, 0.25rem);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
}

.dark .et3am-bottom-nav {
    background: #1e293b;
    border-top-color: #334155;
}

.et3am-bottom-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.et3am-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    padding: 0.375rem 0.5rem;
    color: #64748b;
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 600;
    font-family: var(--et3am-font-family);
    min-width: 56px;
    transition: color 0.15s;
}

.et3am-bottom-nav-item svg {
    width: 1.25rem;
    height: 1.25rem;
}

.et3am-bottom-nav-item:hover,
.et3am-bottom-nav-item.active {
    color: var(--et3am-emerald-600);
}

/* Show bottom nav only on mobile */
@media (max-width: 768px) {
    .et3am-bottom-nav {
        display: block;
    }

    /* Add padding to main content so it doesn't hide behind bottom nav */
    .fi-main {
        padding-bottom: 5rem !important;
    }
}

/* Scan result feedback animation */
@keyframes et3am-scan-success {
    0% { background-color: rgba(16, 185, 129, 0.2); }
    100% { background-color: transparent; }
}

@keyframes et3am-scan-error {
    0% { background-color: rgba(239, 68, 68, 0.2); }
    100% { background-color: transparent; }
}

.et3am-scan-flash-success {
    animation: et3am-scan-success 0.8s ease-out;
}

.et3am-scan-flash-error {
    animation: et3am-scan-error 0.8s ease-out;
}

/* --------------------------------------------------------------------------
 * 28. DASHBOARD LAYOUT CLASSES
 * -------------------------------------------------------------------------- */

/* Welcome Banner */
.et3am-welcome-banner {
    background: linear-gradient(to left, #059669, #10b981, #0d9488);
    border-radius: 1rem;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}
.et3am-welcome-banner-overlay {
    position: absolute;
    inset: 0;
    opacity: 0.08;
}
.et3am-welcome-banner-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.et3am-welcome-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0 0 0.25rem 0;
    color: #fff;
}
.et3am-welcome-subtitle {
    color: rgba(255,255,255,0.85);
    font-size: 0.95rem;
    margin: 0;
}
.et3am-welcome-subtitle strong {
    font-weight: 600;
}
.et3am-banner-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.et3am-banner-stat {
    text-align: center;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    border-radius: 0.75rem;
    padding: 0.75rem 1.25rem;
}
.et3am-banner-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
}
.et3am-banner-stat-label {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.8);
}

/* Section Heading */
.et3am-section-heading {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
}

/* Volunteer Task Grid */
.et3am-volunteer-task-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.et3am-volunteer-task-card {
    border-radius: 0.75rem;
    padding: 1.25rem;
    text-align: center;
    border-width: 1.5px;
    border-style: solid;
}
.et3am-volunteer-task-card--warning {
    background: #fffbeb;
    border-color: #fde68a;
}
.et3am-volunteer-task-card--info {
    background: #eff6ff;
    border-color: #bfdbfe;
}
.et3am-volunteer-task-card--success {
    background: #ecfdf5;
    border-color: #a7f3d0;
}
.et3am-volunteer-task-value {
    font-size: 2rem;
    font-weight: 800;
}
.et3am-volunteer-task-value--warning { color: #d97706; }
.et3am-volunteer-task-value--info { color: #2563eb; }
.et3am-volunteer-task-value--success { color: #059669; }
.et3am-volunteer-task-label {
    font-size: 0.85rem;
    font-weight: 600;
}
.et3am-volunteer-task-label--warning { color: #92400e; }
.et3am-volunteer-task-label--info { color: #1e40af; }
.et3am-volunteer-task-label--success { color: #065f46; }

/* Quick Action Cards */
.et3am-quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
.et3am-quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1rem;
    background: #fff;
    border-radius: 0.75rem;
    border: 1.5px solid #e2e8f0;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.et3am-quick-action-card:hover,
.et3am-quick-action-card:focus {
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transform: translateY(-3px);
    border-color: var(--et3am-emerald-500);
    outline: none;
}
.et3am-quick-action-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}
.et3am-quick-action-icon svg {
    width: 1.5rem;
    height: 1.5rem;
}
.et3am-quick-action-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
    line-height: 1.3;
}

/* Widget Grid Layouts */
.et3am-widget-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.et3am-widget-grid-dynamic {
    display: grid;
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.et3am-widget-single {
    margin-top: 1.5rem;
}
.et3am-section-margin {
    margin-bottom: 2rem;
}

/* Dashboard Divider (moved from inline style) */
.et3am-dashboard-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}
.et3am-dashboard-divider::before,
.et3am-dashboard-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to var(--direction, right), #e2e8f0, transparent);
}
.et3am-dashboard-divider::after {
    --direction: left;
}
.et3am-dashboard-divider span {
    font-size: 0.85rem;
    font-weight: 700;
    color: #64748b;
    white-space: nowrap;
    padding: 0.25rem 0.75rem;
    background: #f8fafc;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
}
.et3am-dashboard-divider-top {
    margin-top: 2rem;
}

/* --------------------------------------------------------------------------
 * 29. TABULAR NUMBERS FOR CURRENCY
 * -------------------------------------------------------------------------- */
.et3am-currency,
.fi-ta-text-item-column [data-money] {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
 * 30. ACCESSIBILITY: CONTRAST & KEYBOARD
 * -------------------------------------------------------------------------- */

/* Improve sidebar item text contrast (slate-500 -> slate-600) */
.fi-sidebar-item-label {
    color: #475569 !important;
}
.dark .fi-sidebar-item-label {
    color: #94a3b8 !important;
}

/* Keyboard-accessible topbar tools button */
.et3am-topbar-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.625rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}
.et3am-topbar-btn:hover,
.et3am-topbar-btn:focus {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #059669;
    outline: none;
}

/* Ctrl+K search hint badge */
.et3am-search-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.625rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 0.7rem;
    font-weight: 500;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}
.et3am-search-hint:hover {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #059669;
}
.et3am-search-hint kbd {
    font-size: 0.65rem;
    font-weight: 700;
    color: #64748b;
    background: #fff;
    padding: 0.1rem 0.3rem;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    font-family: inherit;
}

/* --------------------------------------------------------------------------
 * 31. DASHBOARD RESPONSIVE OVERRIDES
 * -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .et3am-quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .et3am-widget-grid-2 {
        grid-template-columns: 1fr;
    }
    .et3am-volunteer-task-grid {
        grid-template-columns: 1fr;
    }
    .et3am-banner-stats {
        justify-content: center;
    }
    .et3am-welcome-title {
        font-size: 1.35rem;
    }
    .et3am-search-hint {
        display: none;
    }
}

/* --------------------------------------------------------------------------
 * 33. DARK MODE TOGGLE BUTTON
 * -------------------------------------------------------------------------- */

/* Desktop topbar dark toggle */
.et3am-dark-toggle {
    display: flex;
    align-items: center;
}

.et3am-dark-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.et3am-dark-toggle-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

.dark .et3am-dark-toggle-btn {
    background: #334155;
    border-color: #475569;
    color: #f59e0b;
}

.dark .et3am-dark-toggle-btn:hover {
    background: #475569;
    border-color: #64748b;
    color: #fbbf24;
}

/* Mobile bottom nav dark toggle */
.et3am-bottom-dark-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--et3am-font-family);
}

/* Dark mode topbar adjustments */
.dark .et3am-topbar-btn {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

.dark .et3am-topbar-btn:hover,
.dark .et3am-topbar-btn:focus {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--et3am-emerald-400);
}

.dark .et3am-search-hint {
    background: #1e293b;
    border-color: #334155;
    color: #64748b;
}

.dark .et3am-search-hint:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--et3am-emerald-400);
}

.dark .et3am-search-hint kbd {
    background: #334155;
    border-color: #475569;
    color: #94a3b8;
}

/* Dark mode: topbar tools dropdown & calculator */
.dark .et3am-topbar-tools [x-show="toolsOpen"] {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3) !important;
}

.dark .et3am-topbar-tools [x-show="toolsOpen"] button,
.dark .et3am-topbar-tools [x-show="toolsOpen"] a {
    color: #e2e8f0 !important;
}

.dark .et3am-topbar-tools [x-show="toolsOpen"] button:hover,
.dark .et3am-topbar-tools [x-show="toolsOpen"] a:hover {
    background: rgba(16, 185, 129, 0.1) !important;
    color: #34d399 !important;
}

.dark .et3am-topbar-tools [x-show="toolsOpen"] > div[style*="border-top"] {
    border-color: #334155 !important;
}

/* Dark mode: calculator popup */
.dark .et3am-topbar-tools [x-show="calcOpen"] > div:last-child {
    background: #1e293b !important;
    border-color: #334155 !important;
}

.dark .et3am-topbar-tools [x-show="calcOpen"] [style*="background: #f8fafc"] {
    background: #0f172a !important;
}

.dark .et3am-topbar-tools [x-show="calcOpen"] button[style*="background: #ffffff"] {
    background: #334155 !important;
    color: #e2e8f0 !important;
    border-color: #475569 !important;
}

.dark .et3am-topbar-tools [x-show="calcOpen"] button[style*="background: #f1f5f9"] {
    background: #475569 !important;
    color: #e2e8f0 !important;
}

.dark .et3am-topbar-tools [x-show="calcOpen"] button[style*="background: #fef2f2"] {
    background: rgba(220, 38, 38, 0.15) !important;
}

.dark .et3am-topbar-tools [x-show="calcOpen"] button[style*="background: #fff7ed"] {
    background: rgba(234, 88, 12, 0.15) !important;
}

/* Dark mode: hide duplicate theme toggle on mobile (bottom-nav has it) */
@media (max-width: 768px) {
    .fi-topbar button[x-on\:click*="theme"] {
        display: none !important;
    }
}

/* --------------------------------------------------------------------------
 * 34. DARK MODE - SETTINGS PAGE OVERRIDES
 * -------------------------------------------------------------------------- */
.dark .et3am-settings-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}

.dark .et3am-settings-card-header {
    background: #0f172a !important;
    border-bottom-color: #334155 !important;
}

.dark .et3am-settings-card-header h3 {
    color: #e2e8f0 !important;
}

.dark .et3am-settings-card-header p {
    color: #64748b !important;
}

.dark .et3am-settings-label {
    color: #cbd5e1 !important;
}

.dark .et3am-settings-input {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

.dark .et3am-settings-input:focus {
    border-color: var(--et3am-emerald-500) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

.dark .et3am-settings-readonly {
    background: #0f172a !important;
    color: #94a3b8 !important;
}

.dark .et3am-settings-btn-save {
    background: var(--et3am-emerald-600) !important;
}

.dark .et3am-settings-btn-save:hover {
    background: var(--et3am-emerald-700) !important;
}

.dark .et3am-settings-toggle-bg {
    background: #0f172a !important;
    border-color: #334155 !important;
}

.dark .et3am-settings-toggle-bg.active {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

.dark .et3am-settings-info-box {
    background: rgba(59, 130, 246, 0.1) !important;
    border-color: rgba(59, 130, 246, 0.2) !important;
}

.dark .et3am-settings-info-box p {
    color: #93c5fd !important;
}

/* Color picker buttons in dark mode */
.dark .et3am-color-btn {
    border-color: #334155 !important;
    background: #1e293b !important;
}

.dark .et3am-color-btn.selected {
    background: rgba(var(--selected-rgb), 0.15) !important;
}

.dark .et3am-color-btn span {
    color: #94a3b8 !important;
}

/* Dark mode welcome banner keeps its gradient */
.dark .et3am-welcome-banner {
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3);
}

/* --------------------------------------------------------------------------
 * 35. MOBILE UX FIXES (2026-02-21)
 * -------------------------------------------------------------------------- */

/* Fix #6: Widget grid inline styles (style="grid-template-columns: repeat(2,1fr)")
   override CSS media queries. Use !important to force single column on mobile. */
@media (max-width: 768px) {
    .et3am-widget-grid-dynamic {
        grid-template-columns: 1fr !important;
    }
}

/* Fix #5: Quick actions grid - single column on extra-small screens */
@media (max-width: 380px) {
    .et3am-quick-actions-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }
    .et3am-quick-action-card {
        flex-direction: row;
        justify-content: flex-start;
        padding: 0.875rem 1rem;
    }
    .et3am-quick-action-icon {
        margin-bottom: 0;
        margin-inline-end: 0.75rem;
    }
}

/* Fix #2: Kitchen wizard step labels hidden on small screens */
@media (max-width: 640px) {
    .et3am-step-label {
        display: none;
    }
    .et3am-step-divider {
        width: 1.5rem !important;
    }
    .et3am-step-circle {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.8rem;
    }
}

/* Fix #10: Flow pipeline scroll fade indicator */
.et3am-flow-scroll-wrap {
    position: relative;
    overflow: hidden;
}
.et3am-flow-scroll-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    inset-inline-end: 0;
    width: 2.5rem;
    background: linear-gradient(to left, var(--fi-body-bg, #fff), transparent);
    pointer-events: none;
    z-index: 1;
}
[dir="rtl"] .et3am-flow-scroll-wrap::after {
    background: linear-gradient(to right, var(--fi-body-bg, #fff), transparent);
}
.dark .et3am-flow-scroll-wrap::after {
    background: linear-gradient(to left, #1f2937, transparent);
}
[dir="rtl"].dark .et3am-flow-scroll-wrap::after,
.dark [dir="rtl"] .et3am-flow-scroll-wrap::after {
    background: linear-gradient(to right, #1f2937, transparent);
}

/* Fix #9: Attendance bottom bar safe-area + stacking */
@media (max-width: 640px) {
    .et3am-attendance-actions {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    .et3am-attendance-actions .et3am-attendance-btn {
        width: 100%;
    }
}

/* Swipe card visual feedback */
.et3am-swipe-card {
    transition: transform 0.2s ease, background-color 0.15s ease;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}
.et3am-swipe-card.swiping {
    transition: none;
}
.et3am-swipe-hint-received {
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dcfce7;
    border-radius: 0.75rem 0 0 0.75rem;
    opacity: 0;
    transition: opacity 0.15s;
}
.et3am-swipe-hint-absent {
    position: absolute;
    inset-inline-end: 0;
    top: 0;
    bottom: 0;
    width: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fee2e2;
    border-radius: 0 0.75rem 0.75rem 0;
    opacity: 0;
    transition: opacity 0.15s;
}
[dir="rtl"] .et3am-swipe-hint-received {
    border-radius: 0 0.75rem 0.75rem 0;
}
[dir="rtl"] .et3am-swipe-hint-absent {
    border-radius: 0.75rem 0 0 0.75rem;
}

/* Offline banner */
.et3am-offline-banner {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #92400e;
}
.dark .et3am-offline-banner {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

/* Pull-to-refresh indicator */
.et3am-ptr-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 0;
    overflow: hidden;
    transition: height 0.2s ease;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 600;
}
.et3am-ptr-indicator.active {
    height: 3rem;
}
.et3am-ptr-spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #e2e8f0;
    border-top-color: #10b981;
    border-radius: 50%;
    animation: et3am-ptr-spin 0.6s linear infinite;
    margin-inline-end: 0.5rem;
}
@keyframes et3am-ptr-spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Dashboard Components
   ============================================ */

/* Skeleton Loading */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.et3am-skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--et3am-radius-md, 0.5rem);
}
.dark .et3am-skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
}

/* --------------------------------------------------------------------------
 * 30. ACCESSIBILITY IMPROVEMENTS
 * -------------------------------------------------------------------------- */

/* Disabled state styles */
.fi-input:disabled,
.fi-input-wrp:has(:disabled) {
    opacity: 0.6;
    background-color: #f1f5f9;
    cursor: not-allowed;
}

.dark .fi-input:disabled,
.dark .fi-input-wrp:has(:disabled) {
    background-color: #1e293b;
}

.fi-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Focus-visible states for all interactive elements */
.fi-checkbox-input:focus-visible,
.fi-radio-input:focus-visible {
    outline: 2px solid var(--et3am-emerald-500);
    outline-offset: 2px;
}

.fi-select-input:focus-visible,
.fi-textarea-input:focus-visible {
    outline: 2px solid var(--et3am-emerald-500);
    outline-offset: 1px;
}

/* ──────────────────────────────────────────────
   36. Mobile table scroll hint
   ────────────────────────────────────────────── */
.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
}
@media (max-width: 640px) {
    .overflow-x-auto {
        scrollbar-width: thin;
    }
    .overflow-x-auto::-webkit-scrollbar {
        height: 4px;
    }
    .overflow-x-auto::-webkit-scrollbar-thumb {
        background-color: rgba(0,0,0,0.2);
        border-radius: 2px;
    }
    .dark .overflow-x-auto::-webkit-scrollbar-thumb {
        background-color: rgba(255,255,255,0.2);
    }
}

/* ──────────────────────────────────────────────
   37. Wizard step indicator responsive
   ────────────────────────────────────────────── */
@media (max-width: 480px) {
    .et3am-step-circle {
        width: 2rem;
        height: 2rem;
        font-size: 0.75rem;
    }
    .et3am-step-label {
        display: none;
    }
    .et3am-step-divider {
        width: 1.5rem;
    }
}

/* --------------------------------------------------------------------------
 * OFFLINE / PWA STYLES
 * -------------------------------------------------------------------------- */

/* Offline banner push-down: when offline banner is visible, push content down */
.et3am-offline-bar + * {
    margin-top: 36px;
}

/* Sync badge animation */
.et3am-sync-badge.syncing {
    animation: et3am-pulse 1.5s ease-in-out infinite;
}
@keyframes et3am-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Animate spin for sync icon */
@keyframes spin {
    to { transform: rotate(360deg); }
}
.animate-spin {
    animation: spin 1s linear infinite;
}

/* Offline form amber styling */
[x-cloak] { display: none !important; }

/* Dark mode adjustments for offline elements */
.dark .et3am-sync-badge > div {
    background: #047857 !important;
}

.dark .et3am-offline-bar {
    background: #92400e !important;
    color: #fef3c7 !important;
}
