/* Design System Themes - Modern Linear/Stripe Aesthetic */
:root, body[data-theme="light"] {
    --bg-color: #FDFBF7; /* Warm parchment paper */
    --text-primary: #2C2C2C; /* Charcoal ink */
    --text-secondary: #5A5A5A; /* Faded ink */
    --accent-primary: #D35400; /* Vintage stamp red/orange */
    --accent-hover: #A04000;   
    --surface-bg: #FDFBF7; /* Same as bg for seamless notebook look */
    --surface-border: #D1CDBF; /* Crisp ruled line color */
    --sidebar-bg: #F9F8F6;
    --radial-glow-1: rgba(211, 84, 0, 0.05);
    --radial-glow-2: rgba(211, 84, 0, 0.02);
    --input-bg: #FDFBF7;
    --input-focus-bg: #FFFFFF;
    --danger: #ef4444;
    --success: #10b981;
    --font-family: 'Inter', 'Outfit', sans-serif;
    --sidebar-width: 80px; /* Slim collapsed sidebar */
    --sidebar-expanded-width: 260px;
    --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);

    --bg: var(--bg-color);
    --text: var(--text-primary);
    --muted-text: var(--text-secondary);
    --card: var(--surface-bg);
    --primary: var(--accent-primary);
    --hover-bg: #F4F3ED;
}

body[data-theme="dark"] {
    --bg-color: #000000;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --accent-primary: #f59e0b; 
    --accent-hover: #d97706;   
    --surface-bg: #09090b; 
    --surface-border: #27272a;
    --sidebar-bg: #000000;
    --radial-glow-1: rgba(245, 158, 11, 0.08);
    --radial-glow-2: rgba(245, 158, 11, 0.05);
    --input-bg: #09090b;
    --input-focus-bg: #18181b;
    --danger: #f87171;
    --success: #34d399;

    --bg: var(--bg-color);
    --text: var(--text-primary);
    --muted-text: var(--text-secondary);
    --card: var(--surface-bg);
    --primary: var(--accent-primary);
    --hover-bg: #18181b;
}

body[data-theme="dark"] .logo-container img {
    filter: brightness(0) invert(1);
}

body[data-theme="blue"] {
    --bg-color: #020617;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-primary: #3b82f6; 
    --accent-hover: #2563eb;   
    --surface-bg: #0f172a; 
    --surface-border: #1e293b;
    --sidebar-bg: #020617;
    --radial-glow-1: rgba(59, 130, 246, 0.08);
    --radial-glow-2: rgba(59, 130, 246, 0.05);
    --input-bg: #0f172a;
    --input-focus-bg: #1e293b;
    --danger: #ef4444;
    --success: #10b981;

    --bg: var(--bg-color);
    --text: var(--text-primary);
    --muted-text: var(--text-secondary);
    --card: var(--surface-bg);
    --primary: var(--accent-primary);
    --hover-bg: #1e293b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

*::-webkit-scrollbar {
    display: none;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
}

p {
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Glassmorphism */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    background-color: var(--bg-color);
    overflow: hidden;
}
.auth-container::before, .auth-container::after {
    content: '';
    position: absolute;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    animation: floatBlob 15s infinite alternate ease-in-out;
}
.auth-container::before {
    background: var(--radial-glow-1);
    top: -20%;
    left: -10%;
}
.auth-container::after {
    background: var(--radial-glow-2);
    bottom: -20%;
    right: -10%;
    animation-delay: -7s;
}

@keyframes floatBlob {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

.auth-box {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    border-radius: 16px;
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow-y: auto;
}

.glass-premium {
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    border-radius: 0px; /* Sharp notebook edges */
    box-shadow: none;
}
.glass-premium:hover {
    box-shadow: none;
    background: var(--hover-bg);
}

.glass {
    background: var(--surface-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--surface-border);
    border-radius: 0px;
    box-shadow: none;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--surface-border);
    padding: 2rem 0.5rem;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 50;
    transition: width var(--transition), background var(--transition), border-color var(--transition);
    overflow-x: hidden;
    overflow-y: auto;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    /* Hide scrollbar for IE, Edge and Firefox */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.sidebar::-webkit-scrollbar {
    display: none;
}
.sidebar:hover {
    width: var(--sidebar-expanded-width);
    box-shadow: 4px 0 24px rgba(0,0,0,0.05);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem 2rem 1rem;
    border-bottom: 1px solid var(--surface-border);
    margin-bottom: 2rem;
}

.logo-icon {
    color: var(--accent-primary);
    font-size: 2rem;
}

.logo-text {
    font-size: 1.1rem; /* slightly smaller to fit */
    font-weight: 700;
    background: linear-gradient(to right, var(--text-primary), var(--accent-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    opacity: 0;
    transition: opacity var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar:hover .logo-text {
    opacity: 1;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 0px; /* Notebook sharp edges */
    border-right: 3px solid transparent; /* Prevents shifting in RTL */
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    font-weight: 500;
    user-select: none;
    touch-action: manipulation;
    position: relative;
    overflow: hidden;
}

.nav-item span:not(.material-icons-round) {
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}
.sidebar:hover .nav-item span:not(.material-icons-round) {
    opacity: 1;
    pointer-events: auto;
}

.nav-item:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    transform: translateX(4px);
}
html[dir="rtl"] .nav-item:hover {
    transform: translateX(-4px);
}

.nav-item.active {
    background: var(--hover-bg);
    color: var(--accent-primary);
    border-right: 3px solid var(--accent-primary); /* RTL active border on the right */
}

html[dir="ltr"] .nav-item {
    border-right: none;
    border-left: 3px solid transparent;
}
html[dir="ltr"] .nav-item {
    border-right: none;
    border-left: 3px solid transparent;
}
html[dir="ltr"] .nav-item.active {
    border-right: none;
    border-left: 3px solid var(--accent-primary);
}

.lang-selector {
    padding: 1rem;
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}
.lang-selector select {
    padding: 0.5rem;
    font-size: 0.9rem;
    background-color: transparent;
    border: none;
    outline: none;
    cursor: pointer;
}
.nav-item.active .material-icons-round {
    color: var(--accent-primary);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem 3rem;
}

.view-section {
    display: none;
    opacity: 0;
    filter: blur(8px);
    transform: translateX(30px);
    will-change: opacity, filter, transform;
}

.view-section.active {
    display: block;
    animation: gsapFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes gsapFade {
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateX(0);
    }
}

/* Premium GSAP-style Scroll Fade & Blur Utility */
.fade-in-content {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(20px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), 
                filter 1s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 1s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, filter, transform;
}

.fade-in-content.visible {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

.view-header {
    margin-bottom: 2rem;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Bento Grid System */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(140px, auto);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.bento-grid .card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
}

.bento-revenue {
    grid-column: span 2;
    grid-row: span 2;
}

.bento-revenue h3 {
    font-size: 3.5rem !important;
}

.bento-profit, .bento-debt, .bento-expenses, .bento-customers, .bento-sales {
    grid-column: span 1;
}

.bento-grid h3 {
    font-size: 1.8rem !important;
}

.card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border: 1px solid var(--surface-border);
    border-radius: 0px;
    background: var(--surface-bg);
    transition: background 0.2s ease;
}

.card:hover {
    transform: none;
    box-shadow: none;
    background: var(--hover-bg);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: rgba(245, 158, 11, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
}

.card-icon .material-icons-round {
    font-size: 2rem;
}

.card.warning .card-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.card h3, .card div h3 {
    color: var(--text);
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
}

.card p, .card div p {
    color: var(--muted-text);
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
}

/* Tables */
.table-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    overflow-x: auto;
}

.capitalize {
    text-transform: capitalize;
}

.content-panel {
    padding: 1.5rem;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
    text-align: left;
}

th {
    padding: 1rem;
    color: var(--muted-text);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: none;
}

td {
    padding: 1rem 1.25rem;
    background: var(--surface-bg);
    border-top: 1px solid var(--surface-border);
    border-bottom: 1px solid var(--surface-border);
}

tr td:first-child {
    border-left: 1px solid var(--surface-border);
    border-radius: 8px 0 0 8px;
}
tr td:last-child {
    border-right: 1px solid var(--surface-border);
    border-radius: 0 8px 8px 0;
}

tr:hover td {
    background: var(--hover-bg);
    cursor: default;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-paid {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-pending {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0px; /* Notebook sharp edges */
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-family);
    user-select: none;
    touch-action: manipulation;
    min-height: 44px;
}

.btn-primary {
    background-color: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    box-shadow: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--accent-primary);
    color: #FDFBF7;
    transform: none;
    box-shadow: none;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--surface-border);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    touch-action: manipulation;
    min-width: 44px;
    min-height: 44px;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.google-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    background: var(--surface-bg);
    color: var(--text-primary);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100%;
}
.google-btn:hover {
    background: var(--hover-bg);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.google-btn:active {
    transform: translateY(0) scale(0.98);
}
body[data-theme="dark"] .google-btn:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.icon-btn.pay-btn {
    color: var(--success);
}
.icon-btn.pay-btn:hover {
    background: rgba(16, 185, 129, 0.1);
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.product-card {
    padding: 1.5rem;
    text-align: center;
    position: relative;
}

.product-card .price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin: 1rem 0;
}

.product-card .icon-placeholder {
    width: 80px;
    height: 80px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: var(--accent-primary);
}
.product-card .icon-placeholder span {
    font-size: 2.5rem;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    z-index: 100;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    padding: 1.5rem;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.modal.show .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 16px !important;
    transition: var(--transition);
    touch-action: manipulation;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--input-focus-bg);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

select option {
    background-color: var(--bg-color);
}

.helper-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.highlight-box {
    background: rgba(245, 158, 11, 0.1);
    padding: 1rem;
    border-radius: 8px;
    border: 1px dashed var(--accent-primary);
}

.balance-amount {
    font-size: 1.5rem;
    color: var(--accent-primary);
    margin: 0;
}

.margin-bottom-md {
    margin-bottom: 1rem;
}

/* Responsive Adaptive Layouts */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        padding-top: 1.5rem; /* Reduced since top bar is gone */
        padding-bottom: 70px;
    }
    .sidebar {
        width: 100%;
        height: 0; /* Remove top bar height */
        position: fixed;
        top: 0;
        left: 0;
        padding: 0; /* Remove padding */
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        border-right: none;
        border-bottom: none; /* Remove border */
        z-index: 20;
        background: transparent; /* Make transparent */
        pointer-events: none; /* Let clicks pass through empty space */
    }
    .sidebar > * {
        pointer-events: auto; /* Re-enable clicks for children like nav-links */
    }
    .logo-container {
        display: none !important; /* Completely hide logo container */
    }
    .header-right-controls {
        display: none !important; /* Completely hide settings gear */
    }
    .logo-text {
        display: none !important;
    }
    .desktop-only-tab {
        display: none !important;
    }
    .mobile-more-tab {
        display: flex !important;
    }
    .mobile-only-action {
        display: flex !important;
    }
    /* Compact 6-tab mobile bottom nav */
    .nav-links .nav-item {
        padding: 0.2rem 0;
        min-height: 48px;
    }
    .nav-links .nav-item .material-icons-round {
        font-size: 1.25rem;
    }
    .nav-links .nav-item span:last-child {
        font-size: 0.5rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 56px;
    }
    .lang-selector {
        margin-top: 0;
        padding: 0;
    }
    .lang-selector span {
        display: none;
    }
    .lang-selector select {
        padding: 0.35rem 1.25rem 0.35rem 0.5rem;
        font-size: 0.85rem;
        background-position: right 0.25rem center;
    }
    .nav-links {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: auto;
        min-height: 70px;
        padding-bottom: env(safe-area-inset-bottom);
        background: var(--sidebar-bg);
        backdrop-filter: blur(16px);
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-top: 1px solid var(--surface-border);
        padding: 0 0.25rem;
        z-index: 20;
        overflow: hidden;
    }
    .nav-links::-webkit-scrollbar {
        display: none;
    }
    .nav-item {
        flex: 1;
        width: auto;
        min-width: 0;
        flex-direction: column;
        padding: 0.25rem 0;
        gap: 0.1rem;
        border-radius: 8px;
        text-align: center;
        border: none !important;
        margin-top: 0 !important;
        min-height: 52px;
        justify-content: center;
    }
    .nav-item span:last-child {
        display: block;
        font-size: 0.6rem;
    }
    .nav-item.active {
        background: transparent;
        border-bottom: 3px solid var(--accent-primary) !important;
        border-radius: 0;
        color: var(--accent-primary);
    }
    .main-content {
        margin-left: 0;
        padding: 1.25rem 1rem;
        width: 100%;
    }
    .global-header {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        position: fixed;
        top: 1.5rem;
        right: 1.5rem;
        width: auto !important;
        z-index: 100;
        pointer-events: none;
    }
    .global-header > div:first-child,
    #sync-status, 
    .icon-btn[title="Search (Ctrl+K)"] {
        display: none !important;
    }
    .global-header > div:last-child {
        width: auto !important;
        justify-content: flex-end;
    }
    #notif-bell-btn {
        pointer-events: auto;
        background: var(--surface-bg);
        border: 1px solid var(--surface-border);
        box-shadow: var(--shadow-sm);
        border-radius: 50%;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .dashboard-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .bento-revenue {
        grid-column: span 2;
    }
    .auth-box {
        padding: 1.75rem;
        width: 92%;
    }

    /* Stacked Table Cards for Mobile Viewports */
    .table-container {
        border: none;
        background: transparent;
        overflow-x: hidden !important;
    }
    table, thead, tbody, th, td, tr {
        display: block;
        width: 100%;
    }
    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    tr {
        background: var(--surface-bg);
        border: 1px solid var(--surface-border);
        border-radius: 12px;
        margin-bottom: 1rem;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    td {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        border: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
        padding: 0.75rem 1rem !important;
        text-align: left;
        gap: 0.25rem;
    }
    td:last-child {
        flex-direction: row;
        border-bottom: none !important;
        justify-content: flex-end;
        align-items: center;
        gap: 0.5rem;
        background: rgba(0, 0, 0, 0.02);
    }
    td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--muted-text);
        font-size: 0.75rem;
        text-transform: uppercase;
        text-align: left;
        margin-right: 0;
        margin-bottom: 0.1rem;
    }
    }
    th:first-child, td:first-child {
        position: sticky;
        left: 0;
        background: var(--card);
        z-index: 10;
        border-right: 1px solid var(--surface-border);
    }
    th {
        position: sticky;
        top: 0;
        background: var(--card);
        z-index: 5;
    }
    .view-header.flex-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .charts-grid {
        grid-template-columns: 1fr !important;
    }
    .global-header {
        padding: 0.75rem 1rem !important;
    }
    .mobile-hide {
        display: none !important;
    }
    .chart-card {
        padding: 1rem !important;
    }
    .card.glass {
        padding: 1rem !important;
    }
}

/* Tablet Adaptive Rules (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 1.5rem 0.5rem;
    }
    .logo-text, .nav-item span:last-child, .lang-selector span {
        display: none; /* Hide labels for slim tablet view */
    }
    .logo-container {
        justify-content: center;
        padding-bottom: 1rem;
    }
    .nav-item {
        justify-content: center;
        padding: 0.75rem;
    }
    .main-content {
        margin-left: 80px;
        padding: 1.5rem 2rem;
    }
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
    [dir="rtl"] .main-content {
        margin-left: 0;
        margin-right: 80px;
    }
}

/* RTL Support */
[dir="rtl"] .sidebar {
    right: 0;
    left: auto;
    border-right: none;
    border-left: 1px solid var(--surface-border);
}
[dir="rtl"] .main-content {
    margin-left: 0;
    margin-right: var(--sidebar-width);
}
[dir="rtl"] .nav-item {
    border-left: none;
}
[dir="rtl"] .nav-item.active {
    border-right: 4px solid var(--accent-primary);
}
[dir="rtl"] select {
    background-position: left 1rem center;
}
[dir="rtl"] .modal-actions {
    justify-content: flex-start;
}
[dir="rtl"] table {
    text-align: right;
}
@media (max-width: 768px) {
    [dir="rtl"] .main-content {
        margin-right: 0;
    }
    [dir="rtl"] .sidebar {
        border-left: none;
    }
    [dir="rtl"] .nav-item.active {
        border-right: none;
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 9999;
    pointer-events: none;
}
.toast {
    background: var(--surface-bg);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 1px solid var(--surface-border);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    animation: slideUpToast 0.3s ease-out forwards;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast .material-icons-round { font-size: 1.2rem; }

@keyframes slideUpToast {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Support Floating Action Button */
.support-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 55px;
    height: 55px;
    background: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    text-decoration: none;
    transition: transform 0.2s ease;
}
.support-fab:hover {
    transform: scale(1.1);
}
.support-fab .material-icons-round {
    font-size: 1.8rem;
}

@media (max-width: 768px) {
    .support-fab {
        bottom: 90px; /* Keep above mobile nav */
    }
}

/* Account & Settings Page */
.account-info-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--surface-border);
}
.account-info-row:last-of-type {
    border-bottom: none;
}
.account-info-row .material-icons-round {
    color: var(--accent-primary);
    font-size: 1.5rem;
    flex-shrink: 0;
}
.account-info-row label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Premium Interactive Theme Selection Cards */
.theme-selector-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 0.5rem;
    margin-bottom: 1.25rem;
}
.theme-option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
    border-radius: 12px;
    background: var(--input-bg);
    border: 2px solid var(--surface-border);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--text-primary);
    font-family: var(--font-family);
    user-select: none;
}
.theme-option-card:hover {
    border-color: rgba(245, 158, 11, 0.4);
    transform: translateY(-2px);
}
.theme-option-card.active {
    border-color: var(--accent-primary);
    background: rgba(245, 158, 11, 0.05);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.1);
}
.theme-option-card.active[data-opt-theme="blue"] {
    background: rgba(59, 130, 246, 0.05);
    border-color: #3b82f6;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.1);
}
.theme-option-card .theme-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--surface-border);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-option-card.active .theme-indicator::after {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-primary);
}
.theme-option-card.active[data-opt-theme="blue"] .theme-indicator::after {
    background: #3b82f6;
}

/* Notebook & Tasks Hub Premium Styles */
.done-note {
    opacity: 0.55 !important;
    border-color: rgba(16, 185, 129, 0.1) !important;
    background: rgba(16, 185, 129, 0.02) !important;
}

.done-note h3 {
    text-decoration: line-through;
    color: var(--text-secondary) !important;
}

.filter-btn {
    border-radius: 8px;
    padding: 0.5rem 1rem !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.filter-btn.active {
    background-color: var(--accent-primary) !important;
    color: #fff !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.category-filters-container::-webkit-scrollbar {
    display: none; /* Hide scrollbars for ultra-clean look on touch-devices */
}

/* Settings Responsive Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    max-width: 1200px;
    align-items: start;
}
@media (max-width: 900px) {
    .settings-grid {
        grid-template-columns: 1fr !important;
    }
    .settings-grid > div {
        grid-column: span 1 !important;
    }
}

/* ==========================================================================
   PREMIUM LANDING PAGE & DASHBOARD DEVICE MOCKUPS SYSTEM
   ========================================================================== */

/* Mockups Wrapper Grid with Parallax Depth */
.landing-mockups-grid {
    position: relative;
    width: 100%;
    max-width: 1080px;
    height: 520px;
    margin: 3.5rem auto 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.6s backwards;
}

.landing-mockup {
    position: absolute;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
    will-change: transform;
}

/* Center Desktop Mockup (Playground Container) */
.landing-mockup.desktop-mockup {
    position: relative;
    width: 680px;
    z-index: 2;
    left: -70px; /* Shift left to leave perfect space for Android phone mockup on the right */
    transform: none !important; /* Flat premium layout */
    animation: floatDesktopVertical 8s ease-in-out infinite;
}

.landing-mockup.desktop-mockup:hover {
    transform: scale(1.02) !important;
    z-index: 10;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
}

/* Android Flagship Overlay (Right) - COMPLETELY VERTICAL & GENEROUS SPACE */
.landing-mockup.android-mockup {
    width: 230px;
    height: 450px;
    right: 40px; /* Aligned nicely next to Desktop */
    bottom: 35px;
    z-index: 3;
    transform: none !important;
    animation: floatAndroidVertical 7.5s ease-in-out infinite;
    background: #080d16;
}

.landing-mockup.android-mockup:hover {
    transform: scale(1.05) translateY(-8px) !important;
    z-index: 10;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}

/* RTL Layout Auto Flip */
[dir="rtl"] .landing-mockup.desktop-mockup {
    left: auto;
    right: -70px;
}

[dir="rtl"] .landing-mockup.android-mockup {
    right: auto;
    left: 40px;
}

/* 🤖 Android Hardware Frame Styling */
.android-bezel {
    width: 100%;
    height: 100%;
    border: 6px solid #373739;
    border-radius: 32px;
    box-sizing: border-box;
    position: relative;
    background: #000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: inset 0px 0px 4px 2px rgba(0,0,0,0.95);
}

.android-camera {
    position: absolute;
    top: 9px;
    left: 50%;
    transform: translateX(-50%);
    width: 9px;
    height: 9px;
    background: #000;
    border-radius: 50%;
    z-index: 20;
    border: 1px solid rgba(255,255,255,0.12);
}

.android-screen {
    flex: 1;
    border-radius: 27px;
    overflow: hidden;
    position: relative;
    background: var(--bg-color);
}

.android-navigation-bar {
    height: 18px;
    background: #000;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 35px;
}

.android-navigation-bar span {
    display: block;
    background: #888;
    opacity: 0.6;
}

.nav-btn-back {
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: 8px solid #888;
    background: transparent !important;
}

.nav-btn-home {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.nav-btn-recent {
    width: 8px;
    height: 8px;
    border-radius: 1.5px;
}

/* ==========================================================================
   LIVE DASHBOARDS & SCROLL STACK SYSTEM (REAL CONTENT TICKERS)
   ========================================================================== */

.mini-dashboard {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    box-sizing: border-box;
}

.mini-header {
    padding: 24px 12px 10px 12px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid var(--surface-border);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    z-index: 10;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

[dir="rtl"] .mini-header {
    flex-direction: row-reverse;
}

.mini-header .material-icons-round {
    font-size: 1.15rem;
}

/* Seamless Continuous Scrolling Stack Container */
.mini-scroll-stack {
    flex: 1;
    overflow: hidden;
    position: relative;
    padding: 10px;
    mask-image: linear-gradient(to bottom, transparent 0%, #000 8%, #000 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 8%, #000 92%, transparent 100%);
}

.scroll-stack-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: miniScrollStack 18s linear infinite;
}

.scroll-stack-container:hover {
    animation-play-state: paused; /* Pause scrolling on hover to inspect details! */
}

.mini-card {
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease, border-color 0.2s ease;
    box-sizing: border-box;
    text-align: left;
}

[dir="rtl"] .mini-card {
    text-align: right;
}

.mini-card label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.mini-card h4 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.mini-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

[dir="rtl"] .mini-card-row {
    flex-direction: row-reverse;
}

.mini-card-row span:first-child {
    font-weight: 600;
    font-size: 0.85rem;
}

.mini-card-row span:last-child {
    font-size: 0.75rem;
    font-weight: 500;
}

.mini-card p {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.3;
    margin: 0;
}

/* Infinite Scrolling Stack Keyframes */
@keyframes miniScrollStack {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

/* Companion App Section in Dashboard Settings */
.settings-download-card {
    grid-column: span 2;
    padding: 2rem !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2.5rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, var(--surface-bg) 100%) !important;
    border: 1px solid var(--surface-border);
}

.companion-mockups-flex {
    position: relative;
    width: 280px;
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 800px;
    flex-shrink: 0;
}

.companion-mockup {
    position: absolute;
    width: 110px;
    height: 200px;
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    will-change: transform;
}

.companion-mockup.iphone {
    left: 20px;
    transform: rotateY(15deg) translateZ(10px) translateY(-5px);
    animation: floatIOSVertical 6s ease-in-out infinite;
}

.companion-mockup.android {
    right: 20px;
    transform: rotateY(-15deg) translateZ(10px) translateY(5px);
    animation: floatAndroidVertical 6.5s ease-in-out infinite;
}

.companion-mockup .iphone-bezel, .companion-mockup .android-bezel {
    border-width: 4px;
    border-radius: 20px;
}

.companion-mockup .iphone-screen, .companion-mockup .android-screen {
    border-radius: 16px;
}

.companion-mockup .iphone-island {
    width: 40px;
    height: 9px;
    top: 5px;
}

.companion-mockup .iphone-home-indicator {
    width: 45px;
    height: 2.5px;
}

.companion-mockup .mini-header {
    padding: 14px 6px 4px;
    font-size: 0.6rem;
    gap: 4px;
}

.companion-mockup .mini-header .material-icons-round {
    font-size: 0.8rem;
}

.companion-mockup .scroll-stack-container {
    animation-duration: 25s; /* Scroll slightly slower in miniature settings panels */
}

.companion-mockup .mini-card {
    padding: 6px 8px;
    border-radius: 8px;
    gap: 2px;
}

.companion-mockup .mini-card label {
    font-size: 0.5rem;
}

.companion-mockup .mini-card h4 {
    font-size: 0.85rem;
}

.companion-mockup .mini-card-row span:first-child {
    font-size: 0.7rem;
}

.companion-mockup .mini-card-row span:last-child {
    font-size: 0.6rem;
}

.companion-mockup .mini-card p {
    display: none;
}

/* Floating Animations for Vertical Mockups */
@keyframes floatDesktopVertical {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes floatIOSVertical {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

@keyframes floatAndroidVertical {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(12px); }
}

/* Responsive Viewports for CSS Device Layouts */
@media (max-width: 1240px) {
    .landing-mockup.desktop-mockup {
        left: -40px;
    }
    .landing-mockup.android-mockup {
        right: 10px;
    }
    [dir="rtl"] .landing-mockup.desktop-mockup {
        right: -40px;
        left: auto;
    }
    [dir="rtl"] .landing-mockup.android-mockup {
        left: 10px;
        right: auto;
    }
}

@media (max-width: 1024px) {
    .landing-mockup.desktop-mockup {
        left: 0;
        width: 580px;
    }
    .landing-mockup.android-mockup {
        right: -20px;
        width: 200px;
        height: 390px;
    }
    [dir="rtl"] .landing-mockup.desktop-mockup {
        right: 0;
        left: auto;
    }
    [dir="rtl"] .landing-mockup.android-mockup {
        left: -20px;
        right: auto;
    }
}

@media (max-width: 860px) {
    .landing-mockup.desktop-mockup {
        width: 480px;
    }
    .landing-mockup.android-mockup {
        display: none !important; /* Hide overlay on medium tablet to let playground be usable */
    }
}

/* MOBILE DEVICE VIEWPORT - HIDE DESKTOP PLAYGROUND & SHOW ONLY THE VERTICAL PHONE MOCKUP */
@media (max-width: 600px) {
    .landing-mockups-grid {
        height: 500px;
        margin-top: 2rem;
    }
    
    .landing-mockup.desktop-mockup {
        display: none !important; /* Fully hide desktop sandbox for perfect mobile experience */
    }
    
    .landing-mockup.android-mockup {
        display: flex !important;
        position: relative !important;
        right: auto !important;
        left: auto !important;
        top: auto !important;
        bottom: auto !important;
        margin: 0 auto !important;
        width: 250px !important;
        height: 480px !important;
        box-shadow: 0 25px 55px rgba(0, 0, 0, 0.35);
    }
}

/* Loading Spinner */
.spinner {
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top: 2px solid var(--accent-primary);
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ================================================================
   PREMIUM UPGRADE v2 — New Feature Styles
   ================================================================ */

/* Notification Center */
.notification-bell {
    position: relative;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}
.notification-bell:hover { color: var(--text-primary); }
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    animation: notifPulse 2s ease-in-out infinite;
}
@keyframes notifPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}
.notification-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: var(--sidebar-bg);
    border-left: 1px solid var(--surface-border);
    backdrop-filter: blur(20px);
    z-index: 200;
    transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0,0,0,0.2);
}
.notification-panel.open { right: 0; }
[dir="rtl"] .notification-panel { right: auto; left: -400px; border-left: none; border-right: 1px solid var(--surface-border); }
[dir="rtl"] .notification-panel.open { left: 0; }
.notif-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--surface-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.notif-header h3 { margin: 0; font-size: 1.15rem; }
.notif-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}
.notif-item {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    transition: background 0.2s ease;
    cursor: pointer;
}
.notif-item:hover { background: var(--hover-bg); }
.notif-item.unread { background: rgba(245, 158, 11, 0.05); border-left: 3px solid var(--accent-primary); }
.notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
}
.notif-icon.warning { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.notif-icon.info { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.notif-icon.success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.notif-icon.alert { background: rgba(245, 158, 11, 0.1); color: var(--accent-primary); }
.notif-body { flex: 1; }
.notif-body strong { font-size: 0.9rem; color: var(--text-primary); display: block; margin-bottom: 2px; }
.notif-body p { font-size: 0.8rem; color: var(--text-secondary); margin: 0; line-height: 1.4; }
.notif-time { font-size: 0.7rem; color: var(--text-secondary); margin-top: 4px; }
.notif-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}
@media (max-width: 480px) {
    .notification-panel { width: 100vw; right: -100vw; }
    [dir="rtl"] .notification-panel { left: -100vw; }
}

/* Global Search */
.global-search-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(8px);
    z-index: 300;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
}
.global-search-overlay.show { display: flex; }
.global-search-box {
    width: 90%;
    max-width: 600px;
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    backdrop-filter: blur(20px);
}
.global-search-input-row {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    gap: 0.75rem;
    border-bottom: 1px solid var(--surface-border);
}
.global-search-input-row input {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 1.1rem;
    color: var(--text-primary);
    outline: none;
    padding: 0;
}
.global-search-results {
    max-height: 50vh;
    overflow-y: auto;
    padding: 0.5rem;
}
.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.search-result-item:hover { background: var(--hover-bg); }
.search-result-item .material-icons-round { color: var(--accent-primary); font-size: 1.3rem; }
.search-result-item strong { font-size: 0.9rem; color: var(--text-primary); }
.search-result-item span { font-size: 0.8rem; color: var(--text-secondary); margin-left: 0.5rem; }
.search-shortcut {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: var(--input-bg);
    border: 1px solid var(--surface-border);
    border-radius: 4px;
    color: var(--text-secondary);
}

/* Customer Detail Modal - Slide out panel */
.customer-detail-modal {
    align-items: stretch;
    justify-content: flex-end;
}
.customer-detail-modal .modal-content {
    width: 90%;
    max-width: 500px;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
html[dir="rtl"] .customer-detail-modal .modal-content {
    transform: translateX(-100%);
}
.customer-detail-modal.show .modal-content {
    transform: translateX(0);
}
.customer-profile-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--surface-border);
}
.customer-avatar-lg {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}
.customer-meta h3 { margin: 0 0 4px 0; font-size: 1.3rem; }
.customer-meta p { margin: 0; }
.customer-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.customer-stat-card {
    background: var(--input-bg);
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--surface-border);
}
.customer-stat-card h4 { margin: 0; font-size: 1.3rem; font-weight: 700; color: var(--text-primary); }
.customer-stat-card p { font-size: 0.8rem; margin: 4px 0 0 0; }
.customer-history-list {
    max-height: 300px;
    overflow-y: auto;
}
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--surface-border);
}
.history-item:last-child { border-bottom: none; }

/* Expenses & Profit Section */
.expense-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.exp-cat-supplies { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.exp-cat-packaging { background: rgba(168, 85, 247, 0.1); color: #a855f7; }
.exp-cat-transport { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.exp-cat-equipment { background: rgba(236, 72, 153, 0.1); color: #ec4899; }
.exp-cat-labor { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.exp-cat-marketing { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.exp-cat-other { background: rgba(148, 163, 184, 0.1); color: #94a3b8; }

/* Stock Level Indicators */
.stock-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.stock-good { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.stock-low { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.stock-critical { background: rgba(239, 68, 68, 0.1); color: var(--danger); animation: stockPulse 2s ease-in-out infinite; }
.stock-out { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
@keyframes stockPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
.stock-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.05);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}
.stock-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Invoice / Receipt Styles */
.invoice-preview {
    background: #fff;
    color: #1a1a2e;
    padding: 2.5rem;
    border-radius: 12px;
    max-width: 700px;
    margin: 0 auto;
    font-family: 'Outfit', sans-serif;
}
.invoice-preview .inv-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f59e0b;
}
.invoice-preview .inv-brand { font-size: 1.5rem; font-weight: 800; color: #f59e0b; }
.invoice-preview .inv-details { text-align: right; }
.invoice-preview .inv-details p { margin: 2px 0; font-size: 0.85rem; color: #555; }
.invoice-preview table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.invoice-preview th {
    background: #f8f9fa;
    padding: 0.75rem;
    text-align: left;
    font-size: 0.85rem;
    color: #333;
    border-bottom: 2px solid #eee;
}
.invoice-preview td { padding: 0.75rem; border-bottom: 1px solid #f0f0f0; font-size: 0.9rem; color: #444; }
.invoice-preview .inv-total-row td { border-top: 2px solid #333; font-weight: 700; font-size: 1.05rem; color: #1a1a2e; }
.invoice-preview .inv-footer { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid #eee; font-size: 0.8rem; color: #888; text-align: center; }

/* Activity Feed / Timeline */
.activity-feed {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem 0;
}
.activity-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--surface-border);
    align-items: flex-start;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}
.activity-dot.sale { background: var(--accent-primary); }
.activity-dot.payment { background: var(--success); }
.activity-dot.expense { background: var(--danger); }
.activity-dot.customer { background: #3b82f6; }
.activity-dot.product { background: #a855f7; }
.activity-body { flex: 1; }
.activity-body strong { font-size: 0.85rem; color: var(--text-primary); }
.activity-body p { font-size: 0.8rem; margin: 2px 0 0; }
.activity-time { font-size: 0.7rem; color: var(--text-secondary); white-space: nowrap; margin-top: 4px; }

/* Skeleton Loaders */
.skeleton {
    background: linear-gradient(90deg, var(--surface-bg) 25%, rgba(255,255,255,0.06) 50%, var(--surface-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton-text { height: 14px; margin-bottom: 8px; border-radius: 4px; }
.skeleton-text.short { width: 60%; }
.skeleton-card {
    height: 100px;
    border-radius: 16px;
}
.skeleton-circle { width: 48px; height: 48px; border-radius: 50%; }

/* Dashboard Grid — support for more KPI cards */
.dashboard-cards-6 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}
@media (max-width: 1024px) {
    .dashboard-cards-6 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .dashboard-cards-6 { grid-template-columns: 1fr; gap: 1rem; }
}

/* Date Range Selector */
.date-range-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    border-radius: 10px;
    padding: 0.4rem 0.75rem;
}
.date-range-selector select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    padding: 0.25rem;
    appearance: auto;
}

/* Profit indicator colors */
.text-profit { color: var(--success); }
.text-loss { color: var(--danger); }
.text-neutral { color: var(--text-secondary); }

/* Print-friendly styles */
@media print {
    body {
        background: #fff !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .sidebar, .nav-links, .support-fab, .toast-container,
    .notification-panel, .global-search-overlay,
    .global-header, #impersonation-banner,
    .btn, button, .icon-btn, .modal { display: none !important; }
    .app-container { display: block !important; }
    .main-content {
        margin-left: 0 !important;
        padding: 1rem !important;
    }
    .view-section { display: block !important; opacity: 1 !important; filter: none !important; transform: none !important; }
    .view-section:not(.active) { display: none !important; }
    .glass, .card, .content-panel {
        background: #fff !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
    }
    .invoice-preview { box-shadow: none; border: 1px solid #ccc; }
}

/* Overlay dimmer for notification panel */
.notif-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.4);
    z-index: 199;
}
.notif-overlay.show { display: block; }

/* ==========================================================================
   PREMIUM UTILITIES & KEYFRAMES (REDESIGN PHASE 1)
   ========================================================================== */

/* Staggered Fade-In */
@keyframes staggerFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.stagger-1 { animation: staggerFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards; opacity: 0; }
.stagger-2 { animation: staggerFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards; opacity: 0; }
.stagger-3 { animation: staggerFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards; opacity: 0; }
.stagger-4 { animation: staggerFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards; opacity: 0; }
.stagger-5 { animation: staggerFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards; opacity: 0; }
.stagger-6 { animation: staggerFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards; opacity: 0; }

/* Table Row Hover Shimmer */
tr:hover td {
    background: linear-gradient(90deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.02) 100%);
    background-size: 200% 100%;
    animation: rowShimmer 2s infinite linear;
}

@keyframes rowShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Utilities */
.hover-lift {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.glow-border {
    border: 1px solid transparent;
    transition: border-color 0.3s ease;
}
.glow-border:hover {
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

/* Bento Grid Dashboard Layout */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(140px, auto);
    gap: 1.25rem;
}
.bento-grid > div {
    display: flex; flex-direction: column; justify-content: center;
}
.bento-revenue { grid-column: span 4; grid-row: span 1; padding: 1.5rem; }
.bento-profit { grid-column: span 4; grid-row: span 1; padding: 1.5rem; }
.bento-debt { grid-column: span 4; grid-row: span 1; padding: 1.5rem; }
.bento-expenses { grid-column: span 4; grid-row: span 1; padding: 1.5rem; }
.bento-customers { grid-column: span 4; grid-row: span 1; padding: 1.5rem; }
.bento-sales { grid-column: span 4; grid-row: span 1; padding: 1.5rem; }

@media (max-width: 1024px) {
    .bento-revenue, .bento-profit, .bento-debt, .bento-expenses, .bento-customers, .bento-sales {
        grid-column: span 12;
    }
}

/* -------------------------------------
   Side-Panel (Drawer) Modals Override
   ------------------------------------- */
.modal {
    justify-content: flex-end !important;
    align-items: flex-start !important;
    padding: 0 !important;
}

.modal-content {
    height: 100vh !important;
    max-height: 100vh !important;
    max-width: 480px !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border-left: 1px solid var(--surface-border) !important;
    border-top: none !important;
    border-right: none !important;
    border-bottom: none !important;
    transform: translateX(100%) !important;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
    overflow-y: auto;
}

.modal.show .modal-content {
    transform: translateX(0) !important;
}

/* Custom Select Dropdown UI */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
}
.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}
.custom-select-trigger.open {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}
.custom-select-trigger .arrow {
    display: inline-block;
    transition: transform 0.3s ease;
}
.custom-select-trigger.open .arrow {
    transform: rotate(180deg);
}
.custom-select-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 250px;
    overflow-y: auto;
}
.custom-select-wrapper.open .custom-select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.custom-option {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease;
}
.custom-option:hover {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-primary);
}
.custom-option.selected {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-primary);
    font-weight: 600;
}
.date-range-selector .custom-select-wrapper { width: auto; min-width: 140px; }
.date-range-selector .custom-select-trigger { padding: 0.4rem 1rem; border-radius: 50px; }

/* List Animations */
.animated-list-item {
    opacity: 0;
    transform: scale(0.85) translateY(20px);
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}
.animated-list-item.show {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Upgraded select spacing for language & currency icons */
.lang-selector-wrapper .custom-select-trigger,
.lang-selector .custom-select-trigger {
    padding-left: 2.75rem;
}
[dir="rtl"] .lang-selector-wrapper .custom-select-trigger,
[dir="rtl"] .lang-selector .custom-select-trigger {
    padding-left: 1rem;
    padding-right: 2.75rem;
}
[dir="rtl"] .lang-selector-wrapper .material-icons-round,
[dir="rtl"] .lang-selector .material-icons-round {
    left: auto !important;
    right: 1rem !important;
}

/* Inline SVG Logo Components */
.svg-logo-stacked {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}
.svg-logo-horizontal {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.svg-logo-icon {
    color: var(--accent-primary);
}
.svg-logo-text {
    font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
    font-weight: 800;
    font-size: 2.5rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-primary);
    line-height: 1;
}
.svg-logo-horizontal .svg-logo-text {
    font-size: 1.5rem;
}

/* Mobile Logo Overrides */
@media (max-width: 768px) {
    .auth-logo .svg-logo-icon {
        width: 60px !important;
        height: 60px !important;
    }
    .auth-logo .svg-logo-text {
        font-size: 1.8rem !important;
    }
    .logo-container .svg-logo-icon {
        width: 30px !important;
        height: 30px !important;
    }
    .logo-container .svg-logo-text {
        font-size: 1.2rem !important;
    }
}
