/* CSS Reset and Theme Variables for FinSheet Dark Mode */
:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    /* Google Sheets Dark Theme Variables */
    --sheet-grid-border: #1e293b;
    --sheet-header-bg: #1e293b;
    --sheet-header-text: #cbd5e1;
    --sheet-header-border: #334155;
    --sheet-green: #10b981;
    --sheet-green-glow: rgba(16, 185, 129, 0.15);
    --sheet-green-hover: #059669;
    --sheet-blue: #3b82f6;
    --sheet-blue-glow: rgba(59, 130, 246, 0.15);
    --sheet-blue-hover: #2563eb;
    
    --sheet-active-tab-bg: #0f172a;
    --sheet-tab-border: #1e293b;
    --sheet-active-cell-border: #10b981;
    --sheet-selection-bg: rgba(16, 185, 129, 0.08);
    --sheet-protected-bg: rgba(255, 255, 255, 0.02);
    
    --accent-rose: #f43f5e;
    --accent-rose-glow: rgba(244, 63, 94, 0.15);
    --accent-amber: #f59e0b;
    --accent-amber-glow: rgba(245, 158, 11, 0.15);
    --accent-violet: #8b5cf6;
    --accent-violet-glow: rgba(139, 92, 246, 0.15);
    
    --font-primary: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-primary);
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden; /* App wraps in a viewport, spreadsheet scrolls */
    position: relative;
    line-height: 1.4;
}

/* Background Glow Effects */
.bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.3;
    pointer-events: none;
}

.bg-glow-1 {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
    top: -100px;
    left: -100px;
}

.bg-glow-2 {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, rgba(0, 0, 0, 0) 70%);
    bottom: -100px;
    right: -100px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: calc(100% - 48px);
}

.toast {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-color);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.6);
    transform: translateY(-20px);
    opacity: 0;
    transition: transform var(--transition-normal), opacity var(--transition-normal);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
}

.toast-content {
    flex-grow: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.toast-message {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 1px;
}

.toast-success { border-left: 4px solid var(--sheet-green); }
.toast-success .toast-icon { background: var(--sheet-green-glow); color: var(--sheet-green); }
.toast-error { border-left: 4px solid var(--accent-rose); }
.toast-error .toast-icon { background: var(--accent-rose-glow); color: var(--accent-rose); }
.toast-warning { border-left: 4px solid var(--accent-amber); }
.toast-warning .toast-icon { background: var(--accent-amber-glow); color: var(--accent-amber); }

/* Hide helper class */
.hide {
    display: none !important;
}

/* SCREEN MANAGEMENT */
.screen {
    display: none;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.screen.active {
    display: flex;
    flex-direction: column;
    opacity: 1;
    height: 100vh;
    width: 100vw;
}

/* LOGIN SCREEN STYLING */
#login-screen {
    justify-content: center;
    align-items: center;
    padding: 24px;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 36px 32px;
    backdrop-filter: blur(16px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--sheet-green), var(--sheet-blue), var(--accent-violet));
}

.brand {
    text-align: center;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--sheet-green), var(--sheet-blue));
    color: white;
    margin-bottom: 14px;
    box-shadow: 0 6px 18px -4px var(--sheet-green);
}

.brand h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.brand p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
}

/* Forms General Styling */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-fast);
}

input, select {
    width: 100%;
    padding: 10px 14px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

.input-wrapper input {
    padding-left: 38px;
}

input:focus, select:focus {
    border-color: var(--sheet-green);
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

input:focus + .input-icon {
    color: var(--sheet-green);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--sheet-green), var(--sheet-blue));
    color: white;
    box-shadow: 0 4px 12px -3px var(--sheet-green);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -3px var(--sheet-green);
    opacity: 0.95;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-block {
    width: 100%;
}

.login-demo-accounts {
    margin-top: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.login-demo-accounts h4 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.demo-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.demo-chip {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.demo-chip:hover {
    background: var(--sheet-green-glow);
    border-color: var(--sheet-green);
    color: var(--sheet-green);
}

/* SPREADSHEET INTERFACE SHELL */

/* Google Sheets Header */
.sheets-header {
    background-color: #0f172a;
    border-bottom: 1px solid var(--border-color);
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
    flex-shrink: 0;
}

.header-main-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sheets-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background-color: var(--sheet-green);
    color: white;
    cursor: pointer;
}

.sheets-title-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sheets-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

#sheet-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    border: 1px solid transparent;
    padding: 1px 4px;
    border-radius: var(--radius-sm);
    outline: none;
    max-width: 400px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#sheet-title:focus {
    background: #1e293b;
    border-color: var(--sheet-blue);
}

.title-icons {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 14px;
}

.star-icon:hover, .folder-icon:hover {
    color: var(--text-secondary);
    cursor: pointer;
}

.sheets-menu {
    display: flex;
    list-style: none;
    gap: 12px;
}

.menu-item {
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 1px 4px;
    border-radius: var(--radius-sm);
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* Header Actions Right */
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.role-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    border-radius: var(--radius-md);
}

.role-selector-wrapper label {
    font-size: 9px;
    font-weight: 700;
    color: var(--sheet-green);
    letter-spacing: 0.5px;
}

.role-select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 24px 2px 4px;
    height: auto;
    width: auto;
    cursor: pointer;
}

.role-select:focus {
    box-shadow: none;
}

.sheets-share-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: var(--sheet-blue);
    color: white;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 4px 10px -4px var(--sheet-blue);
    transition: background-color var(--transition-fast);
}

.sheets-share-badge:hover {
    background-color: var(--sheet-blue-hover);
}

.sheets-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--accent-violet);
    color: white;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.user-popover {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    width: 200px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    z-index: 100;
    text-align: center;
}

.sheets-user-avatar:hover .user-popover {
    display: block;
}

.popover-username {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.popover-role {
    font-size: 11px;
    font-weight: 600;
    color: var(--sheet-green);
    text-transform: uppercase;
    margin-bottom: 12px;
}

/* SPREADSHEET TOOLBAR */
.sheets-toolbar {
    background-color: #1e293b;
    border-bottom: 1px solid var(--border-color);
    padding: 6px 16px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    height: 40px;
    overflow: hidden;
    flex-shrink: 0;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.toolbar-divider {
    height: 20px;
    width: 1px;
    background-color: var(--border-color);
    margin: 0 6px;
}

.tb-btn {
    background: transparent;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sheet-header-text);
    cursor: pointer;
    font-size: 13px;
    transition: all var(--transition-fast);
}

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

.tb-btn.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--sheet-green);
}

.tb-btn svg {
    color: inherit;
}

.tb-select {
    background: transparent;
    border: none;
    height: 28px;
    font-size: 12px;
    color: var(--sheet-header-text);
    padding: 0 20px 0 6px;
    cursor: pointer;
    width: auto;
    border-radius: var(--radius-sm);
}

.tb-select:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.tb-btn.highlight-green {
    background: var(--sheet-green-glow);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--sheet-green);
    width: auto;
    padding: 0 10px;
    font-weight: 600;
}

.tb-btn.highlight-green:hover {
    background: var(--sheet-green);
    color: white;
}

.tb-btn.highlight-blue {
    background: var(--sheet-blue-glow);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--sheet-blue);
    width: auto;
    padding: 0 10px;
    font-weight: 600;
}

.tb-btn.highlight-blue:hover {
    background: var(--sheet-blue);
    color: white;
}

.tb-btn-text {
    font-size: 12px;
    margin-left: 4px;
}

.filter-indicator-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--accent-amber);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: auto;
}

.indicator-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-amber);
    animation: pulse 1.5s infinite;
}

/* FORMULA BAR */
.sheets-formula-bar {
    background-color: #0f172a;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    height: 36px;
    flex-shrink: 0;
}

.cell-address-box {
    width: 60px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.02);
}

.formula-fx-icon {
    font-family: 'Georgia', serif;
    font-style: italic;
    font-size: 14px;
    font-weight: bold;
    color: var(--text-muted);
    padding: 0 10px;
    height: 100%;
    display: flex;
    align-items: center;
    border-right: 1px solid var(--border-color);
}

.formula-input-wrapper {
    flex-grow: 1;
    height: 100%;
    display: flex;
    align-items: center;
}

.formula-input-field {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0 12px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
}

.formula-input-field:focus {
    box-shadow: none;
    background: rgba(255, 255, 255, 0.01);
}

/* SPREADSHEET GRID & VIEWPORT */
.grid-viewport {
    flex-grow: 1;
    overflow: auto; /* Handles vertical and horizontal scroll */
    position: relative;
    background-color: #0b0f19;
}

/* Notification banners */
.sheet-info-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(16, 185, 129, 0.08);
    border-bottom: 1px solid rgba(16, 185, 129, 0.15);
    padding: 10px 16px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--sheet-green);
    position: sticky;
    left: 0;
    z-index: 20;
}

.sheet-info-banner strong {
    color: var(--text-primary);
}

.banner-icon {
    font-size: 16px;
    flex-shrink: 0;
}

#cashier-lock-banner {
    background: rgba(59, 130, 246, 0.08);
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
    color: var(--sheet-blue);
}

/* The Spreadsheet Grid Table */
.sheets-grid {
    border-collapse: collapse;
    width: max-content; /* Ensure table keeps its column widths */
    min-width: 100%;
    table-layout: fixed;
    background: #0f172a;
}

/* Grid columns header and row index header */
.sheets-grid th {
    background-color: var(--sheet-header-bg);
    color: var(--sheet-header-text);
    font-weight: 500;
    font-size: 11px;
    text-align: center;
    padding: 6px 4px;
    border: 1px solid var(--sheet-header-border);
    user-select: none;
}

/* Dual sticky freeze header */
.sheets-grid thead tr:nth-child(1) th {
    position: sticky;
    top: 0;
    z-index: 10;
    height: 28px;
    box-shadow: inset 0 -1px 0 var(--sheet-header-border);
}

.sheets-grid thead tr:nth-child(2) th {
    position: sticky;
    top: 28px; /* Sticks right below the column letters */
    z-index: 10;
    height: 32px;
    box-shadow: inset 0 -1px 0 var(--sheet-header-border);
}

/* Corner header (0,0 cell) stays sticky on both scroll axes */
.sheets-grid thead tr:nth-child(1) th.corner-header {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 12;
    width: 40px;
    background-color: var(--sheet-header-bg);
    box-shadow: inset -1px -1px 0 var(--sheet-header-border);
}

/* Row numbers on left sticky (vertical headers) */
.sheets-grid td.row-number, .sheets-grid thead tr:nth-child(2) th.row-number {
    background-color: var(--sheet-header-bg);
    color: var(--sheet-header-text);
    font-weight: 500;
    font-size: 10px;
    text-align: center;
    border: 1px solid var(--sheet-header-border);
    position: sticky;
    left: 0;
    z-index: 9;
    width: 40px;
    max-width: 40px;
    user-select: none;
    box-shadow: inset -1px 0 0 var(--sheet-header-border);
}

.sheets-grid thead tr:nth-child(2) th.row-number {
    top: 28px;
    z-index: 12;
    box-shadow: inset -1px -1px 0 var(--sheet-header-border);
}
}

/* Regular cells styling */
.sheets-grid td.grid-cell {
    border: 1px solid var(--sheet-grid-border);
    padding: 6px 8px;
    font-size: 13px;
    height: 32px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    color: var(--text-primary);
    cursor: cell;
    vertical-align: middle;
}

.sheets-grid tbody tr:hover td.grid-cell {
    background-color: rgba(255, 255, 255, 0.01);
}

.sheets-grid tbody tr:hover td.row-number {
    background-color: #334155;
    color: var(--text-primary);
}

/* Column dimensions */
.col-id { width: 60px; text-align: center; }
.col-date { width: 110px; text-align: center; }
.col-name { width: 180px; }
.col-phone { width: 140px; }
.col-service { width: 200px; }
.col-price { width: 100px; text-align: right; font-weight: 600; }
.col-paid { width: 130px; text-align: right; }
.col-type { width: 120px; text-align: center; }
.col-change { width: 140px; text-align: right; font-weight: 600; }
.col-status { width: 110px; text-align: center; }

.col-exp-date { width: 120px; text-align: center; }
.col-exp-title { width: 260px; }
.col-exp-amount { width: 130px; text-align: right; font-weight: 600; }
.col-exp-notes { width: 260px; }

/* Dashboard custom layout widths */
.col-dash-a { width: 220px; }
.col-dash-b { width: 160px; text-align: right; }
.col-dash-c { width: 280px; font-family: var(--font-mono); color: var(--text-muted); font-size: 11px; }
.col-dash-d { width: 40px; } /* Empty separation column */
.col-dash-e { width: 180px; }
.col-dash-f { width: 130px; }
.col-dash-g { width: 130px; text-align: right; font-weight: 600; }

/* Cell alignments */
.align-center { text-align: center !important; }
.align-right { text-align: right !important; }
.align-left { text-align: left !important; }

/* Special cell styles */
.cell-protected {
    background-color: var(--sheet-protected-bg);
    color: var(--text-secondary);
    cursor: not-allowed !important;
}

.cell-formula {
    color: var(--sheet-blue);
    font-weight: 500;
}

.cell-header-custom {
    background-color: var(--sheet-header-bg) !important;
    color: var(--text-primary) !important;
    font-weight: 700 !important;
    border-bottom: 2px solid var(--sheet-header-border) !important;
    border-top: 2px solid var(--sheet-header-border) !important;
}

.cell-bold {
    font-weight: 700;
}

.cell-italic {
    font-style: italic;
}

.cell-strike {
    text-decoration: line-through;
}

/* Active Selection Overlay */
.sheets-grid td.cell-active {
    outline: 2px solid var(--sheet-active-cell-border);
    outline-offset: -2px;
    background-color: var(--sheet-selection-bg) !important;
    z-index: 5;
}

/* Active cell bottom-right dot */
.sheets-grid td.cell-active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 6px;
    height: 6px;
    background-color: var(--sheet-active-cell-border);
    border: 1px solid white;
    z-index: 10;
    cursor: crosshair;
}

/* CELL INLINE EDITING INPUTS */
.cell-edit-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid var(--sheet-blue) !important;
    border-radius: 0;
    background-color: #0f172a !important;
    color: var(--text-primary) !important;
    font-family: inherit;
    font-size: 13px;
    padding: 0 6px;
    outline: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    z-index: 10;
}

.cell-edit-select {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid var(--sheet-blue) !important;
    border-radius: 0;
    background-color: #0f172a !important;
    color: var(--text-primary) !important;
    font-family: inherit;
    font-size: 12px;
    padding: 0 4px;
    outline: none;
    z-index: 10;
}

/* Status complete buttons */
.grid-action-btn {
    background: var(--sheet-green-glow);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--sheet-green);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.grid-action-btn:hover {
    background: var(--sheet-green);
    color: white;
}

/* Colors for cells depending on value types */
.text-green { color: var(--sheet-green) !important; }
.text-blue { color: var(--sheet-blue) !important; }
.text-rose { color: var(--accent-rose) !important; }
.text-amber { color: var(--accent-amber) !important; }
.text-violet { color: var(--accent-violet) !important; }

/* Dashboard Header block formatting */
.dashboard-title-row {
    background: linear-gradient(90deg, #1e293b 0%, #0f172a 100%) !important;
    color: #38bdf8 !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid var(--sheet-header-border) !important;
}

.dashboard-section-row {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-total-row {
    background-color: rgba(16, 185, 129, 0.05) !important;
    font-weight: 700 !important;
    border-top: 1px solid var(--sheet-header-border) !important;
    border-bottom: 3px double var(--sheet-header-border) !important;
}

/* Interactive Dashboard widget cells */
.cell-widget {
    padding: 2px 4px !important;
}

.cell-widget input, .cell-widget select {
    height: 26px;
    padding: 2px 6px;
    background: #0f172a;
    border: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-primary);
}

/* BOTTOM TAB BAR */
.sheets-tabbar {
    background-color: #0f172a;
    border-top: 1px solid var(--border-color);
    height: 36px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    padding: 0 16px;
    user-select: none;
}

.tabbar-left {
    display: flex;
    align-items: center;
    gap: 4px;
    border-right: 1px solid var(--border-color);
    padding-right: 8px;
    height: 100%;
}

.tabbar-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.sheets-tabs-container {
    display: flex;
    height: 100%;
    flex-grow: 1;
    align-items: flex-end;
    overflow-x: auto;
    scrollbar-width: none; /* Hide scrollbar in Firefox */
}

.sheets-tabs-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar in Chrome/Safari */
}

.tab-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    height: 28px;
    background-color: #1e293b;
    border-right: 1px solid var(--sheet-tab-border);
    border-top: 1px solid var(--sheet-tab-border);
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
}

.tab-item:hover {
    background-color: #334155;
    color: var(--text-primary);
}

.tab-item.active {
    background-color: var(--sheet-active-tab-bg);
    color: var(--sheet-green);
    font-weight: 600;
    height: 32px; /* Active tab stands higher */
    border-top: 3px solid var(--sheet-green); /* Sheets green active indicator */
    border-bottom: 1px solid var(--sheet-active-tab-bg); /* Blend bottom border */
    z-index: 5;
}

.tab-dropdown-arrow {
    font-size: 9px;
    color: var(--text-muted);
}

.tab-item.active .tab-dropdown-arrow {
    color: var(--sheet-green);
}

.tabbar-right {
    font-size: 11px;
    color: var(--text-muted);
    border-left: 1px solid var(--border-color);
    padding-left: 8px;
    height: 100%;
    display: flex;
    align-items: center;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
    100% { transform: scale(1); opacity: 1; }
}

/* MOBILE RESPONSIVE ADAPTATIONS */
@media (max-width: 768px) {
    .sheets-header {
        flex-direction: column;
        height: auto;
        padding: 10px;
        gap: 8px;
    }
    
    .sheets-menu {
        display: none; /* Hide menus on mobile to save space */
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
    }
    
    .sheets-toolbar {
        height: auto;
        padding: 6px;
        gap: 6px;
    }
    
    .toolbar-divider {
        display: none; /* Hide dividers to wrap items neatly */
    }
    
    .tb-select {
        width: 100px;
    }
    
    .filter-indicator-badge {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
    
    .cell-address-box {
        width: 48px;
    }
    
    .sheets-formula-bar {
        height: 32px;
    }
    
    .sheet-info-banner {
        font-size: 11px;
        padding: 6px 12px;
    }
}
