/* ==================== CSS Variables ==================== */
:root {
    /* Gym brand — light theme defaults */
    --primary-color: #0284c7;
    --primary-dark: #0c1929;
    --primary-light: #38bdf8;
    --primary-gradient: linear-gradient(135deg, #38bdf8 0%, #0c1929 72%, #f97316 100%);
    --primary-glow: 0 0 20px rgba(2, 132, 199, 0.25);
    --gym-accent: #ea580c;
    --gym-accent-light: #fb923c;
    --gym-energy: #16a34a;

    /* Secondary Colors */
    --secondary-color: #22c55e;
    --accent-color: #f97316;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --success-color: #10b981;
    --info-color: #38bdf8;
    --purple-color: #8b5cf6;
    --pink-color: #ec4899;
    --cyan-color: #06b6d4;

    /* Background Colors - Light Theme (default) */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-input: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.84);

    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    /* Border Colors */
    --border-color: rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.12);
    --border-focus: rgba(2, 132, 199, 0.45);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 24px rgba(15, 23, 42, 0.1);
    --shadow-xl: 0 24px 48px rgba(15, 23, 42, 0.12);
    --shadow-glow: 0 0 40px rgba(2, 132, 199, 0.1);
    --shadow-card: 0 4px 20px rgba(15, 23, 42, 0.08);

    /* Layout */
    --sidebar-width: 320px;
    --sidebar-collapsed: 72px;
    --header-height: 68px;

    /* Motion */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.45s ease;
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 999px;
}

/* ==================== Dark Theme ==================== */
[data-theme="dark"] {
    --primary-color: #38bdf8;
    --primary-light: #7dd3fc;
    --primary-glow: 0 0 20px rgba(56, 189, 248, 0.35);

    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --bg-card-hover: #263548;
    --bg-input: #334155;
    --bg-glass: rgba(15, 23, 42, 0.8);

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --border-color: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.14);
    --border-focus: rgba(56, 189, 248, 0.5);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.24);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.28);
    --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 40px rgba(56, 189, 248, 0.15);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 1px rgba(255, 255, 255, 0.1);
}

/* ==================== Light Theme ==================== */
[data-theme="light"] {
    --primary-color: #0284c7;
    --primary-dark: #0c1929;
    --primary-light: #38bdf8;
    --primary-gradient: linear-gradient(135deg, #38bdf8 0%, #0c1929 72%, #f97316 100%);
    --primary-glow: 0 0 20px rgba(2, 132, 199, 0.25);
    --gym-accent: #ea580c;
    --gym-accent-light: #fb923c;
    --gym-energy: #16a34a;

    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-input: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.84);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --border-color: rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.12);
    --border-focus: rgba(2, 132, 199, 0.45);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 24px rgba(15, 23, 42, 0.1);
    --shadow-xl: 0 24px 48px rgba(15, 23, 42, 0.12);
    --shadow-glow: 0 0 40px rgba(2, 132, 199, 0.1);
    --shadow-card: 0 4px 20px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .sidebar-nav li a:hover {
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary-color);
}

[data-theme="light"] .main-header {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .stat-card {
    background: #ffffff;
}

[data-theme="light"] .form-control {
    border-color: rgba(0, 0, 0, 0.12);
    color: #1e293b;
}

[data-theme="light"] .form-control:focus {
    border-color: var(--primary-color);
}

[data-theme="light"] .btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

[data-theme="light"] table thead {
    background: #f8fafc;
}

[data-theme="light"] table tbody tr {
    border-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] table tbody tr:hover {
    background: #f8fafc;
}

[data-theme="light"] .modal {
    background: #ffffff;
}

[data-theme="light"] .dropdown-menu {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .dropdown-item:hover {
    background: #f8fafc;
}

[data-theme="light"] .login-right {
    background: #ffffff;
}

[data-theme="light"] .login-form-container {
    background: #ffffff;
}

[data-theme="light"] .company-logo-img,
[data-theme="light"] .footer-company-logo {
    filter: none;
}

/* Splash always has dark background — keep logo inverted regardless of theme */
.splash-company-logo {
    filter: brightness(0) invert(1) !important;
}

.activation-company-logo {
    filter: brightness(0) invert(1);
}

[data-theme="light"] .activation-company-logo {
    filter: none;
}

[data-theme="light"] .activation-right {
    background: #ffffff;
}

/* ==================== Reset & Base ==================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ==================== Global Custom Scrollbars ==================== */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.22) transparent;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 9999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.35);
    background-clip: padding-box;
}

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

[data-theme="dark"] *,
html.dark-theme *,
body.dark-theme * {
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb,
html.dark-theme ::-webkit-scrollbar-thumb,
body.dark-theme ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid transparent;
    background-clip: padding-box;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover,
html.dark-theme ::-webkit-scrollbar-thumb:hover,
body.dark-theme ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.38);
    background-clip: padding-box;
}

/* ==================== Login Page ==================== */
/* ==================== Activation Page ==================== */
.activation-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 20px;
}

.activation-container {
    display: flex;
    width: 100%;
    max-width: 1180px;
    min-height: 520px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl), 0 0 80px rgba(96, 165, 250, 0.1);
    border: 1px solid var(--border-color);
}

.activation-left {
    flex: 1;
    background: linear-gradient(160deg, #e0f2fe 0%, #f8fafc 50%, #e2e8f0 100%);
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    max-width: 380px;
}

.activation-left::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.1) 0%, transparent 70%);
    top: 20%;
    left: 30%;
    transform: translate(-50%, -50%);
    animation: loginGlow 8s ease-in-out infinite alternate;
}

.activation-brand {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-bottom: 16px;
}

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

[data-theme="dark"] .activation-left {
    background: linear-gradient(160deg, #0f172a 0%, #1e293b 40%, #0f172a 100%);
}

[data-theme="dark"] .activation-brand p {
    color: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .activation-feature-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

.activation-features {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activation-feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    border: 1px solid rgba(15, 23, 42, 0.08);
    transition: all var(--transition-normal);
}

.activation-feature-item:hover {
    background: rgba(255, 255, 255, 0.92);
    transform: translateY(-2px);
    border-color: rgba(2, 132, 199, 0.22);
}

[data-theme="dark"] .activation-feature-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(96, 165, 250, 0.2);
}

.activation-right {
    flex: 1;
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: visible;
}

.activation-form-container {
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
}

.activation-preferences {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.activation-features .feature-icon i {
    font-size: 15px;
    color: var(--primary-light);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(96, 165, 250, 0.12);
}

.activation-feature-item .feature-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.activation-feature-item .feature-desc {
    display: block;
    font-size: 11px;
    line-height: 1.45;
    color: var(--text-muted);
    margin-top: 2px;
}

[data-theme="dark"] .activation-feature-item .feature-title {
    color: #fff;
}

[data-theme="dark"] .activation-feature-item .feature-desc {
    color: rgba(255, 255, 255, 0.72);
}

.activation-page .form-group label i {
    width: 18px;
    text-align: center;
    color: var(--primary-light);
    margin-inline-end: 6px;
}

.activation-header {
    text-align: center;
    margin-bottom: 16px;
}

.activation-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.activation-header h2 i {
    color: var(--primary-light);
}

.activation-logo {
    width: auto;
    height: auto;
    max-width: 220px;
    background: transparent;
    border-radius: 0;
    border: none;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.device-id-section {
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
}

.device-id-section label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.device-id-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.device-id-box code {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--primary-light);
    word-break: break-all;
    direction: ltr;
    text-align: left;
}

.device-id-box .copy-btn {
    background: var(--primary-color);
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: #fff;
    cursor: pointer;
    transition: var(--transition-fast);
}

.device-id-box .copy-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.device-id-section small {
    display: block;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.device-id-section small.device-note {
    background: rgba(var(--warning-rgb, 255, 193, 7), 0.1);
    border: 1px solid rgba(var(--warning-rgb, 255, 193, 7), 0.3);
    border-radius: var(--radius-md);
    padding: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.device-id-section small.device-note i {
    color: var(--warning);
    margin-left: 5px;
}

.device-id-section small.device-note strong {
    color: var(--warning);
}

.activation-account-types {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.activation-account-type {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.activation-account-type.is-active {
    border-color: rgba(2, 132, 199, 0.45);
    background: rgba(2, 132, 199, 0.1);
    color: var(--primary-color);
}

.activation-page .form-group {
    margin-bottom: 20px;
}

.activation-page .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

.activation-page .form-group textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Courier New', monospace;
    resize: none;
    direction: ltr;
    text-align: left;
    transition: var(--transition-fast);
}

.activation-page .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.activation-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.activation-tab {
    flex: 1;
    min-width: 120px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
}

.activation-tab.active {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.45);
    color: var(--text-primary);
}

.activation-panel {
    display: none;
}

.activation-panel.active {
    display: block;
}

.activation-panel-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.5;
}

.activation-page .form-group input.form-control {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

@media (max-width: 900px) {
    .activation-container {
        flex-direction: column;
        max-width: 560px;
    }

    .activation-left {
        max-width: none;
        padding: 32px 28px;
    }

    .activation-right {
        padding: 32px 28px;
    }
}

.activation-page .error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger-color);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-top: 16px;
    margin-bottom: 16px;
    font-size: 14px;
    text-align: right;
    line-height: 1.6;
}

.activation-page .error-message strong {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
}

.activation-page .error-message small {
    display: block;
    opacity: 0.9;
    font-size: 12px;
    line-height: 1.7;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(239, 68, 68, 0.2);
}

.whatsapp-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.whatsapp-section p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 12px;
}

.btn-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    width: 100%;
}

.btn-whatsapp:hover {
    background: linear-gradient(135deg, #128C7E 0%, #075E54 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp i {
    font-size: 20px;
}

/* ==================== Floating contact (single blue FAB) ==================== */
.floating-contact {
    position: fixed !important;
    bottom: 24px !important;
    inset-inline-end: 24px !important;
    inset-inline-start: auto !important;
    top: auto !important;
    z-index: 11000;
    display: none;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    touch-action: none;
    user-select: none;
    pointer-events: none;
    animation: floatingContactIn 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.floating-contact.is-visible {
    display: flex !important;
}

body:has(#page-pos.active) .floating-contact,
#page-pos.active ~ .floating-contact {
    display: none !important;
    pointer-events: none !important;
}

.floating-contact-toggle {
    pointer-events: auto;
    position: relative;
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: linear-gradient(145deg, #0c4a6e 0%, #0284c7 55%, #38bdf8 100%);
    box-shadow: 0 12px 36px -10px rgba(2, 132, 199, 0.7);
    outline: 1px solid rgba(255, 255, 255, 0.22);
    transition: transform 0.2s ease, box-shadow 0.25s ease;
}

.floating-contact.is-open .floating-contact-toggle,
.floating-contact-toggle:hover {
    transform: scale(1.06);
    box-shadow: 0 14px 44px -8px rgba(2, 132, 199, 0.85);
}

.floating-contact.dragging .floating-contact-toggle {
    cursor: grabbing;
}

.floating-contact-toggle-glow {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.35);
    filter: blur(10px);
    animation: floatingContactPulse 2.4s ease-in-out infinite;
    pointer-events: none;
}

.floating-contact-toggle i {
    position: relative;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.floating-contact-icon-close {
    position: absolute;
    opacity: 0;
    transform: rotate(-45deg) scale(0.7);
}

.floating-contact.is-open .floating-contact-icon-open {
    opacity: 0;
    transform: rotate(45deg) scale(0.7);
}

.floating-contact.is-open .floating-contact-icon-close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

.floating-contact-toggle::after {
    content: attr(data-tooltip);
    position: absolute;
    inset-inline-end: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.floating-contact:not(.is-open) .floating-contact-toggle:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.floating-contact-panel {
    width: min(18.5rem, calc(100vw - 2.5rem));
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: color-mix(in srgb, var(--bg-card) 96%, transparent);
    backdrop-filter: blur(16px);
    box-shadow: 0 24px 60px -20px rgba(15, 23, 42, 0.45);
    opacity: 0;
    transform: translateY(14px) scale(0.94);
    pointer-events: none;
    transition: opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.floating-contact.is-open .floating-contact-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.floating-contact-panel-header {
    padding: 12px 16px;
    color: #fff;
    background: linear-gradient(135deg, #0c4a6e 0%, #0284c7 55%, #0369a1 100%);
}

.floating-contact-eyebrow {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(224, 242, 254, 0.95);
}

.floating-contact-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    color: #e0f2fe;
}

.floating-contact-options {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.floating-contact-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-primary);
    border-radius: 12px;
    padding: 12px;
    text-align: start;
    cursor: pointer;
    transition: background 0.18s ease;
}

.floating-contact-option:hover,
.floating-contact-option:focus-visible {
    background: color-mix(in srgb, var(--primary-color, #0284c7) 12%, transparent);
    outline: none;
}

.floating-contact-option-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.floating-contact-option-icon.is-whatsapp {
    background: rgba(37, 211, 102, 0.15);
    color: #128C7E;
}

.floating-contact-option-icon.is-call {
    background: rgba(2, 132, 199, 0.16);
    color: #0284c7;
}

.floating-contact-option-icon.is-website {
    background: color-mix(in srgb, var(--primary-color, #0284c7) 16%, transparent);
    color: var(--primary-color, #0284c7);
}

.floating-contact-option-icon.is-card {
    background: rgba(139, 92, 246, 0.16);
    color: #8b5cf6;
}

.floating-contact-option-icon.is-email {
    background: rgba(59, 130, 246, 0.16);
    color: #2563eb;
}

.floating-contact-option-icon.is-telegram {
    background: rgba(0, 136, 204, 0.16);
    color: #0088cc;
}

.floating-contact-option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.floating-contact-option-title {
    font-size: 14px;
    font-weight: 600;
}

.floating-contact-option-hint {
    font-size: 12px;
    color: var(--text-muted, #64748b);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@keyframes floatingContactPulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.08); }
}

@keyframes floatingContactIn {
    from { opacity: 0; transform: scale(0.55) translateY(18px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ==================== Website Link Button ==================== */
.btn-website {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    font-family: inherit;
    background: linear-gradient(135deg, #0f172a 0%, #0b3b7a 100%);
    color: #eff6ff;
    border: 1px solid rgba(96, 165, 250, 0.28);
    border-radius: var(--radius-full);
    padding: 0.68rem 0.98rem;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    margin-bottom: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 12px 26px rgba(2, 6, 23, 0.24);
}

.btn-website span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.btn-website i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    inline-size: 1.7rem;
    block-size: 1.7rem;
    border-radius: 50%;
    background: rgba(191, 219, 254, 0.12);
    font-size: 0.8rem;
    color: #93c5fd;
    opacity: 1;
}

.btn-website:hover {
    background: linear-gradient(135deg, #111827 0%, #1d4ed8 100%);
    color: #fff;
    border-color: rgba(147, 197, 253, 0.46);
    box-shadow: 0 16px 30px rgba(2, 6, 23, 0.32);
    transform: translateY(-1px);
}

.btn-website:hover i {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

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

.btn-website.btn-sm {
    padding: 0.58rem 0.84rem;
    font-size: 0.68rem;
    letter-spacing: 0.07em;
}

.btn-website.btn-sm i {
    inline-size: 1.5rem;
    block-size: 1.5rem;
    font-size: 0.72rem;
}

[data-theme="light"] .btn-website {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.1);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .btn-website i {
    background: rgba(15, 23, 42, 0.05);
    color: #2563eb;
}

[data-theme="light"] .btn-website:hover {
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
    color: #fff;
    border-color: rgba(96, 165, 250, 0.34);
}

[data-theme="light"] .btn-website:hover i {
    background: rgba(191, 219, 254, 0.16);
    color: #dbeafe;
}

/* ==================== Sidebar Website Link ==================== */
.sidebar-website-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    padding: 0.35rem 0.6rem;
    margin-bottom: 0.25rem;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.7) 0%, rgba(15, 59, 122, 0.58) 100%);
    color: var(--text-primary);
    font-size: 0.68rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid rgba(96, 165, 250, 0.18);
    box-shadow: 0 4px 12px rgba(2, 6, 23, 0.14);
    min-height: 28px;
}

.sidebar-website-link__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    inline-size: 1.35rem;
    block-size: 1.35rem;
    border-radius: 50%;
    background: rgba(191, 219, 254, 0.12);
    color: #93c5fd;
    flex-shrink: 0;
    font-size: 0.7rem;
}

.sidebar-website-link:hover {
    background: linear-gradient(135deg, #111827 0%, #1d4ed8 100%);
    color: #fff;
    border-color: rgba(147, 197, 253, 0.34);
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(2, 6, 23, 0.2);
}

.sidebar-website-link__content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    gap: 0;
}

.sidebar-website-link__label {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: currentColor;
    line-height: 1.2;
}

.sidebar-website-link__chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    inline-size: 1.25rem;
    block-size: 1.25rem;
    border-radius: 50%;
    color: #bfdbfe;
    border: 1px solid rgba(147, 197, 253, 0.14);
    background: rgba(191, 219, 254, 0.08);
    transition: all var(--transition-fast);
    font-size: 0.65rem;
}

.sidebar-website-link:hover .sidebar-website-link__icon,
.sidebar-website-link:hover .sidebar-website-link__chevron {
    color: #fff;
    border-color: rgba(147, 197, 253, 0.38);
    background: rgba(255, 255, 255, 0.16);
}

[data-theme="light"] .sidebar-website-link {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .sidebar-website-link__icon {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

[data-theme="light"] .sidebar-website-link__chevron {
    color: #64748b;
    border-color: rgba(15, 23, 42, 0.08);
    background: rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .sidebar-website-link:hover {
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
    color: #fff;
    border-color: rgba(96, 165, 250, 0.28);
}

.sidebar-appearance {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 2px;
}

.sidebar-appearance__label {
    display: none;
}

.sidebar-appearance__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px;
    background: var(--bg-tertiary);
    padding: 2px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.sidebar-theme-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.28rem 0.45rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar-theme-btn:hover {
    color: var(--text-primary);
}

.sidebar-theme-btn.is-active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.sidebar-theme-btn.is-active i {
    color: var(--primary-light);
}

.workspace-tabs {
    position: sticky;
    top: var(--header-height);
    z-index: 8;
    padding: 0.55rem 24px 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.workspace-tabs__scroller {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.35rem;
}

.workspace-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    flex-shrink: 0;
    transition: border-color var(--transition-fast), background var(--transition-fast);
    box-shadow: none;
}

.workspace-tab.is-active {
    border-color: rgba(96, 165, 250, 0.42);
    background: rgba(96, 165, 250, 0.1);
    box-shadow: none;
}

.workspace-tab__button,
.workspace-tab__window,
.workspace-tab__close {
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.workspace-tab__button {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.85rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.workspace-tab.is-active .workspace-tab__button {
    color: var(--text-primary);
}

.workspace-tab__button i {
    color: var(--primary-light);
}

.workspace-tab__window,
.workspace-tab__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    inline-size: 1.9rem;
    block-size: 1.9rem;
    border-radius: 50%;
    color: var(--text-muted);
}

.workspace-tab__window:hover,
.workspace-tab__close:hover {
    background: rgba(96, 165, 250, 0.16);
    color: var(--primary-color);
}

.workspace-tab__close:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #fff;
}

.detached-window .workspace-tabs {
    display: none;
}

[data-theme="light"] .sidebar-appearance__label {
    color: #64748b;
}

[data-theme="light"] .sidebar-theme-btn {
    background: #f1f5f9;
    color: #334155;
    border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .sidebar-theme-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.14);
}

[data-theme="light"] .sidebar-theme-btn.is-active {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2) 0%, #e0f2fe 100%);
    border-color: rgba(96, 165, 250, 0.45);
    color: #1e3a8a;
}

[data-theme="light"] .sidebar-theme-btn.is-active i {
    color: #2563eb;
}

[data-theme="light"] .workspace-tabs {
    background: var(--bg-primary);
}

[data-theme="light"] .workspace-tab {
    background: #f8fafc;
}

[data-theme="light"] .workspace-tab.is-active {
    background: rgba(37, 99, 235, 0.08);
}

.sidebar-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.activation-page .copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
}

.activation-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.activation-footer p {
    color: var(--text-muted);
    font-size: 13px;
}

/* ==================== Login Page ==================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 20px;
}

.login-container {
    display: flex;
    width: 100%;
    max-width: 1100px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl), 0 0 80px rgba(96, 165, 250, 0.1);
    border: 1px solid var(--border-color);
}

.login-left {
    flex: 1;
    background: linear-gradient(160deg, #e0f2fe 0%, #f8fafc 50%, #e2e8f0 100%);
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    max-width: 480px;
}

[data-theme="dark"] .login-left {
    background: linear-gradient(160deg, #0f172a 0%, #1e293b 40%, #0f172a 100%);
}

.login-left::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.1) 0%, transparent 70%);
    top: 20%;
    left: 30%;
    transform: translate(-50%, -50%);
    animation: loginGlow 8s ease-in-out infinite alternate;
}

@keyframes loginGlow {
    from { transform: translate(-50%, -50%) scale(0.9); opacity: 0.5; }
    to { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.login-brand {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-bottom: 28px;
}

.login-logo {
    width: auto;
    height: auto;
    max-width: 220px;
    background: transparent;
    backdrop-filter: none;
    border-radius: 0;
    border: none;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo i {
    font-size: 48px;
    color: var(--primary-color);
}

.login-brand h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

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

[data-theme="dark"] .login-logo i {
    color: white;
}

[data-theme="dark"] .login-brand h1 {
    color: white;
}

[data-theme="dark"] .login-brand p {
    color: rgba(255, 255, 255, 0.8);
}

.login-features {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    border: 1px solid rgba(15, 23, 42, 0.08);
    transition: all var(--transition-normal);
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.92);
    transform: translateY(-2px);
    border-color: rgba(2, 132, 199, 0.22);
}

[data-theme="dark"] .feature-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .feature-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(96, 165, 250, 0.2);
}

.feature-icon {
    flex-shrink: 0;
}

.feature-icon i {
    font-size: 15px;
    color: var(--primary-light);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(96, 165, 250, 0.12);
    border-radius: var(--radius-sm);
}

.feature-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.feature-title {
    color: var(--text-primary);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
}

.feature-desc {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
}

[data-theme="dark"] .feature-title {
    color: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .feature-desc {
    color: rgba(255, 255, 255, 0.5);
}

.login-right {
    flex: 1;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-form-container {
    max-width: 380px;
    width: 100%;
    margin: 0 auto;
}

.login-preferences {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
}

.login-preferences__appearance {
    display: flex;
    align-items: center;
    gap: 6px;
}

.login-theme-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.login-theme-btn:hover {
    color: var(--primary-color);
    border-color: rgba(96, 165, 250, 0.35);
}

.login-theme-btn.is-active {
    color: var(--primary-color);
    border-color: rgba(96, 165, 250, 0.45);
    background: rgba(96, 165, 250, 0.12);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.login-header h2 i {
    color: var(--primary-light);
}

.login-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

.login-form .form-group {
    margin-bottom: 24px;
}

.login-error {
    padding: 14px 18px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--danger-color);
    border-radius: var(--radius-md);
    color: var(--danger-color);
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-error::before {
    content: '\f071';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.login-error.is-loading {
    background: rgba(59, 130, 246, 0.12);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.login-error.is-loading::before {
    content: '\f110';
    animation: fa-spin 1s linear infinite;
}

.login-form .form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-primary);
}

.login-form .form-group label i {
    color: var(--primary-light);
    font-size: 14px;
}

.password-input {
    position: relative;
}

.password-input .form-control {
    padding-right: 50px;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: color var(--transition-fast);
}

.password-toggle:hover {
    color: var(--primary-light);
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.forgot-password {
    color: var(--primary-light);
    text-decoration: none;
    font-size: 14px;
    transition: color var(--transition-fast);
}

.forgot-password:hover {
    color: var(--primary-color);
}

.btn-block {
    width: 100%;
    padding: 16px;
    font-size: 16px;
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    color: var(--text-muted);
    font-size: 13px;
}

.login-footer strong {
    color: var(--text-secondary);
}

/* User Dropdown */
.user-dropdown {
    position: relative;
    z-index: 1001;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.user-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}

.user-btn .user-name {
    font-weight: 500;
    font-size: 14px;
}

.user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.user-details .user-role {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

.user-btn .fa-chevron-down {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
    margin-left: 4px;
}

.user-dropdown.active .fa-chevron-down {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
    z-index: 1002;
    padding: 8px 0;
    overflow: hidden;
}

.user-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    border: none;
    background: transparent;
    width: 100%;
    cursor: pointer;
    font-size: 14px;
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.dropdown-item i {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.dropdown-item.logout {
    color: var(--danger-color);
}

.dropdown-item.logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

/* Responsive Login */
@media (max-width: 900px) {
    .login-container {
        flex-direction: column;
        max-width: 500px;
    }
    
    .login-left {
        padding: 40px 30px;
    }
    
    .login-features {
        grid-template-columns: 1fr;
    }
    
    .login-right {
        padding: 40px 30px;
    }
}

/* RTL Support */
[dir="rtl"] {
    font-family: 'Segoe UI', 'Cairo', 'Tajawal', Tahoma, sans-serif;
}

[dir="rtl"] .sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--border-color);
}

[dir="rtl"] .main-content {
    margin-inline-start: var(--sidebar-width);
}

[dir="rtl"] .sidebar-nav li a i {
    margin-right: 0;
    margin-left: 12px;
}

[dir="rtl"] .modal {
    direction: rtl;
}

[dir="rtl"] .form-group label {
    text-align: right;
}

[dir="rtl"] .btn i {
    margin-right: 0;
    margin-left: 8px;
}

[dir="rtl"] .stat-card .stat-icon {
    right: auto;
    left: 20px;
}

[dir="rtl"] .toast {
    right: auto;
    left: 20px;
    animation: slideInLeft 0.3s ease;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== App Container ==================== */
.app-container {
    display: flex;
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

/* ==================== Sidebar ==================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, rgba(12, 25, 41, 0.98) 100%);
    border-right: 1px solid var(--border-color);
    border-inline-end: 3px solid transparent;
    border-image: linear-gradient(180deg, var(--gym-accent) 0%, var(--primary-color) 45%, var(--gym-energy) 100%) 1;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width var(--transition-normal);
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.sidebar-header {
    padding: 18px 16px 16px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(160deg, rgba(2, 132, 199, 0.12) 0%, rgba(15, 23, 42, 0.04) 55%, rgba(249, 115, 22, 0.08) 100%);
    position: relative;
}

.sidebar-header::after {
    content: '';
    position: absolute;
    inset-inline: 14px;
    bottom: 0;
    height: 2px;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary-color), var(--gym-accent));
    opacity: 0.65;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0;
    width: 100%;
    min-width: 0;
    margin: 0 auto;
}

.logo-text {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.01em;
    text-transform: none;
    margin-top: 0;
    text-align: center;
    line-height: 1.25;
    opacity: 1;
    max-width: 100%;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[lang="ar"] .logo-text,
html[lang="ar"] .logo-text {
    font-size: 10px;
    letter-spacing: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar {
    width: 3px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: var(--radius-full);
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin: 2px 10px;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.sidebar-nav li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary-color);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    transition: height var(--transition-normal);
}

.sidebar-nav li a i {
    font-size: 17px;
    width: 24px;
    margin-right: 12px;
    text-align: center;
    transition: all var(--transition-normal);
}

.sidebar-nav li a span {
    font-weight: 500;
    font-size: 13.5px;
}

.sidebar-nav li a:hover {
    color: var(--text-primary);
    background: rgba(96, 165, 250, 0.08);
}

.sidebar-nav li a:hover::before {
    height: 60%;
}

.sidebar-nav li a:hover i {
    color: var(--primary-color);
}

.sidebar-nav li.active a {
    color: var(--primary-color);
    background: rgba(96, 165, 250, 0.12);
    font-weight: 600;
}

.sidebar-nav li.active a::before {
    height: 70%;
    background: var(--primary-color);
}

.sidebar-nav li.active a i {
    color: var(--primary-color);
}

/* Sidebar Section Labels */
.nav-section-label {
    padding: 8px 14px 2px;
    margin: 4px 10px 0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    opacity: 0.5;
    pointer-events: none;
    list-style: none;
    border-top: 1px solid var(--border-color);
}

.sidebar-nav ul > .nav-section-label:first-of-type {
    border-top: none;
    margin-top: 0;
}

.sidebar-footer {
    padding: 6px 10px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.lang-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 3px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-weight: 600;
    font-size: 11px;
}

.lang-toggle i {
    font-size: 14px;
    color: var(--primary-color);
}

.lang-toggle:hover {
    background: rgba(96, 165, 250, 0.1);
    border-color: rgba(96, 165, 250, 0.3);
    color: var(--primary-color);
}

/* ==================== Main Content ==================== */
.main-content {
    flex: 1;
    margin-inline-start: var(--sidebar-width);
    height: 100vh;
    min-height: 0;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
}

/* ==================== Header ==================== */
.main-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    min-height: var(--header-height);
    background: rgba(12, 25, 41, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    border-bottom-color: rgba(249, 115, 22, 0.22);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    z-index: 100;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04), 0 4px 24px rgba(12, 25, 41, 0.18);
}

[data-theme="light"] .main-header {
    border-bottom-color: rgba(249, 115, 22, 0.18);
}

.menu-toggle {
    display: none;
    padding: 12px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 22px;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.menu-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--primary-light);
}

.header-search {
    flex: 1 1 220px;
    max-width: 420px;
    min-width: 180px;
    position: relative;
}

.header-search i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    transition: color var(--transition-fast);
}

[dir="rtl"] .header-search i {
    left: auto;
    right: 18px;
}

.header-search input {
    width: 100%;
    padding: 14px 18px 14px 48px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-normal);
}

[dir="rtl"] .header-search input {
    padding: 14px 48px 14px 18px;
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.15), var(--shadow-md);
    background: var(--bg-card);
}

.header-search:focus-within i {
    color: var(--primary-light);
}

.header-search input::placeholder {
    color: var(--text-muted);
}

.main-header .header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-inline-start: auto;
    flex-shrink: 0;
}

.notification-btn {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.notification-btn:hover {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--primary-glow);
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
}

.user-info i {
    font-size: 24px;
    color: var(--primary-color);
}

/* ==================== Page Content ==================== */
.page-content {
    flex: 1 1 auto;
    padding: 16px 20px 20px;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.page {
    display: none;
}

.page:not(.active) {
    display: none !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.page.active {
    display: block;
    min-height: 0;
    visibility: visible;
    pointer-events: auto;
    animation: fadeIn 0.3s ease;
}

.header-branch-context {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 42px;
    padding: 0.5rem 0.85rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    max-width: 220px;
}

.header-branch-context i {
    color: var(--primary-light);
}

.header-branch-copy {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.header-branch-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.header-branch-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-branch-code {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.audit-lock-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--warning-color);
}

.audit-source-btn {
    width: auto !important;
    min-width: 0;
    padding: 0 10px !important;
    gap: 6px;
}

.audit-source-btn span {
    white-space: nowrap;
}

.is-audit-locked {
    opacity: 0.92;
}

.source-row-highlight {
    background: rgba(96, 165, 250, 0.16) !important;
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.45);
    transition: background 0.25s ease, box-shadow 0.25s ease;
}

@media (max-width: 768px) {
    .header-branch-context {
        display: none;
    }

    .audit-source-btn span {
        display: none;
    }
}

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

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
    flex-direction: row;
}

.page-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-inline-start: auto;
}

.page-actions .form-control,
.page-actions select.form-control,
.page-actions input.form-control {
    width: auto;
    min-width: 150px;
    max-width: 220px;
    flex: 0 1 auto;
}

.devices-toolbar input#deviceSearch {
    min-width: 220px;
    max-width: 280px;
}

.page-title {
    font-size: 30px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
}

.page-title i {
    color: var(--primary-light);
    font-size: 26px;
}

/* ==================== Cards ==================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    color: var(--primary-light);
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 18px 24px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

/* ==================== Quick Actions ==================== */
.quick-actions-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 28px;
    border: none;
    border-radius: var(--radius-xl);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.quick-action-btn i {
    font-size: 20px;
}

.quick-action-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.quick-action-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-color: var(--primary-color);
    color: #fff;
}

.quick-action-btn.success {
    background: linear-gradient(135deg, var(--success-color), #059669);
    border-color: var(--success-color);
    color: #fff;
}

.quick-action-btn.warning {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
    border-color: var(--warning-color);
    color: #fff;
}

.quick-action-btn.info {
    background: linear-gradient(135deg, var(--info-color), #2563eb);
    border-color: var(--info-color);
    color: #fff;
}

.header-welcome {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ==================== Stats Cards ==================== */
.stats-grid,
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

/* Dashboard hub KPI grids — 6 equal columns on wide screens (≥1400px) */
.hub-cards-grid,
#page-dashboard .stats-grid.hub-cards-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}

@media (max-width: 1399px) {
    .hub-cards-grid,
    #page-dashboard .stats-grid.hub-cards-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .hub-cards-grid,
    #page-dashboard .stats-grid.hub-cards-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.stat-card {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-card);
    min-height: 0;
}

.stat-card.clickable {
    cursor: pointer;
}

.stat-card.clickable:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(96, 165, 250, 0.15);
    border-color: var(--border-light);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 50%);
    pointer-events: none;
}

.stat-card.primary::before { background: linear-gradient(90deg, var(--primary-color), var(--primary-light)); }
.stat-card.success::before { background: linear-gradient(90deg, var(--success-color), #34d399); }
.stat-card.warning::before { background: linear-gradient(90deg, var(--warning-color), #fbbf24); }
.stat-card.danger::before { background: linear-gradient(90deg, var(--danger-color), #f87171); }
.stat-card.info::before { background: linear-gradient(90deg, var(--info-color), #60a5fa); }
.stat-card.purple::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }

.stat-icon {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    font-size: 26px;
    transition: all var(--transition-normal);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
}

.stat-card.primary .stat-icon { background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(96, 165, 250, 0.1)); color: var(--primary-light); }
.stat-card.success .stat-icon { background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1)); color: #34d399; }
.stat-card.warning .stat-icon { background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1)); color: #fbbf24; }
.stat-card.danger .stat-icon { background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1)); color: #f87171; }
.stat-card.info .stat-icon { background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.1)); color: #60a5fa; }
.stat-card.purple .stat-icon { background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.1)); color: #a78bfa; }

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-progress {
    margin-top: 14px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.stat-progress .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--info-color), #60a5fa);
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.stat-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -1px;
}

.stat-change {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.stat-change.positive { color: var(--success-color); }
.stat-change.negative { color: var(--danger-color); }

/* ==================== Tables ==================== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
}

thead {
    background: linear-gradient(180deg, var(--bg-tertiary) 0%, rgba(31, 41, 55, 0.8) 100%);
}

th, td {
    padding: 16px 20px;
    text-align: left;
}

[dir="rtl"] th,
[dir="rtl"] td {
    text-align: right;
}

th {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
}

td {
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

tr:hover td {
    background: rgba(96, 165, 250, 0.05);
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.2;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast),
        color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    box-shadow: none;
}

.btn i {
    font-size: 14px;
    line-height: 1;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    filter: none;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success-color);
    color: #fff;
    border-color: var(--success-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.btn-success:hover {
    filter: brightness(0.94);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.22);
}

.btn-danger {
    background: var(--danger-color);
    color: #fff;
    border-color: var(--danger-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.btn-danger:hover {
    filter: brightness(0.94);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.22);
}

.btn-warning {
    background: var(--warning-color);
    color: #fff;
    border-color: var(--warning-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.btn-warning:hover {
    filter: brightness(0.94);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.22);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12.5px;
    gap: 6px;
    border-radius: var(--radius-md);
    min-height: 32px;
}

.btn-sm i {
    font-size: 12px;
}

.btn-lg {
    padding: 14px 26px;
    font-size: 15px;
    border-radius: var(--radius-lg);
}

.btn-icon {
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
}

.btn-icon:hover {
    transform: translateY(-1px);
}

.btn-group {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn:active {
    transform: translateY(0);
    filter: brightness(0.97);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    filter: none !important;
}


/* ==================== Forms ==================== */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    letter-spacing: 0.3px;
}

.form-group label .required {
    color: var(--danger-color);
    margin-left: 4px;
}

.optional-label {
    font-weight: 400;
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 6px;
}

[dir="rtl"] .optional-label {
    margin-left: 0;
    margin-right: 6px;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 15px;
    transition: all var(--transition-normal);
}

.form-control:hover {
    border-color: var(--border-light);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.15);
    background: var(--bg-secondary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-tertiary);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236366f1' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
}

[dir="rtl"] select.form-control {
    background-position: left 16px center;
    padding-right: 18px;
    padding-left: 44px;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.form-row.three-cols {
    grid-template-columns: repeat(3, 1fr);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

[dir="rtl"] .form-actions {
    justify-content: flex-start;
}

/* Subscription section in member form */
.subscription-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
}

.subscription-section h4 {
    margin: 0 0 16px 0;
    color: var(--primary-color);
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.subscription-section h4 .optional-label {
    font-size: 12px;
}

/* Searchable select container */
.searchable-select-container {
    position: relative;
}

.searchable-select-container .member-search {
    margin-bottom: 8px;
}

.searchable-select-container .member-select {
    max-height: 200px;
}

.input-group {
    position: relative;
}

.input-group .form-control {
    padding-left: 44px;
}

[dir="rtl"] .input-group .form-control {
    padding-left: 16px;
    padding-right: 44px;
}

.input-group-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

[dir="rtl"] .input-group-icon {
    left: auto;
    right: 16px;
}

/* ==================== Modal ==================== */
.modal-overlay {
    position: fixed;
    top: var(--window-taskbar-height, 36px) !important;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 24px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl), 0 0 60px rgba(96, 165, 250, 0.15);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(96, 165, 250, 0.05);
}

.modal-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-title i {
    color: var(--primary-light);
}

.modal-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}

.modal-close:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 28px;
    max-height: calc(90vh - 160px);
    overflow-y: auto;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: var(--radius-full);
}

.modal-lg,
.modal-large {
    max-width: min(1000px, 95vw) !important;
    width: min(1000px, 95vw) !important;
}

.modal-xl,
.modal-xlarge {
    max-width: min(1260px, 96vw) !important;
    width: min(1260px, 96vw) !important;
}

.modal-voucher {
    max-width: min(960px, 95vw) !important;
    width: min(960px, 95vw) !important;
}

.modal-voucher .modal-body {
    padding: 16px 20px 24px;
    max-height: calc(90vh - 110px);
}

.modal-receipt {
    max-width: min(860px, 95vw) !important;
    width: min(860px, 95vw) !important;
}

.modal-receipt .modal-body {
    padding: 16px 20px 24px;
    max-height: calc(90vh - 110px);
}

.modal-member-details {
    max-width: min(1420px, 97vw) !important;
    width: min(1420px, 97vw) !important;
}

.modal-member-details .modal-body {
    max-height: calc(92vh - 120px);
    padding: 24px 28px;
}

.modal-member-details .member-details-grid {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 28px;
    min-height: 0;
    align-items: start;
}

.modal-member-details .member-info-section {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.modal-member-details .member-info-section .tabs {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 4px;
}

.modal-member-details .member-info-section .tab-content.active {
    max-height: calc(92vh - 260px);
    overflow-y: auto;
    overflow-x: auto;
    padding-inline-end: 6px;
    min-width: 0;
}

.modal-member-details .table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    margin-top: 12px;
}

.modal-member-details table,
.modal-member-details .table-compact {
    width: 100%;
    min-width: 580px;
    border-collapse: collapse;
}

.modal-member-details table th,
.modal-member-details .table-compact th {
    padding: 13px 16px;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.modal-member-details table td,
.modal-member-details .table-compact td {
    padding: 12px 16px;
    font-size: 13.5px;
    white-space: nowrap;
    border-top: 1px solid var(--border-light);
    color: var(--text-primary);
}

.modal-whatsapp-qr {
    max-width: 420px;
}

.whatsapp-qr-modal {
    text-align: center;
}

.whatsapp-qr-frame {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 16px auto;
    padding: 14px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.whatsapp-qr-image {
    display: block;
    width: 280px;
    height: 280px;
    object-fit: contain;
    image-rendering: pixelated;
}

.whatsapp-qr-loading {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.5;
    min-height: 20px;
}

.whatsapp-qr-actions {
    margin-top: 14px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

/* ==================== Toast Notifications ==================== */
.toast-container {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 3000;
    display: flex;
    flex-direction: column-reverse;
    gap: 14px;
}

[dir="rtl"] .toast-container {
    right: auto;
    left: 28px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl), 0 0 40px rgba(0, 0, 0, 0.3);
    min-width: 320px;
    max-width: 420px;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
}

[dir="rtl"] .toast::before {
    left: auto;
    right: 0;
}

@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success::before { background: linear-gradient(180deg, var(--success-color), #059669); }
.toast.error::before { background: linear-gradient(180deg, var(--danger-color), #dc2626); }
.toast.warning::before { background: linear-gradient(180deg, var(--warning-color), #d97706); }
.toast.info::before { background: linear-gradient(180deg, var(--info-color), #2563eb); }

.toast-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    font-size: 20px;
}

.toast.success .toast-icon { background: rgba(16, 185, 129, 0.15); color: var(--success-color); }
.toast.error .toast-icon { background: rgba(239, 68, 68, 0.15); color: var(--danger-color); }
.toast.warning .toast-icon { background: rgba(245, 158, 11, 0.15); color: var(--warning-color); }
.toast.info .toast-icon { background: rgba(59, 130, 246, 0.15); color: var(--info-color); }

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 15px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-close {
    padding: 6px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
}

.toast-close:hover {
    color: var(--text-primary);
}

/* ==================== Badges ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    border-radius: var(--radius-full);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.badge-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1));
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.1));
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-primary {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(96, 165, 250, 0.1));
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.3);
}

/* ==================== Avatar ==================== */
.avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    max-width: 44px;
    max-height: 44px;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary-light);
    font-size: 16px;
    border: 2px solid var(--border-color);
    transition: all var(--transition-normal);
    overflow: hidden;
    flex-shrink: 0;
}

.avatar:hover {
    border-color: var(--primary-color);
    box-shadow: var(--primary-glow);
}

.avatar-lg {
    width: 88px;
    height: 88px;
    min-width: 88px;
    min-height: 88px;
    max-width: 88px;
    max-height: 88px;
    font-size: 32px;
}

.avatar-sm {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    max-width: 34px;
    max-height: 34px;
    font-size: 13px;
}

/* ==================== Tabs ==================== */
.tabs {
    display: flex;
    gap: 6px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 28px;
    overflow-x: auto;
    padding-bottom: 0;
}

.tab {
    padding: 14px 24px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* ==================== QR Code Scanner ==================== */
.qr-scanner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#qr-reader {
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

#qr-reader video {
    width: 100%;
    border-radius: var(--radius-lg);
}

.scan-result {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    text-align: center;
}

.scan-result.success {
    border: 2px solid var(--success-color);
}

.scan-result.error {
    border: 2px solid var(--danger-color);
}

/* ==================== Charts ==================== */
.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}

.chart-container--compact {
    height: 260px;
}

.dashboard-chart-card {
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.dashboard-chart-card .card-header {
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
}

.dashboard-chart-card .card-title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.dashboard-chart-card .card-body {
    padding: 16px 18px 18px;
}

/* ==================== Empty State ==================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state i {
    font-size: 64px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* ==================== Loading ==================== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ==================== Member Card ==================== */
.member-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.member-info {
    flex: 1;
}

.member-name {
    font-weight: 500;
    color: var(--text-primary);
}

.member-phone {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ==================== Status Indicators ==================== */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

[dir="rtl"] .status-dot {
    margin-right: 0;
    margin-left: 8px;
}

.status-dot.active { background: var(--success-color); }
.status-dot.inactive { background: var(--danger-color); }
.status-dot.pending { background: var(--warning-color); }
.status-dot.expired { background: var(--text-muted); }

/* ==================== Filters ==================== */
.filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.filter-group .form-control {
    min-width: 150px;
}

/* ==================== Responsive Design ==================== */
@media (max-width: 1200px) {
    .form-row.three-cols {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    [dir="rtl"] .sidebar {
        transform: translateX(100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-inline-start: 0;
    }

    .menu-toggle {
        display: block;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-row.three-cols {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }

    .page-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        margin-inline-start: 0;
        width: auto;
    }

    .header-search {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .modal {
        max-width: 100%;
        margin: 10px;
    }

    .toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }
}

@media (max-width: 576px) {
    .page-content {
        padding: 16px;
    }

    .card-body {
        padding: 16px;
    }

    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .btn-group .btn {
        width: 100%;
    }
}

/* ==================== Print Styles ==================== */
@media print {
    .sidebar,
    .main-header,
    .page-actions,
    .btn,
    .modal-overlay {
        display: none !important;
    }

    .main-content {
        margin: 0;
    }

    .page-content {
        padding: 0;
    }

    body {
        background: white;
        color: black;
    }

    .card {
        border: 1px solid #ddd;
        box-shadow: none;
    }

    table {
        border: 1px solid #ddd;
    }

    th, td {
        border: 1px solid #ddd;
    }
}

/* ==================== QR Code Display ==================== */
.qr-code-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: white;
    border-radius: var(--radius-lg);
}

.qr-code-container canvas,
.qr-code-container img {
    border-radius: var(--radius-md);
}

.qr-code-id {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    font-family: monospace;
}

/* ==================== Action Buttons in Tables ==================== */
.action-buttons {
    display: flex;
    gap: 8px;
}

.action-buttons .btn-icon {
    opacity: 0.7;
}

.action-buttons .btn-icon:hover {
    opacity: 1;
}

/* ==================== Notification Panel ==================== */
.notification-panel {
    position: absolute;
    top: 100%;
    right: 0;
    width: 360px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    display: none;
}

[dir="rtl"] .notification-panel {
    right: auto;
    left: 0;
}

.notification-panel.active {
    display: block;
}

.notification-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.notification-item:hover {
    background: var(--bg-tertiary);
}

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

.notification-item.unread {
    background: rgba(96, 165, 250, 0.1);
}

.notification-title {
    font-weight: 500;
    margin-bottom: 4px;
}

.notification-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.notification-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==================== Profile Modal ==================== */
.profile-modal {
    text-align: center;
}

.profile-header {
    padding: 30px 20px;
    background: var(--primary-gradient);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin: -20px -20px 20px -20px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar i {
    font-size: 80px;
    color: rgba(255,255,255,0.9);
}

.profile-header h3 {
    color: white;
    font-size: 22px;
    margin-bottom: 8px;
}

.profile-header .badge {
    background: rgba(255,255,255,0.2);
    color: white;
}

.profile-info {
    text-align: left;
}

.profile-info .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}

.profile-info .info-row:last-child {
    border-bottom: none;
}

.profile-info .info-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 14px;
}

.profile-info .info-label i {
    width: 18px;
    color: var(--primary-color);
}

.profile-info .info-value {
    font-weight: 500;
    color: var(--text-primary);
}

/* ==================== Dashboard Alerts ==================== */
.dashboard-alerts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.alert-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    border-inline-start: 4px solid;
}

.alert-card i {
    font-size: 20px;
}

.alert-card .alert-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.alert-card .alert-body strong {
    font-size: 0.9rem;
}

.alert-card .alert-body span {
    font-size: 0.8rem;
    opacity: 0.8;
}

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

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning-color);
    color: var(--warning-color);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--info-color);
    color: var(--info-color);
}

/* ==================== Dashboard Grids ==================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== Activity List ==================== */
.activity-list {
    list-style: none;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.activity-icon.new-member { background: rgba(96, 165, 250, 0.2); color: var(--primary-color); }
.activity-icon.attendance { background: rgba(16, 185, 129, 0.2); color: var(--success-color); }
.activity-icon.payment { background: rgba(245, 158, 11, 0.2); color: var(--warning-color); }

.activity-content {
    flex: 1;
}

.activity-text {
    color: var(--text-primary);
    margin-bottom: 4px;
}

.activity-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* ==================== Expiring List ==================== */
.expiring-list {
    list-style: none;
}

.expiring-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.expiring-info {
    display: flex;
    flex-direction: column;
}

.expiring-name {
    font-weight: 500;
    color: var(--text-primary);
}

.expiring-plan {
    font-size: 13px;
    color: var(--text-secondary);
}

.expiring-date {
    font-size: 13px;
    font-weight: 500;
}

.expiring-date.urgent {
    color: var(--danger-color);
}

.expiring-date.soon {
    color: var(--warning-color);
}

/* ==================== Barcode Scanner Styles ==================== */
.attendance-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
}

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

.scanner-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.scanner-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.scanner-status .status-dot.active {
    background: var(--success-color);
    animation: pulse 1.5s infinite;
}

.barcode-scanner-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.scanner-viewport {
    position: relative;
    width: 100%;
    height: 280px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: none;
}

.scanner-viewport.active {
    display: block;
}

.scanner-viewport video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
}

.scanner-frame {
    width: 250px;
    height: 100px;
    border: 3px solid var(--primary-color);
    border-radius: var(--radius-md);
    position: relative;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

.scanner-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    animation: scanLine 2s linear infinite;
}

@keyframes scanLine {
    0% { top: 0; }
    50% { top: calc(100% - 3px); }
    100% { top: 0; }
}

.scanner-controls {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

/* New Barcode Scanner Main Design */
.barcode-scanner-main {
    text-align: center;
    padding: 40px 20px;
}

.barcode-scanner-main .scanner-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
    box-shadow: var(--shadow-glow);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(96, 165, 250, 0.4); }
    50% { box-shadow: 0 0 40px rgba(96, 165, 250, 0.6); }
}

.barcode-scanner-main .scanner-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.barcode-scanner-main .scanner-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 32px;
}

.barcode-input-wrapper {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.barcode-input-large {
    width: 100%;
    padding: 20px 60px 20px 24px;
    font-size: 24px;
    font-family: 'Consolas', 'Monaco', monospace;
    letter-spacing: 2px;
    text-align: center;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    transition: all var(--transition-normal);
}

/* Compact attendance desk sizing */
#page-attendance .attendance-mode-tabs {
    margin-bottom: 12px !important;
}

#page-attendance .barcode-scanner-main {
    text-align: start;
    padding: 4px 0 0;
}

#page-attendance .barcode-scanner-main .scanner-icon {
    display: none;
}

#page-attendance .barcode-scanner-main .scanner-title {
    font-size: 1.05rem;
    margin-bottom: 4px;
}

#page-attendance .barcode-scanner-main .scanner-subtitle {
    font-size: 0.82rem;
    margin-bottom: 6px;
    line-height: 1.35;
}

#page-attendance .biometric-hint-line {
    margin-bottom: 10px !important;
}

#page-attendance .barcode-input-wrapper {
    max-width: 100%;
    margin: 0;
}

#page-attendance .barcode-input-large {
    padding: 10px 44px 10px 14px;
    font-size: 1.05rem;
    letter-spacing: 1px;
    border-radius: var(--radius-md);
    border-width: 1px;
    min-height: 42px;
}

#page-attendance .input-scan-indicator {
    inset-inline-end: 12px;
}

#page-attendance .attendance-workspace {
    gap: 12px;
}

#page-attendance .attendance-desk {
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.75fr);
    gap: 14px;
}

#page-attendance .attendance-desk__checkin-body {
    gap: 12px;
}

#page-attendance .attendance-method-card {
    padding: 10px 12px;
    border-radius: var(--radius-md);
}

#page-attendance .pin-checkin-section label {
    font-size: 0.85rem;
    margin-bottom: 6px;
}

#page-attendance .pin-checkin-row .btn {
    min-height: 36px;
    padding: 6px 12px;
}

#page-attendance .pin-input {
    max-width: 140px;
    min-height: 36px;
    font-size: 1rem;
    letter-spacing: 0.15em;
}

#page-attendance .pin-hint {
    margin-top: 4px;
    font-size: 0.75rem;
}

#page-attendance .attendance-manual-submit {
    min-height: 40px;
    padding: 8px 12px;
}

#page-attendance .attendance-quick-stats {
    margin-top: 0;
}

#page-attendance .quick-stat-box {
    padding: 10px 12px;
}

#page-attendance .quick-stat-icon {
    width: 36px;
    height: 36px;
    font-size: 14px;
}

#page-attendance .quick-stat-value {
    font-size: 1.15rem;
}

#page-attendance .quick-stat-label {
    font-size: 0.75rem;
}

#page-attendance .attendance-registration-result {
    padding: 12px 14px;
}

#page-attendance .scan-result-photo-wrap,
#page-attendance .attendance-registration-result .scan-result-photo-wrap {
    flex-basis: 96px;
    width: 96px;
    height: 96px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

#page-attendance .scan-result-photo-fallback {
    font-size: 28px;
}

#page-attendance .scan-result-message {
    font-size: 0.95rem;
}

#page-attendance .scan-result-member .member-name {
    font-size: 1rem;
}

#page-attendance .scan-result-icon {
    font-size: 1.25rem;
}

#page-attendance .card-header {
    padding: 12px 14px;
}

#page-attendance .card-body {
    padding: 14px;
}

#page-attendance .card-title {
    font-size: 0.98rem;
    margin: 0;
}

#page-attendance .form-control-lg {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 0.92rem;
}

#page-attendance #attendanceTodayCard .member-card .avatar,
#page-attendance .attendance-row-photo {
    width: 36px;
    height: 36px;
    font-size: 12px;
}

.barcode-input-large:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.2);
}

.barcode-input-large::placeholder {
    color: var(--text-muted);
    font-size: 16px;
    letter-spacing: normal;
}

.input-scan-indicator {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--success-color);
    font-size: 24px;
    animation: blink 1.5s ease-in-out infinite;
}

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

/* QR Camera Scanner */
.qr-scanner-section {
    margin-top: 20px;
    text-align: center;
}

.qr-scanner-container {
    margin-top: 16px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.qr-reader {
    width: 100%;
}

.qr-reader video {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.qr-stop-btn {
    margin: 12px;
}

/* Attendance Quick Stats */
.attendance-quick-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.quick-stat-box {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    min-width: 180px;
}

.quick-stat-box .quick-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
}

.quick-stat-box .quick-stat-info {
    display: flex;
    flex-direction: column;
}

.quick-stat-box .quick-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.quick-stat-box .quick-stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

.barcode-input-section {
    margin-top: 10px;
}

.input-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.input-divider::before,
.input-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.barcode-input-group {
    display: flex;
    gap: 8px;
}

.barcode-input-group .form-control {
    flex: 1;
}

.form-hint {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 12px;
}

.form-hint i {
    margin-right: 4px;
}

.form-control-lg {
    padding: 14px 16px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.quick-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.quick-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.quick-stat-icon.bg-primary { background: rgba(96, 165, 250, 0.2); color: var(--primary-color); }
.quick-stat-icon.bg-success { background: rgba(16, 185, 129, 0.2); color: var(--success-color); }

.quick-stat-info {
    display: flex;
    flex-direction: column;
}

.quick-stat-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.quick-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Scan Result */
.scan-result {
    padding: 24px;
    border-radius: var(--radius-lg);
    text-align: center;
    animation: slideIn 0.3s ease;
}

.scan-result.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--success-color);
}

.scan-result.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--danger-color);
}

.scan-result-icon {
    margin-bottom: 16px;
}

.scan-result-member {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.scan-result-member .avatar-lg {
    width: 60px;
    height: 60px;
    font-size: 24px;
}

.scan-result-message {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.scan-result-barcode {
    font-size: 13px;
    color: var(--text-muted);
}

.scan-result-barcode i {
    margin-right: 6px;
}

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

/* Time Badges */
.time-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
}

.time-badge.check-in {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.time-badge.check-out {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
}

/* Barcode Display */
.barcode-display {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    color: var(--primary-light);
}

/* Row Highlight */
.row-highlight {
    background: rgba(16, 185, 129, 0.05);
}

/* Attendance Stats Header */
.attendance-stats {
    display: flex;
    gap: 20px;
}

.stat-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.stat-mini i {
    font-size: 16px;
}

.stat-mini span {
    font-weight: 600;
    color: var(--text-primary);
}

.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-muted { color: var(--text-muted); }

/* Member Details Grid */
.member-details-grid {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.member-info-section {
    min-width: 0;
}

.member-profile-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.member-profile-card {
    text-align: center;
    padding: 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
}

.member-profile-card .avatar-xl {
    width: 100px;
    height: 100px;
    margin: 0 auto 16px;
    font-size: 36px;
}

.member-profile-name {
    font-size: 20px;
    margin-bottom: 4px;
}

.member-profile-id {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 12px;
    font-family: monospace;
}

/* ========== Staff Attendance Styles ========== */
/* Tab Navigation */
.tabs-container {
    margin-bottom: 24px;
}

.tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 24px;
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.tab-btn.active {
    color: var(--primary-color);
    background: transparent;
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 12px;
    right: 12px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(90deg, var(--primary-color), var(--gym-accent, #38bdf8));
}

.tab-content {
    display: none;
}

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

/* Attendance Summary Cards */
.attendance-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.summary-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 16px;
}

.summary-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.summary-card.present .summary-icon {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.summary-card.total .summary-icon {
    background: rgba(33, 150, 243, 0.1);
    color: #2196F3;
}

.summary-info {
    flex: 1;
}

.summary-value {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.summary-label {
    font-size: 14px;
    color: var(--text-muted);
}

/* Attendance Form */
.attendance-form .form-group {
    margin-bottom: 16px;
}

.attendance-buttons:not(.workplace-action-grid) {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.attendance-buttons:not(.workplace-action-grid) .btn {
    flex: 1;
    min-width: 140px;
}

/* Today's Attendance Table */
.attendance-table-container {
    margin-top: 24px;
}

.attendance-table-container h3 {
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
}

/* Staff Attendance View Modal */
.staff-attendance-view {
    max-width: 800px;
}

.attendance-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius-lg);
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.attendance-history-section h4 {
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
}

/* Barcode Card */
.barcode-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.barcode-card h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.barcode-container {
    background: white;
    padding: 16px;
    border-radius: var(--radius-md);
    text-align: center;
    margin-bottom: 16px;
}

.barcode-container svg {
    max-width: 100%;
}

.barcode-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.barcode-actions .btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 120px;
}

.card-theme-section {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border-color, rgba(255,255,255,0.08));
}

.card-theme-section .section-subtitle {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 700;
}

.card-theme-section .section-hint {
    margin: 0 0 14px;
    font-size: 13px;
}

.card-color-row .form-group {
    min-width: 140px;
}

input.color-input {
    min-height: 42px;
    padding: 4px;
    cursor: pointer;
}

.member-card-preview-wrap {
    text-align: center;
    padding: 12px;
    background: #ffffff;
    border-radius: 12px;
}

.member-card-preview-wrap img {
    max-height: min(72vh, 720px);
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

/* Portrait Freepik staff/employer ID cards — show larger in preview */
.member-card-preview-wrap.portrait-id-preview img,
.modal-content:has(.portrait-id-preview) .member-card-preview-wrap img {
    max-height: min(92vh, 1200px);
    max-width: min(96vw, 900px);
}

.member-cards-intro {
    margin-bottom: 16px;
}

.member-cards-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.member-cards-barcode-preview {
    display: block;
    width: 100%;
    min-width: 140px;
    padding: 6px 8px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.member-cards-barcode-preview:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.member-cards-barcode-preview svg {
    width: 100%;
    height: 40px;
}

.renewals-filters-card {
    margin-bottom: 20px;
}

.renewals-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
    margin-bottom: 0;
}

.renewals-search-group {
    flex: 1 1 240px;
    min-width: 220px;
}

.renewals-search-group .form-control {
    min-width: 220px;
    width: 100%;
}

.renewals-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-inline-start: auto;
}

.barcode-tools-toolbar {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
}

.barcode-tools-qty {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 120px;
}

.barcode-tools-qty label {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.barcode-tools-actions-inline {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
}

.barcode-tools-generate-row {
    align-items: flex-end;
    margin-bottom: 0;
}

.barcode-tools-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.member-cards-actions-compact .btn {
    min-width: 36px;
}

.member-barcode-tools-card {
    margin-bottom: 20px;
}

.member-barcode-tools-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.6fr) auto;
    gap: 16px;
    align-items: end;
}

.member-barcode-tools-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.report-meta-banner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.08));
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(15, 23, 42, 0.02));
}

.report-meta-gym {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.report-meta-range,
.report-meta-generated {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.calendar-hijri-label,
.day-date-hijri,
.shift-dual-date-label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.day-date-hijri {
    margin-top: 2px;
}

.shift-dual-date-label {
    margin: 0 8px;
    font-weight: 600;
}

@media (max-width: 900px) {
    .member-barcode-tools-grid {
        grid-template-columns: 1fr;
    }
}

.member-cards-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.member-cards-actions .btn {
    min-width: 34px;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.info-item {
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.info-item.full-width {
    grid-column: span 2;
}

.info-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.info-value {
    font-size: 14px;
    color: var(--text-primary);
}

/* Subscription Section */
.subscription-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.subscription-section h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.subscription-card {
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.subscription-card--frozen {
    border: 1px solid rgba(56, 189, 248, 0.35);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(15, 23, 42, 0.02));
}

.subscription-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.freeze-active-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 14px;
    padding: 14px;
    border-radius: var(--radius-md);
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.freeze-active-banner__icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-md);
    background: rgba(56, 189, 248, 0.18);
    color: var(--info-color);
    flex-shrink: 0;
}

.freeze-active-banner__body {
    flex: 1;
    min-width: 0;
}

.freeze-active-banner__dates {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.freeze-active-banner__reason {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.subscription-plan {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.subscription-dates {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.date-separator {
    color: var(--text-muted);
}

.no-subscription {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: var(--radius-md);
    color: var(--warning-color);
}

.no-subscription .btn {
    margin-left: auto;
}

/* Empty State Small */
.empty-state-small {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}

.empty-state-small i {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state-small p {
    font-size: 14px;
}

/* Table Compact */
.table-compact {
    width: 100%;
}

.table-compact th,
.table-compact td {
    padding: 10px 12px;
    font-size: 13px;
}

/* Tab Content Active State */
.tab-content {
    display: none;
    padding-top: 20px;
}

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

/* Table Striped */
.table-striped tbody tr:nth-child(even) {
    background: var(--bg-tertiary);
}

/* Avatar Sizes */
.avatar-lg {
    width: 80px;
    height: 80px;
    font-size: 28px;
}

.avatar-xl {
    width: 100px;
    height: 100px;
    font-size: 36px;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.avatar.avatar-logo,
.avatar-logo {
    background: #fff;
    border-radius: 10px;
}

.avatar.avatar-logo img,
.avatar-logo img {
    object-fit: contain;
    border-radius: 6px;
    padding: 2px;
    box-sizing: border-box;
}

/* Card Actions */
.card-actions {
    display: flex;
    gap: 8px;
}

/* ==================== Settings Page ==================== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
}

.settings-grid .card {
    height: auto;
    min-width: 0;
}

.settings-grid-single,
.settings-grid.settings-grid-single {
    grid-template-columns: 1fr;
}

.settings-full-width-card {
    width: 100%;
    grid-column: 1 / -1;
}

@media (max-width: 1100px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-color);
}

.settings-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.settings-tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.settings-tab.active {
    color: var(--primary-color);
    background: rgba(96, 165, 250, 0.12);
    border-color: rgba(96, 165, 250, 0.25);
}

.settings-tab-panel {
    display: none;
}

.settings-tab-panel.active {
    display: block;
}

.settings-grid-single {
    grid-template-columns: 1fr;
    max-width: 100%;
}

.settings-stack {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Settings page: consistent forms, tables, and cards fill content width */
#page-settings .settings-filter-sector {
    gap: 20px;
    width: 100%;
}

#page-settings .settings-stack {
    gap: 20px;
    width: 100%;
    max-width: none;
}

#page-settings .card {
    min-width: 0;
    width: 100%;
}

#page-settings .card-body {
    padding: 20px 22px;
}

#page-settings .form {
    gap: 16px;
    width: 100%;
}

#page-settings .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px 18px;
    align-items: start;
    width: 100%;
}

#page-settings .form-row > .form-group {
    min-width: 0;
    width: 100%;
}

#page-settings .form-row > .form-group:only-child {
    grid-column: 1 / -1;
}

#page-settings .form-actions {
    margin-top: 8px;
    padding-top: 16px;
}

#page-settings .table-container,
#page-settings .data-table {
    width: 100%;
}

#page-backup-restore .settings-grid,
#page-backup-restore .card,
#page-backup-restore .backup-manager-card,
#page-appearance-access .settings-grid,
#page-appearance-access .card {
    width: 100%;
    max-width: none;
}

@media (max-width: 720px) {
    #page-settings .form-row {
        grid-template-columns: 1fr;
    }
}

.settings-full-width-card {
    width: 100%;
    grid-column: 1 / -1;
}

.settings-role-select {
    max-width: 320px;
    margin-bottom: 16px;
}

.audit-log-toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    align-items: center;
}

.audit-log-toolbar .form-control {
    max-width: 180px;
}

.permissions-table-wrap,
.audit-log-wrap {
    overflow-x: auto;
}

.attendance-policies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.attendance-policy-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    background: var(--bg-secondary);
}

.attendance-policy-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.attendance-policy-card__head h4 {
    margin: 0;
    font-size: 1rem;
}

.attendance-policy-card__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 640px) {
    .attendance-policy-card__grid {
        grid-template-columns: 1fr;
    }
}

.settings-section-intro {
    margin-bottom: 16px;
}

.attendance-policies-table-wrap {
    overflow-x: auto;
}

.attendance-policies-table input.form-control-sm {
    min-width: 88px;
    padding: 6px 8px;
    font-size: 13px;
}

.biometric-settings-card .biometric-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.biometric-connection-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.biometric-connection-badge.disconnected {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
}

.biometric-connection-badge.connected {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.biometric-connection-badge.simulation {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.biometric-connection-badge.error {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.biometric-setup-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
    gap: 24px;
    align-items: start;
}

.biometric-setup-guide {
    padding: 20px;
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.biometric-setup-guide h4 {
    margin: 0 0 12px;
    font-size: 15px;
    color: var(--text-primary);
}

.biometric-link-steps {
    margin: 0 0 16px;
    padding-inline-start: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

.biometric-vendor-info-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin: 12px 0;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    font-size: 13px;
    color: var(--text-secondary);
}

.biometric-simulate-panel {
    margin-top: 16px;
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-color);
    background: var(--bg-tertiary);
}

.biometric-simulate-panel h4 {
    margin: 0 0 12px;
    font-size: 14px;
}

.license-settings-card .card-body {
    padding: 24px;
}

@media (max-width: 900px) {
    .biometric-setup-grid {
        grid-template-columns: 1fr;
    }
}

.staff-attendance-config {
    margin: 16px 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0;
}

.staff-attendance-config summary {
    cursor: pointer;
    padding: 12px 16px;
    font-weight: 600;
    list-style: none;
}

.staff-attendance-config summary::-webkit-details-marker {
    display: none;
}

.staff-attendance-config-body {
    padding: 0 16px 16px;
    border-top: 1px solid var(--border-color);
}

.staff-attendance-preview-box {
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    min-height: 48px;
}

.staff-attendance-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px 16px;
    font-size: 0.92rem;
}

.staff-attendance-preview-holiday {
    margin-top: 8px;
    color: var(--warning-color, #d97706);
    font-size: 0.9rem;
}

.staff-attendance-config-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.biometric-staff-map-table {
    width: 100%;
    font-size: 0.9rem;
}

.biometric-staff-map-table th,
.biometric-staff-map-table td {
    vertical-align: middle;
}

.biometric-staff-map-table .form-control-sm {
    min-width: 120px;
}

.biometric-staff-map-card {
    margin-top: 16px;
}

.biometric-staff-map-table .bio-map-today-shift {
    white-space: nowrap;
    font-size: 0.85rem;
}

.my-workplace-tabs {
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.my-workplace-tabs .tab-btn {
    min-height: 44px;
    padding: 10px 16px;
    box-shadow: none;
}

.my-workplace-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.my-workplace-today-card {
    grid-column: 1 / -1;
}

.my-workplace-personal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
}

.attendance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
    align-items: start;
}

.workplace-action-grid,
.attendance-buttons.workplace-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.workplace-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    min-height: 92px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.25;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.workplace-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.workplace-action-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.workplace-action-btn i {
    font-size: 1.35rem;
}

.workplace-action-btn--check-in {
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.08);
    color: var(--success-color);
}

.workplace-action-btn--break-start {
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.08);
    color: var(--info-color, #3b82f6);
}

.workplace-action-btn--break-end {
    border-color: rgba(100, 116, 139, 0.35);
    background: rgba(100, 116, 139, 0.08);
    color: var(--text-muted);
}

.workplace-action-btn--check-out {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.08);
    color: var(--warning-color, #f59e0b);
}

.staff-attendance-card .staff-dash-actions,
.staff-attendance-card .workplace-action-grid {
    margin-top: 16px;
}

.personal-record-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 20px;
}

.personal-record-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.staff-dashboard-panel {
    margin-bottom: 24px;
}

.staff-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.staff-payroll-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.staff-payroll-row:last-child {
    border-bottom: none;
}

.kpi-progress-card {
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}

.kpi-progress-card:last-child {
    border-bottom: none;
}

.kpi-progress-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.kpi-progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 999px;
    overflow: hidden;
}

.kpi-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    border-radius: 999px;
}

.commission-summary-row {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}

.staff-kpi-config {
    margin: 16px 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0 12px 12px;
}

.staff-kpi-config summary {
    cursor: pointer;
    font-weight: 600;
    padding: 12px 0;
}

.staff-kpi-editor {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.staff-kpi-row {
    display: grid;
    grid-template-columns: 1fr 140px;
    gap: 10px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.setting-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.setting-info label {
    font-weight: 500;
    color: var(--text-primary);
}

.setting-description {
    font-size: 13px;
    color: var(--text-muted);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    transition: var(--transition-normal);
    border-radius: var(--radius-full);
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition-normal);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.early-dismissals-card .badge-warning {
    font-weight: 600;
}

/* Backup Actions */
.backup-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.backup-action {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.backup-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(96, 165, 250, 0.2);
    color: var(--primary-color);
    border-radius: var(--radius-md);
    font-size: 20px;
}

.backup-icon.warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

.backup-info {
    flex: 1;
}

.backup-info h4 {
    margin-bottom: 4px;
    font-size: 15px;
}

.backup-info p {
    font-size: 13px;
    color: var(--text-muted);
}

.backup-info-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.backup-info-box i {
    color: var(--info-color);
}

.backup-manager-card .backup-settings-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.backup-directory-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: stretch;
}

.backup-directory-row .form-control {
    flex: 1 1 220px;
    min-width: 0;
}

.data-import-root--embedded .data-import-order-banner {
    margin-bottom: 12px;
}

.data-import-settings-card .data-import-root--embedded {
    margin-top: 8px;
}

.backup-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.backup-actions-secondary {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.backup-list-section {
    margin-top: 20px;
}

.backup-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.backup-list-header h4 {
    margin: 0;
    font-size: 15px;
}

.backup-list-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 320px;
    overflow-y: auto;
}

.backup-list-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 14px;
}

.backup-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.backup-list-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.backup-list-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}

.backup-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(96, 165, 250, 0.15);
    color: var(--primary-color);
}

.backup-type-auto {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success-color);
}

.backup-type-close {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
}

@media (max-width: 900px) {
    .backup-list-item {
        flex-direction: column;
        align-items: stretch;
    }

    .backup-list-actions {
        justify-content: flex-start;
    }
}

/* Theme Selector */
.theme-selector {
    display: flex;
    gap: 20px;
}

.theme-option {
    flex: 1;
    cursor: pointer;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-normal);
}

.theme-option:hover {
    border-color: var(--primary-color);
}

.theme-option.active {
    border-color: var(--primary-color);
    background: rgba(96, 165, 250, 0.1);
}

/* Enterprise Settings */
.enterprise-settings-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.enterprise-settings-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.875rem;
}

.enterprise-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.875rem 1rem;
.enterprise-branch-switcher {
    display: flex;
    align-items: end;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}
.enterprise-branch-switcher-field {
    flex: 1;
    margin-bottom: 0;
}
.enterprise-branch-switcher-action {
    flex-shrink: 0;
}
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}
.cash-review-tabs {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.cash-review-modal {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.cash-review-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.875rem;
}

.enterprise-summary-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.enterprise-summary-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.enterprise-settings-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.enterprise-detail-card {
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.enterprise-detail-card h4,
.enterprise-flags-section h4 {
    margin-bottom: 0.875rem;
    color: var(--text-primary);
}

.enterprise-detail-row,
.enterprise-flag-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-color);
}

.enterprise-detail-row:last-child,
.enterprise-flag-item:last-child {
    border-bottom: none;
}

.enterprise-flags-section {
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.enterprise-flag-list {
    display: flex;
    flex-direction: column;
}

.enterprise-flag-key,
.enterprise-mono {
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.8125rem;
}

.enterprise-flag-value {
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.enterprise-flag-value.is-enabled {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.enterprise-flag-value.is-disabled {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
}

.theme-preview {
    width: 100%;
    height: 80px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    overflow: hidden;
}

.theme-preview.dark {
    background: #1e293b;
}

.theme-preview.light {
    background: #f1f5f9;
}

.theme-preview .preview-header {
    height: 20px;
    background: rgba(0,0,0,0.2);
}

.theme-preview .preview-content {
    padding: 8px;
}

/* About Section */
.about-content {
    text-align: center;
    padding: 20px;
}

.about-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: var(--radius-lg);
    font-size: 36px;
    color: white;
}

.about-content .version {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 16px;
}

.about-content .description {
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto 20px;
    line-height: 1.6;
}

.about-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.feature-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--text-secondary);
}

.feature-tag i {
    color: var(--success-color);
}

/* Danger Zone */
.danger-zone {
    border-color: var(--danger-color) !important;
}

.danger-zone .card-header {
    background: rgba(239, 68, 68, 0.1);
}

.danger-zone .card-title {
    color: var(--danger-color);
}

.danger-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.danger-info h4 {
    margin-bottom: 4px;
    color: var(--text-primary);
}

.danger-info p {
    font-size: 13px;
    color: var(--text-muted);
}

/* Confirm Dialog */
.confirm-dialog {
    text-align: center;
    padding: 20px;
}

.confirm-dialog h3 {
    margin-bottom: 10px;
    color: var(--danger-color);
}

.confirm-dialog p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Responsive Settings */
@media (max-width: 1200px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .backup-action {
        flex-direction: column;
        text-align: center;
    }
    
    .danger-action {
        flex-direction: column;
        text-align: center;
    }
    
    .theme-selector {
        flex-direction: column;
    }

    .enterprise-branch-switcher,
    .cash-review-summary-grid {
        grid-template-columns: 1fr;
    }

    .enterprise-branch-switcher {
        flex-direction: column;
        align-items: stretch;
    }

    .enterprise-settings-summary,
    .enterprise-settings-details {
        grid-template-columns: 1fr;
    }
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .attendance-grid {
        grid-template-columns: 1fr;
    }
    
    .member-details-grid {
        grid-template-columns: 1fr;
    }
}

/* Alert Styles */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.alert i {
    font-size: 20px;
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #4CAF50;
}

.alert-warning {
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.3);
    color: #FF9800;
}

.alert-info {
    background: rgba(33, 150, 243, 0.1);
    border: 1px solid rgba(33, 150, 243, 0.3);
    color: #2196F3;
}

.alert-danger {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #F44336;
}

/* ==================== License Info Section ==================== */
.license-info-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.license-info-container .license-status {
    grid-column: 1 / -1;
}

.license-info-container .license-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 32px;
}

.license-info-container .license-notice {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .license-info-container .license-details {
        grid-template-columns: 1fr;
    }
}

.license-status {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
}

.license-status-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.license-status.active .license-status-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.license-status.permanent .license-status-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.license-status.expiring .license-status-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.license-status.expired .license-status-icon,
.license-status.inactive .license-status-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.license-status-text h4 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.license-status-text p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.license-details {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.license-detail-row {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.license-detail-row:last-child {
    border-bottom: none;
}

.license-detail-row .label {
    flex: 0 0 180px;
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.license-detail-row .label i {
    width: 20px;
    text-align: center;
    color: var(--primary-color);
}

.license-detail-row .value {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.license-detail-row .value.device-id {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    letter-spacing: 1px;
    background: var(--bg-input);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.license-detail-row .btn-sm {
    padding: 6px 10px;
    font-size: 12px;
    margin-left: 10px;
}

.license-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: var(--radius-lg);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.license-notice i {
    color: var(--primary-color);
    font-size: 18px;
    margin-top: 2px;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

/* RTL Support for License Info */
[dir="rtl"] .license-detail-row .label {
    flex: 0 0 200px;
}

[dir="rtl"] .license-detail-row .btn-sm {
    margin-left: 0;
    margin-right: 10px;
}

/* ==================== Classes Module ==================== */
.classes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.class-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: var(--transition-normal);
}

.class-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.class-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-tertiary);
}

.class-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.class-badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.class-body {
    padding: 20px;
}

.class-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0 0 15px;
    line-height: 1.5;
}

.class-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.class-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 13px;
}

.class-meta .meta-item i {
    color: var(--primary-color);
    width: 16px;
}

.class-actions {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

/* Schedule Grid */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    overflow-x: auto;
}

.schedule-day {
    min-width: 150px;
}

.schedule-day--today .day-header {
    background: var(--success-color, #10b981);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.room-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.empty-state-inline {
    padding: 16px 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.empty-state-inline i {
    display: block;
    margin-bottom: 6px;
    opacity: 0.6;
}

.gym-training-schedule .schedule-item,
.external-coach-schedule .schedule-item {
    padding: 10px;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.attendance-mode-tabs .tab-btn {
    min-width: 140px;
}

.day-header {
    background: var(--primary-color);
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: 600;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.day-classes {
    background: var(--bg-card);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: 10px;
    min-height: 200px;
}

.schedule-item {
    background: var(--bg-tertiary);
    padding: 10px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    position: relative;
}

.schedule-item .schedule-time {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
}

.schedule-item .schedule-class {
    font-size: 13px;
    margin-top: 4px;
    color: var(--text-secondary);
}

.schedule-item .schedule-room {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.schedule-item .btn-icon {
    position: absolute;
    top: 5px;
    right: 5px;
    opacity: 0;
    transition: opacity 0.2s;
}

[dir="rtl"] .schedule-item .btn-icon {
    right: auto;
    left: 5px;
}

.schedule-item:hover .btn-icon {
    opacity: 1;
}

.no-classes {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
    font-size: 13px;
}

/* Enrollments Section */
.enrollments-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.enrollment-form {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

/* ==================== Private Sessions Module ==================== */
.status-badge.status-scheduled {
    background: #f59e0b20;
    color: #f59e0b;
}

.status-badge.status-completed {
    background: #10b98120;
    color: #10b981;
}

.status-badge.status-cancelled,
.status-badge.status-no-show {
    background: #ef444420;
    color: #ef4444;
}

/* ==================== Products Module ==================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: var(--transition-normal);
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.product-card.low-stock {
    border: 2px solid var(--danger-color);
}

.product-image {
    height: 150px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-image i {
    font-size: 48px;
    color: var(--text-muted);
}

.stock-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    background: var(--primary-color);
    color: white;
}

.stock-badge.danger {
    background: var(--danger-color);
}

.product-info {
    padding: 15px;
}

.product-category {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    margin-bottom: 8px;
}

.product-name {
    margin: 0 0 10px;
    font-size: 16px;
    color: var(--text-primary);
}

.product-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 10px;
}

.product-stock {
    display: flex;
    align-items: center;
    gap: 5px;
}

.product-price {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.selling-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.cost-price {
    font-size: 12px;
    color: var(--text-muted);
}

.product-actions {
    padding: 10px 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Categories Manager */
.categories-manager {
    max-height: 400px;
    overflow-y: auto;
}

.add-category-form {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.add-category-form input,
.add-category-form select {
    flex: 1;
    min-width: 120px;
}

.add-category-form input[type="color"] {
    width: 50px;
    flex: 0;
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.category-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.category-name {
    flex: 1;
    color: var(--text-primary);
}

/* Stock Modal */
.current-stock-display {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.current-stock-display .label {
    color: var(--text-secondary);
}

.current-stock-display .value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

/* ==================== POS Module (Viewport-Locked, Zero-Scroll) ==================== */
#page-pos {
    height: calc(100vh - var(--header-height, 64px) - 36px);
    max-height: calc(100vh - var(--header-height, 64px) - 36px);
    display: none;
    flex-direction: column;
    overflow: hidden;
    gap: 8px;
    box-sizing: border-box;
    padding: 0;
}

#page-pos.active {
    display: flex !important;
}

.pos-top-bar {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 2px 4px;
    flex-wrap: wrap;
}

.pos-stat-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pos-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pos-stat-pill strong {
    font-weight: 700;
}

.pos-container {
    flex: 1 1 0;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(380px, 430px);
    gap: 12px;
    padding: 0;
    margin: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.pos-products {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.pos-products .pos-header {
    flex: 0 0 auto;
    padding: 8px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.pos-products .pos-header h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.pos-products .products-grid {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    align-content: flex-start;
}

/* Cart — items scroll; footer (totals + payment grid + checkout) always fully visible */
.pos-cart {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.pos-cart > .cart-header {
    flex: 0 0 auto;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.pos-cart > .cart-header h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.pos-cart > .cart-member {
    flex: 0 0 auto;
    padding: 6px 12px;
    border-bottom: 1px solid var(--border-color);
}

.pos-cart > .cart-items {
    flex: 1 1 auto;
    min-height: 60px;
    max-height: none;
    overflow-y: auto;
    padding: 6px 12px;
}

.cart-footer {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    z-index: 2;
}

.cart-summary {
    flex-shrink: 0;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.cart-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-bottom: 6px;
}

.cart-summary-item {
    background: var(--bg-card);
    padding: 4px 6px;
    border-radius: 6px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.cart-summary-item .cs-label {
    font-size: 10px;
    color: var(--text-muted);
    display: block;
}

.cart-summary-item .cs-value {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.cart-payment {
    flex-shrink: 0;
    padding: 8px 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pos-ref-proof-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 6px;
    margin-bottom: 0;
    width: 100%;
}

.payment-method {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 8px;
    min-height: 38px;
    height: 38px;
    width: 100%;
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: center;
    overflow: hidden;
    box-sizing: border-box;
}

.payment-method input {
    display: none;
}

.payment-method:hover {
    border-color: var(--primary-color);
}

.payment-method.active {
    border-color: var(--primary-color);
    background: rgba(96, 165, 250, 0.12);
}

.payment-method i {
    font-size: 14px;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1;
    flex-shrink: 0;
}

.payment-method.active i {
    color: var(--primary-color);
}

.payment-method span {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-checkout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 42px;
    font-size: 15px;
    font-weight: 700;
    margin-top: 2px;
}
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    height: 52px;
    padding: 0 18px;
    font-size: 16px;
    font-weight: 700;
    box-sizing: border-box;
}

.btn-checkout i {
    margin: 0;
    font-size: 18px;
}

[dir="rtl"] .btn-checkout i {
    margin: 0;
}

.pos-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pos-header h2 {
    margin: 0;
    font-size: 18px;
}

.pos-search {
    position: relative;
    flex: 1;
    max-width: 300px;
    margin-left: 20px;
}

.pos-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.pos-search input {
    width: 100%;
    padding: 10px 15px 10px 35px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
}

[dir="rtl"] .pos-search {
    margin-left: 0;
    margin-right: 20px;
}

[dir="rtl"] .pos-search i {
    left: auto;
    right: 12px;
}

[dir="rtl"] .pos-search input {
    padding: 10px 35px 10px 15px;
}

.pos-grid {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    align-content: start;
}

.pos-product-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.pos-product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.pos-product-card .product-image {
    height: 96px;
    min-height: 96px;
    max-height: 96px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    overflow: hidden;
    flex-shrink: 0;
}

.pos-product-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pos-product-card .product-image i {
    font-size: 34px;
    color: var(--text-muted);
    line-height: 1;
}

.pos-stock-pill {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    font-size: 10px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
    box-shadow: var(--shadow-sm);
}

[dir="rtl"] .pos-stock-pill {
    right: auto;
    left: 6px;
}

.pos-stock-pill.low {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1));
    color: var(--warning-color);
    border-color: rgba(245, 158, 11, 0.3);
}

.pos-product-card .product-details {
    padding: 10px;
}

.pos-product-card h4 {
    margin: 0 0 5px;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-product-card .product-price {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
}

/* Cart */
.pos-cart {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 0;
    height: 100%;
}

.pos-cart > .cart-footer {
    flex: 0 0 auto;
}

.cart-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.cart-header h2 {
    margin: 0;
    font-size: 18px;
}

.cart-member {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.cart-member label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.cart-items {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 10px 20px;
    min-height: 80px;
}

.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-cart i {
    font-size: 48px;
    margin-bottom: 10px;
}

.cart-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 10px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.cart-summary {
    flex-shrink: 0;
}

.cart-payment {
    padding: 15px 20px;
    flex-shrink: 0;
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
    width: 100%;
}

.payment-method {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 6px;
    min-height: 86px;
    height: auto;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: center;
    overflow: visible;
    box-sizing: border-box;
}

.payment-method input {
    display: none;
}

.payment-method i {
    font-size: 20px;
    margin-bottom: 0;
    color: var(--text-secondary);
    line-height: 1;
    flex-shrink: 0;
}

.payment-method span {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.2;
    word-break: break-word;
    max-width: 100%;
    overflow: visible;
}

.item-info {
    display: flex;
    flex-direction: column;
}

.item-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.item-price {
    font-size: 12px;
    color: var(--text-muted);
}

.item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.qty-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.qty-value {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
}

.item-total {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 60px;
    text-align: right;
}

.remove-item {
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.remove-item:hover {
    color: var(--danger-color);
}

.cart-summary {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.summary-row.discount-row input {
    width: 100px;
    text-align: right;
    padding: 5px 10px;
}

.summary-row.total-row {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    border-top: 1px solid var(--border-color);
    margin-top: 10px;
    padding-top: 15px;
}

.cart-payment {
    padding: 14px 18px 16px;
    flex-shrink: 0;
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
    width: 100%;
}

.payment-method {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 8px;
    min-height: 92px;
    height: 92px;
    width: 100%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: center;
    overflow: hidden;
    box-sizing: border-box;
}

.payment-method input {
    display: none;
}

.payment-method i {
    font-size: 22px;
    margin-bottom: 0;
    color: var(--text-secondary);
    line-height: 1;
    flex-shrink: 0;
}

.payment-method span {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.payment-method.active {
    border-color: var(--primary-color);
    background: rgba(96, 165, 250, 0.12);
}

.payment-method.active i,
.payment-method.active span {
    color: var(--primary-color);
}

.btn-checkout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    height: 52px;
    padding: 0 18px;
    font-size: 16px;
    font-weight: 700;
    box-sizing: border-box;
}

/* Receipt */
.receipt {
    text-align: center;
}

.receipt-header {
    margin-bottom: 20px;
}

.receipt-header .success-icon {
    font-size: 48px;
    color: var(--success-color);
    margin-bottom: 10px;
}

.receipt-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.receipt-body {
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
}

.receipt-row.total {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    border-top: 1px solid var(--border-color);
    margin-top: 10px;
    padding-top: 15px;
}

/* ==================== Cash Account Module ==================== */
.cash-stats {
    margin-bottom: 20px;
}

.stat-card.income .stat-icon {
    animation: pulse-green 2s infinite;
}

.stat-card.expense .stat-icon {
    animation: pulse-red 2s infinite;
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}

.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}

.type-badge.income {
    background: #10b98120;
    color: #10b981;
}

.type-badge.expense {
    background: #ef444420;
    color: #ef4444;
}

.category-badge {
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.payment-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.amount.income {
    color: #10b981;
    font-weight: 600;
}

.amount.expense {
    color: #ef4444;
    font-weight: 600;
}

/* ==================== Shifts Module ==================== */
.week-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.week-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 250px;
    text-align: center;
}

.shifts-schedule {
    overflow-x: auto;
}

.schedule-table {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.schedule-header {
    display: grid;
    grid-template-columns: 180px repeat(7, 1fr);
    background: var(--bg-tertiary);
}

.schedule-cell {
    padding: 12px;
    border-right: 1px solid var(--border-color);
    min-height: 60px;
}

.schedule-cell:last-child {
    border-right: none;
}

.staff-header {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.day-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.day-header.today {
    background: var(--primary-color)20;
}

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

.day-date {
    font-size: 12px;
    color: var(--text-muted);
}

.schedule-row {
    display: grid;
    grid-template-columns: 180px repeat(7, 1fr);
    border-top: 1px solid var(--border-color);
}

.staff-cell {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
}

.staff-info .staff-name {
    font-weight: 500;
    color: var(--text-primary);
    display: block;
}

.staff-info .staff-role {
    font-size: 11px;
    color: var(--text-muted);
}

.shift-cell {
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.shift-cell:hover {
    background: var(--bg-tertiary);
}

.shift-cell.today {
    background: var(--primary-color)08;
}

/* Shift Weekly Toolbar & Actions */
.schedule-toolbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.schedule-actions-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Shifts KPI Bar */
.shifts-kpi-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.shift-kpi-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.shift-kpi-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.shift-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.shift-kpi-content {
    display: flex;
    flex-direction: column;
}

.shift-kpi-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shift-kpi-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-top: 2px;
}

/* Schedule Cell & Shift Badge */
.shift-cell {
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 85px;
    position: relative;
    padding: 6px;
}

.shift-cell:hover {
    background: var(--bg-tertiary);
}

.shift-cell.today {
    background: var(--primary-color)08;
    outline: 1px dashed var(--primary-color)40;
}

.shift-badge {
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.shift-badge:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.shift-badge .shift-time {
    font-weight: 600;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.shift-badge .shift-name {
    font-size: 10px;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-inline-end: 36px;
}

.shift-badge-actions {
    position: absolute;
    top: 5px;
    inset-inline-end: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.shift-badge:hover .shift-badge-actions {
    opacity: 1;
}

.shift-badge-btn {
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    border: none;
    border-radius: 4px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.shift-badge-btn:hover {
    transform: scale(1.15);
}

.shift-badge-btn.edit:hover {
    background: #3b82f6;
}

.shift-badge-btn.delete:hover {
    background: #ef4444;
}

.add-shift-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 40px;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 11px;
    gap: 4px;
}

.shift-cell:hover .add-shift-placeholder {
    opacity: 0.85;
    background: var(--bg-secondary);
}

/* Shifts Manager Redesign */
.shifts-manager {
    max-height: calc(85vh - 130px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-inline-end: 4px;
}

/* Quick Presets Bar */
.shift-presets-container {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}

.shift-presets-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shift-presets-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.shift-preset-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.shift-preset-chip:hover {
    border-color: var(--primary-color);
    background: var(--primary-color)10;
    transform: translateY(-1px);
}

.shift-preset-chip .preset-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.shift-preset-chip .preset-times {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono, monospace);
}

/* Shift Creator Form Card */
.shift-form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
}

.shift-form-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.shift-form-card-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.shift-form-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.shift-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

/* Configured Shifts Catalog */
.shifts-catalog-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.shifts-catalog-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.shifts-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.shift-catalog-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.shift-catalog-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.shift-catalog-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.shift-catalog-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

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

.shift-catalog-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.shift-catalog-times-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.shift-catalog-policies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
    color: var(--text-secondary);
}

.shift-policy-tag {
    background: var(--bg-tertiary);
    border-radius: 4px;
    padding: 2px 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.shift-catalog-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    margin-top: 4px;
}

/* Interactive Shift Chips Selector in Assign Modal */
.shift-chips-selector-group {
    margin-bottom: 14px;
}

.shift-chips-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    margin-top: 6px;
}

.shift-chip-option {
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    background: var(--bg-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all var(--transition-fast);
}

.shift-chip-option:hover {
    border-color: var(--primary-color);
    background: var(--primary-color)08;
}

.shift-chip-option.selected {
    border-color: var(--primary-color);
    background: var(--primary-color)15;
    box-shadow: 0 0 0 1px var(--primary-color);
}

.shift-chip-option .chip-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.shift-chip-option .chip-info {
    display: flex;
    flex-direction: column;
}

.shift-chip-option .chip-name {
    font-weight: 600;
    font-size: 12px;
    color: var(--text-primary);
}

.shift-chip-option .chip-time {
    font-size: 10px;
    color: var(--text-muted);
}

/* Shift daily operations & history */
.shift-daily-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.shift-daily-toolbar .form-control {
    max-width: 180px;
}

.shift-ops-summary {
    margin-bottom: 20px;
}

.shift-model-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: 16px;
    overflow: hidden;
}

.shift-model-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.shift-model-header h3 {
    margin: 0;
    font-size: 16px;
}

.shift-model-times {
    color: var(--text-secondary);
    font-size: 13px;
}

.shift-staff-list {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shift-staff-process {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    background: var(--bg-secondary);
}

.shift-staff-process-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 8px;
}

.staff-role-tag {
    display: inline-block;
    margin-inline-start: 8px;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: capitalize;
}

.shift-process-timeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.shift-process-step {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
}

.shift-process-step .step-label {
    font-weight: 600;
    color: var(--text-primary);
}

.shift-process-step .step-scheduled {
    color: var(--text-muted);
}

.shift-process-step .step-actual {
    color: var(--text-secondary);
}

.shift-process-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-inline-start: 4px;
}

.shift-process-badge.late {
    background: var(--warning-color)20;
    color: var(--warning-color);
}

.shift-process-badge.early {
    background: var(--danger-color)20;
    color: var(--danger-color);
}

.shift-status-badge {
    display: inline-block;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 999px;
    font-weight: 600;
    text-transform: capitalize;
}

.shift-status-badge.status-on_time { background: var(--success-color)20; color: var(--success-color); }
.shift-status-badge.status-late { background: var(--warning-color)20; color: var(--warning-color); }
.shift-status-badge.status-absent { background: var(--danger-color)20; color: var(--danger-color); }
.shift-status-badge.status-holiday { background: var(--info-color)20; color: var(--info-color); }
.shift-status-badge.status-scheduled { background: var(--text-muted)20; color: var(--text-muted); }

.shift-holiday-note {
    margin-top: 8px;
    font-size: 12px;
    color: var(--info-color);
}

.shift-history-filters {
    margin-bottom: 16px;
}

/* ==================== Filters & Tabs ==================== */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 12px;
    color: var(--text-muted);
}

.filter-group .form-control {
    min-width: 150px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding-top: 22px;
}

.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: color var(--transition-fast), background var(--transition-fast);
    position: relative;
}

.tab-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary-color);
    background: rgba(56, 189, 248, 0.08);
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: -11px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--gym-accent, #38bdf8));
}

.tab-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.tab-pane {
    display: none;
}

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

/* ==================== Responsive POS ==================== */
@media (max-width: 1024px) {
    .pos-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .pos-products {
        height: 400px;
    }
    
    .pos-cart {
        height: auto;
    }
}

@media (max-width: 768px) {
    .schedule-header,
    .schedule-row {
        grid-template-columns: 120px repeat(7, 100px);
    }
    
    .classes-grid,
    .products-grid {
        grid-template-columns: 1fr;
    }
}
/* ==================== Professional Modal Enhancements ==================== */
.modal-overlay {
    position: fixed;
    top: var(--window-taskbar-height, 36px) !important;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    width: 92%;
    max-width: 680px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl), 0 0 60px rgba(96, 165, 250, 0.15);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--border-light);
}

.modal.modal-sm,
.modal.modal-small {
    max-width: 480px !important;
    width: min(480px, 92vw) !important;
}

.modal.modal-md,
.modal.modal-medium {
    max-width: 720px !important;
    width: min(720px, 94vw) !important;
}

.modal.modal-lg,
.modal.modal-large {
    max-width: min(1000px, 95vw) !important;
    width: min(1000px, 95vw) !important;
}

.modal.modal-xl,
.modal.modal-xlarge {
    max-width: min(1260px, 96vw) !important;
    width: min(1260px, 96vw) !important;
}

.modal.modal-member-details {
    max-width: min(1420px, 97vw) !important;
    width: min(1420px, 97vw) !important;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, var(--bg-tertiary) 0%, var(--bg-card) 100%);
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h2 i {
    color: var(--primary-color);
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--bg-tertiary);
}

/* ==================== Professional Form Styling ==================== */
.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-group label .required {
    color: var(--danger-color);
}

.form-control {
    padding: 12px 16px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
    width: 100%;
}

.form-control:hover {
    border-color: var(--border-light);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
    background: var(--bg-secondary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-control[type="color"] {
    padding: 4px;
    height: 46px;
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

[dir="rtl"] select.form-control {
    background-position: left 12px center;
    padding-right: 16px;
    padding-left: 36px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}

/* ==================== Professional Button Styling ==================== */
/* Canonical button look — keeps variants consistent across the app */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.2;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast),
        color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
    box-shadow: none;
}

.btn::before,
.btn::after {
    content: none !important;
    display: none !important;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    filter: none;
}

.btn-primary:active {
    transform: translateY(0);
    filter: brightness(0.97);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-input);
    border-color: var(--border-light);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success-color);
    color: #fff;
    border-color: var(--success-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.btn-success:hover {
    filter: brightness(0.94);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.22);
}

.btn-danger {
    background: var(--danger-color);
    color: #fff;
    border-color: var(--danger-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.btn-danger:hover {
    filter: brightness(0.94);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.22);
}

.btn-warning {
    background: var(--warning-color);
    color: #fff;
    border-color: var(--warning-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.btn-outline {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-lg {
    padding: 14px 26px;
    font-size: 15px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12.5px;
    min-height: 32px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ==================== Action Buttons Group ==================== */
.action-buttons,
.member-cards-actions,
.employer-detail-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.action-buttons .btn-icon,
.member-cards-actions-compact .btn {
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 8px;
    justify-content: center;
}

.member-cards-actions-compact {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.member-cards-actions-compact .btn i {
    margin: 0;
    font-size: 13px;
}

.employer-detail-actions .btn {
    width: auto;
    height: auto;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 8px;
    font-weight: 600;
}

.employer-detail-actions .btn i,
.page-actions .btn i,
.action-buttons .btn i {
    opacity: 0.95;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    margin-inline-start: auto;
}

.page-actions .btn {
    border-radius: 8px;
    min-height: 38px;
    padding: 8px 16px;
}

.page-actions .btn i {
    transition: transform var(--transition-fast);
}

.page-actions .btn:hover i {
    transform: none;
}

.table .btn-sm {
    border-radius: 8px;
}

.table td .btn-sm.btn-secondary,
.table td .btn-sm.btn-outline {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

.table td .btn-sm.btn-primary {
    box-shadow: none;
}

.employer-link-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.employer-link-row .form-control {
    flex: 1 1 200px;
    min-width: 160px;
    max-width: 320px;
}

/* ==================== Professional Confirmation Dialog ==================== */
.confirm-dialog {
    text-align: center;
    padding: 20px;
}

.confirm-dialog .confirm-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.confirm-dialog .confirm-icon.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
}

.confirm-dialog .confirm-icon.danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.confirm-dialog h3 {
    margin: 0 0 10px;
    font-size: 20px;
    color: var(--text-primary);
}

.confirm-dialog p {
    margin: 0 0 24px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.confirm-dialog .confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ==================== Professional Cards ==================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: all 0.3s;
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, var(--bg-tertiary) 0%, var(--bg-card) 100%);
}

.card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 20px;
}

/* ==================== Professional Table Styling ==================== */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    background: var(--bg-tertiary);
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
}

[dir="rtl"] .data-table th {
    text-align: right;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 14px;
}

.data-table tbody tr {
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ==================== Member Info Cell ==================== */
.member-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==================== Empty State ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    margin: 0 0 10px;
    font-size: 20px;
    color: var(--text-primary);
    font-weight: 600;
}

.empty-state p {
    margin: 0 0 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.empty-state.small {
    padding: 30px 20px;
}

.empty-state.small i {
    font-size: 40px;
    margin-bottom: 12px;
}

.empty-state.small h3 {
    font-size: 16px;
}

/* ==================== Professional Badges ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.badge-info {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

.badge-primary {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

/* ==================== Loading States ==================== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-input) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

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

/* ==================== Professional Tooltips ==================== */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px);
}

/* ==================== Print Styles ==================== */
@media print {
    .sidebar,
    .header,
    .btn,
    .action-buttons,
    .filters-bar,
    .page-actions {
        display: none !important;
    }
    
    .main-content {
        margin: 0 !important;
        padding: 20px !important;
    }
    
    .page {
        display: block !important;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px;
    }
}

/* ==================== Animations ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.animate-fadeIn { animation: fadeIn 0.3s ease; }
.animate-slideUp { animation: slideUp 0.3s ease; }
.animate-slideDown { animation: slideDown 0.3s ease; }
.animate-scaleIn { animation: scaleIn 0.3s ease; }

/* ==================== Section Headers ==================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.section-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header h3 i {
    color: var(--primary-color);
}

/* ==================== Quick Info Cards ==================== */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.info-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.info-card-content {
    flex: 1;
}

.info-card-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.info-card-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* ==================== Enhanced Module Styles ==================== */

/* Classes Module */
.classes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.class-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-card);
}

.class-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.class-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.class-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.class-badge {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.class-body {
    padding: 16px 20px;
}

.class-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.class-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
}

.meta-item i {
    color: var(--primary-color);
    opacity: 0.8;
}

.class-actions {
    padding: 16px 20px;
    display: flex;
    gap: 8px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

/* Schedule Grid */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    padding: 20px 0;
    overflow-x: auto;
}

.schedule-day {
    min-width: 140px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.day-header {
    padding: 12px;
    background: var(--bg-tertiary);
    font-weight: 600;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.day-classes {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 200px;
}

.schedule-item {
    padding: 10px;
    border-radius: var(--radius-sm);
    position: relative;
}

.schedule-time {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.schedule-class {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.schedule-room {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.schedule-item .btn-icon {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    font-size: 10px;
    opacity: 0;
    transition: var(--transition-fast);
}

[dir="rtl"] .schedule-item .btn-icon {
    right: auto;
    left: 4px;
}

.schedule-item:hover .btn-icon {
    opacity: 1;
}

.no-classes {
    color: var(--text-muted);
    text-align: center;
    font-size: 12px;
    padding: 20px;
}

/* Private Sessions */
.sessions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.session-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: var(--transition-normal);
}

.session-card:hover {
    box-shadow: var(--shadow-lg);
}

.session-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.session-datetime {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.session-date {
    font-size: 13px;
    color: var(--text-muted);
}

.session-time {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.session-body {
    padding: 16px 20px;
    display: flex;
    gap: 16px;
}

.session-member, .session-trainer {
    flex: 1;
}

.session-member h4, .session-trainer h4 {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.session-member p, .session-trainer p {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Enhanced POS Styles (Preserving Viewport Lock) */
.pos-search input {
    font-size: 13px;
}

.pos-products {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    min-height: 0;
}

.pos-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.pos-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.pos-search {
    position: relative;
    width: 300px;
}

.pos-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

[dir="rtl"] .pos-search i {
    left: auto;
    right: 14px;
}

.pos-search input {
    width: 100%;
    padding: 12px 12px 12px 42px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition-fast);
}

[dir="rtl"] .pos-search input {
    padding: 12px 42px 12px 12px;
}

.pos-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

.pos-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    padding: 20px;
    overflow-y: auto;
    align-content: start;
}

.pos-grid:has(.pos-empty-products) {
    display: flex;
    align-items: center;
    justify-content: center;
    grid-template-columns: none;
}

.pos-empty-products {
    width: 100%;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 24px;
    margin: 0 auto;
}

.pos-empty-products i {
    font-size: 88px;
    line-height: 1;
    color: var(--text-muted);
    opacity: 0.55;
    margin-bottom: 18px;
}

.pos-empty-products p {
    margin: 0;
    font-size: 16px;
    color: var(--text-secondary);
}

.pos-product-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-normal);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.pos-product-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pos-product-card:active {
    transform: scale(0.98);
}

.pos-product-card .product-image {
    height: 96px;
    min-height: 96px;
    max-height: 96px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.pos-product-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pos-product-card .product-image i {
    font-size: 34px;
    color: var(--text-muted);
    line-height: 1;
}

.pos-product-card .product-details {
    padding: 12px;
    text-align: center;
    min-width: 0;
}

.pos-product-card .product-details h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-product-card .product-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Cart */
.pos-cart {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow-card);
    min-height: 0;
    height: 100%;
}

.pos-cart > .cart-header,
.pos-cart > .cart-member {
    flex-shrink: 0;
}

.pos-cart > .cart-items {
    flex: 1 1 auto;
    min-height: 80px;
    overflow-y: auto;
}

.pos-cart > .cart-footer {
    flex-shrink: 0;
}

.cart-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.cart-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.cart-member {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
}

.cart-member label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.cart-member select {
    width: 100%;
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
}

.pos-customer-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pos-customer-search {
    position: relative;
}

.pos-customer-search i {
    position: absolute;
    inset-inline-start: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 13px;
}

.pos-customer-search input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
}

[dir="rtl"] .pos-customer-search input {
    padding: 10px 36px 10px 12px;
}

.pos-customer-row > .btn {
    min-height: 38px;
}

@media (min-width: 380px) {
    .pos-customer-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 42px;
        grid-template-areas:
            "search search"
            "select add";
        gap: 8px;
        align-items: stretch;
    }
    .pos-customer-search { grid-area: search; }
    .pos-customer-row > select { grid-area: select; }
    .pos-customer-row > .btn {
        grid-area: add;
        width: 42px;
        padding: 0;
        justify-self: stretch;
    }
}

.cart-items {
    flex: 1 1 auto;
    padding: 16px 20px;
    overflow-y: auto;
    min-height: 120px;
}

.empty-cart {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.empty-cart i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.cart-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.item-info {
    min-width: 0;
}

.item-name {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-price {
    font-size: 11px;
    color: var(--text-muted);
}

.item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.qty-value {
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.item-total {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 60px;
    text-align: right;
}

[dir="rtl"] .item-total {
    text-align: left;
}

.remove-item {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.remove-item:hover {
    background: var(--danger-color);
    color: white;
}

/* POS Top Summary Section Grid */
.pos-summary-section {
    margin-bottom: 16px;
    width: 100%;
}

.pos-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
}

@media (max-width: 992px) {
    .pos-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .pos-summary-grid {
        grid-template-columns: 1fr;
    }
}

.pos-stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.pos-stat-card:hover {
    border-color: var(--primary-color);
}

.pos-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    background: rgba(96, 165, 250, 0.12);
    color: var(--primary-color);
}

.pos-stat-card.success .pos-stat-icon {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}

.pos-stat-card.warning .pos-stat-icon {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.pos-stat-card.danger .pos-stat-icon {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.pos-stat-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pos-stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-stat-value {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-top: 2px;
}

.cart-summary {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.cart-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 12px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-color);
}

.cart-summary-item {
    display: flex;
    flex-direction: column;
}

.cart-summary-item .cs-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
}

.cart-summary-item .cs-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 13px;
}

.summary-row span:first-child {
    color: var(--text-secondary);
}

.summary-row span:last-child {
    font-weight: 600;
    color: var(--text-primary);
}

.discount-row input {
    width: 90px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    text-align: right;
    font-weight: 600;
}

[dir="rtl"] .discount-row input {
    text-align: left;
}

.total-row {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 2px solid var(--border-color);
}

.total-row span:first-child {
    font-weight: 700;
    color: var(--text-primary);
}

.total-row span:last-child {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-color);
}

.cart-payment {
    padding: 12px 16px 14px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
    width: 100%;
}

.payment-method {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 4px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: center;
    min-height: 62px;
    height: 62px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 5;
    pointer-events: auto !important;
    user-select: none;
}

.payment-method input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
    margin: 0;
}

.payment-method * {
    pointer-events: none;
}

.payment-method:hover {
    border-color: var(--primary-color);
    background: rgba(96, 165, 250, 0.08);
}

.payment-method.active {
    border-color: var(--primary-color);
    background: rgba(96, 165, 250, 0.16);
    box-shadow: 0 0 0 1px var(--primary-color);
}

.payment-method i {
    font-size: 20px;
    color: var(--text-muted);
    transition: var(--transition-fast);
    line-height: 1;
    flex-shrink: 0;
    margin: 0;
}

.payment-method.active i {
    color: var(--primary-color);
}

.payment-method span {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-secondary);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.payment-method.active span {
    color: var(--primary-color);
}

.btn-checkout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    height: 48px;
    padding: 0 16px;
    font-size: 15px;
    font-weight: 700;
    box-sizing: border-box;
}

.btn-checkout i {
    margin: 0;
    font-size: 18px;
}

[dir="rtl"] .btn-checkout i {
    margin: 0;
}

/* Receipt Modal */
.receipt {
    text-align: center;
    padding: 20px 0;
}

.receipt-header {
    margin-bottom: 24px;
}

.receipt-header .success-icon {
    font-size: 60px;
    color: var(--success-color);
    margin-bottom: 12px;
    animation: scaleIn 0.3s ease-out;
}

.receipt-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--text-primary);
}

.receipt-body {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.receipt-row:last-child {
    margin-bottom: 0;
}

.receipt-row span:first-child {
    color: var(--text-muted);
}

.receipt-row span:last-child {
    font-weight: 500;
    color: var(--text-primary);
}

.receipt-row.total span:last-child {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.receipt-actions {
    display: flex;
    justify-content: center;
}

.receipt-actions .btn {
    min-width: 150px;
}

/* Cash Module */
.cash-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.cash-stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-card);
    transition: var(--transition-normal);
}

.cash-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.cash-stat-card i {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.9;
}

.cash-stat-card.income i {
    color: var(--success-color);
}

.cash-stat-card.expense i {
    color: var(--danger-color);
}

.cash-stat-card.balance i {
    color: var(--primary-color);
}

.cash-stat-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.cash-stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* Shifts Module */
.shifts-calendar {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.calendar-nav {
    display: flex;
    gap: 8px;
}

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

.calendar-grid {
    display: grid;
    grid-template-columns: 200px repeat(7, 1fr);
    min-height: 400px;
}

.calendar-staff {
    border-right: 1px solid var(--border-color);
}

[dir="rtl"] .calendar-staff {
    border-right: none;
    border-left: 1px solid var(--border-color);
}

.staff-list-header {
    padding: 12px 16px;
    font-weight: 600;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.staff-list-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.calendar-days {
    display: contents;
}

.calendar-day-header {
    padding: 12px;
    text-align: center;
    font-weight: 600;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
}

[dir="rtl"] .calendar-day-header {
    border-left: none;
    border-right: 1px solid var(--border-color);
}

.calendar-day-header.today {
    background: rgba(96, 165, 250, 0.1);
    color: var(--primary-color);
}

.shift-cell {
    padding: 8px;
    border-left: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    min-height: 60px;
}

[dir="rtl"] .shift-cell {
    border-left: none;
    border-right: 1px solid var(--border-color);
}

.shift-badge {
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.shift-badge:hover {
    opacity: 0.8;
}

/* Enrollments Section */
.enrollments-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
}

.enrollment-form {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
}

.enrollments-list {
    margin-top: 20px;
}

/* Categories Manager */
.categories-manager {
    padding: 16px 0;
}

.add-category-form {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.add-category-form input,
.add-category-form select {
    flex: 1;
    min-width: 150px;
}

.categories-list {
    display: grid;
    gap: 8px;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

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

.category-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.category-name {
    font-weight: 500;
    color: var(--text-primary);
}

.category-type {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 8px;
}

[dir="rtl"] .category-type {
    margin-left: 0;
    margin-right: 8px;
}

/* ==================== Photo Upload Section ==================== */
.photo-upload-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.photo-preview-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.gym-logo-picker {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gym-logo-preview {
    width: 280px;
    min-height: 140px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    overflow: hidden;
    padding: 12px;
}

.gym-logo-preview.empty {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.gym-logo-preview img {
    width: 100%;
    max-height: 116px;
    object-fit: contain;
}

.gym-logo-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.photo-preview {
    width: 150px;
    height: 150px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-tertiary);
    border: 3px dashed var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-normal);
}

.photo-preview:hover {
    border-color: var(--primary-color);
}

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

.photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.photo-placeholder i {
    font-size: 40px;
    opacity: 0.5;
}

.photo-placeholder span {
    font-size: 12px;
}

.photo-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ==================== Camera Modal ==================== */
.camera-modal-overlay {
    z-index: 10001;
    padding: 16px;
    align-items: center;
    justify-content: center;
}

.modal.camera-modal,
.camera-modal.modal {
    max-width: min(960px, 96vw);
    width: min(960px, 96vw);
    max-height: 94vh;
}

.camera-modal .modal-header {
    padding: 18px 24px;
}

.camera-modal .modal-body {
    padding: 20px 24px 28px;
    max-height: calc(94vh - 88px);
    overflow-y: auto;
}

.camera-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    width: 100%;
}

.camera-preview {
    width: 100%;
    max-width: none;
    min-height: 420px;
    aspect-ratio: 4 / 3;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-preview video {
    width: 100%;
    height: 100%;
    min-height: 420px;
    object-fit: cover;
    display: block;
    transform: scaleX(-1);
}

.camera-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.camera-captured {
    width: 100%;
    max-width: none;
}

.camera-captured img {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    background: #000;
    transform: scaleX(-1);
}

.captured-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

@media (max-width: 720px) {
    .camera-preview,
    .camera-preview video {
        min-height: 280px;
    }

    .modal.camera-modal,
    .camera-modal.modal {
        width: 100%;
        max-width: 100%;
        border-radius: var(--radius-lg);
    }
}

/* ==================== Staff Photo Upload ==================== */
.staff-photo-upload {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.staff-photo-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.staff-photo-preview.employer-logo-preview {
    border-radius: 14px;
    background: #fff;
}

.staff-photo-preview.employer-logo-preview img,
.employer-logo-img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    padding: 8px;
    box-sizing: border-box;
}

.staff-photo-preview i {
    font-size: 32px;
    color: var(--text-muted);
}

/* Responsive Fixes */
@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-body {
        max-height: calc(95vh - 140px);
    }
    
    .btn {
        padding: 10px 16px;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .pos-container {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
    }
    
    .pos-cart {
        order: -1;
        height: auto;
        max-height: none;
    }

    .pos-cart > .cart-items {
        max-height: 240px;
    }

    .payment-methods {
        grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    }

    .btn-checkout {
        min-height: 52px;
        height: 52px;
    }
    
    .schedule-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .classes-grid {
        grid-template-columns: 1fr;
    }
    
    .sessions-grid {
        grid-template-columns: 1fr;
    }
    
    .photo-preview-container {
        flex-direction: column;
        text-align: center;
    }
    
    .photo-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ==================== Advanced Features Styles ==================== */

/* Quick Actions Card */
.quick-actions-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 15px;
    border: 1px solid var(--border-color);
}

.quick-actions-card h4 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-buttons-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-buttons-grid .btn {
    width: 100%;
    justify-content: center;
}

/* Debt Section Styles */
.debt-summary {
    padding: 20px;
}

.debt-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 25px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.debt-card.has-debt {
    border-left: 4px solid var(--danger-color);
}

.debt-card.no-debt {
    border-left: 4px solid var(--success-color);
}

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

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

.debt-card.no-debt .debt-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.debt-info {
    flex: 1;
}

.debt-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.debt-row:last-child {
    border-bottom: none;
}

.debt-row.debt-total {
    font-size: 18px;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 2px solid var(--border-color);
    border-bottom: none;
}

/* Measurements Section Styles */
.measurements-header {
    display: flex;
    justify-content: flex-end;
    padding: 15px 0;
}

.measurements-grid {
    display: grid;
    gap: 15px;
}

.measurements-grid h4.section-title {
    margin: 20px 0 10px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Freeze Section Styles */
.freeze-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-md);
    padding: 15px;
    margin: 15px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.freeze-info i {
    color: var(--info-color);
    margin-inline-end: 8px;
}

/* Badge Sizes */
.badge-sm {
    font-size: 10px;
    padding: 2px 6px;
    margin-inline-start: 5px;
}

.badge-xs {
    font-size: 9px;
    padding: 1px 4px;
}

/* Small Button */
.btn-xs {
    padding: 4px 8px;
    font-size: 11px;
    margin-inline-start: 8px;
}

/* Tab styles with indicator */
.tabs {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.tabs .tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Text utility classes */
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-info { color: var(--info-color) !important; }
.text-muted { color: var(--text-muted) !important; }

/* Alert styles */
.alert {
    padding: 15px;
    border-radius: var(--radius-md);
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert i {
    margin-top: 2px;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--text-secondary);
}

.alert-info i {
    color: var(--info-color);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--text-secondary);
}

.alert-warning i {
    color: var(--warning-color);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--text-secondary);
}

.alert-danger i {
    color: var(--danger-color);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--text-secondary);
}

.alert-success i {
    color: var(--success-color);
}

/* ==================== Attendance Status Styles ==================== */

/* Scan result enhancements */
.scan-result.warning {
    border-left: 4px solid var(--warning-color);
}

.scan-result-member {
    margin-top: 15px;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 15px;
}

.scan-result-member.active {
    border-left: 3px solid var(--success-color);
}

.scan-result-member.expired {
    border-left: 3px solid var(--danger-color);
}

.scan-result-member.expiring-soon {
    border-left: 3px solid var(--warning-color);
}

.scan-result-member.no-subscription {
    border-left: 3px solid var(--text-muted);
}

.scan-result-layout {
    display: flex;
    align-items: stretch;
    gap: 18px;
    width: 100%;
}

.scan-result-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.scan-result-photo-wrap {
    flex: 0 0 96px;
    width: 96px;
    height: 96px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-secondary, #0f172a);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.attendance-workspace {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.attendance-section-kicker {
    margin: 0 0 2px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.attendance-desk {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.75fr);
    gap: 14px;
    align-items: start;
}

.attendance-desk__side {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.attendance-desk__checkin .card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.attendance-desk__checkin-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.attendance-method-card {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
}

.pin-checkin-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.pin-checkin-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.pin-checkin-row .btn {
    min-height: 36px;
}

.pin-input {
    max-width: 140px;
    min-height: 36px;
    font-size: 1rem;
    letter-spacing: 0.15em;
    text-align: center;
}

.pin-hint {
    margin-top: 4px;
    font-size: 0.75rem;
}

.attendance-manual-submit {
    min-height: 40px;
    width: 100%;
}

.attendance-registration-result {
    display: none;
    margin: 0;
    min-height: 0;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
}

.attendance-registration-result.success,
.attendance-registration-result.warning,
.attendance-registration-result.error {
    display: block;
}

.attendance-registration-result .scan-result-photo-wrap {
    flex-basis: 96px;
    width: 96px;
    height: 96px;
    border-radius: 12px;
}

.attendance-row-photo {
    object-fit: cover;
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

#page-attendance .attendance-membership-only,
#page-attendance #attendanceTodayCard {
    margin-top: 4px;
}

#page-attendance #attendanceTodayCard .member-card .avatar {
    width: 36px;
    height: 36px;
    font-size: 12px;
}

@media (max-width: 980px) {
    .attendance-desk {
        grid-template-columns: 1fr;
    }

    .attendance-desk__side {
        position: static;
    }
}

.scan-result-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.scan-result-photo-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(145deg, #0b3d6d, #15956a);
}

.scan-result-body {
    flex: 1;
    min-width: 0;
    text-align: start;
}

.scan-result-member .member-name {
    font-size: 1.15rem;
    font-weight: 700;
}

.scan-result-member .member-phone,
.scan-result-member .member-plan,
.scan-result-member .member-sub-end {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-top: 2px;
}

@media (max-width: 640px) {
    .scan-result-layout {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .scan-result-body {
        text-align: center;
    }

    .scan-result-photo-wrap {
        flex-basis: 88px;
        width: 88px;
        height: 88px;
    }
}

.member-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    color: white;
    margin-top: 5px;
}

/* Attendance table status colors */
.attendance-status-active {
    color: var(--success-color);
}

.attendance-status-expired {
    color: var(--danger-color);
}

.attendance-status-expiring {
    color: var(--warning-color);
}

/* ==================== Closing Page ==================== */
.closing-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 4px;
    border: 1px solid var(--border-color);
}

.closing-tab {
    flex: 1;
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.closing-tab.active {
    background: var(--primary-color);
    color: white;
}

.closing-tab:hover:not(.active) {
    background: var(--bg-tertiary);
}

.closing-panel {
    display: none;
}

.closing-panel.active {
    display: block;
}

.closing-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.closing-controls .form-control {
    max-width: 220px;
}

.closing-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.closing-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

.closing-card.income {
    border-left: 4px solid var(--success-color);
}

.closing-card.expense {
    border-left: 4px solid var(--danger-color);
}

.closing-card.profit {
    border-left: 4px solid var(--primary-color);
}

.closing-card.loss {
    border-left: 4px solid var(--danger-color);
}

[dir="rtl"] .closing-card.income,
[dir="rtl"] .closing-card.expense,
[dir="rtl"] .closing-card.profit,
[dir="rtl"] .closing-card.loss {
    border-left: none;
    border-right: 4px solid;
}

[dir="rtl"] .closing-card.income { border-right-color: var(--success-color); }
[dir="rtl"] .closing-card.expense { border-right-color: var(--danger-color); }
[dir="rtl"] .closing-card.profit { border-right-color: var(--primary-color); }
[dir="rtl"] .closing-card.loss { border-right-color: var(--danger-color); }

.closing-card-icon {
    font-size: 24px;
    color: var(--text-muted);
}

.closing-card-content {
    display: flex;
    flex-direction: column;
}

.closing-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.closing-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.closing-breakdown {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-bottom: 16px;
}

.closing-breakdown h4 {
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.closing-stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.closing-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-size: 14px;
}

.closing-stat i {
    color: var(--primary-color);
}

.closing-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.closing-empty i {
    margin-bottom: 16px;
    color: var(--text-muted);
}

.closing-notes {
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-top: 16px;
    font-size: 14px;
}

/* ==================== Services Balance ==================== */
.service-balance-info {
    margin-bottom: 16px;
}

.balance-cards {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.balance-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-size: 13px;
}

.balance-card i {
    color: var(--primary-color);
}

/* ==================== Splash Screen ==================== */
.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b1120;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.splash-screen::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.08) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: splashPulseGlow 3s ease-in-out infinite alternate;
}

@keyframes splashPulseGlow {
    from { transform: translate(-50%, -50%) scale(0.8); opacity: 0.5; }
    to { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

.splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.splash-content {
    text-align: center;
    position: relative;
    z-index: 1;
    animation: splashFadeIn 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

.splash-logo-container {
    margin-bottom: 48px;
    position: relative;
}

.splash-logo {
    display: block;
    width: min(22rem, 80vw);
    max-width: 100%;
    height: auto;
    animation: splashLogoReveal 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes splashLogoReveal {
    from { opacity: 0; transform: scale(0.9); filter: blur(4px); }
    to { opacity: 1; transform: scale(1); filter: blur(0); }
}

.splash-loader {
    width: 180px;
    height: 2px;
    background: rgba(96, 165, 250, 0.1);
    border-radius: 10px;
    margin: 0 auto 40px;
    overflow: hidden;
}

.splash-loader-bar {
    width: 0%;
    height: 100%;
    background: #60a5fa;
    border-radius: 10px;
    animation: splashLoading 2.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    box-shadow: 0 0 12px rgba(96, 165, 250, 0.5);
}

@keyframes splashLoading {
    0% { width: 0%; }
    20% { width: 25%; }
    50% { width: 55%; }
    80% { width: 80%; }
    100% { width: 100%; }
}

.splash-company {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: splashFadeIn 1s ease 0.6s both;
}

.splash-company-logo {
    width: 36px;
    height: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.5;
}

.splash-powered {
    font-size: 10px;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-weight: 500;
}

.splash-company-name {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ==================== Sidebar Logo Image ==================== */
.sidebar-logo-img {
    width: min(100%, 9.5rem);
    max-width: 9.5rem;
    height: auto;
    margin-inline: auto;
    object-fit: contain;
    transition: transform var(--transition-normal);
}

/* Default / Dark Theme: show logo-light, hide logo-dark */
.sidebar-logo-img.logo-light {
    display: block !important;
    filter: drop-shadow(0 12px 24px rgba(15, 23, 42, 0.2));
}

.sidebar-logo-img.logo-dark {
    display: none !important;
}

/* Light Theme: hide logo-light, show logo-dark */
[data-theme="light"] .sidebar-logo-img.logo-light,
html[data-theme="light"] .sidebar-logo-img.logo-light,
body[data-theme="light"] .sidebar-logo-img.logo-light {
    display: none !important;
}

[data-theme="light"] .sidebar-logo-img.logo-dark,
html[data-theme="light"] .sidebar-logo-img.logo-dark,
body[data-theme="light"] .sidebar-logo-img.logo-dark {
    display: block !important;
    filter: drop-shadow(0 10px 20px rgba(15, 23, 42, 0.08));
}

.sidebar-header:hover .sidebar-logo-img {
    transform: scale(1.02);
}

/* Sidebar Company Branding */
.sidebar-company {
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.5;
    transition: opacity var(--transition-normal);
    flex: 1;
    min-width: 0;
}

.sidebar-company:hover {
    opacity: 0.8;
}

.company-logo-img {
    width: 18px;
    height: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
    flex-shrink: 0;
}

.sidebar-powered-by {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.sidebar-company-name {
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== Login Logo Image ==================== */
.login-logo-img {
    display: block;
    width: min(100%, 15rem);
    max-width: 15rem;
    height: auto;
    margin-inline: auto;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.1));
    animation: loginLogoFloat 6s ease-in-out infinite;
}

/* Login logo — match sidebar: light variant on dark panel, dark variant on light panel */
.login-logo-img.logo-dark {
    display: none !important;
}
.login-logo-img.logo-light {
    display: block !important;
}

[data-theme="light"] .login-logo-img.logo-light,
html[data-theme="light"] .login-logo-img.logo-light,
body[data-theme="light"] .login-logo-img.logo-light {
    display: none !important;
}

[data-theme="light"] .login-logo-img.logo-dark,
html[data-theme="light"] .login-logo-img.logo-dark,
body[data-theme="light"] .login-logo-img.logo-dark {
    display: block !important;
    filter: drop-shadow(0 10px 20px rgba(15, 23, 42, 0.08));
}

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

/* ==================== Activation Logo Image ==================== */
.activation-logo-img {
    display: block;
    width: min(100%, 13rem);
    max-width: 13rem;
    height: auto;
    margin-inline: auto;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.1));
    animation: loginLogoFloat 6s ease-in-out infinite;
}

.activation-logo-img.logo-dark {
    display: none !important;
}
.activation-logo-img.logo-light {
    display: block !important;
}

[data-theme="light"] .activation-logo-img.logo-light,
html[data-theme="light"] .activation-logo-img.logo-light,
body[data-theme="light"] .activation-logo-img.logo-light {
    display: none !important;
}

[data-theme="light"] .activation-logo-img.logo-dark,
html[data-theme="light"] .activation-logo-img.logo-dark,
body[data-theme="light"] .activation-logo-img.logo-dark {
    display: block !important;
    filter: drop-shadow(0 10px 20px rgba(15, 23, 42, 0.08));
}

/* ==================== Company Credit ==================== */
.footer-company {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
}

.footer-company-logo {
    width: 22px;
    height: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.7;
}

.company-credit {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.5px;
    opacity: 0.7;
}

/* ==================== Professional Animations & Transitions ==================== */

/* Page Transitions */
.page {
    animation: none;
}

.page.active {
    animation: pageSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

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

/* Card Entrance Animations */
.card,
.stat-card,
.balance-card {
    animation: cardFadeUp 0.5s ease forwards;
    animation-delay: var(--card-delay, 0ms);
}

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

/* Enhanced Card Hover Effects */
.card {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(96, 165, 250, 0.12);
}

/* Stat Card Hover */
.stat-card {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
    transition: transform var(--transition-normal);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1);
}

/* Button Animations — subdued; no ripple / shine */
.btn {
    transition: background-color var(--transition-fast), border-color var(--transition-fast),
        color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    filter: none;
}

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

.btn-secondary:hover {
    transform: translateY(-1px);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.22);
}

.page-actions .btn i {
    transition: transform var(--transition-fast);
}

.page-actions .btn:hover i {
    transform: none;
}

/* Stats Row Stagger Animation */
.stats-row .stat-card:nth-child(1) { --card-delay: 0ms; }
.stats-row .stat-card:nth-child(2) { --card-delay: 60ms; }
.stats-row .stat-card:nth-child(3) { --card-delay: 120ms; }
.stats-row .stat-card:nth-child(4) { --card-delay: 180ms; }
.stats-row .stat-card:nth-child(5) { --card-delay: 240ms; }
.stats-row .stat-card:nth-child(6) { --card-delay: 300ms; }

/* Data Import Wizard */
.data-import-card .card-body {
    padding: 1.5rem;
}

.data-import-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-import-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.data-import-step span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--bg-tertiary);
    font-weight: 600;
    font-size: 0.8rem;
}

.data-import-step.active {
    color: var(--primary-color);
    font-weight: 600;
}

.data-import-step.active span {
    background: var(--primary-color);
    color: #fff;
}

.data-import-step.done {
    color: var(--success-color);
}

.data-import-step.done span {
    background: var(--success-color);
    color: #fff;
}

.data-import-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.data-import-file-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.data-import-file-path {
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    word-break: break-all;
    margin-bottom: 1rem;
}

.data-import-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.data-import-mapping-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.data-import-issues {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: rgba(255, 193, 7, 0.1);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.data-import-issues ul {
    margin: 0.5rem 0 0;
    padding-inline-start: 1.25rem;
    font-size: 0.85rem;
}

.data-import-preview-table {
    font-size: 0.85rem;
}

.data-import-row-invalid {
    background: rgba(220, 53, 69, 0.08);
}

.data-import-results h4 {
    margin-bottom: 0.75rem;
}

.data-import-mode-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.data-import-mode-tab {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    cursor: pointer;
    font-size: 0.875rem;
}

.data-import-mode-tab.active {
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb, 59, 130, 246), 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

.data-import-order-banner {
    padding: 0.75rem 1rem;
    background: rgba(59, 130, 246, 0.08);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.data-import-duplicate-options {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.data-import-duplicate-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.data-import-json-preview table {
    font-size: 0.85rem;
}

/* ==================== Training Plans (Workouts & Nutrition) ==================== */
.tp-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    width: fit-content;
}

.tp-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.tp-tab:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.tp-tab.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.tp-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: var(--radius-full);
    background: rgba(127, 127, 127, 0.18);
    font-size: 12px;
}

.tp-tab.active .tp-tab-count {
    background: rgba(255, 255, 255, 0.25);
}

.tp-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.tp-search {
    position: relative;
    flex: 1;
    max-width: 420px;
}

.tp-search i {
    position: absolute;
    top: 50%;
    inset-inline-start: 14px;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
}

.tp-search input {
    width: 100%;
    padding: 10px 14px;
    padding-inline-start: 38px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.tp-search input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.tp-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}

.tp-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.tp-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-light);
}

.tp-card-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.tp-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: var(--radius-lg);
    font-size: 18px;
}

.tp-card-icon.workout {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(2, 132, 199, 0.12));
    color: var(--primary-color);
}

.tp-card-icon.nutrition {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.08));
    color: #10b981;
}

.tp-card-titles {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.tp-card-titles h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.tp-card-desc {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tp-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--text-secondary);
    font-size: 13px;
}

.tp-card-meta i {
    margin-inline-end: 5px;
    color: var(--text-muted);
}

.tp-card-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.tp-card-actions .btn {
    justify-content: center;
    padding: 7px 4px;
    font-size: 11px;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Macro bars */
.tp-macros {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tp-macro-bar {
    display: flex;
    height: 8px;
    border-radius: var(--radius-full);
    overflow: hidden;
    background: var(--bg-tertiary);
}

.tp-macro-seg.protein { background: #38bdf8; }
.tp-macro-seg.carbs { background: #f59e0b; }
.tp-macro-seg.fat { background: #a78bfa; }

.tp-macro-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.tp-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-inline-end: 5px;
}

.tp-dot.protein { background: #38bdf8; }
.tp-dot.carbs { background: #f59e0b; }
.tp-dot.fat { background: #a78bfa; }

/* Today panel */
.tp-today-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 16px;
    align-items: start;
}

@media (max-width: 860px) {
    .tp-today-layout {
        grid-template-columns: 1fr;
    }
}

.tp-today-picker {
    padding: 18px;
}

.tp-today-picker h3 {
    margin: 0 0 14px;
    font-size: 15px;
}

.tp-today-result {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tp-today-card {
    padding: 18px;
}

.tp-today-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.tp-today-card-head h3 {
    margin: 0;
    font-size: 16px;
    flex: 1;
}

.tp-today-card-head.workout i { color: var(--primary-color); }
.tp-today-card-head.nutrition i { color: #10b981; }

.tp-today-focus {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 12px;
}

.tp-exercise-table {
    font-size: 13px;
}

/* Meal list */
.tp-meal-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tp-meal-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.tp-meal-type {
    flex-shrink: 0;
    min-width: 92px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(16, 185, 129, 0.14);
    color: #10b981;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.tp-meal-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.tp-meal-foods {
    color: var(--text-secondary);
    font-size: 12.5px;
}

/* Detail modal */
.tp-detail {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tp-detail-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tp-detail-desc {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.tp-detail-section {
    margin: 6px 0 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-primary);
}

.tp-detail-day {
    padding: 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.tp-detail-day-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.tp-day-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

/* Builders */
.tp-form-section {
    margin: 18px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-primary);
}

.tp-day-block,
.tp-meal-block {
    margin-bottom: 12px;
    padding: 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.tp-day-block-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.tp-day-title { flex: 2; }
.tp-day-focus { flex: 3; }

.tp-ex-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.tp-ex-row {
    display: grid;
    grid-template-columns: 3fr 70px 90px 2fr 36px;
    gap: 6px;
    align-items: center;
}

.tp-ex-row-head {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.tp-ex-row .form-control {
    padding: 7px 10px;
    font-size: 13px;
}

.tp-add-ex {
    width: 100%;
    border-style: dashed;
}

.tp-builder-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tp-day-name {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    min-height: 34px;
    padding: 5px 9px;
    border-radius: var(--radius-md);
    background: var(--primary-color);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.tp-meal-block-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.tp-meal-type-select {
    flex: 0 0 150px;
}

.tp-meal-cal {
    flex: 0 0 100px;
}

.tp-meal-block-row input[data-mfield="title"] {
    flex: 1;
}

@media (max-width: 720px) {
    .tp-ex-row {
        grid-template-columns: 1fr 60px 70px 36px;
    }
    .tp-ex-row [data-exfield="notes"],
    .tp-ex-row-head span:nth-child(4) {
        display: none;
    }
}

/* Advanced player schedule center */
.tp-player-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
}

.tp-player-toolbar p {
    margin: 0;
    color: var(--text-secondary);
}

.tp-player-toolbar p i {
    color: var(--primary-color);
    margin-inline-end: 6px;
}

.tp-player-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tp-player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}

.tp-player-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.tp-player-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.tp-player-card.no-schedule {
    border-style: dashed;
}

.tp-player-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tp-player-avatar {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    color: #fff;
    font-size: 19px;
    font-weight: 800;
}

.tp-player-identity {
    flex: 1;
    min-width: 0;
}

.tp-player-identity h3 {
    margin: 0 0 3px;
    color: var(--text-primary);
    font-size: 16px;
}

.tp-player-identity span {
    color: var(--text-muted);
    font-size: 12px;
}

.tp-player-programs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.tp-player-program {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    background: var(--bg-tertiary);
}

.tp-player-program.is-linked {
    border-style: solid;
    border-color: rgba(2, 132, 199, .28);
    color: var(--primary-color);
    background: rgba(2, 132, 199, .07);
}

.tp-player-program.nutrition.is-linked {
    border-color: rgba(16, 185, 129, .28);
    color: #10b981;
    background: rgba(16, 185, 129, .07);
}

.tp-player-program > i {
    font-size: 18px;
}

.tp-player-program div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tp-player-program span {
    color: var(--text-muted);
    font-size: 11px;
}

.tp-player-program strong {
    overflow: hidden;
    color: var(--text-primary);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tp-player-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.tp-player-actions .btn {
    justify-content: center;
    padding: 7px 4px;
    font-size: 11px;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

@media (max-width: 640px) {
    .tp-card-actions,
    .tp-player-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

.tp-player-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
}

.tp-player-modal-head > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tp-player-modal-head > div:first-child {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.tp-player-modal-head span {
    color: var(--text-muted);
    font-size: 12px;
}

.tp-player-detail,
.tp-program-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tp-program-section {
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
}

.tp-program-title {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.tp-program-title > i {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    color: var(--primary-color);
    background: rgba(2, 132, 199, .1);
}

.tp-program-title.nutrition > i {
    color: #10b981;
    background: rgba(16, 185, 129, .1);
}

.tp-program-title span {
    color: var(--text-muted);
    font-size: 11px;
}

.tp-program-title h3 {
    margin: 2px 0 0;
    color: var(--text-primary);
    font-size: 16px;
}

.tp-week-schedule {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px;
}

.tp-week-day {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
}

.tp-week-day-head {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3px 8px;
    align-items: center;
    margin-bottom: 10px;
}

.tp-week-day-head > span {
    grid-row: span 2;
    padding: 5px 8px;
    border-radius: var(--radius-md);
    color: #fff;
    background: var(--primary-color);
    font-size: 11px;
    font-weight: 700;
}

.tp-week-day-head strong {
    color: var(--text-primary);
    font-size: 13px;
}

.tp-week-day-head em {
    color: var(--text-muted);
    font-size: 11px;
    font-style: normal;
}

.tp-week-exercises {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tp-week-exercises > div {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 8px;
    padding: 7px 8px;
    border-radius: 7px;
    background: var(--bg-card);
}

.tp-week-exercises strong {
    color: var(--text-primary);
    font-size: 12px;
}

.tp-week-exercises span {
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 700;
}

.tp-week-exercises small {
    grid-column: 1 / -1;
    color: var(--text-muted);
}

.tp-link-program-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.tp-link-program {
    padding: 14px;
    border: 1px solid rgba(2, 132, 199, .25);
    border-radius: var(--radius-md);
    background: rgba(2, 132, 199, .06);
}

.tp-link-program.nutrition {
    border-color: rgba(16, 185, 129, .25);
    background: rgba(16, 185, 129, .06);
}

.tp-link-program h4 {
    margin: 0 0 10px;
    color: var(--text-primary);
}

.tp-link-program h4 i {
    margin-inline-end: 6px;
    color: var(--primary-color);
}

.tp-link-program.nutrition h4 i {
    color: #10b981;
}

.tp-clone-flow {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 14px;
    align-items: center;
}

.tp-clone-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
}

.tp-clone-step .form-group {
    flex: 1;
    margin-bottom: 0;
}

.tp-clone-step-number {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    font-weight: 800;
}

.tp-clone-arrow {
    color: var(--primary-color);
    font-size: 20px;
}

[dir="rtl"] .tp-clone-arrow {
    transform: rotate(180deg);
}

.tp-clone-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0 12px;
    padding: 14px;
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
}

.tp-clone-options h4 {
    width: 100%;
    margin: 0 0 3px;
}

.tp-clone-option {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 200px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    cursor: pointer;
}

.tp-clone-option input {
    width: 17px;
    height: 17px;
    accent-color: var(--primary-color);
}

.tp-clone-option i {
    margin-inline-end: 5px;
    color: var(--primary-color);
}

.tp-clone-option:nth-of-type(2) i {
    color: #10b981;
}

.tp-clone-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.tp-clone-summary > div {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-muted);
}

.tp-clone-summary > div.is-available {
    border-style: solid;
    border-color: rgba(16, 185, 129, .3);
    color: var(--text-primary);
    background: rgba(16, 185, 129, .06);
}

.tp-member-picker {
    margin: 14px 0;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
}

.tp-member-picker-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.tp-member-search {
    position: relative;
    flex: 1 1 260px;
}

.tp-member-search i {
    position: absolute;
    inset-inline-start: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.tp-member-search input {
    padding-inline-start: 36px;
}

.tp-member-picker-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
    gap: 8px;
    max-height: 390px;
    overflow-y: auto;
    padding: 12px;
}

.tp-member-choice {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: border-color var(--transition-normal), background var(--transition-normal);
}

.tp-member-choice:hover {
    border-color: var(--primary-color);
    background: rgba(2, 132, 199, .06);
}

.tp-member-choice > input {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    accent-color: var(--primary-color);
}

.tp-member-choice-avatar {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.tp-member-choice-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.tp-member-choice-info strong {
    overflow: hidden;
    color: var(--text-primary);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tp-member-choice-info small {
    color: var(--text-muted);
}

@media (max-width: 720px) {
    .tp-player-grid,
    .tp-player-programs,
    .tp-link-program-grid,
    .tp-clone-summary {
        grid-template-columns: 1fr;
    }

    .tp-player-toolbar,
    .tp-player-modal-head {
        align-items: stretch;
        flex-direction: column;
    }

    .tp-clone-flow {
        grid-template-columns: 1fr;
    }

    .tp-clone-arrow {
        justify-self: center;
        transform: rotate(90deg);
    }

    [dir="rtl"] .tp-clone-arrow {
        transform: rotate(90deg);
    }
}

/* ==================== Live Gym Floor & Attendance Hub ==================== */
.live-floor-hub {
    margin-bottom: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.live-floor-header {
    padding: 10px 18px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(180deg, var(--bg-tertiary) 0%, var(--bg-card) 100%);
    border-bottom: 1px solid var(--border-color);
}

.live-floor-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-floor-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.live-indicator-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: pulseLiveDot 1.8s infinite;
}

@keyframes pulseLiveDot {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.8; }
}

.live-floor-subtitle {
    display: none;
}

.live-floor-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.live-floor-search-box {
    position: relative;
    width: 200px;
}

.live-floor-search-box input {
    padding-inline-start: 30px;
    height: 30px;
    font-size: 12px;
    border-radius: var(--radius-md);
}

.live-floor-search-box i {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    inset-inline-start: 10px;
    color: var(--text-muted);
    font-size: 11px;
    pointer-events: none;
}

.live-floor-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    padding: 10px 18px 8px;
    background: var(--bg-card);
}

.live-floor-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: all 0.22s ease;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.live-floor-pill:hover {
    transform: translateY(-1px);
    border-color: var(--border-light);
    box-shadow: var(--shadow-sm);
}

.live-floor-pill.active {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.live-floor-pill-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.live-floor-pill--members .live-floor-pill-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.live-floor-pill--trainers .live-floor-pill-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.live-floor-pill--checkedout .live-floor-pill-icon {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

.live-floor-pill--allday .live-floor-pill-icon {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.live-floor-pill-data {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.live-floor-pill-value {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-primary);
}

.live-floor-pill-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.2px;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-floor-tab-content {
    padding: 0 18px 12px;
    max-height: 250px;
    overflow-y: auto;
}

.live-floor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 8px;
    margin-top: 6px;
}

.live-person-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.live-person-card:hover {
    border-color: var(--border-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.live-person-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-color);
    flex-shrink: 0;
    overflow: hidden;
}

.live-person-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-person-info {
    flex: 1;
    min-width: 0;
}

.live-person-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.live-person-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-muted);
}

.live-duration-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    font-size: 10.5px;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.live-checkout-btn {
    flex-shrink: 0;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.35);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.live-checkout-btn:hover {
    background: var(--danger-color);
    color: #ffffff;
    border-color: var(--danger-color);
}

.role-dashboard-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(56, 189, 248, 0.06) 100%);
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.role-dashboard-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-color);
}

/* ==================== Advanced Micro-Interactions & Transitions ==================== */

/* 1. Fluid Page Transitions */
.page.active {
    animation: appPageFadeSlide 0.26s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

/* 2. Tactile Button & Control Press Micro-Interactions */
.btn:active,
.quick-action-btn:active,
.sidebar-theme-btn:active,
.lang-toggle:active,
.tab-btn:active,
.floating-contact-toggle:active,
.nav-tabs button:active,
.workspace-tab:active {
    transform: scale(0.96) !important;
    transition: transform 0.08s ease !important;
}

/* 3. Interactive Metric Cards Hover Elevation */
.module-hub-kpi,
.role-hub-card,
.hub-kpi-card,
.quick-action-btn,
.stat-card {
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.24s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.24s ease !important;
}

.module-hub-kpi:hover,
.role-hub-card:hover,
.hub-kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.16), 0 0 14px rgba(56, 189, 248, 0.12);
}

.quick-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.14), 0 0 10px rgba(56, 189, 248, 0.15);
}

/* 4. Modal Spring Pop-in & Backdrop Blur Transition */
.modal.active {
    animation: modalBackdropFadeIn 0.22s ease-out both;
}

.modal.active .modal-content,
.modal.active .modal-dialog {
    animation: modalSpringPopup 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.15) both;
}

@keyframes modalBackdropFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(6px);
    }
}

@keyframes modalSpringPopup {
    from {
        opacity: 0;
        transform: scale(0.94) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 5. Floating Contact Pulsing Ring & Staggered Options Entrance */
@keyframes contactPulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.5), 0 12px 30px rgba(15, 23, 42, 0.35);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(14, 165, 233, 0), 0 16px 36px rgba(14, 165, 233, 0.4);
    }
}

.floating-contact-toggle {
    animation: contactPulseGlow 3s infinite ease-in-out;
}

.floating-contact.is-open .floating-contact-option:nth-child(1) { animation: contactItemSlide 0.22s 0.02s cubic-bezier(0.16, 1, 0.3, 1) both; }
.floating-contact.is-open .floating-contact-option:nth-child(2) { animation: contactItemSlide 0.22s 0.05s cubic-bezier(0.16, 1, 0.3, 1) both; }
.floating-contact.is-open .floating-contact-option:nth-child(3) { animation: contactItemSlide 0.22s 0.08s cubic-bezier(0.16, 1, 0.3, 1) both; }
.floating-contact.is-open .floating-contact-option:nth-child(4) { animation: contactItemSlide 0.22s 0.11s cubic-bezier(0.16, 1, 0.3, 1) both; }
.floating-contact.is-open .floating-contact-option:nth-child(5) { animation: contactItemSlide 0.22s 0.14s cubic-bezier(0.16, 1, 0.3, 1) both; }
.floating-contact.is-open .floating-contact-option:nth-child(6) { animation: contactItemSlide 0.22s 0.17s cubic-bezier(0.16, 1, 0.3, 1) both; }

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

/* 6. Toast & Banner Slide-in Bounce */
.toast-notification,
.toast,
.alert-banner {
    animation: toastSmoothSlide 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes toastSmoothSlide {
    from {
        opacity: 0;
        transform: translateY(-14px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}