/* ── Theme CSS custom properties (defaults = Classic Baize) ── */
:root {
    --theme-accent: #22c55e;
    --theme-accent-rgb: 34, 197, 94;
    --theme-nav: #0F7A3F;
    --theme-body: #0D2618;
    --theme-card: #1A3D2A;
    --theme-card-rgb: 26, 61, 42;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--theme-body);
    color: #f0f0f0;
    min-height: 100vh;
    line-height: 1.5;
    padding-top: 60px;
    scrollbar-gutter: stable; /* Prevents layout shift when modal opens/closes */
}

.nav {
    background: var(--theme-nav);
    border-bottom: 2px solid var(--theme-accent);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    height: 60px;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    position: relative;
}

/* Sliding pill indicator behind active tab */
.nav-tab-indicator {
    position: absolute;
    background: var(--theme-accent, #22c55e);
    border-radius: 6px;
    transition: left 300ms cubic-bezier(0.25, 0.1, 0.25, 1.0),
                width 300ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
    z-index: 0;
    pointer-events: none;
}

.nav-links a {
    padding: 0.5rem 1rem;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease, font-weight 0.15s ease;
    border: 2px solid transparent;
    position: relative;
    z-index: 1;
}

.nav-links a:hover {
    background: transparent;
    color: #fff;
    font-weight: 600;
    border-color: var(--theme-accent, #22c55e);
    border-radius: 8px;
}

.nav-links a.active {
    background: var(--theme-accent, #22c55e);
    color: #fff;
    font-weight: 600;
    border-color: var(--theme-accent, #22c55e);
    border-radius: 8px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #d0d0d0;
	margin-left: auto;
}

.logout-btn {
    background: #dc2626;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.2s ease;
}

.logout-btn:hover {
    background: #b91c1c;
}

.filters {
    border-bottom: 0px solid var(--theme-accent);
    padding: 0.75rem 0;
    position: sticky;
    top: 60px;
    z-index: 90;
    background: var(--theme-body);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filters-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 0.5rem;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    align-items: center;
}

.filter-select {
    background: #1A3D2A;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.82rem;
    min-width: 0;
    flex: 0 1 auto;
    max-width: 220px;
    transition: all 0.25s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%239ca3af' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 8px 5px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2), 0 1px 0 rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Tooltip for filter-select */
.filter-tooltip {
    position: fixed;
    background: var(--theme-card);
    color: var(--theme-accent);
    font-size: 0.72rem;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 4px;
    border: 1px solid rgba(var(--theme-accent-rgb), 0.3);
    white-space: nowrap;
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.filter-tooltip.visible {
    opacity: 1;
}

.filter-select:hover {
    border-color: rgba(var(--theme-accent-rgb), 0.35);
    background: linear-gradient(135deg, rgba(34, 80, 48, 0.7), rgba(24, 50, 32, 0.9));
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 8px rgba(var(--theme-accent-rgb), 0.08);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2322c55e' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 8px 5px;
}

.filter-select:focus {
    outline: none;
    border-color: rgba(var(--theme-accent-rgb), 0.5);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 0 2px rgba(var(--theme-accent-rgb), 0.15), 0 0 12px rgba(var(--theme-accent-rgb), 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2322c55e' d='M5 0l5 6H0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 8px 5px;
}

/* ── Custom Dropdown Component ── */
.cd-dropdown {
    position: relative;
    display: inline-flex;
    min-width: 0;
    flex: 0 1 auto;
    max-width: 220px;
}

/* Hide native select when custom dropdown is active */
.cd-dropdown .filter-select {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.cd-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    background: #1A3D2A;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    padding: 0.5rem 0.65rem 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2), 0 1px 0 rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cd-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cd-toggle:hover {
    border-color: rgba(var(--theme-accent-rgb), 0.35);
    background: linear-gradient(135deg, rgba(34, 80, 48, 0.7), rgba(24, 50, 32, 0.9));
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 8px rgba(var(--theme-accent-rgb), 0.08);
}

.cd-open .cd-toggle {
    border-color: rgba(var(--theme-accent-rgb), 0.5);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 0 2px rgba(var(--theme-accent-rgb), 0.15), 0 0 12px rgba(var(--theme-accent-rgb), 0.1);
}

.cd-arrow {
    flex-shrink: 0;
    width: 10px;
    height: 6px;
    color: #9ca3af;
    transition: transform 0.25s ease, color 0.25s ease;
}

.cd-toggle:hover .cd-arrow { color: var(--theme-accent); }
.cd-open .cd-arrow { transform: rotate(180deg); color: var(--theme-accent); }

.cd-disabled .cd-toggle {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* Panel — lives on document.body, positioned via JS */
.cd-panel {
    position: fixed;
    min-width: 200px;
    max-width: 320px;
    background: #0a1a0f;
    border: 1px solid rgba(var(--theme-accent-rgb), 0.12);
    border-radius: 10px;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.6),
        0 8px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    z-index: 1001; /* base z-index, also set dynamically by JS */
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.cd-panel.cd-panel-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    z-index: 10001 !important;
}

/* Search */
.cd-search-wrap {
    position: relative;
    padding: 8px 8px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cd-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #4b5563;
    pointer-events: none;
    margin-top: -2px;
}

.cd-search {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #e2e8f0;
    padding: 8px 10px 8px 32px;
    font-size: 0.8rem;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.cd-search:focus {
    border-color: rgba(var(--theme-accent-rgb), 0.35);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 2px rgba(var(--theme-accent-rgb), 0.08);
}

.cd-search::placeholder {
    color: #4b5563;
}

/* List */
.cd-list {
    max-height: none;
    overflow-y: auto;
    padding: 4px;
    scroll-behavior: smooth;
}

/* Styled scrollbar */
.cd-list::-webkit-scrollbar {
    width: 4px;
}

.cd-list::-webkit-scrollbar-track {
    background: transparent;
    margin: 4px 0;
}

.cd-list::-webkit-scrollbar-thumb {
    background: rgba(var(--theme-accent-rgb), 0.15);
    border-radius: 10px;
}

.cd-list::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--theme-accent-rgb), 0.3);
}

/* Items */
.cd-item {
    padding: 8px 12px;
    font-size: 0.82rem;
    color: #94a3b8;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.12s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 1px 0;
}

.cd-item:hover {
    background: rgba(var(--theme-accent-rgb), 0.1);
    color: #e2e8f0;
}

.cd-item.cd-selected {
    background: rgba(var(--theme-accent-rgb), 0.15);
    color: var(--theme-accent);
    font-weight: 500;
    position: relative;
}

.cd-item.cd-selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 16px;
    background: var(--theme-accent);
    border-radius: 2px;
}

.cd-item.cd-selected:hover {
    background: rgba(var(--theme-accent-rgb), 0.2);
}

.cd-item-disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.cd-empty {
    padding: 20px 12px;
    font-size: 0.8rem;
    color: #4b5563;
    text-align: center;
}

.cd-empty {
    padding: 16px 12px;
    font-size: 0.8rem;
    color: #6b7280;
    text-align: center;
}

/* Status filter checkbox labels */
.cd-status-label:hover {
    background: rgba(var(--theme-accent-rgb), 0.1) !important;
    color: #e2e8f0 !important;
}

/* Date filter with calendar button - seamless look */
.date-filter-select.has-calendar {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.date-picker-btn {
    background: var(--theme-accent);
    border: 1px solid var(--theme-accent);
    border-left: 1px solid rgba(255,255,255,0.2);
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    color: #0d1f12;
    padding: 0 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.date-picker-btn:hover {
    background: #16a34a;
    border-color: #16a34a;
}

.date-picker-btn:active {
    background: #15803d;
    transform: scale(0.98);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0.5rem;
    /* margin-top: 1rem; */
}

.card {
    background: #1A3D2A;
    border: 0px solid var(--theme-accent);
    border-radius: 8px;
    padding: 1.5rem;
    padding-top: 12px;
    /* margin: 1rem 0; */
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 0px solid var(--theme-accent);
    padding-top: 0.5rem;
}

.card-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--theme-accent);
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-success {
    background: var(--theme-accent);
    color: #0a1a0d;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
}


.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-info {
    background: #06b6d4;
    color: white;
}

.btn-info:hover {
    background: #0891b2;
}



.search-bar {
    margin-bottom: 1rem;
}

.form-input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--theme-card);
    border: 1px solid var(--theme-accent);
    border-radius: 4px;
    color: #f0f0f0;
    font-size: 0.85rem;
}

.form-input:focus {
    outline: none;
    border-color: #16a34a;
}

.data-table {
    width: 100%;
    table-layout: fixed;
    background: transparent;
    border: none;
    border-collapse: collapse;
}

.data-table thead tr {
    background: rgba(var(--theme-accent-rgb), 0.1);
}

.data-table th,
.data-table td {
    padding: 0.45rem 0.6rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.82rem;
}

.data-table td:last-child {
    padding: 1rem 0.8rem;
}

.data-table .btn {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    min-width: 60px;
}

.data-table .btn:last-child {
    margin-right: 0;
}

/* Vertical action button container (legacy) */
.actions-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: flex-start;
}

.actions-vertical .btn {
    width: 100%;
    min-width: 70px;
    max-width: 90px;
    margin: 0;
}

/* Inline icon action buttons */
.actions-inline {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    justify-content: center;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: #999;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-icon:hover {
    background: var(--theme-card);
    border-color: #333;
}

.btn-icon-view:hover {
    color: #60a5fa;
    border-color: #60a5fa44;
    background: #1e2a3a;
}

.btn-icon-edit:hover {
    color: var(--theme-accent);
    border-color: rgba(var(--theme-accent-rgb), 0.27);
    background: var(--theme-card);
}

.btn-icon-delete:hover {
    color: #f87171;
    border-color: #f8717144;
    background: #2f1a1a;
}

/* Kebab actions dropdown for tables with >3 actions */
.actions-kebab {
    position: relative;
    display: inline-block;
}

.actions-kebab-toggle {
    background: transparent;
    border: 1px solid #6b7280;
    color: #f0f0f0;
    cursor: pointer;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 1rem;
    line-height: 1;
    letter-spacing: 2px;
    transition: border-color 0.2s ease, background 0.2s ease;
    font-family: inherit;
}

.actions-kebab-toggle:hover {
    border-color: var(--theme-accent);
    background: rgba(var(--theme-accent-rgb), 0.08);
}

.actions-kebab.active .actions-kebab-toggle {
    border-color: var(--theme-accent);
    background: rgba(var(--theme-accent-rgb), 0.1);
}

.actions-kebab-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: var(--theme-card);
    border: 1px solid #6b7280;
    border-radius: 4px;
    min-width: 140px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 100;
    overflow: hidden;
}

.actions-kebab.active .actions-kebab-menu {
    display: block;
}

.actions-kebab-menu button {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    color: #d0d0d0;
    text-align: left;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: inherit;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.actions-kebab-menu button:hover {
    background: rgba(var(--theme-accent-rgb), 0.12);
    color: #f0f0f0;
}

.actions-kebab-menu button.action-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.actions-kebab-menu button.action-warning {
    color: #f59e0b;
}

.actions-kebab-menu button.action-warning:hover {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.actions-kebab-menu .kebab-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 2px 0;
}

.data-table th {
    background: var(--theme-card);
    font-weight: 600;
    color: var(--theme-accent);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid rgba(var(--theme-accent-rgb), 0.2);
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table td {
    color: #d0d0d0;
    white-space: normal;
    word-wrap: break-word;
    overflow: visible;
}

.data-table tbody tr:hover {
    background: rgba(var(--theme-accent-rgb), 0.08);
}

/* Table column widths - Admins (8 columns) */
#adminsTable th:nth-child(1), #adminsTable td:nth-child(1) { width: 10%; }
#adminsTable th:nth-child(2), #adminsTable td:nth-child(2) { width: 13%; }
#adminsTable th:nth-child(3), #adminsTable td:nth-child(3) { width: 18%; }
#adminsTable th:nth-child(4), #adminsTable td:nth-child(4) { width: 12%; }
#adminsTable th:nth-child(5), #adminsTable td:nth-child(5) { width: 10%; }
#adminsTable th:nth-child(6), #adminsTable td:nth-child(6) { width: 10%; }
#adminsTable th:nth-child(7), #adminsTable td:nth-child(7) { width: 8%; }
#adminsTable th:nth-child(8), #adminsTable td:nth-child(8) { width: 19%; }

/* Table column widths - Clients (8 columns) */
#clientsTable th:nth-child(1), #clientsTable td:nth-child(1) { width: 8%; }   /* Created */
#clientsTable th:nth-child(2), #clientsTable td:nth-child(2) { width: 10%; }  /* Name */
#clientsTable th:nth-child(3), #clientsTable td:nth-child(3) { width: 14%; }  /* Email */
#clientsTable th:nth-child(4), #clientsTable td:nth-child(4) { width: 10%; }  /* Mobile */
#clientsTable th:nth-child(5), #clientsTable td:nth-child(5) { width: 8%; }   /* Last Login */
#clientsTable th:nth-child(6), #clientsTable td:nth-child(6) { width: 7%; }   /* Status */
#clientsTable th:nth-child(7), #clientsTable td:nth-child(7) { width: 32%; }  /* Expiry - full width */
#clientsTable th:nth-child(8), #clientsTable td:nth-child(8) { width: 11%; }  /* Actions - slim */

/* Clients table - allow text wrap for non-badge columns */
#clientsTable td:nth-child(1),
#clientsTable td:nth-child(2),
#clientsTable td:nth-child(3),
#clientsTable td:nth-child(4),
#clientsTable td:nth-child(5) {
    white-space: normal;
    word-wrap: break-word;
}

/* Clients table - expiry column full display */
#clientsTable td:nth-child(7) {
    white-space: normal;
}

/* Clients table - badges stay on one line */
#clientsTable .status-badge,
#clientsTable .expiry-cell .badge,
#clientsTable .expiry-cell span[class*="badge"] {
    white-space: nowrap;
    display: inline-block;
}

/* Table column widths - Organizations (10 columns) */
#organizationsTable th:nth-child(1), #organizationsTable td:nth-child(1) { width: 9%; }
#organizationsTable th:nth-child(2), #organizationsTable td:nth-child(2) { width: 10%; }
#organizationsTable th:nth-child(3), #organizationsTable td:nth-child(3) { width: 12%; }
#organizationsTable th:nth-child(4), #organizationsTable td:nth-child(4) { width: 15%; }
#organizationsTable th:nth-child(5), #organizationsTable td:nth-child(5) { width: 10%; }
#organizationsTable th:nth-child(6), #organizationsTable td:nth-child(6) { width: 7%; }
#organizationsTable th:nth-child(7), #organizationsTable td:nth-child(7) { width: 8%; }
#organizationsTable th:nth-child(8), #organizationsTable td:nth-child(8) { width: 10%; }
#organizationsTable th:nth-child(9), #organizationsTable td:nth-child(9) { width: 7%; }
#organizationsTable th:nth-child(10), #organizationsTable td:nth-child(10) { width: 12%; }

/* Table column widths - Centers (7 columns) */
#centersTable th:nth-child(1), #centersTable td:nth-child(1) { width: 10%; }
#centersTable th:nth-child(2), #centersTable td:nth-child(2) { width: 8%; }
#centersTable th:nth-child(3), #centersTable td:nth-child(3) { width: 25%; }
#centersTable th:nth-child(4), #centersTable td:nth-child(4) { width: 10%; }
#centersTable th:nth-child(5), #centersTable td:nth-child(5) { width: 15%; }
#centersTable th:nth-child(6), #centersTable td:nth-child(6) { width: 10%; }
#centersTable th:nth-child(7), #centersTable td:nth-child(7) { width: 22%; }

/* Table column widths - Employees (9 columns) */
#employeesTable th:nth-child(1), #employeesTable td:nth-child(1) { width: 9%; }
#employeesTable th:nth-child(2), #employeesTable td:nth-child(2) { width: 12%; }
#employeesTable th:nth-child(3), #employeesTable td:nth-child(3) { width: 16%; }
#employeesTable th:nth-child(4), #employeesTable td:nth-child(4) { width: 11%; }
#employeesTable th:nth-child(5), #employeesTable td:nth-child(5) { width: 8%; }
#employeesTable th:nth-child(6), #employeesTable td:nth-child(6) { width: 12%; }
#employeesTable th:nth-child(7), #employeesTable td:nth-child(7) { width: 10%; }
#employeesTable th:nth-child(8), #employeesTable td:nth-child(8) { width: 7%; }
#employeesTable th:nth-child(9), #employeesTable td:nth-child(9) { width: 15%; }

/* Table column widths - Members (11 columns) */
#membersTable th:nth-child(1), #membersTable td:nth-child(1) { width: 8%; }
#membersTable th:nth-child(2), #membersTable td:nth-child(2) { width: 10%; }
#membersTable th:nth-child(3), #membersTable td:nth-child(3) { width: 14%; }
#membersTable th:nth-child(4), #membersTable td:nth-child(4) { width: 10%; }
#membersTable th:nth-child(5), #membersTable td:nth-child(5) { width: 9%; }
#membersTable th:nth-child(6), #membersTable td:nth-child(6) { width: 7%; }
#membersTable th:nth-child(7), #membersTable td:nth-child(7) { width: 8%; }
#membersTable th:nth-child(8), #membersTable td:nth-child(8) { width: 8%; }
#membersTable th:nth-child(9), #membersTable td:nth-child(9) { width: 6%; }
#membersTable th:nth-child(10), #membersTable td:nth-child(10) { width: 7%; }
#membersTable th:nth-child(11), #membersTable td:nth-child(11) { width: 13%; }

/* Subscription card amount highlight */
.sub-card-amount {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f0f0f0;
}

/* Client table - compact rows with aligned actions */
#clientsTable tbody tr {
    vertical-align: middle;
}

#clientsTable tbody td {
    vertical-align: middle;
    padding: 0.5rem 0.8rem;
}

.client-actions-cell {
    vertical-align: middle;
}

.client-actions-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: flex-start;
}

.data-table .client-action-extra {
    display: none !important;
}

.client-row-selected {
    background: rgba(var(--theme-accent-rgb), 0.15) !important;
}

.data-table .client-row-selected .client-action-extra {
    display: inline-block !important;
}

/* Client table - expiry column */
.expiry-cell {
    min-width: 120px;
}

.expiry-full-list {
    font-size: 11px;
    line-height: 1.3;
}

.status-badge {
    padding: 0.05rem 0.3rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    display: inline-block;
    width: fit-content;
    background: transparent;
}

/* Universal badge protection - prevent truncation */
.data-table .status-badge,
.data-table span[class*="badge"] {
    white-space: nowrap;
    display: inline-block;
    width: fit-content;
    overflow: visible;
}

.status-active {
    background: transparent;
    border: 1px solid var(--theme-accent);
    color: var(--theme-accent);
}

.status-inactive {
    background: transparent;
    border: 1px solid #dc2626;
    color: #dc2626;
}

.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    min-height: 536px; /* Height of 2 rows of table cards — consistent across all pages/zones */
    align-content: start;
}

.table-card {
    background: var(--theme-body);
    border: 2px solid var(--theme-accent);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    height: 200px; /* Fixed height for consistent layout */
    width: 176px; /* Fixed width */
}

/* Pool Table Theme - Compact Design */
.table-card.theme-pool {
    background: transparent;
    border: none;
    padding: 0;
    position: relative;
    height: 200px;
    width: 176px;
}

.table-card.theme-pool .pool-rail {
    background: linear-gradient(145deg, #6b4532 0%, #5c3d2e 50%, #4a3025 100%);
    border-radius: 6px;
    padding: 6px;
    height: 100%;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.table-card.theme-pool .pool-felt {
    background: linear-gradient(145deg, #1a6b2e 0%, #145224 50%, #0f3d1b 100%);
    border-radius: 3px;
    height: 100%;
    padding: 6px;
    display: flex;
    flex-direction: column;
}

.table-card.theme-pool .pool-cushion {
    border: 1px solid rgba(45, 122, 74, 0.4);
    border-radius: 3px;
    height: 100%;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    text-align: center;
}

/* Pool table pockets - smaller */
.table-card.theme-pool .pocket {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle, #0a0a0a 40%, #1a1a1a 100%);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
    z-index: 5;
}

.table-card.theme-pool .pocket-tl { top: 2px; left: 2px; }
.table-card.theme-pool .pocket-tr { top: 2px; right: 2px; }
.table-card.theme-pool .pocket-bl { bottom: 2px; left: 2px; }
.table-card.theme-pool .pocket-br { bottom: 2px; right: 2px; }
.table-card.theme-pool .pocket-ml { top: 50%; left: 2px; transform: translateY(-50%); }
.table-card.theme-pool .pocket-mr { top: 50%; right: 2px; transform: translateY(-50%); }

/* Table name at top of felt area */
.table-card.theme-pool .table-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #86efac;
    text-align: center;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Pool theme hover effects */
.table-card.theme-pool:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(74, 222, 128, 0.3);
}

/* Pool theme hover outline */
.table-card.theme-pool .hover-outline {
    position: absolute;
    inset: 0;
    border-radius: 6px;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
    pointer-events: none;
    z-index: 10;
}

.table-card.theme-pool:hover .hover-outline {
    border-color: rgba(74, 222, 128, 0.6);
}

/* Pool theme timer */
.table-card.theme-pool .table-timer {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 2px;
    margin-top: 8px; /* Push timer down from top */
    flex-shrink: 0;
}

/* Pool theme status */
.table-card.theme-pool .table-status {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #a7f3d0;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Pool theme operation buttons */
.table-card.theme-pool .table-operations {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: auto;
    flex-shrink: 0;
}

.table-card.theme-pool .table-operations button {
    flex: 1;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.table-card.theme-pool .table-operations button:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    outline: 2px solid rgba(74, 222, 128, 0.6);
    outline-offset: -2px;
}

/* Pool theme status indicator - colored left border on cushion */
.table-card.theme-pool.available .pool-cushion {
    border-left: 3px solid var(--theme-accent);
}

.table-card.theme-pool.occupied .pool-cushion {
    border-left: 3px solid #f97316;
}

.table-card.theme-pool.checkedout .pool-cushion {
    border-left: 3px solid #dc2626;
}

.table-card.theme-pool.maintenance .pool-cushion,
.table-card.theme-pool.inactive .pool-cushion {
    border-left: 3px solid #6b7280;
}

/* Pool theme status text colors */
.table-card.theme-pool.available .table-status { color: #86efac; }
.table-card.theme-pool.occupied .table-status { color: #fed7aa; }
.table-card.theme-pool.checkedout .table-status { color: #fecaca; }
.table-card.theme-pool.maintenance .table-status,
.table-card.theme-pool.inactive .table-status { color: #d1d5db; }

/* Pool Table Square Theme */
.table-card.theme-pool-square {
    background: transparent;
    border: none;
    padding: 0;
    height: 200px;
    width: 176px;
    display: flex;
    flex-direction: column;
}

.table-card.theme-pool-square .table-title-container {
    padding: 4px 8px;
    margin-bottom: 4px;
    border-radius: 4px;
    border: 2px solid;
    background: rgba(0, 0, 0, 0.4);
    text-align: center;
    flex-shrink: 0;
}

.table-card.theme-pool-square .table-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-card.theme-pool-square .pool-felt-square {
    flex: 1;
    border-radius: 4px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.table-card.theme-pool-square .table-timer {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 2px;
    margin-top: 8px; /* Push timer down from top */
}

.table-card.theme-pool-square .table-status {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-card.theme-pool-square .table-operations {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: auto;
    flex-shrink: 0;
}

.table-card.theme-pool-square .table-operations button {
    flex: 1;
    padding: 4px 6px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.table-card.theme-pool-square .table-operations button:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    outline: 2px solid rgba(74, 222, 128, 0.6);
    outline-offset: -2px;
}

.table-card.theme-pool-square:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(74, 222, 128, 0.3);
}

/* Pool-square theme status indicator - colored left border on felt */
.table-card.theme-pool-square.available .pool-felt-square {
    border-left: 3px solid var(--theme-accent);
}

.table-card.theme-pool-square.occupied .pool-felt-square {
    border-left: 3px solid #f97316;
}

.table-card.theme-pool-square.checkedout .pool-felt-square {
    border-left: 3px solid #dc2626;
}

.table-card.theme-pool-square.maintenance .pool-felt-square,
.table-card.theme-pool-square.inactive .pool-felt-square {
    border-left: 3px solid #6b7280;
}

/* ========================================
   SNOOKER TABLE THEME - Exact Design-6.txt
   Card IS the rail (no separate rail div)
   ======================================== */

/* Snooker ball shake animation (on click) */
@keyframes snookerBallShake {
    0%   { transform: translateX(-50%) translateY(0); }
    10%  { transform: translateX(-42%) translateY(0); }
    20%  { transform: translateX(-58%) translateY(0); }
    30%  { transform: translateX(-44%) translateY(0); }
    40%  { transform: translateX(-56%) translateY(0); }
    50%  { transform: translateX(-46%) translateY(0); }
    60%  { transform: translateX(-54%) translateY(0); }
    70%  { transform: translateX(-48%) translateY(0); }
    80%  { transform: translateX(-52%) translateY(0); }
    90%  { transform: translateX(-49%) translateY(0); }
    100% { transform: translateX(-50%) translateY(0); }
}

/* [REMOVED] snookerBallRoll keyframes — dead CSS removed 2026-03-16 */

/* Base snooker theme card - Card IS the rail (like Design-6.txt) */
.table-card.theme-snooker{
    /* rail-wood from Design-6.txt */
    background: linear-gradient(145deg, #6b4532 0%, #5c3d2e 50%, #4a3025 100%);
    border: none;
    border-radius: 8px; /* rounded-lg */
    padding: 12px; /* p-3 */
    width: 176px; /* w-44 */
    height: 240px; /* Fixed height for consistent layout */
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); /* shadow-lg */
    transition: all 0.3s ease;
    margin-top: 20px; /* Space for ball badge */
}

/* Ball badge - snooker ball style at top */
.table-card.theme-snooker .ball-badge {
    position: absolute;
    top: -16px; /* -top-4 */
    left: 50%;
    transform: translateX(-50%);
    min-width: 32px; /* w-8 */
    height: 32px; /* h-8 */
    padding: 0 10px; /* px-2.5 */
    border-radius: 9999px; /* rounded-full */
    background: radial-gradient(circle at 35% 35%, #f87171 0%, #dc2626 30%, #b91c1c 60%, #7f1d1d 100%);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.3s ease;
}

/* Ball badge pill shape for longer names */
.table-card.theme-snooker .ball-badge.pill {
    border-radius: 9999px;
}

/* Ball badge text */
.table-card.theme-snooker .ball-badge span {
    color: white;
    font-size: 0.75rem; /* text-xs */
    font-weight: 700; /* font-bold */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); /* drop-shadow */
    white-space: nowrap;
}

/* Ball animation on hover */
.table-card.theme-snooker:hover .ball-badge {
    animation: snookerBallShake 0.4s ease-out;
    box-shadow:
        0 3px 6px rgba(0, 0, 0, 0.5),
        0 0 12px rgba(239, 68, 68, 0.6);
}

/* Corner pockets - positioned on the card (rail) */
.table-card.theme-snooker .snooker-pocket {
    position: absolute;
    width: 16px; /* w-4 */
    height: 16px; /* h-4 */
    border-radius: 9999px; /* rounded-full */
    background: radial-gradient(circle, #0a0a0a 40%, #1a1a1a 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8); /* shadow-inner */
    z-index: 5;
}

/* Pocket positions: top-1 = 4px, left-1 = 4px */
.table-card.theme-snooker .snooker-pocket-tl { top: 4px; left: 4px; }
.table-card.theme-snooker .snooker-pocket-tr { top: 4px; right: 4px; }
.table-card.theme-snooker .snooker-pocket-bl { bottom: 4px; left: 4px; }
.table-card.theme-snooker .snooker-pocket-br { bottom: 4px; right: 4px; }
.table-card.theme-snooker .snooker-pocket-ml { top: 50%; left: 4px; transform: translateY(-50%); }
.table-card.theme-snooker .snooker-pocket-mr { top: 50%; right: 4px; transform: translateY(-50%); }

/* Clickable QR pocket button for available tables */
.table-card.available .pocket-qr-btn {
    cursor: pointer;
    z-index: 15;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.table-card.available .pocket-qr-btn:hover {
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(var(--theme-accent-rgb), 0.6);
}

.table-card.available .pocket-qr-btn::after {
    content: "\F6AE";
    font-family: "bootstrap-icons";
    font-size: 8px;
    color: rgba(var(--theme-accent-rgb), 0.8);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Clickable history pocket button (bottom-right) — same style as QR pocket */
.table-card .pocket-history-btn {
    cursor: pointer;
    z-index: 15;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.table-card .pocket-history-btn:hover {
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(var(--theme-accent-rgb), 0.6);
}

.table-card .pocket-history-btn::after {
    content: "\F292";
    font-family: "bootstrap-icons";
    font-size: 8px;
    color: rgba(var(--theme-accent-rgb), 0.8);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Clickable proforma pocket button (bottom-right) — blue glow */
.table-card .pocket-proforma-btn {
    cursor: pointer;
    z-index: 15;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.table-card .pocket-proforma-btn:hover {
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
}

.table-card .pocket-proforma-btn::after {
    content: "\F571";
    font-family: "bootstrap-icons";
    font-size: 8px;
    color: rgba(59, 130, 246, 0.8);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* History button for non-pocket themes (pool-square, snooker-square, classic) */
.table-card .btn-table-history-corner {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle, #0a0a0a 40%, #1a1a1a 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
    cursor: pointer;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.table-card .btn-table-history-corner:hover {
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(var(--theme-accent-rgb), 0.6);
}

.table-card .btn-table-history-corner i {
    font-size: 8px;
    color: rgba(var(--theme-accent-rgb), 0.8);
    line-height: 1;
}

/* Proforma corner button (bottom-right) */
.table-card .btn-table-proforma-corner {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle, #0a0a0a 40%, #1a1a1a 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
    cursor: pointer;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.table-card .btn-table-proforma-corner:hover {
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
}

.table-card .btn-table-proforma-corner i {
    font-size: 8px;
    color: rgba(59, 130, 246, 0.8);
    line-height: 1;
}

/* Felt surface - background set via inline style from surfaceStyles */
.table-card.theme-snooker .snooker-felt {
    border-radius: 4px; /* rounded */
    padding: 8px; /* p-2 */
    height: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Hover outline effect */
.table-card.theme-snooker .hover-outline {
    position: absolute;
    inset: 0;
    border-radius: 8px; /* rounded-lg */
    border: 1px solid transparent;
    transition: border-color 0.2s ease;
    pointer-events: none;
    z-index: 10;
}

.table-card.theme-snooker:hover {
    transform: translateY(-2px); /* hover:-translate-y-0.5 */
    box-shadow: 0 10px 25px -5px rgba(74, 222, 128, 0.3);
}

.table-card.theme-snooker:hover .hover-outline {
    border-color: rgba(74, 222, 128, 0.6);
}

/* Timer display - text-2xl mb-2 from Design-6.txt */
.table-card.theme-snooker .table-timer {
    font-family: 'Courier New', monospace; /* font-mono */
    font-size: 1.25rem; /* text-xl */
    font-weight: 700;
    color: white;
    margin-bottom: 2px;
    margin-top: 6px;
    flex-shrink: 0;
}

/* Status text - text-xs uppercase tracking-wide - fixed 2-line height */
.table-card.theme-snooker .table-status {
    font-size: 0.75rem; /* text-xs */
    text-transform: uppercase;
    color: #bbf7d0; /* text-green-200 */
    letter-spacing: 0.05em; /* tracking-wide */
    margin-bottom: 0;
    flex-shrink: 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
}

/* Flexible spacer - pushes buttons to bottom */
.table-card.theme-snooker .table-spacer {
    flex-grow: 1;
    min-height: 2px;
}

/* Placeholder for empty button row - maintains 2-row height */
.table-card.theme-snooker .btn-placeholder {
    height: 22px;  /* Match button height */
    flex-shrink: 0;
}

/* Operation buttons */
.table-card.theme-snooker .table-operations {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    flex-shrink: 0;
    margin-top: auto;
}

.table-card.theme-snooker .table-operations button {
    flex: 1;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.table-card.theme-snooker .table-operations button:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    outline: 2px solid rgba(74, 222, 128, 0.6);
    outline-offset: -2px;
}

/* Status text colors - no border-left, ball badge uses table type color */
.table-card.theme-snooker.available .table-status { color: #86efac; }
.table-card.theme-snooker.occupied .table-status { color: #fed7aa; }
.table-card.theme-snooker.checkedout .table-status { color: #fecaca; }
.table-card.theme-snooker.maintenance .table-status,
.table-card.theme-snooker.inactive .table-status { color: #d1d5db; }

/* ========================================
   SNOOKER SQUARE THEME - Exact Design-6.txt
   Card IS the rail (w-44 aspect-square)
   ======================================== */

/* Base snooker-square theme card - Card IS the rail */
.table-card.theme-snooker-square {
    /* rail-wood from Design-6.txt */
    background: linear-gradient(145deg, #6b4532 0%, #5c3d2e 50%, #4a3025 100%);
    border: none;
    border-radius: 8px; /* rounded-lg */
    padding: 12px; /* p-3 */
    width: 176px; /* w-44 */
    height: 176px; /* aspect-square */
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); /* shadow-lg */
    transition: all 0.3s ease;
    margin-top: 20px; /* Space for ball badge */
}

/* Ball badge for square theme */
.table-card.theme-snooker-square .ball-badge {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 9999px;
    background: radial-gradient(circle at 35% 35%, #f87171 0%, #dc2626 30%, #b91c1c 60%, #7f1d1d 100%);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.3s ease;
}

.table-card.theme-snooker-square .ball-badge.pill {
    border-radius: 9999px;
}

.table-card.theme-snooker-square .ball-badge span {
    color: white;
    font-size: 0.75rem; /* text-xs */
    font-weight: 700; /* font-bold */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

.table-card.theme-snooker-square:hover .ball-badge {
    animation: snookerBallShake 0.4s ease-out;
    box-shadow:
        0 3px 6px rgba(0, 0, 0, 0.5),
        0 0 12px rgba(239, 68, 68, 0.6);
}

/* Only corner pockets for square - positioned on card (rail) */
.table-card.theme-snooker-square .snooker-pocket {
    position: absolute;
    width: 16px; /* w-4 */
    height: 16px; /* h-4 */
    border-radius: 9999px; /* rounded-full */
    background: radial-gradient(circle, #0a0a0a 40%, #1a1a1a 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 5;
}

.table-card.theme-snooker-square .snooker-pocket-tl { top: 4px; left: 4px; }
.table-card.theme-snooker-square .snooker-pocket-tr { top: 4px; right: 4px; }
.table-card.theme-snooker-square .snooker-pocket-bl { bottom: 4px; left: 4px; }
.table-card.theme-snooker-square .snooker-pocket-br { bottom: 4px; right: 4px; }

/* Felt surface for square - p-3 h-full - background set via inline style */
.table-card.theme-snooker-square .snooker-felt {
    border-radius: 4px; /* rounded */
    padding: 8px; /* p-2 */
    height: 100%; /* h-full */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    text-align: center;
}

/* Hover outline for square */
.table-card.theme-snooker-square .hover-outline {
    position: absolute;
    inset: 0;
    border-radius: 8px; /* rounded-lg */
    border: 1px solid transparent;
    transition: border-color 0.2s ease;
    pointer-events: none;
    z-index: 10;
}

.table-card.theme-snooker-square:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(74, 222, 128, 0.3);
}

.table-card.theme-snooker-square:hover .hover-outline {
    border-color: rgba(74, 222, 128, 0.6);
}

/* Timer for square - text-xl mb-1 */
.table-card.theme-snooker-square .table-timer {
    font-family: 'Courier New', monospace; /* font-mono */
    font-size: 1.25rem; /* text-xl */
    font-weight: 700;
    color: white;
    margin-bottom: 2px;
    margin-top: 6px;
    flex-shrink: 0;
}

/* Status for square - text-xs uppercase tracking-wide - fixed 2-line height */
.table-card.theme-snooker-square .table-status {
    font-size: 0.75rem; /* text-xs */
    text-transform: uppercase;
    color: #bbf7d0; /* text-green-200 */
    letter-spacing: 0.05em; /* tracking-wide */
    margin-bottom: 0;
    flex-shrink: 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
}

/* Flexible spacer for square - pushes buttons to bottom */
.table-card.theme-snooker-square .table-spacer {
    flex-grow: 1;
    min-height: 2px;
}

/* Placeholder for empty button row in square theme */
.table-card.theme-snooker-square .btn-placeholder {
    height: 22px;  /* Match button height for square */
    flex-shrink: 0;
}

/* Operation buttons for square - flex-row gap-1 justify-center */
.table-card.theme-snooker-square .table-operations {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px; /* gap-1 */
    justify-content: center;
    flex-shrink: 0;
}

.table-card.theme-snooker-square .table-operations button {
    padding: 4px 8px; /* px-2 py-1 */
    border-radius: 4px; /* rounded */
    font-size: 0.75rem; /* text-xs */
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.table-card.theme-snooker-square .table-operations button:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    outline: 2px solid rgba(74, 222, 128, 0.6);
    outline-offset: -2px;
}

/* Status text colors for square - no border-left, ball badge uses table type color */
.table-card.theme-snooker-square.available .table-status { color: #86efac; }
.table-card.theme-snooker-square.occupied .table-status { color: #fed7aa; }
.table-card.theme-snooker-square.checkedout .table-status { color: #fecaca; }
.table-card.theme-snooker-square.maintenance .table-status,
.table-card.theme-snooker-square.inactive .table-status { color: #d1d5db; }

/* End Snooker Themes */

/* ===== Pool Themes — Identical to Snooker, only felt color differs (via surface_color) ===== */
/* Pool Rectangle inherits all snooker rectangle styles */
.table-card.theme-pool {
    background: linear-gradient(145deg, #6b4532 0%, #5c3d2e 50%, #4a3025 100%);
    border: none;
    border-radius: 8px;
    padding: 12px;
    width: 176px;
    height: 240px;
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    margin-top: 20px;
}
.table-card.theme-pool:hover { transform: translateY(-2px); box-shadow: 0 10px 25px -5px rgba(74, 222, 128, 0.3); }
.table-card.theme-pool:hover .ball-badge { animation: snookerBallShake 0.4s ease-out; box-shadow: 0 3px 6px rgba(0,0,0,0.5), 0 0 12px rgba(239,68,68,0.6); }
.table-card.theme-pool:hover .hover-outline { border-color: rgba(74, 222, 128, 0.6); }
.table-card.theme-pool .ball-badge { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); min-width: 32px; height: 32px; padding: 0 10px; border-radius: 9999px; box-shadow: 0 2px 5px rgba(0,0,0,0.4); z-index: 20; display: flex; align-items: center; justify-content: center; transition: box-shadow 0.3s ease; }
.table-card.theme-pool .ball-badge span { color: white; font-size: 0.75rem; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,0.5); white-space: nowrap; }
.table-card.theme-pool .snooker-pocket { position: absolute; width: 16px; height: 16px; border-radius: 9999px; background: radial-gradient(circle, #0a0a0a 40%, #1a1a1a 100%); box-shadow: inset 0 2px 4px rgba(0,0,0,0.8); z-index: 5; }
.table-card.theme-pool .snooker-pocket-tl { top: 4px; left: 4px; }
.table-card.theme-pool .snooker-pocket-tr { top: 4px; right: 4px; }
.table-card.theme-pool .snooker-pocket-bl { bottom: 4px; left: 4px; }
.table-card.theme-pool .snooker-pocket-br { bottom: 4px; right: 4px; }
.table-card.theme-pool .snooker-pocket-ml { top: 50%; left: 4px; transform: translateY(-50%); }
.table-card.theme-pool .snooker-pocket-mr { top: 50%; right: 4px; transform: translateY(-50%); }
.table-card.theme-pool .snooker-felt { border-radius: 4px; padding: 8px; height: 100%; text-align: center; display: flex; flex-direction: column; justify-content: flex-start; }
.table-card.theme-pool .hover-outline { position: absolute; inset: 0; border-radius: 8px; border: 1px solid transparent; transition: border-color 0.2s ease; pointer-events: none; z-index: 10; }
.table-card.theme-pool .table-timer { font-family: 'Courier New', monospace; font-size: 1.25rem; font-weight: 700; color: white; margin-bottom: 2px; margin-top: 6px; flex-shrink: 0; }
.table-card.theme-pool .table-status { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0; flex-shrink: 0; line-height: 1.4; white-space: nowrap; overflow: hidden; }
.table-card.theme-pool .table-spacer { flex-grow: 1; min-height: 2px; }
.table-card.theme-pool .btn-placeholder { height: 22px; flex-shrink: 0; }
.table-card.theme-pool .table-operations { display: flex; flex-direction: row; flex-wrap: wrap; gap: 4px; justify-content: center; flex-shrink: 0; margin-top: auto; }
.table-card.theme-pool .table-operations button { flex: 1; padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; cursor: pointer; }
.table-card.theme-pool.available .table-status { color: #86efac; }
.table-card.theme-pool.occupied .table-status { color: #fed7aa; }
.table-card.theme-pool.checkedout .table-status { color: #fecaca; }
.table-card.theme-pool.maintenance .table-status,
.table-card.theme-pool.inactive .table-status { color: #d1d5db; }

/* Pool Square inherits all snooker-square styles */
.table-card.theme-pool-square {
    background: linear-gradient(145deg, #6b4532 0%, #5c3d2e 50%, #4a3025 100%);
    border: none;
    border-radius: 8px;
    padding: 12px;
    width: 176px;
    height: 176px;
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    margin-top: 20px;
}
.table-card.theme-pool-square:hover { transform: translateY(-2px); box-shadow: 0 10px 25px -5px rgba(74, 222, 128, 0.3); }
.table-card.theme-pool-square:hover .ball-badge { animation: snookerBallShake 0.4s ease-out; box-shadow: 0 3px 6px rgba(0,0,0,0.5), 0 0 12px rgba(239,68,68,0.6); }
.table-card.theme-pool-square:hover .hover-outline { border-color: rgba(74, 222, 128, 0.6); }
.table-card.theme-pool-square .ball-badge { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); min-width: 32px; height: 32px; padding: 0 10px; border-radius: 9999px; box-shadow: 0 2px 5px rgba(0,0,0,0.4); z-index: 20; display: flex; align-items: center; justify-content: center; transition: box-shadow 0.3s ease; }
.table-card.theme-pool-square .ball-badge span { color: white; font-size: 0.75rem; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,0.5); white-space: nowrap; }
.table-card.theme-pool-square .snooker-pocket { position: absolute; width: 16px; height: 16px; border-radius: 9999px; background: radial-gradient(circle, #0a0a0a 40%, #1a1a1a 100%); box-shadow: inset 0 2px 4px rgba(0,0,0,0.8); z-index: 5; }
.table-card.theme-pool-square .snooker-pocket-tl { top: 4px; left: 4px; }
.table-card.theme-pool-square .snooker-pocket-tr { top: 4px; right: 4px; }
.table-card.theme-pool-square .snooker-pocket-bl { bottom: 4px; left: 4px; }
.table-card.theme-pool-square .snooker-pocket-br { bottom: 4px; right: 4px; }
.table-card.theme-pool-square .snooker-felt { border-radius: 4px; padding: 8px; height: 100%; text-align: center; display: flex; flex-direction: column; justify-content: flex-start; }
.table-card.theme-pool-square .hover-outline { position: absolute; inset: 0; border-radius: 8px; border: 1px solid transparent; transition: border-color 0.2s ease; pointer-events: none; z-index: 10; }
.table-card.theme-pool-square .table-timer { font-family: 'Courier New', monospace; font-size: 1.25rem; font-weight: 700; color: white; margin-bottom: 2px; margin-top: 6px; flex-shrink: 0; }
.table-card.theme-pool-square .table-status { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0; flex-shrink: 0; line-height: 1.4; white-space: nowrap; overflow: hidden; }
.table-card.theme-pool-square .table-spacer { flex-grow: 1; min-height: 2px; }
.table-card.theme-pool-square .btn-placeholder { height: 22px; flex-shrink: 0; }
.table-card.theme-pool-square .table-operations { display: flex; flex-direction: row; flex-wrap: wrap; gap: 4px; justify-content: center; flex-shrink: 0; margin-top: auto; }
.table-card.theme-pool-square .table-operations button { flex: 1; padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; cursor: pointer; }
.table-card.theme-pool-square.available .table-status { color: #86efac; }
.table-card.theme-pool-square.occupied .table-status { color: #fed7aa; }
.table-card.theme-pool-square.checkedout .table-status { color: #fecaca; }
.table-card.theme-pool-square.maintenance .table-status,
.table-card.theme-pool-square.inactive .table-status { color: #d1d5db; }
/* End Pool Themes */

/* ===== Access Card Theme ===== */

/* Blink animation for status dots */
@keyframes classicBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

.table-card.theme-access-card {
    background: #f5f5f5;
    border: none;
    border-radius: 10px;
    padding: 0;
    height: 240px;
    width: 176px;
    overflow: hidden;
    position: relative;
    margin: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease;
}

.table-card.theme-access-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Color band at top */
.table-card.theme-access-card .ac-stripes {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 38px;
    z-index: 0;
    border-radius: 10px 10px 0 0;
    background: var(--label-color, #22c55e);
}

/* Main card body */
.table-card.theme-access-card .ac-inner {
    position: relative;
    z-index: 1;
    margin: 42px 10px 0 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 8px 6px;
    text-align: center;
    overflow: hidden;
}

/* Table name */
.table-card.theme-access-card .ac-table-name {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1a1a1a;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Status row: dot - STATUS - dot */
.table-card.theme-access-card .ac-status-line {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-bottom: 4px;
}

.table-card.theme-access-card .ac-status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    display: inline-block;
    animation: classicBlink 1.6s ease-in-out infinite;
}

/* Timer inside inner card — force dark text on light background */
.table-card.theme-access-card .ac-inner .table-timer {
    font-family: 'Courier New', monospace;
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a1a1a !important;
    margin: 0;
}

/* TIME UP state — red timer */
.table-card.theme-access-card.checkedout .ac-inner .table-timer,
.table-card.theme-access-card.pending_payment .ac-inner .table-timer {
    color: #dc2626 !important;
}

/* Occupied — dark orange timer */
.table-card.theme-access-card.occupied .ac-inner .table-timer {
    color: #c2410c !important;
}

/* Customer name / status text — dark on light bg */
.table-card.theme-access-card .ac-inner .table-status {
    font-size: 0.65rem;
    color: #4b5563 !important;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

/* Operation buttons inside inner card — outlined style, always side-by-side */
.table-card.theme-access-card .ac-inner .table-operations {
    width: 100%;
}

.table-card.theme-access-card .ac-inner .table-spacer {
    display: none !important;
}

.table-card.theme-access-card .ac-inner .btn-placeholder {
    display: none !important;
}

.table-card.theme-access-card .ac-inner .btn-table-operation {
    background: white !important;
    color: #1a6b3a !important;
    border: 1px solid var(--theme-accent) !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    font-size: 0.7rem !important;
    letter-spacing: 0.06em;
    padding: 0.25rem !important;
    transition: background 0.15s ease;
}

.table-card.theme-access-card .ac-inner .btn-table-operation:hover {
    background: rgba(0, 0, 0, 0.04) !important;
}

/* Light On/Off row — muted text, no button styling */
.table-card.theme-access-card .ac-inner .table-operations > div:last-child {
    margin-top: 2px !important;
}
.table-card.theme-access-card .ac-inner .table-operations > div:last-child .btn-table-operation {
    border: none !important;
    background: transparent !important;
    color: #7a9aba !important;
    font-size: 0.6rem !important;
    letter-spacing: 0.1em;
    padding: 0 !important;
}

/* Bottom row — RFID chip indicator */
.table-card.theme-access-card .ac-bottom {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: flex-start;
    padding: 4px 10px;
}

.table-card.theme-access-card .btn-table-history-corner {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.65rem;
    transition: all 0.2s ease;
    background: var(--theme-accent) !important;
    border: none;
    color: white !important;
}

.table-card.theme-access-card .btn-table-history-corner i {
    color: white !important;
    font-size: 10px;
}

.table-card.theme-access-card .btn-table-history-corner:hover {
    opacity: 0.85;
    transform: scale(1.1);
}

.table-card.theme-access-card .btn-table-proforma-corner {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.65rem;
    transition: all 0.2s ease;
    background: #3b82f6 !important;
    border: none;
    color: white !important;
}

.table-card.theme-access-card .btn-table-proforma-corner i {
    color: white !important;
    font-size: 10px;
}

.table-card.theme-access-card .btn-table-proforma-corner:hover {
    opacity: 0.85;
    transform: scale(1.1);
}

/* (merged into main hover rule above) */

/* Classic status colors by state */
.table-card.theme-access-card.available .ac-status-dot { background: var(--theme-accent); }
.table-card.theme-access-card.available .ac-status-line { color: var(--theme-accent); }
.table-card.theme-access-card.occupied .ac-status-dot { background: #f97316; animation: none; }
.table-card.theme-access-card.occupied .ac-status-line { color: #f97316; }
.table-card.theme-access-card.checkedout .ac-status-dot { background: #dc2626; }
.table-card.theme-access-card.checkedout .ac-status-line { color: #dc2626; }
.table-card.theme-access-card.pending_payment .ac-status-dot { background: #dc2626; }
.table-card.theme-access-card.pending_payment .ac-status-line { color: #dc2626; }
.table-card.theme-access-card.maintenance .ac-status-dot { background: #6b7280; animation: none; }
.table-card.theme-access-card.maintenance .ac-status-line { color: #6b7280; }
.table-card.theme-access-card.inactive .ac-status-dot { background: #6b7280; animation: none; }
.table-card.theme-access-card.inactive .ac-status-line { color: #6b7280; }

/* ===== End Classic Theme ===== */

.table-card.available {
    border-color: var(--theme-accent);
}

.table-card.occupied {
    border-color: #f97316;
}

.table-card.loading {
    border-color: #6b7280;
    opacity: 0.8;
    pointer-events: none;
}

.table-card.loading .table-timer {
    color: #6b7280;
}

.table-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.table-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--theme-accent);
    margin-bottom: 0;
}

.table-timer {
    font-family: 'Courier New', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    color: var(--theme-accent);
}

.table-status {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #d0d0d0;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
}

/* Grand total badge on table cards */
.table-grand-total {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    padding: 3px 10px;
    text-align: center;
    margin: 5px auto;
    white-space: nowrap;
    line-height: 1.4;
    display: inline-block;
    background: rgba(245, 158, 11, 0.25);
    border: 1px solid rgba(245, 158, 11, 0.6);
    border-radius: 4px;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Animation for table card updates */
@keyframes tableUpdate {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(var(--theme-accent-rgb), 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 4px rgba(var(--theme-accent-rgb), 0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(var(--theme-accent-rgb), 0);
    }
}

@keyframes rateBadgePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.95;
    }
    50% {
        transform: scale(1.15);
        opacity: 1;
    }
}

/* Animation for session start float-up effect */
@keyframes sessionStartFloat {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.8);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -70%) scale(1.15);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -180%) scale(0.9);
    }
}

/* === Table Card Overlay Effects === */
.table-card-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    color: var(--theme-accent);
    pointer-events: none;
}

.table-start-effect {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    white-space: nowrap;
    animation: sessionStartFloat 1.5s ease-out forwards;
    text-shadow: 0 0 12px rgba(var(--theme-accent-rgb), 0.6), 0 0 24px rgba(var(--theme-accent-rgb), 0.3);
}

/* Float-down animation (for Countdown start) */
@keyframes sessionStartFloatDown {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.8);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -30%) scale(1.15);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, 80%) scale(0.9);
    }
}
.table-start-effect-down {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    white-space: nowrap;
    animation: sessionStartFloatDown 1.5s ease-out forwards;
    text-shadow: 0 0 12px rgba(var(--theme-accent-rgb), 0.6), 0 0 24px rgba(var(--theme-accent-rgb), 0.3);
}

/* Icon enlarge animation (for Item/Round) */
@keyframes tableIconEnlarge {
    0%   { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    30%  { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
    60%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}
.table-icon-effect {
    font-size: 1.8rem;
    animation: tableIconEnlarge 1.5s ease-out forwards;
    text-shadow: 0 0 12px rgba(var(--theme-accent-rgb), 0.6), 0 0 24px rgba(var(--theme-accent-rgb), 0.3);
    line-height: 1;
}

/* Effect 5: Payment success — green checkmark on table card */
@keyframes tableSuccessCheck {
    0%   { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    30%  { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    60%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}
.table-success-effect {
    font-size: 2rem;
    animation: tableSuccessCheck 1.8s ease-out forwards;
    text-shadow: 0 0 16px rgba(var(--theme-accent-rgb), 0.7), 0 0 32px rgba(var(--theme-accent-rgb), 0.3);
    line-height: 1;
}

.fab-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 50;
}

.fab {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--theme-accent);
    color: #0a1a0d;
    border: none;
    margin: 0;
    padding: 0;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab:hover {
    transform: scale(1.1);
}

/* [REMOVED] .fab-blue — dead CSS removed 2026-03-16 */

.fab-orange {
    background: #f97316;
    color: white;
    /* display controlled by JS via inline style — no CSS override needed */
}

.fab-pos {
    background: #3b82f6;
    color: white;
}

.fab-sound {
    background: #f59e0b;
    color: white;
}

.fab-settings {
    background: #6b7280;
    color: white;
    display: none; /* Hide by default */
}

.table-page-fab-container {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 50;
}

.table-page-fab,
.zone-pill-fab {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #1A3D2A;
    color: var(--theme-accent);
    border: 2px solid var(--theme-accent);
    font-size: 0.65rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    text-align: center;
    line-height: 1.1;
    overflow: hidden;
    word-break: break-word;
}

.table-page-fab:hover,
.zone-pill-fab:hover {
    transform: scale(1.1);
    background: var(--theme-accent, #22c55e);
    color: #0a1a0d;
}

.table-page-fab-active,
.zone-pill-fab-active {
    background: var(--theme-accent, #22c55e);
    color: #0a1a0d;
    border-color: var(--theme-accent, #22c55e);
}

.zone-pill-fab:hover {
    transform: scale(1.05);
    background: var(--theme-accent, #22c55e);
    color: #0a1a0d;
}

.zone-pill-fab-active {
    background: var(--theme-accent, #22c55e);
    color: #0a1a0d;
    border-color: var(--theme-accent, #22c55e);
}

/* iOS-style page swipe viewport */
.tables-viewport {
    overflow: hidden;
    position: relative;
    width: 100%;
}

.tables-slider-track {
    display: flex;
    width: 200%;
    will-change: transform;
}

.tables-panel {
    width: 50%;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Display mode chip selector */
/* @DEPRECATED .display-mode-chip — removed with page mode display feature */

.fab-notification {
    background: #ec4899;
    color: white;
    position: relative;
}

.notification-unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #dc2626;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    pointer-events: none;
    line-height: 1;
}

.fab-chat {
    background: #25D366;
    color: white;
    display: none; /* Hide by default */
}

/* Camera mirror */
.camera-mirrored {
    transform: scaleX(-1);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10000 !important;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

/* Ensure modal uses flex display when shown */
.modal[style*="block"], .modal[style*="flex"] {
    display: flex !important;
}

/* Modals with Tabs - Full height with margin for consistent sizing */
#splitBillGameModal .modal-content,
#viewCountingUpTableModal .modal-content,
#viewCountingDownTableModal .modal-content,
#settingsModal .modal-content,
#transactionModal .modal-content,
#tableInvoiceHistoryModal .modal-content,
#posModal .modal-content,
#fnbModal .modal-content,
#systemLogsModal .modal-content,
#organizationModal .modal-content,
#adminModal .modal-content,
#clientModal .modal-content,
#employeeModal .modal-content,
#centerModal .modal-content,
#campaignModal .modal-content,
#membershipModal .modal-content,
#memberModal .modal-content,
#announcementModal .modal-content {
    height: calc(100vh - 40px);
    margin: 20px auto;
}

/* V2 modal width — large modals */
#splitBillGameModal .modal-content,
#tableInvoiceHistoryModal .modal-content,
#posModal .modal-content,
#fnbModal .modal-content,
#organizationModal .modal-content,
#centerModal .modal-content,
#clientModal .modal-content,
#campaignModal .modal-content,
#memberModal .modal-content {
    width: 1080px !important;
}

#splitBillGameModal .modal-body,
#viewCountingUpTableModal .modal-body,
#viewCountingDownTableModal .modal-body,
#settingsModal .modal-body,
#transactionModal .modal-body,
#fnbModal .modal-body,
#systemLogsModal .modal-body,
#organizationModal .modal-body,
#adminModal .modal-body,
#clientModal .modal-body,
#employeeModal .modal-body,
#centerModal .modal-body,
#campaignModal .modal-body,
#memberModal .modal-body,
#announcementModal .modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 0;
}

#membershipModal .modal-body {
    flex: 1;
    overflow-y: auto;
}

#posModal .modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
}

#tableInvoiceHistoryModal .modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#tableInvoiceHistoryModal .data-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-content {
    background: var(--theme-body);
    margin: 1rem auto;
    border-radius: 8px;
    max-width: 95vw;
    width: 1000px;
    max-height: 90vh;
    overflow: hidden;
    border: 1px solid var(--theme-accent);
    display: flex;
    flex-direction: column;
}

/* ===== Modal Styling — All Modals ===== */
.modal .modal-content {
    background: var(--theme-body);
    border: 1px solid rgba(var(--theme-accent-rgb), 0.25);
    border-radius: 12px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(var(--theme-accent-rgb), 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.modal .modal-header {
    background: var(--theme-card);
    border-bottom: 1px solid rgba(var(--theme-accent-rgb), 0.2);
}

.modal .modal-footer {
    background: var(--theme-card);
    border-top: 1px solid rgba(var(--theme-accent-rgb), 0.2);
}

.modal .modal-content .tabs,
.modal .modal-content.has-sticky-tabs .tabs {
    background: var(--theme-body);
}
/* --- Open/close animation (overlay — content animated via JS) --- */
@keyframes glassOverlayOpen {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes glassOverlayClose {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.modal.glass-opening {
    animation: glassOverlayOpen 0.35s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}

.modal.glass-closing {
    animation: glassOverlayClose 0.28s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}
/* --- Table card landing effect after modal closes back into card --- */
@keyframes glassCardLand {
    0% {
        transform: scale(1.04);
        box-shadow: 0 0 12px rgba(var(--theme-accent-rgb), 0.35);
    }
    40% {
        transform: scale(1.0);
        box-shadow: 0 0 8px rgba(var(--theme-accent-rgb), 0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: none;
    }
}

.table-card.glass-land {
    animation: glassCardLand 0.5s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
    z-index: 2;
    position: relative;
}
/* ===== End Glassmorphism ===== */

.modal-content.has-sticky-tabs .modal-header {
    border-bottom: 1px solid var(--theme-accent);
    padding-bottom: 1rem;
}

.modal-content.has-sticky-tabs .modal-body {
    padding-top: 0;
}

.modal-content.has-sticky-tabs .tabs {
    position: sticky;
    top: 0;
    background: var(--theme-body);
    z-index: 10;
    border-bottom: 1px solid rgba(var(--theme-accent-rgb), 0.2);
    margin: 0;
    padding: 12px 0 10px 0;
    flex-wrap: wrap;
    overflow-x: hidden;
}

.modal-content.has-sticky-tabs .tabs .tab-btn {
    font-size: 0.75rem;
    padding: 0.45rem 0.65rem;
}

.modal-content.has-sticky-tabs .modal-body {
    font-size: 0.8rem;
}

.modal-content.has-sticky-tabs .modal-body label,
.modal-content.has-sticky-tabs .modal-body input,
.modal-content.has-sticky-tabs .modal-body select,
.modal-content.has-sticky-tabs .modal-body textarea,
.modal-content.has-sticky-tabs .modal-body button,
.modal-content.has-sticky-tabs .modal-body .btn {
    font-size: 0.8rem;
}

.modal-content.has-sticky-tabs .modal-body h4,
.modal-content.has-sticky-tabs .modal-body h5 {
    font-size: 0.9rem;
}

.modal-content .tabs {
    position: sticky;
    top: 0;
    background: var(--theme-body);
    z-index: 10;
    border-bottom: 1px solid rgba(var(--theme-accent-rgb), 0.2);
    margin: 0;
    padding: 12px 0 10px 0;
    border-top: none;
}

.modal-content-large {
    width: 1080px !important;
    max-height: 85vh;
}

/* Receipt/invoice preview modals — fixed 90vh height, 80mm content centered */
.modal-content-large.modal-receipt-preview {
    height: 90vh;
    max-height: 90vh;
}
.modal-receipt-preview .modal-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--theme-accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--theme-card);
}

.modal-header h3 {
    color: var(--theme-accent);
    font-size: 1.2rem;
    font-weight: 600;
}

.close {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #d0d0d0;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.close:hover {
    color: #ef4444;
}

.modal-body {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden !important;
    /* Removed position:fixed/width/height - they break sticky positioning and cause layout shift */
}

.modal-content.has-sticky-tabs .modal-body {
    padding: 0 1rem 1rem 1rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-content.has-sticky-tabs .tab-content {
    padding-top: 1rem;
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid var(--theme-accent);
    background: var(--theme-card);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    flex-wrap: nowrap;
    row-gap: 0.8rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: #f0f0f0;
    font-size: 0.85rem;
    font-weight: 500;
}

/* @DEPRECATED — Old 3-column POS layout (replaced by pos-v2-layout) */
/* .pos-content, .pos-categories, .pos-items, .pos-invoice — replaced by pos-v2-* classes */

/* ============================================================
   POS V2 — 4-Column Layout
   ============================================================ */
.pos-v2-layout {
    display: grid;
    grid-template-columns: 120px 1fr 280px 290px;
    gap: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    width: 100%;
}

.pos-v2-categories {
    padding: 0.6rem;
    overflow-y: auto;
    border-right: 1px solid rgba(var(--theme-accent-rgb), 0.15);
}

.pos-v2-items {
    padding: 0.6rem;
    overflow-y: auto;
    border-right: 1px solid rgba(var(--theme-accent-rgb), 0.15);
}

.pos-v2-cart {
    display: flex;
    flex-direction: column;
    padding: 0.6rem;
    overflow-y: auto;
    border-right: 1px solid rgba(var(--theme-accent-rgb), 0.15);
}

.pos-v2-right {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.6rem;
    overflow-y: auto;
}

.category-btn {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.3rem;
    background: var(--theme-body);
    border: none;
    color: #f0f0f0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.category-btn:hover,
.category-btn.active {
    background: var(--theme-accent);
    color: #0a1a0d;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
}

.item-card {
    background: var(--theme-body);
    border: 1px solid rgba(var(--theme-accent-rgb), 0.3);
    border-radius: 6px;
    padding: 0.6rem;
    text-align: center;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
}

.item-card:hover {
    background: var(--theme-body);
    border-color: var(--theme-accent);
}

.invoice-items {
    flex: 1;
    overflow-y: auto;
}

.invoice-item {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(var(--theme-accent-rgb), 0.15);
    font-size: 0.78rem;
}

.invoice-total {
    padding: 0.6rem 0;
    border-top: 2px solid var(--theme-accent);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--theme-accent);
    text-align: center;
}

/* ============================================================
   Document Designer — Two-Panel Layout (POS-inspired)
   ============================================================ */
.doc-designer-layout {
    display: flex;
    height: calc(100% - 0px);
    min-height: 400px;
    overflow: hidden;
}

.doc-designer-preview-panel {
    display: flex;
    flex-direction: column;
    min-width: 330px;
    overflow: hidden;
    padding: 0.6rem;
}

.doc-designer-divider {
    width: 5px;
    min-width: 5px;
    cursor: col-resize;
    background: rgba(var(--theme-accent-rgb), 0.15);
    transition: background 0.15s;
    flex-shrink: 0;
}
.doc-designer-divider:hover,
.doc-designer-divider.dragging {
    background: rgba(var(--theme-accent-rgb), 0.5);
}

.doc-designer-settings-panel {
    flex: 1;
    min-width: 280px;
    overflow-y: auto;
    padding: 0.6rem;
}

/* Preview Tabs — chip style */
.doc-designer-preview-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.6rem;
    flex-shrink: 0;
}
.doc-designer-preview-tab {
    padding: 0.3rem 0.7rem;
    background: transparent;
    border: 1px solid #444;
    border-radius: 9999px;
    color: #999;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.doc-designer-preview-tab:hover {
    color: var(--theme-accent);
    border-color: var(--theme-accent);
}
.doc-designer-preview-tab.active {
    background: var(--theme-accent);
    border-color: var(--theme-accent);
    color: #0a1a0d;
}

/* Preview Scroll Container */
.doc-designer-preview-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    padding: 0.5rem;
}

/* 80mm Receipt Preview — wrapper for the .t container */
.doc-designer-preview-receipt {
    min-height: 200px;
    align-self: flex-start;
    flex-shrink: 0;
}
/* Paper look — exact same sizing as real 80mm invoice, rendered in iframe for isolation */
.doc-designer-preview-receipt {
    min-height: 200px;
    align-self: flex-start;
    flex-shrink: 0;
}
.doc-designer-preview-receipt iframe {
    border: none;
    width: 80mm;
    min-height: 400px;
    display: block;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    border-radius: 2px;
    background: #fff;
}

/* Settings Cards (POS style) */
.doc-designer-card {
    background: linear-gradient(135deg, rgba(var(--theme-accent-rgb),0.08) 0%, rgba(var(--theme-accent-rgb),0.03) 100%);
    border: 1px solid rgba(var(--theme-accent-rgb),0.2);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.6rem;
}
.doc-designer-card-title {
    color: var(--theme-accent);
    font-size: 0.82rem;
    font-weight: 600;
    margin: 0 0 0.6rem 0;
}
.doc-designer-label {
    display: block;
    font-size: 0.78rem;
    color: #d0d0d0;
    margin-bottom: 0.25rem;
    font-weight: 500;
}
.doc-designer-input {
    width: 100%;
    padding: 0.3rem 0.5rem;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    color: #f0f0f0;
    font-size: 0.82rem;
    outline: none;
    transition: border-color 0.15s;
}
.doc-designer-input:focus {
    border-color: var(--theme-accent);
}
.doc-designer-checkbox-row {
    font-size: 0.82rem;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--theme-accent);
    margin-bottom: 1rem;
    gap: 0.2rem;
    overflow-x: auto;
}

.tab-btn {
    padding: 0.6rem 0.8rem;
    background: none;
    border: none;
    color: #d0d0d0;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.tab-btn:hover,
.tab-btn.active {
    color: var(--theme-accent);
    border-bottom-color: var(--theme-accent);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.page-content {
    display: none;
}

.page-content.active {
    display: block;
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 0.8rem;
        gap: 0.8rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.3rem;
    }
    
    .nav-links a {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .filters-container {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0 0.8rem;
    }
    
    .container {
        padding: 0.8rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .card-header {
        flex-direction: column;
        gap: 0.8rem;
        align-items: stretch;
    }
    
    .tables-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.8rem;
    }
    
.pos-content {
    display: grid;
    grid-template-columns: 120px 1fr 200px;
    gap: 0.5rem;
    flex: 1;
    min-height: 0;
}
    
    .data-table {
        font-size: 0.75rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
    
    .fab {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .modal-content {
        margin: 0.5rem auto;
        max-width: 98vw;
        width: 95vw;
        max-height: 95vh;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        font-size: 0.75rem;
        padding: 0.5rem 0.6rem;
    }

    .modal-footer {
        gap: 0.8rem;
        row-gap: 0.6rem;
        flex-wrap: nowrap !important;
    }
    
    .modal-footer > div {
        gap: 0.8rem;
        justify-content: center;
        flex-wrap: nowrap !important;
    }
    
    .modal-footer .btn {
        min-width: 100px;
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

 .data-table .btn-sm {
        padding: 0.2rem 0.5rem;
        font-size: 0.7rem;
        min-width: 50px;
    }
    
    .data-table td:last-child > div {
        gap: 0.3rem !important;
    }
    
    .data-table td:last-child {
        padding: 0.8rem 0.5rem;
    }


}

@media (max-width: 480px) {
    .nav-links a {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .card-title {
        font-size: 1.2rem;
    }
    
    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.4rem;
        font-size: 0.7rem;
    }
    
    .table-card {
        padding: 0.8rem;
    }
    
    .table-number {
        font-size: 1rem;
    }
    
    .table-timer {
        font-size: 1.1rem;
    }
}

/* Custom Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0a1a0d;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--theme-accent);
    border-radius: 4px;
    border: 1px solid var(--theme-body);
}

::-webkit-scrollbar-thumb:hover {
    background: #16a34a;
}

::-webkit-scrollbar-corner {
    background: #0a1a0d;
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--theme-accent) #0a1a0d;
}


.tabs {
    display: flex;
    border-bottom: 1px solid var(--theme-accent);
    margin-bottom: 1rem;
    gap: 0.2rem;
    overflow-x: auto;
    align-items: center;
}

.table-card.maintenance {
    border-color: #f97316;
}

.table-card.inactive {
    border-color: #6b7280;
    opacity: 0.6;
}

.table-card.maintenance .table-timer,
.table-card.inactive .table-timer {
    color: #f97316;
    font-size: 0.9rem;
}

.pos-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(var(--theme-accent-rgb), 0.2);
    font-size: 0.85rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.3rem;
}

.quantity-btn {
    background: none;
    border: 1px solid var(--theme-accent);
    color: var(--theme-accent);
    width: 20px;
    height: 20px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: rgba(var(--theme-accent-rgb), 0.1);
}

.remove-btn {
    border-color: #dc2626;
    color: #dc2626;
}

.remove-btn:hover {
    background: rgba(220, 38, 38, 0.1);
}

.items-tab-content {
    min-height: 400px;
}

.stock-warning {
    color: #dc2626 !important;
    font-weight: 600;
}

.stock-ok {
    color: var(--theme-accent) !important;
}

.payment-method-btn {
    background: var(--theme-card);
    border: 2px solid #6b7280;
    border-radius: 6px;
    padding: 0.8rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #f0f0f0;
    font-size: 0.85rem;
    font-weight: 500;
}

.payment-method-btn:hover {
    border-color: var(--theme-accent);
    background: rgba(var(--theme-accent-rgb), 0.1);
}

.payment-method-btn.selected {
    border-color: var(--theme-accent);
    background: rgba(var(--theme-accent-rgb), 0.2);
    color: var(--theme-accent);
}

.payment-method-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #dc2626;
}

.payment-method-btn:disabled:hover {
    border-color: #dc2626;
    background: var(--theme-card);
}


.modal-footer > div {
    display: flex;
    gap: 1rem;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.modal-footer .btn {
    min-width: 120px;
    white-space: nowrap;
}


/* Invoice Preview Styles */
.invoice-preview {
    background: white;
    color: black;
    border: 1px solid #ddd;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.invoice-preview-80mm {
    width: 80mm;
    max-width: 80mm;
    font-size: 11px;
    line-height: 1.2;
    margin: 0 auto;
}

.invoice-preview-58mm {
    width: 58mm;
    max-width: 58mm;
    font-size: 9px;
    line-height: 1.1;
    margin: 0 auto;
}

.invoice-preview-a4 {
    width: 210mm;
    max-width: 500px;
    font-size: 12px;
    line-height: 1.4;
    margin: 0 auto;
}

.invoice-header {
    text-align: center;
    border-bottom: 2px solid #000;
    padding: 8px;
    margin-bottom: 10px;
}

.invoice-business-name {
    font-weight: bold;
    font-size: 1.3em;
    margin-bottom: 4px;
}

.invoice-info-section {
    margin-bottom: 10px;
    font-size: 0.95em;
}

.invoice-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
    padding: 0 8px;
}

.invoice-items-section {
    border-top: 1px solid #000;
    padding-top: 8px;
    margin: 10px 0;
}

.invoice-item-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
    padding: 0 8px;
    font-size: 0.9em;
}

.invoice-totals-section {
    border-top: 2px solid #000;
    padding-top: 8px;
    margin-top: 10px;
}

.invoice-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
    padding: 0 8px;
    font-size: 0.9em;
}

.invoice-final-total {
    border-top: 2px solid #000;
    padding-top: 4px;
    font-weight: bold;
    font-size: 1.1em;
}

.invoice-footer {
    text-align: center;
    margin-top: 15px;
    padding-top: 8px;
    border-top: 1px solid #000;
    font-size: 0.8em;
    padding: 8px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

#invoiceDisplayContainer {
    scrollbar-width: thin;
    scrollbar-color: var(--theme-accent) var(--theme-card);
}

#invoiceDisplayContainer::-webkit-scrollbar {
    width: 8px;
}

#invoiceDisplayContainer::-webkit-scrollbar-track {
    background: var(--theme-card);
    border-radius: 4px;
}

#invoiceDisplayContainer::-webkit-scrollbar-thumb {
    background: var(--theme-accent);
    border-radius: 4px;
}

#invoiceDisplayContainer .header {
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

#invoiceDisplayContainer .final-total {
    border-top: 2px solid #000;
    padding-top: 5px;
    font-weight: bold;
    font-size: 14px;
}

.items-subtabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    background: #0a1a0e;
    border-radius: 12px;
    padding: 4px;
    border: 1px solid #1e3a24;
}

.items-subtab-btn {
    flex: 1;
    background: transparent;
    border: none;
    border-radius: 10px;
    padding: 12px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.items-subtab-btn:hover {
    color: #d0d0d0;
    background: rgba(var(--theme-accent-rgb), 0.06);
}

.items-subtab-btn.active {
    background: linear-gradient(135deg, #132b18 0%, #1a3520 100%);
    color: var(--theme-accent);
    box-shadow: 0 2px 12px rgba(var(--theme-accent-rgb), 0.15), inset 0 1px 0 rgba(var(--theme-accent-rgb), 0.1);
    border: 1px solid rgba(var(--theme-accent-rgb), 0.25);
}

.items-subtab-btn.active::after {
    display: none;
}

.subtab-icon {
    font-size: 1.25rem;
    filter: grayscale(1) brightness(0.7);
    transition: all 0.25s ease;
    flex-shrink: 0;
    margin-bottom: 0;
}

.items-subtab-btn:hover .subtab-icon {
    filter: grayscale(0.5) brightness(0.9);
}

.items-subtab-btn.active .subtab-icon {
    filter: grayscale(0);
}

.subtab-label {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 0;
    white-space: nowrap;
}

.items-subtab-btn.active .subtab-label {
    color: var(--theme-accent);
}

.subtab-description {
    display: none;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .items-subtabs {
        border-radius: 10px;
        padding: 3px;
    }

    .items-subtab-btn {
        padding: 10px 8px;
        gap: 6px;
    }

    .subtab-icon {
        font-size: 1.1rem;
    }

    .subtab-label {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .subtab-label {
        display: none;
    }

    .subtab-icon {
        font-size: 1.3rem;
    }
}

/* Animation for tab content switching */
.tab-content {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.tab-content.active {
    opacity: 1;
    transform: translateY(0);
}

.stats-card {
    background: var(--theme-card);
    border: 1px solid var(--theme-accent);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.stats-label {
    color: #d0d0d0;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.stats-value {
    color: var(--theme-accent);
    font-size: 1.5rem;
    font-weight: 700;
}

.member-credit-balance {
    transition: background-color 0.3s ease;
}

.credit-deduction-highlight {
    background-color: #fef3c7 !important;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

.table-timer.pay-status {
    background-color: #fee2e2;
    color: #dc2626;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    animation: blink 1s infinite;
}

.table-card.checkedout {
    background: #7c2d12;
    border-color: #dc2626 !important;
}

.table-card.checkedout .table-timer {
    color: #dc2626 !important;
    font-weight: bold;
    animation: blink 1s infinite;
}

/* Danger Zone Styling */
.danger-zone {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #374151;
    text-align: center;
}

.danger-zone h3 {
    color: #ef4444;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.danger-zone p {
    color: #d0d0d0;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.danger-zone .btn-danger {
    background: #dc2626;
    border: 1px solid #dc2626;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.danger-zone .btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    transform: translateY(-1px);
}

/* Enhanced modal styles for new 6-modal system */
.modal-content-large {
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
}

.has-sticky-tabs {
    position: relative;
}

.has-sticky-tabs .tabs {
    position: sticky;
    top: 0;
    background: #0a1a0d;
    z-index: 10;
    border-bottom: 1px solid var(--theme-accent);
    padding: 0 0 10px 0;
    margin-bottom: 20px;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--theme-accent);
    padding-bottom: 0.5rem;
}

.tab-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid #6b7280;
    color: #d0d0d0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.tab-btn:hover {
    background: rgba(var(--theme-accent-rgb), 0.1);
    border-color: var(--theme-accent);
    color: var(--theme-accent);
}

.tab-btn.active {
    background: var(--theme-accent);
    border-color: var(--theme-accent);
    color: #0a0a0a;
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.payment-method-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--theme-card);
    border: 2px solid #6b7280;
    border-radius: 8px;
    color: #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 80px;
}

.payment-method-btn:hover {
    border-color: var(--theme-accent);
    background: rgba(var(--theme-accent-rgb), 0.1);
}

.payment-method-btn.selected {
    border-color: var(--theme-accent);
    background: rgba(var(--theme-accent-rgb), 0.2);
    color: var(--theme-accent);
}

.package-selection-card {
    border: 2px solid #6b7280;
    border-radius: 6px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #2a1f0e;
}

.package-selection-card:hover {
    border-color: #b8860b;
    background: rgba(146, 96, 15, 0.08);
}

.package-selection-card.selected {
    border-color: #b8860b;
    background: rgba(146, 96, 15, 0.15);
}

/* Responsive design for modals */
@media (max-width: 768px) {
    .modal-content-large {
        width: 95%;
        max-height: 95vh;
    }
    .tabs {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .tab-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .payment-method-btn {
        min-height: 60px;
        padding: 0.5rem;
    }
}

/* Enhanced form styling for new modals */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--theme-accent);
    font-weight: 600;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    background: var(--theme-card);
    color: #f0f0f0;
    border: 1px solid #6b7280;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 2px rgba(var(--theme-accent-rgb), 0.2);
}

.form-input:readonly {
    background: #111827;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Button styling consistency */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-success {
    background: var(--theme-accent);
    color: white;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-info {
    background: #0891b2;
    color: white;
}

.btn-info:hover {
    background: #0e7490;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.btn:disabled {
    background: #374151;
    color: #9ca3af;
    cursor: not-allowed;
}

.btn:disabled:hover {
    background: #374151;
}


/* Reset any default margins/padding that might interfere */
.login-page {
    margin: 0 !important;
    padding: 0 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* Input focus effects */
.login-input:focus {
    border-color: var(--theme-accent) !important;
    box-shadow: 0 0 0 4px rgba(var(--theme-accent-rgb), 0.15) !important;
    outline: none !important;
    background: rgba(15, 15, 15, 0.95) !important;
}

.login-input::placeholder {
    color: #aaa !important;
    font-weight: 400;
}

/* Button hover effects - desktop only */
@media (hover: hover) and (pointer: fine) {
    .login-submit-btn:hover:not(:disabled) {
        background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(var(--theme-accent-rgb), 0.4);
    }

    .login-submit-btn:active {
        transform: translateY(0);
    }
}

.login-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Card hover effect - desktop only */
@media (hover: hover) and (pointer: fine) {
    .login-page .card:hover {
        transform: translateY(-5px);
        box-shadow: 0 35px 100px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(var(--theme-accent-rgb), 0.2) !important;
    }

    .login-page .card:hover img {
        transform: scale(1.08) rotate(5deg);
    }
}

/* VYROX AI link hover */
.login-page a[href*="vyrox.com"]:hover {
    color: #86efac !important;
    text-shadow: 0 0 8px rgba(var(--theme-accent-rgb), 0.6);
    transform: translateY(-1px);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .login-container {
        padding: 0.5rem !important;
        align-items: center !important;
        justify-content: center !important;
        overflow: hidden !important;
    }

    .login-page .card-header {
        padding: 0.5rem 0.75rem !important;
    }

    .login-page h1 {
        font-size: 1.3rem !important;
    }

    .login-page p {
        font-size: 0.9rem !important;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 0.25rem !important;
    }

    .login-page h1 {
        font-size: 1.2rem !important;
    }

    .login-page p {
        font-size: 0.85rem !important;
    }
}


/* Vanity mode filter styling */
.vanity-mode-filter {
    background: rgba(var(--theme-accent-rgb), 0.1) !important;
    border: 2px solid var(--theme-accent) !important;
    position: relative;
}

.vanity-mode-filter::after {
    content: "🔒";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--theme-accent);
    font-size: 0.8rem;
}

.vanity-indicator {
    animation: vanityFadeIn 0.5s ease-in-out;
}

@keyframes vanityFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive vanity indicator */
@media (max-width: 768px) {
    .vanity-indicator {
        font-size: 0.75rem !important;
        padding: 6px 12px !important;
    }
    
    .vanity-indicator span:first-child {
        display: none;
    }
}

/* WeChat-style Login Loader Styles */
.wechat-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

.wechat-loader-box {
    width: 120px;
    height: 120px;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.3s ease-out;
}

.wechat-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid #07C160;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.wechat-loader-text {
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    font-weight: 400;
    text-align: center;
    letter-spacing: 0.5px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { 
        opacity: 0;
        transform: scale(0.8);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Disabled button state */
#loginBtn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}


.btn-info {
    background-color: #3b82f6;
    border: 1px solid #3b82f6;
    color: white;
}

.btn-info:hover {
    background-color: #2563eb;
    border-color: #2563eb;
}

#qrCodeContainer img {
    max-width: 100%;
    height: auto;
}

   /* Fix bouncing / scroll stability on iOS */
    #memberPortal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        overflow: hidden;
        overscroll-behavior: none;
        -webkit-overflow-scrolling: touch;
    }

   /* Prevent double-tap zoom on mobile devices */
    #memberPortal * {
        touch-action: manipulation !important;
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        -khtml-user-select: none !important;
        -moz-user-select: none !important;
        -ms-user-select: none !important;
        user-select: none !important;
    }
    
    /* Allow text selection for input fields */
    #memberPortal input, #memberPortal textarea {
        -webkit-user-select: text !important;
        -khtml-user-select: text !important;
        -moz-user-select: text !important;
        -ms-user-select: text !important;
        user-select: text !important;
    }
    
    /* Prevent text selection highlighting */
    #memberPortal *::selection {
        background: transparent;
    }
    
    #memberPortal *::-moz-selection {
        background: transparent;
    }
    
    /* Prevent image dragging */
    #memberPortal img {
        -webkit-user-drag: none !important;
        -khtml-user-drag: none !important;
        -moz-user-drag: none !important;
        -o-user-drag: none !important;
        user-drag: none !important;
    }
    
    /* Disable text selection on buttons */
    #memberPortal button {
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        -khtml-user-select: none !important;
        -moz-user-select: none !important;
        -ms-user-select: none !important;
        user-select: none !important;
    }

/* Add this CSS to make disabled input text color match disabled select text color */
.form-input:disabled {
    color: #6c757d !important; /* Same grey color as disabled select */
}

select.form-input:disabled {
    color: #6c757d !important; /* Ensure select also has consistent grey text */
}

#revenues > div.container > div.filters-container {
    margin-bottom: 1.0rem;
    padding-left: 0;
    padding-right: 0;
}


/* User Dropdown Styles */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown-toggle {
    background: none;
    border: none;
    color: #f0f0f0;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.user-dropdown-toggle[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--theme-card);
    border: 1px solid var(--theme-accent);
    border-radius: 6px;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    padding: 0.5rem 0;
    margin-top: 0.25rem;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #f0f0f0;
    text-decoration: none;
    font-size: 0.85rem;
    transition: background-color 0.2s ease;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.user-dropdown-item:hover {
    background-color: rgba(var(--theme-accent-rgb), 0.1);
    color: var(--theme-accent);
}

.dropdown-icon {
    font-size: 1rem;
    width: 16px;
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .user-dropdown-menu {
        right: -1rem;
        min-width: 160px;
    }
    
    .user-dropdown-toggle {
        font-size: 0.8rem;
        padding: 0.4rem;
    }
    
    .user-dropdown-item {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* User dropdown styles */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown-toggle {
    background: #1A3D2A;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-family: inherit;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2), 0 1px 0 rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.user-dropdown-toggle:hover {
    border-color: rgba(var(--theme-accent-rgb), 0.35);
    background: linear-gradient(135deg, rgba(34, 80, 48, 0.7), rgba(24, 50, 32, 0.9));
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 8px rgba(var(--theme-accent-rgb), 0.08);
}

.user-dropdown.active .user-dropdown-toggle {
    border-color: rgba(var(--theme-accent-rgb), 0.5);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 0 2px rgba(var(--theme-accent-rgb), 0.15), 0 0 12px rgba(var(--theme-accent-rgb), 0.1);
}

.user-dropdown-arrow {
    font-size: 0;
    display: inline-block;
    width: 10px;
    height: 6px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23f0f0f0' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 10px 6px;
    transition: transform 0.3s ease;
}

.user-dropdown.active .user-dropdown-arrow {
    transform: rotate(180deg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2322c55e' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
}

.user-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    background: linear-gradient(135deg, rgba(26, 50, 32, 0.95), rgba(18, 36, 24, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    min-width: 200px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.user-dropdown.active .user-dropdown-menu {
    display: block;
}

.user-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    color: #f0f0f0;
    text-decoration: none;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 0.9rem;
}

.user-dropdown-item:hover {
    background: rgba(var(--theme-accent-rgb), 0.1);
    color: #f0f0f0;
    text-decoration: none;
}

.user-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
}

/* Header icon buttons (Messenger, Notifications) */
.header-icon-btn {
    position: relative;
    background: #1A3D2A;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2), 0 1px 0 rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.header-icon-btn:hover {
    border-color: color-mix(in srgb, var(--theme-accent, #22c55e) 35%, transparent);
    color: var(--theme-accent, #22c55e);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.header-notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    background: #dc2626;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    pointer-events: none;
    line-height: 1;
}

/* Real-time table update animations */
@keyframes tableStatusUpdate {
    0% { 
        transform: scale(1); 
        box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
    }
    25% { 
        transform: scale(1.02); 
        box-shadow: 0 4px 12px rgba(var(--theme-accent-rgb), 0.3); 
    }
    75% { 
        transform: scale(1.01); 
        box-shadow: 0 6px 16px rgba(var(--theme-accent-rgb), 0.4); 
    }
    100% { 
        transform: scale(1); 
        box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
    }
}

/* Member name column styles */
.member-name-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.member-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gender-icon {
    font-size: 1rem;
    cursor: help;
    transition: opacity 0.2s ease;
    position: relative;
    z-index: 1000;
    pointer-events: auto !important;
    user-select: none;
}

.gender-icon:hover {
    opacity: 0.7;
}

.age-badge {
    font-size: 0.75rem;
    background: rgba(var(--theme-accent-rgb), 0.1);
    color: var(--theme-accent);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    border: 1px solid rgba(var(--theme-accent-rgb), 0.3);
    cursor: help;
    display: inline-block;
    font-weight: 500;
    position: relative;
    z-index: 1000;
    pointer-events: auto !important;
    user-select: none;
}

.age-badge:hover {
    background: rgba(var(--theme-accent-rgb), 0.2);
    border-color: rgba(var(--theme-accent-rgb), 0.5);
}

/* Ensure member name container allows tooltips to show */
.member-name-container {
    position: relative;
    z-index: 1;
}

.member-name-row {
    position: relative;
    z-index: 1;
}

/* Allow tooltips to show outside table cells */
.data-table td:has(.gender-icon), 
.data-table td:has(.age-badge) {
    overflow: visible !important;
    position: relative;
}

/* Fallback for browsers that don't support :has() */
.data-table td .member-name-container {
    overflow: visible;
}

/* Custom CSS tooltips as fallback */
.gender-icon::before,
.age-badge::before {
    content: attr(title);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--theme-card);
    color: #f0f0f0;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    border: 1px solid var(--theme-accent);
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.gender-icon::after,
.age-badge::after {
    content: '';
    position: absolute;
    bottom: 112%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--theme-accent);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.gender-icon:hover::before,
.gender-icon:hover::after,
.age-badge:hover::before,
.age-badge:hover::after {
    opacity: 1;
}




/* ====================
   ANNOUNCEMENT SYSTEM STYLES
   ==================== */

/* Active Organizations Panel */
.active-orgs-panel {
    background: rgba(var(--theme-accent-rgb), 0.08);
    border: 2px solid var(--theme-accent);
    border-radius: 8px;
    padding: 1rem;
    min-height: 100px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
    align-content: flex-start;
    position: relative;
}

.active-orgs-panel .no-selection {
    color: #888;
    text-align: center;
    padding: 1.5rem;
    font-style: italic;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Organization Badge */
.org-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--theme-accent);
    color: #0a1a0d;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.org-badge:hover {
    background: #16a34a;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(var(--theme-accent-rgb), 0.3);
}

.org-badge .remove-btn {
    background: transparent;
    border: none;
    color: #0a1a0d;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.org-badge .remove-btn:hover {
    transform: scale(1.2);
    color: #dc2626;
}

.btn-clear-all {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear-all:hover {
    background: #b91c1c;
}

/* Available Organizations Panel */
.available-orgs-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 1rem;
}

.available-orgs-list {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 0.5rem;
}

.org-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid rgba(var(--theme-accent-rgb), 0.1);
    transition: background 0.2s ease;
}

.org-list-item:hover {
    background: rgba(var(--theme-accent-rgb), 0.05);
}

.org-list-item:last-child {
    border-bottom: none;
}

.org-name {
    color: #f0f0f0;
    font-size: 0.9rem;
    flex: 1;
}

.btn-add {
    background: var(--theme-accent);
    color: #0a1a0d;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-add:hover {
    background: #16a34a;
    transform: translateX(2px);
}

.btn-add:active {
    transform: translateX(0);
}

/* Spinner for loading */
.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: text-bottom;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .active-orgs-panel {
        min-height: 80px;
        padding: 0.75rem;
    }
    
    .org-badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
    
    .available-orgs-list {
        max-height: 250px;
    }
    
    .org-list-item {
        padding: 0.6rem;
    }
    
    .org-name {
        font-size: 0.85rem;
    }
    
    .btn-add {
        font-size: 0.8rem;
        padding: 0.35rem 0.8rem;
    }
}

/* =============================================
   CENTER PHOTOS & BANNER STYLES
   ============================================= */

/* Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.photo-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: var(--theme-card);
    border: 2px solid #333;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.photo-card:hover {
    border-color: var(--theme-accent);
}

.photo-card.primary {
    border-color: var(--theme-accent);
    border-width: 3px;
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-card .primary-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background: var(--theme-accent);
    color: #000;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

.photo-card .photo-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 3px;
    padding: 5px;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.photo-card:hover .photo-actions {
    opacity: 1;
}

.photo-card.add-photo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-style: dashed;
    cursor: pointer;
}

.photo-card.add-photo:hover {
    background: rgba(var(--theme-accent-rgb), 0.1);
}

/* Extra small button for photo actions */
.btn-xs {
    padding: 2px 6px;
    font-size: 0.65rem;
}

/* Default Banners Grid */
.default-banners-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.default-banner-option {
    cursor: pointer;
    border: 2px solid #333;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease;
    padding: 5px;
    text-align: center;
}

.default-banner-option:hover {
    border-color: var(--theme-accent);
    transform: scale(1.02);
}

.default-banner-option.selected {
    border-color: var(--theme-accent);
    background: rgba(var(--theme-accent-rgb), 0.1);
}

.default-banner-option img {
    width: 100%;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

/* Smaller photo grid variant for settings */
.photo-grid.photo-grid-sm {
    grid-template-columns: repeat(6, 80px);
    gap: 8px;
}

.photo-grid.photo-grid-sm .photo-card {
    width: 80px;
    height: 80px;
    aspect-ratio: 1;
    border-radius: 6px;
}

.photo-grid.photo-grid-sm .photo-card.add-photo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px dashed #555;
    background: rgba(255,255,255,0.03);
}

.photo-grid.photo-grid-sm .photo-card .primary-badge {
    top: 2px;
    left: 2px;
    padding: 1px 4px;
    font-size: 0.5rem;
}

.photo-grid.photo-grid-sm .photo-card .photo-actions {
    padding: 2px;
    gap: 2px;
}

/* Responsive for smaller screens */
@media (max-width: 768px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .photo-grid.photo-grid-sm {
        grid-template-columns: repeat(3, 1fr);
    }

    .default-banners-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* =============================================
   Theme Presets Grid
   ============================================= */

.theme-presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.theme-preset-card {
    position: relative;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.15s ease;
    background: #1a1a1a;
}

.theme-preset-card:hover {
    border-color: #555;
    transform: translateY(-1px);
}

.theme-preset-card.selected {
    border-color: var(--theme-accent);
}

.theme-preview {
    border-radius: 4px;
    overflow: hidden;
    height: 60px;
    display: flex;
    flex-direction: column;
    margin-bottom: 6px;
}

.theme-preview-nav {
    height: 10px;
    flex-shrink: 0;
}

.theme-preview-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
}

.theme-preset-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: #e0e0e0;
    line-height: 1.2;
}

.theme-preset-desc {
    font-size: 0.62rem;
    color: #888;
    line-height: 1.2;
}

.theme-preset-check {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--theme-accent);
    color: #000;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
}

.theme-custom-colors {
    display: flex;
    gap: 1.5rem;
    margin-top: 12px;
    padding: 10px;
    background: #1a1a1a;
    border-radius: 6px;
    border: 1px solid #333;
}

.theme-color-picker {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-color-picker label {
    font-size: 0.75rem;
    color: #ccc;
    white-space: nowrap;
}

.theme-color-picker input[type="color"] {
    width: 36px;
    height: 28px;
    border: 1px solid #555;
    border-radius: 4px;
    background: none;
    cursor: pointer;
    padding: 0;
}

/* ========================================
   WhatsApp-Style Chat Modal
   ======================================== */

.whatsapp-chat-modal {
    max-width: 450px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
}

.whatsapp-header {
    background: #1a3d2b;
    padding: 14px 16px;
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid var(--theme-accent);
}

.whatsapp-header h3 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--theme-accent);
    margin: 0;
}

.whatsapp-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #0d1f14;
    min-height: 0;
}

.whatsapp-msg-bubble {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 0 8px 8px 8px;
    background: #1a3d2b;
    align-self: flex-start;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Own messages - right aligned, different color */
.whatsapp-msg-own {
    align-self: flex-end;
    background: #054640;
    border-radius: 8px 0 8px 8px;
}

.whatsapp-msg-own .whatsapp-msg-sender {
    color: #4ade80;
}

.whatsapp-msg-sender {
    font-size: 12px;
    font-weight: 600;
    color: var(--theme-accent);
    margin-bottom: 4px;
}

.whatsapp-msg-text {
    color: #e0e0e0;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.whatsapp-msg-time {
    font-size: 10px;
    color: #888;
    text-align: right;
    margin-top: 4px;
}

.whatsapp-system-msg {
    text-align: center;
    margin: 8px 0;
    align-self: center;
}

.whatsapp-system-msg span {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 14px;
    border-radius: 16px;
    font-size: 12px;
    color: #888;
    font-style: italic;
    display: inline-block;
}

.whatsapp-input-area {
    display: flex;
    gap: 10px;
    padding: 12px;
    background: var(--theme-card);
    border-radius: 0 0 12px 12px;
    border-top: 1px solid var(--theme-accent);
}

.whatsapp-input-area input {
    flex: 1;
    padding: 10px 16px;
    border-radius: 20px;
    border: 1px solid var(--theme-accent);
    background: #0d1f14;
    color: #e0e0e0;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.whatsapp-input-area input:focus {
    border-color: #4ade80;
}

.whatsapp-input-area input::placeholder {
    color: #666;
}

.whatsapp-send-btn {
    padding: 10px 20px;
    border-radius: 20px;
    background: var(--theme-accent);
    color: #000;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.whatsapp-send-btn:hover {
    background: #4ade80;
}

/* Mobile responsive */
@media (max-width: 500px) {
    .whatsapp-chat-modal {
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .whatsapp-header {
        border-radius: 0;
    }

    .whatsapp-input-area {
        border-radius: 0;
    }
}

/* ========================================
   Messenger Modal — WhatsApp Desktop Style
   Two-panel layout: conversation list + active chat
   ======================================== */

/* Modal container — V2 style with fixed header/footer */
.messenger-modal {
    width: 1080px !important;
    height: 85vh !important;
    max-height: 85vh !important;
    display: flex !important;
    flex-direction: column !important;
    border-radius: 12px;
    overflow: hidden;
    padding: 0 !important;
    margin: auto !important;
}

/* Body is the two-panel flex row container */
.messenger-body {
    display: flex !important;
    flex-direction: row !important;
    flex: 1 !important;
    min-height: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* ---- LEFT PANEL ---- */
.messenger-left-panel {
    width: 340px;
    min-width: 340px;
    display: flex;
    flex-direction: column;
    background: #111b14;
    border-right: 1px solid rgba(var(--theme-accent-rgb), 0.15);
}

.messenger-left-header {
    padding: 10px 12px;
    background: var(--theme-body);
    border-bottom: 1px solid rgba(var(--theme-accent-rgb), 0.1);
}

.messenger-search-bar {
    position: relative;
}

.messenger-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #555;
    font-size: 13px;
    pointer-events: none;
}

.messenger-search-bar input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    border-radius: 8px;
    border: 1px solid rgba(var(--theme-accent-rgb), 0.15);
    background: #0d1f14;
    color: #e0e0e0;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
.messenger-search-bar input:focus { border-color: var(--theme-accent); }
.messenger-search-bar input::placeholder { color: #555; }

/* Conversation List */
.messenger-conversation-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.messenger-section-label {
    padding: 10px 16px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--theme-accent);
    letter-spacing: 0.8px;
}

.messenger-conv-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.15s;
    border-left: 3px solid transparent;
}
.messenger-conv-item:hover { background: rgba(26, 61, 43, 0.35); }
.messenger-conv-item.active {
    background: rgba(26, 61, 43, 0.6);
    border-left-color: var(--theme-accent);
}

.messenger-conv-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #1a3d2b;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.15rem;
    color: var(--theme-accent);
}

.messenger-conv-info {
    flex: 1;
    min-width: 0;
}

.messenger-conv-name {
    font-size: 14px;
    font-weight: 500;
    color: #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.messenger-conv-preview {
    font-size: 12px;
    color: #777;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.messenger-conv-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.messenger-conv-time {
    font-size: 11px;
    color: #666;
    white-space: nowrap;
}

.messenger-conv-badge {
    background: var(--theme-accent);
    color: #000;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.messenger-conv-status {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

/* Loading state */
.messenger-loading {
    text-align: center;
    color: #555;
    padding: 40px 20px;
    font-size: 13px;
    line-height: 2;
}
.messenger-loading i { font-size: 2rem; color: var(--theme-accent)33; }

/* ---- RIGHT PANEL ---- */
.messenger-right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0d1f14;
    min-width: 0;
}

/* Empty state */
.messenger-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #555;
    gap: 8px;
    user-select: none;
}
.messenger-empty-state i {
    font-size: 5rem;
    color: rgba(var(--theme-accent-rgb), 0.12);
    margin-bottom: 8px;
}
.messenger-empty-state h4 {
    color: #888;
    font-weight: 500;
    font-size: 1.1rem;
    margin: 0;
}
.messenger-empty-state p {
    color: #555;
    font-size: 13px;
    margin: 0;
}

/* Chat view */
.messenger-chat-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.messenger-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #1a3d2b;
    border-bottom: 1px solid rgba(var(--theme-accent-rgb), 0.15);
    flex-shrink: 0;
}

.messenger-chat-header-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(var(--theme-accent-rgb), 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--theme-accent);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.messenger-chat-header-info {
    flex: 1;
    min-width: 0;
}

.messenger-chat-header-info h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.messenger-chat-subtitle {
    font-size: 12px;
    color: #888;
}

.messenger-back-btn {
    display: none;
    background: none;
    border: none;
    color: var(--theme-accent);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
}

/* Messages area — inherits whatsapp-messages styling */
.messenger-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    background: #0b1a10;
}

/* Input bar */
.messenger-chat-input {
    display: flex;
    gap: 10px;
    padding: 10px 16px;
    background: var(--theme-card);
    border-top: 1px solid rgba(var(--theme-accent-rgb), 0.15);
    flex-shrink: 0;
}

.messenger-chat-input input {
    flex: 1;
    padding: 10px 16px;
    border-radius: 22px;
    border: 1px solid rgba(var(--theme-accent-rgb), 0.3);
    background: #0d1f14;
    color: #e0e0e0;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.messenger-chat-input input:focus { border-color: #4ade80; }
.messenger-chat-input input::placeholder { color: #555; }

.messenger-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--theme-accent);
    color: #000;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}
.messenger-send-btn:hover { background: #4ade80; }

/* Announcement cards in right panel */
.messenger-announcement-item {
    background: var(--theme-body);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 6px;
    border-left: 3px solid var(--theme-accent);
    transition: background 0.15s;
}
.messenger-announcement-item:hover { background: #1a3d2b; }
.messenger-announcement-item.urgent { border-left-color: #ef4444; }
.messenger-announcement-item.high { border-left-color: #f59e0b; }

.messenger-announcement-title {
    font-weight: 600;
    color: var(--theme-accent);
    font-size: 14px;
    margin-bottom: 6px;
}

.messenger-announcement-content {
    color: #c0c0c0;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.messenger-announcement-meta {
    font-size: 11px;
    color: #666;
    margin-top: 8px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.messenger-announcement-priority {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}
.messenger-announcement-priority.urgent { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.messenger-announcement-priority.high { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.messenger-announcement-priority.normal { background: rgba(var(--theme-accent-rgb), 0.15); color: var(--theme-accent); }

/* Section divider in conversation list */
.messenger-section-divider {
    height: 1px;
    background: rgba(var(--theme-accent-rgb), 0.1);
    margin: 4px 16px;
}

/* No results */
.messenger-no-results {
    text-align: center;
    color: #555;
    padding: 20px;
    font-size: 13px;
}

/* ---- MOBILE RESPONSIVE ---- */
@media (max-width: 768px) {
    .messenger-modal {
        width: 100vw !important;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        position: relative;
    }

    .messenger-left-panel {
        width: 100%;
        min-width: 100%;
    }

    .messenger-right-panel {
        position: absolute;
        top: 0; left: 0;
        width: 100%; height: 100%;
        z-index: 2;
        display: none;
    }

    .messenger-right-panel.mobile-active {
        display: flex !important;
    }

    .messenger-back-btn {
        display: flex !important;
    }
}

/* ==================== Form Validation Error Styles ==================== */
.input-error {
    border-color: #ef4444 !important;
    background-color: rgba(239, 68, 68, 0.1) !important;
}

.field-error-message {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: block;
}

/* ============================================
   SETUP WIZARD — ProMax Design
   ============================================ */
#setupWizardPage {
    display: none;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #0a1a0d;
    padding: 1rem;
}

.setup-wizard-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

/* Brand Header */
.setup-wizard-container .wizard-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.setup-wizard-container .wizard-brand-title {
    color: var(--theme-accent);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    margin-bottom: 0.5rem;
}

.setup-wizard-container .wizard-brand-subtitle {
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 400;
}

/* Segmented Progress Bar */
.setup-wizard-container .wizard-progress-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 0.5rem;
}

.setup-wizard-container .wizard-progress-segment {
    flex: 1;
    height: 4px;
    background: #1e293b;
    border-radius: 2px;
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

.setup-wizard-container .wizard-progress-segment.completed {
    background: var(--theme-accent);
}

.setup-wizard-container .wizard-progress-segment.active {
    background: var(--theme-accent);
    box-shadow: 0 0 8px rgba(var(--theme-accent-rgb), 0.4);
    animation: wizard-pulse 2s ease-in-out infinite;
}

@keyframes wizard-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(var(--theme-accent-rgb), 0.4); }
    50% { box-shadow: 0 0 14px rgba(var(--theme-accent-rgb), 0.6); }
}

/* Progress Labels */
.setup-wizard-container .wizard-progress-labels {
    display: flex;
    margin-bottom: 1.5rem;
}

.setup-wizard-container .wizard-progress-label {
    flex: 1;
    text-align: center;
    font-size: 0.7rem;
    color: #64748b;
    transition: color 0.3s ease;
}

.setup-wizard-container .wizard-progress-label.active {
    color: var(--theme-accent);
    font-weight: 600;
}

.setup-wizard-container .wizard-progress-label.completed {
    color: var(--theme-accent);
}

/* Step Cards */
.setup-wizard-container .setup-panel {
    display: none;
    opacity: 0;
    transform: translateX(30px);
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid #1e293b;
    border-radius: 16px;
    padding: 2rem;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.setup-wizard-container .setup-panel.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

.setup-wizard-container .setup-panel.exit-left {
    opacity: 0;
    transform: translateX(-30px);
}

.setup-wizard-container .setup-panel.exit-right {
    opacity: 0;
    transform: translateX(30px);
}

/* Step Badge */
.setup-wizard-container .wizard-step-badge {
    display: inline-block;
    background: var(--theme-accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    letter-spacing: 0.03em;
}

/* Step Title & Subtitle */
.setup-wizard-container .wizard-step-title {
    color: #f1f5f9;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
}

.setup-wizard-container .wizard-step-subtitle {
    color: #64748b;
    font-size: 0.8rem;
    margin: 0 0 1.5rem 0;
}

/* Form Fields */
.setup-wizard-container .setup-field {
    margin-bottom: 1.25rem;
}

.setup-wizard-container .setup-field label {
    display: block;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.setup-wizard-container .setup-field input,
.setup-wizard-container .setup-field select {
    width: 100%;
    padding: 0.75rem;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 12px;
    color: #f1f5f9;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.setup-wizard-container .setup-field input:focus,
.setup-wizard-container .setup-field select:focus {
    outline: none;
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 3px rgba(var(--theme-accent-rgb), 0.15);
}

.setup-wizard-container .setup-field input.readonly-field {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Navigation */
.setup-wizard-container .setup-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    gap: 0.75rem;
}

/* Continue Button */
.setup-wizard-container .wizard-btn-continue {
    width: 100%;
    padding: 0.85rem;
    background: var(--theme-accent);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.setup-wizard-container .wizard-btn-continue:hover {
    background: #16a34a;
    transform: translateY(-1px);
}

.setup-wizard-container .wizard-btn-continue:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Back Button */
.setup-wizard-container .wizard-btn-back {
    background: transparent;
    color: #94a3b8;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 0;
    transition: color 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.setup-wizard-container .wizard-btn-back:hover {
    color: #f1f5f9;
}

/* Completion Checkmark */
.setup-wizard-container .wizard-checkmark {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(var(--theme-accent-rgb), 0.15);
    border: 2px solid var(--theme-accent);
    margin: 0 auto 1.5rem;
    position: relative;
    transform: scale(0);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.setup-wizard-container .setup-panel.active .wizard-checkmark {
    transform: scale(1);
}

.setup-wizard-container .wizard-checkmark::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 28px;
    border-right: 3px solid var(--theme-accent);
    border-bottom: 3px solid var(--theme-accent);
    transform: rotate(45deg);
    top: 14px;
    left: 22px;
}

/* Completion Title & Subtitle */
.setup-wizard-container .wizard-complete-title {
    color: #f1f5f9;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    text-align: center;
}

.setup-wizard-container .wizard-complete-subtitle {
    color: #94a3b8;
    font-size: 0.85rem;
    margin: 0 0 1.5rem 0;
    text-align: center;
}

/* Summary */
.setup-wizard-container .wizard-summary {
    text-align: left;
    background: rgba(var(--theme-accent-rgb), 0.08);
    border: 1px solid rgba(var(--theme-accent-rgb), 0.2);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

/* Skip Link */
.setup-wizard-container .setup-wizard-skip {
    text-align: center;
    margin-top: 1.5rem;
}

.setup-wizard-container .setup-wizard-skip a {
    color: #64748b;
    font-size: 0.8rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.setup-wizard-container .setup-wizard-skip a:hover {
    color: #94a3b8;
}

/* Responsive */
@media (max-width: 600px) {
    .setup-wizard-container {
        max-width: 100%;
    }

    .setup-wizard-container .setup-panel {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .setup-wizard-container .wizard-progress-label {
        font-size: 0.6rem;
    }
}

/* ========================================
   UI VERSION TOGGLE SYSTEM
   Toggle between old (v1) and new (v2) modal UI versions.
   Toggle only visible in debug.php (hidden by default).
   ======================================== */

/* Toggle switch - hidden by default, shown via JS in debug mode */
.ui-version-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    margin-right: 0.75rem;
}

.ui-version-toggle-label {
    font-size: 0.7rem;
    color: #9ca3af;
    font-weight: 500;
    white-space: nowrap;
}

.ui-version-toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    background: #404040;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.ui-version-toggle-switch.active {
    background: var(--theme-accent);
}

.ui-version-toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.ui-version-toggle-switch.active .ui-version-toggle-slider {
    transform: translateX(16px);
}

/* Printer visibility — hides buttons regardless of inline style.display overrides */
.printer-hidden {
    display: none !important;
}

/* Printer Settings Toggle */
.printer-toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: #404040;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
    flex-shrink: 0;
}
.printer-toggle-switch.active {
    background: var(--theme-accent);
}
.printer-toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.printer-toggle-switch.active .printer-toggle-slider {
    transform: translateX(20px);
}

/* Version content switching via data attribute on modal */
.modal[data-ui-version="v1"] .ui-v2 {
    display: none !important;
}

.modal[data-ui-version="v2"] .ui-v1 {
    display: none !important;
}

/* V2 placeholder styling */
.ui-v2-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    color: #9ca3af;
    text-align: center;
    min-height: 200px;
}

.ui-v2-placeholder-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--theme-accent);
    margin-bottom: 0.5rem;
}

.ui-v2-placeholder-text {
    font-size: 0.85rem;
    color: #6b7280;
}

/* ============================================
   V2 Countup Game Modal — Single-Page Layout
   ============================================ */

/* V2 Status Bar — compact game info strip */
.v2-status-bar {
    display: flex; align-items: center; gap: 1.5rem; padding: 0.75rem 1rem;
    background: var(--theme-card); border: 1px solid var(--theme-accent); border-radius: 8px;
    margin-bottom: 1rem; flex-wrap: wrap;
}
.v2-status-item { display: flex; flex-direction: column; gap: 0.15rem; }
.v2-status-label { font-size: 0.65rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; }
.v2-status-value { font-size: 0.85rem; color: #f0f0f0; font-weight: 500; }
.v2-timer { color: var(--theme-accent); font-family: monospace; font-weight: 600; }

/* V2 Sections */
.v2-section { margin-bottom: 1rem; }
.v2-section-main { margin-bottom: 1.5rem; }
.v2-section-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 0.75rem;
}
.v2-section-title { color: var(--theme-accent); margin: 0; font-size: 1rem; }
.v2-section-toggle {
    font-size: 0.8rem; color: var(--theme-accent); cursor: pointer; padding: 0.25rem 0.5rem;
    border: 1px solid var(--theme-accent); border-radius: 4px; background: transparent;
}
.v2-section-toggle:hover { background: rgba(var(--theme-accent-rgb), 0.1); }

/* V2 Customer Summary */
.v2-customer-summary { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0; }
.v2-customer-name { color: #f0f0f0; font-weight: 500; }
.v2-customer-mobile { color: #9ca3af; font-size: 0.85rem; }
.v2-customer-edit {
    padding: 1rem; background: var(--theme-card); border-radius: 8px; margin-top: 0.5rem;
    border: 1px solid #333;
}

/* V2 Inline Customer Edit — hover hints for clickable fields */
#splitBillV2CustomerDisplayName:hover,
#splitBillV2CustomerDisplayMobile:hover {
    text-decoration: underline;
}

/* V2 Member Card — compact left-accent design */
.v2-member-card {
    border-left: 3px solid var(--theme-accent);
    padding: 0.4rem 0 0.4rem 0.6rem;
    margin-bottom: 0.75rem;
}
.v2-member-card-remove {
    color: #9ca3af;
    font-size: 0.75rem;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s;
}
.v2-member-card-remove:hover { color: #dc2626; }

/* V2 Member Search Dropdown */
.v2-member-search-dropdown {
    position: absolute;
    width: 100%;
    z-index: 10;
    max-height: 350px;
    overflow-y: auto;
    background: #1a1a1a;
    border: 1px solid #333;
    border-top: none;
    border-radius: 0 0 6px 6px;
    margin-top: -1px;
    scrollbar-width: thin;
    scrollbar-color: #555 transparent;
}
.v2-member-search-dropdown::-webkit-scrollbar {
    width: 5px;
}
.v2-member-search-dropdown::-webkit-scrollbar-track {
    background: transparent;
}
.v2-member-search-dropdown::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}
.v2-member-search-dropdown::-webkit-scrollbar-thumb:hover {
    background: #777;
}
.v2-member-search-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(51, 51, 51, 0.8);
}
.v2-member-search-item:last-child { border-bottom: none; }
.v2-member-search-item:hover { background: rgba(var(--theme-accent-rgb), 0.08); }
.v2-member-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(var(--theme-accent-rgb), 0.15);
    border: 1px solid rgba(var(--theme-accent-rgb), 0.4);
    display: flex; align-items: center; justify-content: center;
    color: var(--theme-accent); font-size: 0.7rem; font-weight: 600;
    flex-shrink: 0;
}

.remark-chip {
    display: inline-block;
    background: var(--theme-card);
    border: 1px solid rgba(var(--theme-accent-rgb), 0.4);
    border-radius: 20px;
    padding: 0.4rem 0.8rem;
    color: #d0d0d0;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0.25rem;
}
.remark-chip:hover {
    border-color: var(--theme-accent);
    background: rgba(var(--theme-accent-rgb), 0.15);
    color: #f0f0f0;
}

/* V2 Invoice Table */
.v2-invoice-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.v2-invoice-table th {
    padding: 0.4rem 0.5rem; text-align: left; color: var(--theme-accent);
    border-bottom: 0px solid #444; font-weight: 600;
}
.v2-invoice-table td { padding: 0.5rem; }
.v2-invoice-table .text-right,
.v2-totals-table .text-right { text-align: right; }
.v2-invoice-table .text-center { text-align: center; }
.v2-totals-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.v2-totals-table td { padding: 0.2rem 0.4rem; }
.v2-totals-table td.text-right { min-width: 100px; }
.v2-totals-row-total { border-top: none; }
.v2-totals-row-total td { padding: 0.35rem 0.4rem; font-weight: 600; color: var(--theme-accent); font-size: 0.95rem; }

/* V2 Split Layout — Two-column invoice view */
#splitBillGameModal[data-ui-version="v2"] .modal-body {
    padding-top: 0;
    padding-right: 0;
    padding-bottom: 0;
}
#splitBillGameModal .modal-body > .ui-v2 {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}
.dot-loader {
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
    gap: 3px;
}
.dot-loader .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--theme-accent);
    animation: dot-bounce 1.4s infinite ease-in-out both;
}
.dot-loader .dot:nth-child(1) { animation-delay: 0s; }
.dot-loader .dot:nth-child(2) { animation-delay: 0.16s; }
.dot-loader .dot:nth-child(3) { animation-delay: 0.32s; }
@keyframes dot-bounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}
.v2-split-layout {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.v2-split-left {
    overflow-y: auto;
    min-height: 0;
    padding-top: 1rem;
    padding-right: 0.75rem;
}
.v2-split-right {
    display: flex;
    flex-direction: column;
    width: 310px;
    flex-shrink: 0;
    border-left: 1px solid rgba(var(--theme-accent-rgb), 0.15);
    padding: 0.5rem 0.6rem;
    overflow: hidden;
}
.v2-split-right-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* ============================================================
   V2 GLOBAL UI TOGGLE
   ============================================================ */

.ui-version-toggle-global {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-right: 1rem;
}

/* ============================================================
   V2 PAYMENT METHOD BUTTONS
   ============================================================ */

.v2-payment-method-btn {
    padding: 0.4rem;
    background: #252525;
    border: 1px solid #404040;
    border-radius: 4px;
    color: #d0d0d0;
    cursor: pointer;
    font-size: 0.8rem;
    text-align: center;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.v2-payment-method-btn:hover {
    border-color: var(--theme-accent);
    color: var(--theme-accent);
}

.v2-payment-method-btn.selected {
    background: rgba(var(--theme-accent-rgb), 0.15);
    border-color: var(--theme-accent);
    color: var(--theme-accent);
}

/* V2 Sidebar Section Spacing */
.v2-sidebar-section {
    flex-shrink: 0;
}

/* Searchable Dropdown */
.searchable-dropdown-trigger {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}
.searchable-dropdown-arrow {
    color: #999;
    font-size: 14px;
    margin-left: 8px;
}
.searchable-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 6px;
    z-index: 10;
    margin-top: 2px;
}
.searchable-dropdown-search-wrapper {
    position: sticky;
    top: 0;
    padding: 8px;
    border-bottom: 1px solid #333;
    background: #1a1a2e;
}
.searchable-dropdown-search-input {
    width: 100%;
    padding: 6px 10px;
    background: #0d0d1a;
    border: 1px solid #444;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}
.searchable-dropdown-search-input:focus {
    border-color: var(--theme-accent);
}
.searchable-dropdown-options-list {
    max-height: 300px;
    overflow-y: auto;
}
.searchable-dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #e0e0e0;
}
.searchable-dropdown-item:hover {
    background: #2a2a4a;
}
.searchable-dropdown-region-header {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--theme-accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #0f0f1e;
    border-top: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 1;
    cursor: default;
    user-select: none;
}

/* Disable all hover effects for available (not started) tables — except classic theme */
.table-card.available:not(.theme-access-card):hover,
.table-card.available.theme-pool:hover,
.table-card.available.theme-pool-square:hover,
.table-card.available.theme-snooker:hover,
.table-card.available.theme-snooker-square:hover {
    transform: none !important;
    box-shadow: none !important;
}
.table-card.available:not(.theme-access-card):hover .hover-outline {
    border-color: transparent !important;
}

/* Classic theme — always show border on hover (all states) */
.table-card.theme-access-card:hover {
    border-color: var(--label-color, #22c55e) !important;
    transform: translateY(-2px) !important;
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.12),
        0 0 0 4px var(--label-color, #22c55e),
        0 6px 20px rgba(0, 0, 0, 0.3) !important;
}
.table-card.available:hover .ball-badge {
    animation: snookerBallShake 0.4s ease-out !important;
}

/* Keyboard-focused table card */
.table-card.kb-focused .hover-outline {
    border-color: rgba(74, 222, 128, 0.8) !important;
}
.table-card.kb-focused {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(74, 222, 128, 0.3);
}
.table-card.kb-focused .ball-badge {
    animation: snookerBallShake 0.4s ease-out;
}

/* Bounce countup/countdown buttons on available table hover & keyboard focus */
@keyframes tableButtonBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.18); box-shadow: 0 0 12px rgba(236, 72, 153, 0.7); }
}
.table-card.available:hover button.btn-table-operation,
.table-card.available.kb-focused button.btn-table-operation {
    animation: tableButtonBounce 0.5s ease-in-out 3;
}

/* ============================================================
   REVENUES PAGE + SETTINGS MODAL V2 REDESIGN
   ============================================================ */

/* --- REVENUES: Revenue-specific filter overrides --- */
#revenues .filters .rev-filters {
    flex-wrap: wrap;
}

#revenues .rev-filters .filter-select,
#revenues .rev-filters .date-filter-select,
#revenues .rev-filters select.filter-select {
    min-width: 110px;
}

#revenues .rev-filters .date-input {
    padding: 0.45rem 0.6rem;
    font-size: 0.82rem;
    border: 1px solid #6b7280;
    background: var(--theme-card);
    border-radius: 4px;
    color: #f0f0f0;
    transition: border-color 0.2s ease;
}

#revenues .rev-filters .date-input:focus {
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 2px rgba(var(--theme-accent-rgb), 0.2);
}

/* Status filter dropdown button */
/* @DEPRECATED — status toggle now uses shared .cd-toggle styles */

/* --- REVENUES: Stats formula strip --- */
.rev-stats-formula {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 0.75rem;
    padding-top: 0.5rem;
}

.rev-stat-card {
    background: var(--theme-card);
    border-radius: 6px;
    padding: 0.5rem 0.7rem;
    text-align: center;
    border-left: 3px solid transparent;
    transition: background 0.2s;
    flex: 1 1 auto;
    min-width: 0;
}

.rev-stat-card:hover {
    background: #1e3a24;
}

.rev-stat-card--result {
    border-left-width: 4px;
    background: #1a3322;
}

.rev-stat-card--green  { border-left-color: var(--theme-accent); }
.rev-stat-card--blue   { border-left-color: #3b82f6; }
.rev-stat-card--amber  { border-left-color: #f59e0b; }
.rev-stat-card--cyan   { border-left-color: #06b6d4; }
.rev-stat-card--purple { border-left-color: #8b5cf6; }
.rev-stat-card--red    { border-left-color: #ef4444; }

.rev-stat-separator {
    flex-shrink: 0;
    width: 1rem;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 300;
    color: #4b5563;
    line-height: 1;
    user-select: none;
}

.rev-stat-separator ~ .rev-stat-card + .rev-stat-card {
    margin-left: 0.5rem;
}

.rev-stat-operator {
    flex-shrink: 0;
    width: 1.5rem;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: #9ca3af;
    line-height: 1;
    user-select: none;
}

.rev-stat-operator--minus { color: #f59e0b; }
.rev-stat-operator--plus  { color: var(--theme-accent); }

.rev-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 0.15rem;
    font-weight: 500;
    white-space: nowrap;
}

.rev-stat-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e2e8f0;
}

/* --- REVENUES: Header bar --- */
.rev-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    /* border-bottom: 1px solid rgba(var(--theme-accent-rgb), 0.15); */
}

.rev-header .card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.rev-report-btns {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.rev-report-label {
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    margin-right: 0.25rem;
}

.rev-header .btn-sm {
    padding: 0.2rem 0.5rem;
    font-size: 0.72rem;
    border-radius: 3px;
}

#selectedDateRange {
    font-size: 0.78rem;
    color: #94a3b8;
}

/* --- REVENUES: Search bar --- */
#revenues .search-bar {
    margin-bottom: 0.5rem;
}

#revenues .search-bar .form-input {
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
    background: var(--theme-body);
    border: 1px solid rgba(var(--theme-accent-rgb), 0.2);
    border-radius: 3px;
}

#revenues .search-bar .form-input:focus {
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 1px rgba(var(--theme-accent-rgb), 0.1);
}

/* --- REVENUES: Table-specific overrides --- */
#revenuesTable.rev-table tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}

#revenuesTable.rev-table .status-badge {
    font-size: 0.75rem;
    padding: 0.05rem 0.3rem;
    border-radius: 3px;
}

/* --- SETTINGS MODAL: Tab bar --- */
/* @DEPRECATED stg-tabs — settings modal now uses mt-tab-bar/mt-tab from maintab-modal */
#settingsModal .stg-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 0;
    border-bottom: 2px solid rgba(var(--theme-accent-rgb), 0.25);
    background: transparent;
}

#settingsModal .stg-tabs .tab-btn {
    font-size: 0.78rem;
    padding: 0.6rem 1rem;
    border: 2px solid rgba(var(--theme-accent-rgb), 0.25);
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: #6b7280;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    background: rgba(10, 10, 10, 0.4);
    margin-bottom: -2px;
    position: relative;
}

#settingsModal .stg-tabs .tab-btn:hover {
    color: #d0d0d0;
    background: rgba(var(--theme-accent-rgb), 0.05);
    border-color: rgba(var(--theme-accent-rgb), 0.4);
    border-bottom-color: transparent;
}

#settingsModal .stg-tabs .tab-btn.active {
    color: var(--theme-accent);
    border-color: var(--theme-accent);
    border-bottom-color: #0a0a0a;
    background: #0a0a0a;
    font-weight: 600;
}

/* @DEPRECATED stg-form styles — settings modal now uses maintab-modal base styles */

/* @DEPRECATED stg-section-title — replaced by mt-section-title in maintab-modal */

/* @DEPRECATED stg-box — replaced by mt-preview-box in maintab-modal */

/* --- SETTINGS MODAL: Items sub-tabs compact --- */
#settingsModal .items-subtabs {
    gap: 0.5rem;
    padding: 0.6rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(var(--theme-accent-rgb), 0.2);
}

#settingsModal .items-subtab-btn {
    min-height: 60px;
    padding: 0.6rem 0.5rem;
    border-width: 1px;
    border-radius: 5px;
}

#settingsModal .subtab-icon {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
}

#settingsModal .subtab-label {
    font-size: 0.8rem;
}

/* ============================================================
   SETTINGS MODAL V2 DEEP REDESIGN — Tab Content Enhancements
   ============================================================ */

/* --- Section containers: override heavy inline borders --- */
#settingsModal .stg-section {
    border: 1px solid rgba(var(--theme-accent-rgb), 0.15) !important;
    border-radius: 5px !important;
    padding: 0.85rem !important;
    margin-bottom: 0.85rem !important;
    background: rgba(var(--theme-card-rgb), 0.4) !important;
}

/* --- Section dividers: match org modal mt-section style --- */
#settingsModal .stg-divider {
    border: none !important;
    border-bottom: 1px solid #333 !important;
    margin-bottom: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

/* --- Section header + button layout --- */
#settingsModal .stg-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
    gap: 0.5rem;
}

/* --- Compact buttons inside settings --- */
#settingsModal .stg-btn {
    padding: 0.25rem 0.6rem !important;
    font-size: 0.7rem !important;
    border-radius: 3px !important;
    font-weight: 500 !important;
    white-space: nowrap;
}

/* @DEPRECATED stg-info — replaced by mt-preview-box in maintab-modal */

/* @DEPRECATED stg-grid-2/3 — replaced by mt-grid-2/3 in maintab-modal */

/* --- Inline form with label + input on same row --- */
#settingsModal .stg-inline-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

#settingsModal .stg-inline-field label {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
    min-width: fit-content;
}

#settingsModal .stg-inline-field .form-input {
    max-width: 200px;
}

/* --- Checkbox styling in settings --- */
#settingsModal .stg-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
}

#settingsModal .stg-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--theme-accent);
}

#settingsModal .stg-checkbox label {
    font-size: 0.75rem;
    color: #e2e8f0;
    cursor: pointer;
    margin: 0;
}

/* --- Tooltip overrides for settings --- */
#settingsModal .stg-tooltip {
    background: var(--theme-card) !important;
    border: 1px solid rgba(var(--theme-accent-rgb), 0.3) !important;
    border-radius: 5px !important;
    padding: 0.6rem 0.75rem !important;
    font-size: 0.72rem !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
    max-width: 300px !important;
}

/* --- Data tables inside settings --- */
#settingsModal .data-table {
    border: none;
    border-radius: 4px;
    overflow: hidden;
}

#settingsModal .data-table th {
    background: var(--theme-card);
    color: var(--theme-accent);
    font-size: 0.68rem;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--theme-accent);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

#settingsModal .data-table td {
    font-size: 0.75rem;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid rgba(var(--theme-accent-rgb), 0.08);
}

#settingsModal .data-table tbody tr:hover {
    background: rgba(var(--theme-accent-rgb), 0.05);
}

/* --- Card grid items (tables, packages, etc.) --- */
#settingsModal .stg-card {
    background: rgba(var(--theme-card-rgb), 0.4);
    border: 1px solid rgba(var(--theme-accent-rgb), 0.15);
    border-radius: 5px;
    padding: 0.65rem 0.75rem;
    transition: border-color 0.15s;
    cursor: pointer;
}

#settingsModal .stg-card:hover {
    border-color: rgba(var(--theme-accent-rgb), 0.4);
    background: rgba(var(--theme-card-rgb), 0.6);
}

/* --- Preview/status badges --- */
#settingsModal .stg-badge {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

#settingsModal .stg-badge--active {
    background: rgba(var(--theme-accent-rgb), 0.15);
    color: var(--theme-accent);
    border: 1px solid rgba(var(--theme-accent-rgb), 0.3);
}

#settingsModal .stg-badge--inactive {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

/* Settings modal header/footer now use maintab-modal base styles (matching org modal) */

/* --- Tab content spacing --- */
#settingsModal .mt-tab-content {
    padding-top: 0.75rem;
}
#settingsModal .modal-body {
    scrollbar-width: none;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}
#settingsModal .modal-body::-webkit-scrollbar {
    display: none;
}
#settingsModal .modal-body > .mt-tab-bar {
    flex-shrink: 0;
}
/* Non-items tabs: scroll normally */
#settingsModal .modal-body > .mt-tab-content.active {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Point of Sale tab — 3-panel fills available modal height without scrolling */
#settingsModal .modal-body > .mt-tab-content#items.active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#settingsModal #itemsContent {
    flex: 1;
    min-height: 0;
    flex-direction: column;
}
#settingsModal #itemsInventory.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* Menu tab — 3-panel fills available modal height without scrolling (same as POS) */
#settingsModal .modal-body > .mt-tab-content#menu.active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#settingsModal #menuContent {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
}
#settingsModal .mt-tab-content#menu {
    padding-top: 0;
}

/* @DEPRECATED stg-form select — class removed from HTML */

/* --- Help text and descriptions --- */
#settingsModal .stg-help {
    font-size: 0.68rem;
    color: #6b7280;
    margin-top: 0.2rem;
    line-height: 1.4;
}

/* --- Color-accent section variants --- */
#settingsModal .stg-section--amber {
    border-color: rgba(245, 158, 11, 0.2) !important;
}

#settingsModal .stg-section--purple {
    border-color: rgba(139, 92, 246, 0.2) !important;
}

#settingsModal .stg-section--cyan {
    border-color: rgba(6, 182, 212, 0.2) !important;
}

/* --- Settings modal: 11 tabs in single row, no wrap, no scroll --- */
#settingsModal .mt-tab-bar {
    flex-wrap: nowrap;
    gap: 0;
}

#settingsModal .mt-tab {
    font-size: 0.72rem;
    padding: 0.4rem 0.5rem;
    flex: 0 0 auto;
    text-align: center;
    white-space: nowrap;
}

/* --- Lighting test buttons grid --- */
#settingsModal .stg-test-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

/* --- Responsive adjustments --- */
@media (max-width: 768px) {
    .rev-stats-strip {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    .rev-stat-value {
        font-size: 0.95rem;
    }
    #settingsModal .mt-tab {
        font-size: 0.65rem;
        padding: 0.3rem 0.45rem;
    }
    /* stg-grid-2/3 replaced by mt-grid-2/3 — responsive handled by maintab-modal base */
}

/* ── Membership Discounts Accordion ── */
.md-accordion-card {
    background: var(--theme-card);
    border: 1px solid rgba(var(--theme-accent-rgb), 0.2);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    transition: border-color 0.15s;
}
.md-accordion-card:hover { border-color: var(--theme-accent); }
.md-accordion-card.md-orphaned { background: #2d1b1b; border-color: #ef4444; }
.md-accordion-card.md-orphaned:hover { border-color: #ef4444; }

.md-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    gap: 0.5rem;
    user-select: none;
}
.md-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}
.md-header-right {
    display: flex;
    gap: 0.3rem;
    flex-shrink: 0;
}
.md-chevron {
    font-size: 0.7rem;
    color: #6b7280;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.md-plan-name {
    font-size: 0.85rem;
    font-weight: 600;
}
.md-badge {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.md-badge-active { background: rgba(var(--theme-accent-rgb),0.15); color: var(--theme-accent); }
.md-badge-inactive { background: rgba(107,114,128,0.2); color: #6b7280; }

.md-summary-chips {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    margin-left: 0.25rem;
}
.md-chip {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 1px 5px;
    border: 1px solid;
    border-radius: 3px;
    white-space: nowrap;
}

/* Accordion body */
.md-accordion-body {
    padding: 0 0.8rem 0.8rem;
    border-top: 1px solid rgba(var(--theme-accent-rgb), 0.25);
}
.md-section-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0.8rem 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.md-line-discounts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}
.md-line-discount-card {
    border: 1px solid;
    border-radius: 6px;
    padding: 0.5rem 0.6rem;
    background: rgba(0,0,0,0.2);
}
.md-ldc-header {
    font-weight: 600;
    font-size: 0.65rem;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.md-ldc-value {
    color: #f0f0f0;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}
.md-ldc-conditions {
    font-size: 0.6rem;
    color: #9ca3af;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.md-ldc-target {
    margin-top: 0.3rem;
    font-size: 0.6rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    align-items: baseline;
}
.md-target-badge {
    font-weight: 600;
    font-size: 0.6rem;
}
.md-target-names {
    color: #d0d0d0;
    font-size: 0.6rem;
    word-break: break-word;
}

/* Additional discount card */
.md-additional-discount-card {
    border: 1px solid #eab308;
    border-radius: 6px;
    padding: 0.5rem 0.6rem;
    background: rgba(234,179,8,0.05);
}
.md-add-value {
    color: #eab308;
    font-size: 0.85rem;
    font-weight: 600;
}
.md-calc-info {
    margin-top: 0.6rem;
    font-size: 0.65rem;
    color: #6b7280;
    padding: 0.4rem 0.5rem;
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.06);
}

@media (max-width: 768px) {
    .md-line-discounts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .md-summary-chips { display: none; }
}

/* ── Membership Discounts Compact Row ── */
.md-row {
    background: var(--theme-card);
    border: 1px solid rgba(var(--theme-accent-rgb), 0.25);
    border-radius: 5px;
    margin-bottom: 0.35rem;
    transition: border-color 0.15s;
}
.md-row:hover { border-color: var(--theme-accent); }
.md-row--orphaned { background: #2d1b1b; border-color: #ef4444; }
.md-row--orphaned:hover { border-color: #ef4444; }

.md-row-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
}

.md-name {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 130px;
    flex-shrink: 0;
}
.md-name-text {
    font-size: 0.82rem;
    font-weight: 600;
    color: #f0f0f0;
    white-space: nowrap;
}
.md-name--orphaned { color: #ef4444; }

.md-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.md-dot--active { background: var(--theme-accent); }
.md-dot--inactive { background: #6b7280; }

.md-tags {
    display: flex;
    gap: 0.4rem;
    flex: 1;
    flex-wrap: wrap;
}
.md-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.72rem;
    white-space: nowrap;
}
.md-tag-label {
    font-weight: 500;
    opacity: 0.8;
}
.md-tag-val {
    font-weight: 700;
}
.md-tag--countup  { background: rgba(var(--theme-accent-rgb),0.1);  color: var(--theme-accent); }
.md-tag--countdown { background: rgba(59,130,246,0.1); color: #3b82f6; }
.md-tag--items    { background: rgba(249,115,22,0.1); color: #f97316; }
.md-tag--credit   { background: rgba(139,92,246,0.1); color: #8b5cf6; }

.md-actions {
    display: flex;
    gap: 0.3rem;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .md-row-inner { flex-wrap: wrap; }
    .md-name { min-width: auto; width: 100%; }
    .md-tags { width: 100%; }
}

/* Membership discount modal targeting controls */
.md-radio-label,
.md-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: #d0d0d0;
    cursor: pointer;
    padding: 0.1rem 0;
}
.md-radio-label:hover,
.md-checkbox-label:hover { color: #f0f0f0; }
.md-checkbox-label {
    padding: 0.15rem 0;
}

/* ── Settings 2-Column Layout ── */
/* @DEPRECATED stg-2col - replaced by mt-grid-2 in maintab-modal */
.stg-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
}
.stg-2col > .stg-full { grid-column: 1 / -1; }
.maintab-modal .mt-full { grid-column: 1 / -1; }

/* ── Settings Card Grid (POS Categories, etc.) ── */
.stg-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
}
.stg-mini-card {
    background: var(--theme-card);
    border: 1px solid rgba(var(--theme-accent-rgb), 0.25);
    border-radius: 6px;
    padding: 0.5rem 0.6rem;
    transition: border-color 0.15s;
}
.stg-mini-card:hover { border-color: var(--theme-accent); }
.stg-mini-card--inactive { opacity: 0.55; }

/* POS Keyboard Navigation Badges */
.pos-kb-badge {
    position: absolute;
    top: -6px;
    left: -6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f59e0b;
    color: #0a1a0d;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    animation: posKbBadgeFadeIn 0.15s ease-out;
}
@keyframes posKbBadgeFadeIn {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}
.pos-kb-mode-indicator {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 0.4rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}
.pos-kb-page-hint {
    font-size: 0.65rem;
    color: #888;
    text-align: center;
    margin-top: 0.3rem;
}

/* ============================================
   Organization Modal — Tabbed Compact Layout
   ============================================ */

/* Tab bar */
/* ============================================
   Shared Tab Bar Styles (used by org + center modals)
   ============================================ */
.maintab-modal .mt-tab-bar {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 1rem;
    position: sticky;
    top: 0;
    background: var(--theme-body);
    z-index: 2;
    padding: 0.5rem 1.5rem 0;
    border-bottom: 1px solid #333;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    overflow: hidden;
    flex-wrap: wrap;
}

.maintab-modal .mt-tab {
    padding: 0.5rem 1.15rem;
    background: #1e2a22;
    border: 1px solid #333;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    color: #999;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
    position: relative;
    top: 1px;
}

.maintab-modal .mt-tab:hover {
    color: #ddd;
    background: #243028;
    border-color: #444;
}

.maintab-modal .mt-tab.active {
    color: var(--theme-accent);
    background: var(--theme-body);
    border-color: rgba(var(--theme-accent-rgb), 0.33);
    border-bottom: 1px solid var(--theme-body);
}

/* Tab content panels */
.maintab-modal .mt-tab-content {
    display: none;
}

.maintab-modal .mt-tab-content.active {
    display: block;
}

/* Grid layouts (org-specific aliases) */
#organizationModal .org-grid-2,
.maintab-modal .mt-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
}

#organizationModal .org-grid-3,
.maintab-modal .mt-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0 1rem;
}

#organizationModal .org-grid-4,
.maintab-modal .mt-grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 0 1rem;
}

/* ============================================
   Shared Maintab Modal Compact Styles
   ============================================ */
.maintab-modal .form-group {
    margin-bottom: 0.7rem;
}

.maintab-modal .form-group label {
    font-size: 0.88rem;
    margin-bottom: 0.3rem;
    color: #c0c0c0;
}

.maintab-modal .form-input,
.maintab-modal select.form-input,
.maintab-modal .searchable-dropdown-trigger {
    padding: 0.45rem 0.7rem;
    font-size: 0.9rem;
    height: 38px;
    box-sizing: border-box;
    line-height: 1.4;
}

.maintab-modal textarea.form-input {
    height: auto;
    min-height: 70px;
}

/* Phone input prefix select — override inline styles */
.maintab-modal .phone-input-wrapper .country-code-select {
    padding: 0.45rem 0.5rem !important;
    font-size: 0.9rem !important;
    height: 38px !important;
    box-sizing: border-box !important;
    border-radius: 4px !important;
}

.maintab-modal .phone-input-wrapper {
    align-items: center;
}

/* Shared grid layouts */
.maintab-modal .mt-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
}

.maintab-modal .mt-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0 1rem;
}

.maintab-modal .mt-grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 0 1rem;
}

/* Helper text */
.maintab-modal small {
    font-size: 0.78rem !important;
}

/* Checkbox labels */
.maintab-modal .form-group label span {
    font-size: 0.88rem;
}

/* Section titles */
.maintab-modal .mt-section-title {
    color: var(--theme-accent);
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0.5rem 0 0.7rem 0;
    padding-top: 0.7rem;
    border-top: 1px solid #333;
}

.maintab-modal .mt-section-title:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

@media (max-width: 768px) {
    .maintab-modal .mt-grid-2,
    .maintab-modal .mt-grid-3,
    .maintab-modal .mt-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Section dividers */
.maintab-modal .mt-section,
#organizationModal .org-section {
    border-bottom: 1px solid #333;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

#organizationModal .org-section-title {
    color: var(--theme-accent);
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.7rem 0;
}

/* Preview boxes */
.maintab-modal .mt-preview-box,
#organizationModal .org-preview-box {
    background: var(--theme-card);
    border: 1px solid rgba(var(--theme-accent-rgb), 0.2);
    border-radius: 5px;
    padding: 0.7rem 0.9rem;
    margin: 0.3rem 0 0.6rem 0;
    font-size: 0.85rem;
    color: #d0d0d0;
}

.maintab-modal .mt-preview-box .mt-preview-title,
#organizationModal .org-preview-box .org-preview-title {
    color: var(--theme-accent);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.3rem;
}

/* Responsive: stack grids on narrow screens */
@media (max-width: 768px) {
    #organizationModal .org-grid-2,
    #organizationModal .org-grid-3,
    #organizationModal .org-grid-4 {
        grid-template-columns: 1fr;
    }

    .maintab-modal .mt-tab-bar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .maintab-modal .mt-tab {
        font-size: 0.72rem;
        padding: 0.4rem 0.6rem;
    }
}

/* ── Inventory Tab Styles ── */
.inv-pill {
    background: transparent;
    border: 1px solid #444;
    color: #888;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-size: 0.68rem;
    cursor: pointer;
    transition: all 0.2s;
}
.inv-pill:hover {
    border-color: var(--theme-accent);
    color: var(--theme-accent);
}
.inv-pill.active {
    background: transparent;
    border-color: var(--theme-accent);
    color: var(--theme-accent);
    font-weight: 600;
}
.inv-table-row {
    display: flex;
    padding: 0.3rem 0.5rem;
    border-left: 3px solid transparent;
    border-bottom: 1px solid #2a2a2a;
    cursor: pointer;
    transition: background 0.15s;
    align-items: center;
}
.inv-table-row:hover {
    background: #222;
}
.inv-table-row.selected {
    background: rgba(var(--theme-accent-rgb), 0.1);
    border-left: 3px solid var(--theme-accent);
}

/* Inventory Tab — Fill available space in settings modal */
#settingsModal .mt-tab-content#items {
    padding-top: 0;
}
#itemsContent {
    height: 100%;
}
#itemsInventory {
    margin: -0.25rem -1rem -1rem -1rem;
    padding: 0.25rem 0.5rem 0.5rem 0.5rem;
    height: calc(100vh - 195px);
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

/* Inventory Tab — Sortable Column Headers */
.inv-sort-col {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
    position: relative;
}
.inv-sort-col:hover {
    color: var(--theme-accent);
}

/* Inventory Movement Table — Resizable Columns */
.inv-mv-col {
    flex-shrink: 0;
    position: relative;
    user-select: none;
}
.inv-mv-col::after {
    content: '';
    position: absolute;
    right: 0;
    top: 2px;
    bottom: 2px;
    width: 3px;
    cursor: col-resize;
    background: transparent;
    transition: background 0.15s;
    z-index: 1;
}
.inv-mv-col:hover::after {
    background: rgba(var(--theme-accent-rgb), 0.3);
}
.inv-mv-col.col-dragging::after {
    background: rgba(var(--theme-accent-rgb), 0.6);
}
.inv-mv-col:last-child::after {
    display: none;
}

/* Inventory Movement — Sortable Column Headers */
.inv-mv-sortable {
    user-select: none;
    transition: color 0.15s;
}
.inv-mv-sortable:hover {
    color: var(--theme-accent) !important;
}

/* Inventory Panel Resizer Dividers */
.inv-panel-divider {
    width: 5px;
    cursor: col-resize;
    background: transparent;
    flex-shrink: 0;
    transition: background 0.15s;
    position: relative;
}
.inv-panel-divider::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 2px;
    width: 1px;
    background: #333;
}
.inv-panel-divider:hover,
.inv-panel-divider.dragging {
    background: rgba(var(--theme-accent-rgb), 0.3);
}
.inv-panel-divider:hover::after,
.inv-panel-divider.dragging::after {
    background: var(--theme-accent);
}

/* Inventory Tab — Category Panel */
.inv-cat-row {
    display: flex;
    flex-direction: column;
    padding: 0.3rem 0.5rem;
    border-left: 3px solid transparent;
    border-bottom: 1px solid #2a2a2a;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}
.inv-cat-row:hover {
    background: #222;
}
.inv-cat-row.inv-cat-selected {
    background: rgba(var(--theme-accent-rgb), 0.1);
    border-left: 3px solid var(--theme-accent);
}
.inv-cat-actions {
    display: none;
    gap: 0.3rem;
    margin-top: 0.2rem;
}
.inv-cat-row:hover .inv-cat-actions,
.inv-table-row:hover .inv-cat-actions {
    display: flex;
}
.inv-cat-action-btn {
    font-size: 0.65rem;
    color: #888;
    cursor: pointer;
    padding: 0.1rem 0.25rem;
    border-radius: 3px;
    transition: all 0.15s;
}
.inv-cat-action-btn:hover {
    color: var(--theme-accent);
    background: rgba(var(--theme-accent-rgb), 0.15);
}
.inv-cat-action-del:hover {
    color: #f44336;
    background: rgba(244, 67, 54, 0.15);
}
/* Drag-to-reorder styles */
.inv-cat-drag-handle {
    opacity: 0.4;
    transition: opacity 0.15s;
}
.inv-cat-row:hover .inv-cat-drag-handle {
    opacity: 1;
}
/* ===== Mini Table Cards (Settings Modal) ===== */
/* Base card — mirrors .table-card at ~45% scale */
.mini-tc {
    background: var(--theme-body);
    border: 1px solid var(--theme-accent);
    border-radius: 5px;
    padding: 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    aspect-ratio: 176 / 200;
}
.mini-tc:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(74, 222, 128, 0.25);
}

/* Snooker theme */
.mini-tc.mt-snooker {
    background: linear-gradient(145deg, #6b4532 0%, #5c3d2e 50%, #4a3025 100%);
    border: none;
    border-radius: 5px;
    padding: 5px;
    aspect-ratio: 176 / 240;
    margin-top: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.mini-tc.mt-snooker:hover {
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
}

/* Ball badge — exact replica of .ball-badge at ~56% scale (18px vs 32px) */
/* Actual card: solid background color + inset shadows for 3D sphere */
.mini-tc .mt-ball {
    position: absolute;
    top: -9px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 9999px;
    box-shadow:
        inset -1px -1px 3px rgba(0, 0, 0, 0.4),
        inset 1px 1px 2px rgba(255, 255, 255, 0.15),
        0 1px 3px rgba(0, 0, 0, 0.4);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.3s ease;
}
.mini-tc .mt-ball span {
    color: white;
    font-size: 0.42rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}
.mini-tc:hover .mt-ball {
    box-shadow:
        inset -1px -1px 3px rgba(0, 0, 0, 0.4),
        inset 1px 1px 2px rgba(255, 255, 255, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.5),
        0 0 8px rgba(239, 68, 68, 0.6);
}

/* Pockets */
.mini-tc .mt-pocket {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: radial-gradient(circle, #0a0a0a 40%, #1a1a1a 100%);
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.8);
    z-index: 5;
}
.mini-tc .mt-p-tl { top: 2px; left: 2px; }
.mini-tc .mt-p-tr { top: 2px; right: 2px; }
.mini-tc .mt-p-bl { bottom: 2px; left: 2px; }
.mini-tc .mt-p-br { bottom: 2px; right: 2px; }
.mini-tc .mt-p-ml { top: 50%; left: 2px; transform: translateY(-50%); }
.mini-tc .mt-p-mr { top: 50%; right: 2px; transform: translateY(-50%); }

/* Felt surface */
.mini-tc .mt-felt {
    border-radius: 3px;
    height: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3px;
    gap: 1px;
}
.mini-tc .mt-felt .mt-timer {
    font-family: 'Courier New', monospace;
    font-size: 0.5rem;
    font-weight: 700;
    color: white;
}
.mini-tc .mt-felt .mt-status {
    font-size: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Pool theme */
.mini-tc.mt-pool {
    background: transparent;
    border: none;
    padding: 0;
    aspect-ratio: 176 / 200;
}
.mini-tc .mt-rail {
    border-radius: 4px;
    padding: 3px;
    height: 100%;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.mini-tc .mt-pool-felt {
    border-radius: 2px;
    height: 100%;
    padding: 3px;
    display: flex;
    flex-direction: column;
}
.mini-tc .mt-cushion {
    border-radius: 2px;
    height: 100%;
    padding: 3px;
    display: flex;
    flex-direction: column;
    text-align: center;
    justify-content: center;
    align-items: center;
    gap: 1px;
}
.mini-tc .mt-table-name {
    font-size: 0.45rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    margin-bottom: 2px;
}

/* Pool-square theme — square aspect ratio */
.mini-tc.mt-pool-square {
    background: #111b14;
    border: 1px solid rgba(var(--theme-accent-rgb), 0.25);
    padding: 0;
    display: flex;
    flex-direction: column;
    aspect-ratio: 1 / 1;
}
.mini-tc .mt-title-bar {
    padding: 1px 3px;
    border-radius: 3px 3px 0 0;
    text-align: center;
}
.mini-tc .mt-title-bar .mt-table-name {
    font-size: 0.45rem;
    font-weight: 600;
}

/* Snooker-square theme — square aspect ratio */
.mini-tc.mt-snooker-square {
    background: linear-gradient(145deg, #6b4532 0%, #5c3d2e 50%, #4a3025 100%);
    border: none;
    border-radius: 5px;
    padding: 5px;
    aspect-ratio: 1 / 1;
    margin-top: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.mini-tc.mt-snooker-square:hover {
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
}

/* Access Card theme */
.mini-tc.mt-access-card {
    background: #f5f5f5;
    border: none;
    padding: 0;
    overflow: visible;
    border-radius: 6px;
    aspect-ratio: 176 / 240;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.mini-tc.mt-access-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
/* Color band at top */
.mini-tc .mt-stripes {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30%;
    z-index: 0;
    border-radius: 6px 6px 0 0;
}
/* Card body */
.mini-tc .mt-ac-inner {
    position: relative;
    z-index: 1;
    flex: 1;
    margin-top: 32%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2px 3px;
    text-align: center;
}
.mini-tc .mt-ac-name {
    font-size: 0.48rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1a1a1a;
}
.mini-tc .mt-ac-status {
    font-size: 0.35rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 2px;
}
.mini-tc .mt-ac-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    display: inline-block;
    animation: classicBlink 1.6s ease-in-out infinite;
}
/* RFID chip at bottom-left */
.mini-tc .mt-ac-bottom {
    position: relative;
    z-index: 1;
    height: 12px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 0 4px 2px;
}

/* F&B card */
.mini-tc.mt-fnb {
    background: var(--theme-card);
    border: 1px solid rgba(var(--theme-accent-rgb), 0.25);
    padding: 4px;
    aspect-ratio: 1 / 1;
}
.mini-tc.mt-fnb:hover {
    border-color: #f97316;
    box-shadow: 0 4px 10px rgba(249, 115, 22, 0.25);
}

/* Delete button — hidden by default, shown on hover */
.mini-tc .mt-delete {
    display: none;
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #dc2626;
    border: 1.5px solid #1a1a1a;
    color: white;
    font-size: 0.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.1s;
}
/* Ensure grid containers don't clip delete buttons */
#tablesList, #tableTypesList {
    overflow: visible;
}
.mini-tc .mt-delete:hover {
    transform: scale(1.15);
    background: #b91c1c;
}
.mini-tc:hover .mt-delete {
    display: flex;
}

/* Drag handle — hidden by default, shown on hover (mirrors delete button style) */
.mini-tc .mt-drag {
    display: none;
    position: absolute;
    top: -4px;
    left: -4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4b5563;
    border: 1.5px solid #1a1a1a;
    color: white;
    font-size: 0.55rem;
    line-height: 1;
    cursor: grab;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.1s, background 0.1s;
}
.mini-tc .mt-drag:hover {
    transform: scale(1.15);
    background: var(--theme-accent);
}
.mini-tc .mt-drag:active {
    cursor: grabbing;
    background: #16a34a;
}
.mini-tc:hover .mt-drag {
    display: flex;
}

/* SortableJS ghost/chosen */
.sortable-ghost-table {
    opacity: 0.3;
    background: #1a3a1a !important;
    border: 1px dashed var(--theme-accent) !important;
}
.sortable-chosen-table {
    box-shadow: 0 4px 12px rgba(var(--theme-accent-rgb), 0.3) !important;
    border-color: var(--theme-accent) !important;
}
.inv-cat-drag-ghost {
    opacity: 0.4;
    background: #1a3a1a !important;
    border-left: 3px solid var(--theme-accent) !important;
}
.menu-sort-ghost {
    opacity: 0.4;
    background: #1a3a1a !important;
    border-radius: 4px;
}
.inv-cat-drag-chosen {
    background: #1e3a1e !important;
}
.inv-cat-drag-active {
    opacity: 0.8;
    box-shadow: 0 2px 8px rgba(var(--theme-accent-rgb), 0.3);
}
/* Item drag handle */
.inv-item-drag-handle {
    cursor: grab;
    color: #555;
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    transition: color 0.15s;
}
.inv-item-drag-handle:hover {
    color: var(--theme-accent);
}
.inv-item-drag-handle:active {
    cursor: grabbing;
}
/* Grid view styles */
.inv-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.35rem;
    padding: 0.35rem;
}
.inv-grid-card {
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 0.4rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
    position: relative;
}
.inv-grid-card:hover {
    border-color: var(--theme-accent);
    background: #1e2e1e;
}
.inv-grid-card.inv-grid-selected {
    border-color: var(--theme-accent);
    background: #1a3a1a;
    box-shadow: 0 0 6px rgba(var(--theme-accent-rgb), 0.25);
}
.inv-grid-card-name {
    font-size: 0.68rem;
    color: #fff;
    font-weight: 500;
    margin-bottom: 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}
.inv-grid-card-price {
    font-size: 0.65rem;
    color: var(--theme-accent);
    font-weight: 600;
}
.inv-grid-card-stock {
    font-size: 0.6rem;
    margin-top: 0.1rem;
}
.inv-grid-card-action {
    position: absolute;
    bottom: 6px;
    display: none;
    cursor: pointer;
    font-size: 0.65rem;
    color: #888;
    padding: 0.1rem 0.25rem;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
}
.inv-grid-card:hover .inv-grid-card-action {
    display: flex;
}
.inv-grid-card-action-edit {
    left: 6px;
}
.inv-grid-card-action-edit:hover {
    color: var(--theme-accent);
    background: rgba(var(--theme-accent-rgb), 0.15);
}
.inv-grid-card-action-del {
    right: 6px;
}
.inv-grid-card-action-del:hover {
    color: #f44336;
    background: rgba(244, 67, 54, 0.15);
}
.inv-grid-card > .inv-item-drag-handle {
    position: absolute;
    top: 2px;
    left: 3px;
    font-size: 0.6rem;
    display: none;
}
.inv-grid-card:hover > .inv-item-drag-handle {
    display: flex;
}

/* New invoice line flash highlight */
@keyframes newLineFlash {
    0%   { background: rgba(var(--theme-accent-rgb), 0.25); }
    100% { background: transparent; }
}
tr.new-line-flash > td {
    animation: newLineFlash 1.5s ease-out forwards;
}

