@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base Theme Configurations */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root,
.futuristic-theme {
    color-scheme: dark;
    --font-primary: 'Space Grotesk', sans-serif;
    --font-secondary: 'Plus Jakarta Sans', sans-serif;

    --bg: #000000;
    --bg-gradient: radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 34%),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.14), transparent 30%),
        radial-gradient(circle at bottom center, rgba(29, 78, 216, 0.12), transparent 28%),
        linear-gradient(180deg, #050505 0%, #000000 100%);
    --bg-surface: rgba(10, 10, 15, 0.78);
    --bg-panel: rgba(12, 12, 18, 0.92);
    --surface: rgba(59, 130, 246, 0.06);
    --surface-strong: rgba(59, 130, 246, 0.12);

    --text: #f1f5f9;
    --muted: #94a3b8;
    --muted-strong: #cbd5e1;

    --border: rgba(59, 130, 246, 0.16);
    --border-glow: rgba(59, 130, 246, 0.35);

    --primary: #3b82f6;
    --secondary: #1d4ed8;
    --primary-rgb: 59, 130, 246;
    --secondary-rgb: 29, 78, 216;
    --accent: var(--primary);
    --accent-rgb: var(--primary-rgb);
    --accent-soft: rgba(59, 130, 246, 0.14);
    --accent-dark: var(--secondary);

    --shadow: none;
    --shadow-soft: none;

    --sidebar: rgba(0, 0, 0, 0.92);
    --sidebar-text: #f1f5f9;
    --sidebar-muted: #94a3b8;
    --sidebar-border: rgba(59, 130, 246, 0.14);

    --danger: #f87171;
    --success: #4ade80;
    --chart-sales: var(--primary);
    --chart-items: var(--secondary);
}

.dark-theme {
    color-scheme: dark;
    --font-primary: 'Space Grotesk', sans-serif;
    --font-secondary: 'Plus Jakarta Sans', sans-serif;

    --bg: #000000;
    --bg-gradient: radial-gradient(circle at top, rgba(37, 99, 235, 0.15), transparent 32%),
        radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.1), transparent 28%),
        linear-gradient(180deg, #030303 0%, #000000 100%);
    --bg-surface: rgba(8, 8, 12, 0.82);
    --bg-panel: rgba(10, 10, 16, 0.94);
    --surface: rgba(59, 130, 246, 0.05);
    --surface-strong: rgba(59, 130, 246, 0.1);

    --text: #ffffff;
    --muted: #94a3b8;
    --muted-strong: #cbd5e1;

    --border: rgba(59, 130, 246, 0.14);
    --border-glow: rgba(59, 130, 246, 0.3);

    --primary: #2563eb;
    --secondary: #1e40af;
    --primary-rgb: 37, 99, 235;
    --secondary-rgb: 30, 64, 175;
    --accent: var(--primary);
    --accent-rgb: var(--primary-rgb);
    --accent-soft: rgba(37, 99, 235, 0.14);
    --accent-dark: var(--secondary);

    --shadow: none;
    --shadow-soft: none;

    --sidebar: rgba(0, 0, 0, 0.96);
    --sidebar-text: #ffffff;
    --sidebar-muted: #94a3b8;
    --sidebar-border: rgba(59, 130, 246, 0.12);

    --danger: #f87171;
    --success: #4ade80;
    --chart-sales: var(--primary);
    --chart-items: var(--secondary);
}

.light-theme {
    color-scheme: light;
    --font-primary: 'Space Grotesk', sans-serif;
    --font-secondary: 'Plus Jakarta Sans', sans-serif;

    --bg: #ffffff;
    --bg-gradient: radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 28%),
        radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.06), transparent 26%),
        linear-gradient(180deg, #ffffff 0%, #f0f4ff 100%);
    --bg-surface: rgba(255, 255, 255, 0.94);
    --bg-panel: rgba(255, 255, 255, 0.98);
    --surface: rgba(37, 99, 235, 0.04);
    --surface-strong: rgba(37, 99, 235, 0.08);

    --text: #0f172a;
    --muted: #64748b;
    --muted-strong: #334155;

    --border: rgba(37, 99, 235, 0.12);
    --border-glow: rgba(37, 99, 235, 0.22);

    --primary: #2563eb;
    --secondary: #1d4ed8;
    --primary-rgb: 37, 99, 235;
    --secondary-rgb: 29, 78, 216;
    --accent: var(--primary);
    --accent-rgb: var(--primary-rgb);
    --accent-soft: rgba(37, 99, 235, 0.08);
    --accent-dark: var(--secondary);

    --shadow: none;
    --shadow-soft: none;

    --sidebar: rgba(255, 255, 255, 0.96);
    --sidebar-text: #0f172a;
    --sidebar-muted: #64748b;
    --sidebar-border: rgba(37, 99, 235, 0.1);

    --danger: #dc2626;
    --success: #16a34a;
    --chart-sales: var(--primary);
    --chart-items: var(--secondary);
}

body {
    min-height: 100vh;
    font-family: var(--font-primary);
    font-size: 15.5px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    background-image: var(--bg-gradient);
    transition: background 0.3s ease, color 0.3s ease, background-image 0.3s ease;
    position: relative;
    background-attachment: fixed;
}

body::before,
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

body::before {
    background:
        linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
    background-size: 52px 52px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 84%);
}

body::after {
    background:
        radial-gradient(circle at 15% 20%, rgba(var(--primary-rgb, var(--accent-rgb)), 0.16), transparent 24%),
        radial-gradient(circle at 88% 18%, rgba(var(--secondary-rgb, var(--accent-rgb)), 0.12), transparent 20%),
        radial-gradient(circle at 60% 82%, rgba(var(--primary-rgb, var(--accent-rgb)), 0.08), transparent 22%);
    opacity: 1;
}

/* Grid overlay for futuristic theme */
.futuristic-theme::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

body,
input,
select,
button,
textarea {
    font-family: var(--font-primary);
}

::selection {
    background: var(--accent);
    color: #ffffff;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.08);
}

::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-rgb), 0.42);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--accent-rgb), 0.62);
    background-clip: content-box;
}

:focus-visible {
    outline: 2px solid rgba(var(--accent-rgb), 0.7);
    outline-offset: 3px;
}

@keyframes interface-reveal {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes signal-pulse {

    0%,
    100% {
        box-shadow: none;
    }

    50% {
        box-shadow: none;
    }
}

button,
input,
select,
textarea {
    outline: none;
}

img {
    max-width: 100%;
    display: block;
}

html,
body {
    overflow-x: hidden;
    height: 100%;
}

body.sidebar-open {
    overflow: hidden;
}

.app-page,
.login-page {
    position: relative;
    z-index: 1;
}

.section,
.card,
.form-panel,
.detail-value,
.readonly-field,
.page-header,
.showroom-card,
.support-panel {
    overflow-wrap: anywhere;
    word-break: break-word;
    box-sizing: border-box;
}

/* Login Page Styling */
.login-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
    isolation: isolate;
}

.login-container {
    width: min(460px, calc(100% - 32px));
    position: relative;
    z-index: 1;
}

.login-card {
    position: relative;
    padding: 42px 38px 36px;
    border-radius: 32px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    box-shadow: none;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transform: translateY(0);
}

.futuristic-theme .login-card {
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: none;
}

.login-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, var(--accent-soft), transparent 36%);
    pointer-events: none;
}

.login-brand h1 {
    font-size: clamp(2rem, 4vw, 2.7rem);
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text), var(--muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-brand p {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.login-form {
    margin-top: 26px;
    display: grid;
    gap: 20px;
}

.login-form .btn,
.forgot-password-form .btn {
    width: 100%;
}

.login-footer {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
}

.forgot-password-toggle {
    border: none;
    background: transparent;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.forgot-password-toggle:hover {
    text-decoration: underline;
}

.forgot-password-panel {
    margin-top: 18px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    display: grid;
    gap: 16px;
}

.forgot-password-note {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.forgot-password-form {
    display: grid;
    gap: 16px;
}

.auth-message {
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.auth-message-success {
    color: var(--success);
    background: rgba(52, 211, 153, 0.08);
    border-color: rgba(52, 211, 153, 0.18);
}

.auth-message-error {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

.form-group {
    display: grid;
    gap: 8px;
}

.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted-strong);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    min-height: 48px;
    border-radius: 14px;
    border: 1px solid var(--border);
    padding: 13px 16px;
    font-size: 0.96rem;
    background: var(--surface);
    color: var(--text);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

select option {
    background: var(--bg-panel);
    color: var(--text);
}

.form-group input::placeholder,
.form-group select::placeholder,
.form-group textarea::placeholder {
    color: var(--muted);
    opacity: 0.6;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    background: var(--surface-strong);
    box-shadow: none;
    transform: translateY(-1px);
}

.form-error {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.9rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 12px 18px;
    border: none;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    gap: 8px;
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    box-shadow: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-strong);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.btn-small {
    padding: 8px 14px;
    font-size: 0.85rem;
    min-height: 36px;
    border-radius: 999px;
}

.btn-danger {
    color: #fff;
    background: linear-gradient(135deg, #fb7185, #e11d48);
    box-shadow: none;
}

.btn-danger:hover {
    transform: translateY(-1px);
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.74);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    z-index: 99999;
}

.modal-content {
    position: relative;
    width: min(720px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 28px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    box-shadow: none;
    padding: 32px;
    animation: interface-reveal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    z-index: 100000;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    border: 1px solid var(--border);
}

.modal-close:hover {
    background: var(--danger);
    color: #ffffff;
    border-color: transparent;
}

/* Sidebar Layout */
.app-page {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 286px;
    background: var(--sidebar);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    gap: 20px;
    border-right: 1px solid var(--sidebar-border);
    box-shadow: none;
    z-index: 100;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.sidebar-mobile-toggle {
    display: none;
    position: fixed;
    top: calc(12px + env(safe-area-inset-top));
    left: 12px;
    z-index: 420;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-panel);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    box-shadow: none;
    cursor: pointer;
    touch-action: manipulation;
}

.sidebar-backdrop {
    display: none;
}

.sidebar-brand {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 6px;
    min-width: 0;
    padding-top: 2px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 58px;
    border-radius: 16px;
    background: #ffffff;
    color: #ffffff;
    box-shadow: none;
    flex: 0 0 auto;
}

.brand-mark-image {
    overflow: hidden;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-mark-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.sidebar-brand h1 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.1;
}

.sidebar-user {
    margin-top: 0;
    width: fit-content;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 16px;
    background: var(--surface);
    color: var(--sidebar-muted);
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--sidebar-border);
    white-space: nowrap;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: none;
}

.sidebar-label {
    padding-left: 12px;
    color: var(--sidebar-muted);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
    overflow-y: auto;
    align-content: start;
    grid-auto-rows: min-content;
}

.sidebar-footer {
    display: grid;
    gap: 6px;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar-item {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 14px;
    text-decoration: none;
    color: var(--sidebar-muted);
    font-weight: 600;
    font-size: 0.94rem;
    transition: all 0.2s ease;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
}

.sidebar-item:hover,
.sidebar-item.active {
    background: rgba(var(--accent-rgb), 0.12);
    color: #ffffff;
    border-color: rgba(var(--accent-rgb), 0.2);
    transform: none;
}

.sidebar-item.active {
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.22), rgba(14, 165, 233, 0.16));
    color: #ffffff;
    box-shadow: none;
    animation: none;
}

.sidebar-item.logout {
    background: rgba(239, 68, 68, 0.08);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.sidebar-item.logout:hover {
    background: rgba(239, 68, 68, 0.18);
    color: #ffffff;
}

.theme-toggle {
    position: relative;
    overflow: hidden;
}

.theme-toggle::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.08) 40%, transparent 70%);
    transform: translateX(-120%);
    transition: transform 0.45s ease;
}

.theme-toggle:hover::after {
    transform: translateX(120%);
}

/* Content Frame */
.content {
    flex-grow: 1;
    min-height: 100vh;
    margin-left: 286px;
    padding: 36px clamp(22px, 4vw, 48px) 40px;
    overflow-y: auto;
    position: relative;
    z-index: 1;
    animation: interface-reveal 0.4s ease both;
}

.page-hero {
    position: relative;
    margin-bottom: 26px;
    padding: 32px 32px 30px;
    border-radius: 30px;
    overflow: hidden;
    background: transparent;
    border: none;
    box-shadow: none;
}



.page-hero-copy {
    position: relative;
    z-index: 1;
    max-width: 980px;
}

.page-hero h2 {
    font-size: clamp(2.3rem, 5vw, 3.4rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin-top: 10px;
    margin-bottom: 10px;
}

.page-hero p {
    font-size: 1rem;
    color: var(--muted);
    max-width: 760px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.hero-stat {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
}

.hero-stat-label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero-stat-value {
    display: block;
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Page Header component */
.page-header {
    margin-bottom: 28px;
    padding: 28px 28px 30px;
    background: var(--bg-surface);
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(var(--accent-rgb), 0.14), transparent 34%);
    pointer-events: none;
}

.page-header::after {
    content: '';
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.65), transparent);
    pointer-events: none;
}

.page-header h2 {
    position: relative;
    font-size: clamp(2.1rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
}

.page-header p {
    position: relative;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.96rem;
}

.page-header .showroom-name {
    position: relative;
    margin-top: 8px;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Cards System */
.dashboard-grid,
.showroom-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
    margin-bottom: 30px;
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 24px;
    box-shadow: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
}

.card .card-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 1), rgba(14, 165, 233, 0.9));
    box-shadow: none;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.12), transparent 28%, transparent 72%, rgba(52, 211, 153, 0.06));
    pointer-events: none;
    opacity: 0.85;
}

.card>* {
    position: relative;
    z-index: 1;
}

.card:hover,
.showroom-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: none;
}

.futuristic-theme .card:hover {
    box-shadow: none;
}

.card-master {
    background: linear-gradient(135deg, rgba(var(--primary-rgb, var(--accent-rgb)), 0.1), rgba(var(--secondary-rgb, var(--accent-rgb)), 0.05));
    border-color: rgba(var(--primary-rgb, var(--accent-rgb)), 0.28);
}

.card-user {
    background: linear-gradient(135deg, rgba(var(--secondary-rgb, var(--accent-rgb)), 0.08), rgba(var(--primary-rgb, var(--accent-rgb)), 0.05));
    border-color: rgba(var(--secondary-rgb, var(--accent-rgb)), 0.25);
}

.card h3 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.card p {
    font-size: clamp(1.8rem, 2vw, 2.35rem);
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.01em;
}

.card .card-subtitle {
    font-size: 0.92rem;
    color: var(--muted);
    font-weight: 500;
    margin-top: 8px;
}

.form-panel,
.section,
.showroom-card,
.support-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.section {
    position: relative;
    overflow: hidden;
}

.section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(var(--primary-rgb, var(--accent-rgb)), 0.06), transparent 30%, transparent 70%, rgba(var(--secondary-rgb, var(--accent-rgb)), 0.04));
    pointer-events: none;
}

.section>* {
    position: relative;
    z-index: 1;
}

.section {
    padding: 26px;
    margin-top: 24px;
}

.section h3 {
    margin-bottom: 16px;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.form-panel {
    padding: 30px;
    margin-top: 24px;
}

.form-panel .section-header,
.section .section-header {
    margin-bottom: 20px;
}

.settings-card-body {
    max-width: 640px;
}

.settings-stack {
    display: grid;
    gap: 14px;
}

.settings-shell {
    max-width: 720px;
}

.profile-name {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.profile-email {
    font-size: 0.92rem;
    color: var(--muted);
    margin-bottom: 14px;
}

.profile-meta {
    display: grid;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}

.theme-label {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    text-transform: capitalize;
    color: var(--accent);
}

.theme-copy {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.6;
}

.password-alert {
    display: none;
    margin-bottom: 20px;
}

.password-form {
    display: grid;
    gap: 16px;
}

.password-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.otp-panel {
    display: none;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    padding: 24px;
    margin-top: 24px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 22px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.14);
}

.otp-note {
    color: var(--muted);
    margin-top: 10px;
    display: block;
    font-size: 0.92rem;
    line-height: 1.5;
}

.confirm-page .confirm-card {
    width: 100%;
    max-width: 720px;
    padding: 38px;
    border-radius: 30px;
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(8, 18, 44, 0.96), rgba(6, 12, 24, 0.98));
}

.confirm-page .confirm-card h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    letter-spacing: -0.04em;
    font-size: clamp(2rem, 2.3vw, 2.45rem);
}

.confirm-page .meta-label {
    display: block;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.72);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.82rem;
}

.confirm-page p {
    margin-bottom: 1.5rem;
    color: rgba(238, 242, 255, 0.82);
    line-height: 1.85;
    font-size: 1rem;
}

.confirm-page .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 22px;
}

.confirm-page .form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    color: #f8fafc;
}

.confirm-page .form-group input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: #eef2ff;
    box-sizing: border-box;
}

.confirm-page .alert {
    border-radius: 18px;
    padding: 18px 20px;
    margin-bottom: 1.35rem;
}

.confirm-page .alert-info {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.22);
    color: #e0f7ff;
}

.confirm-page .alert-danger {
    background: rgba(248, 113, 113, 0.14);
    border: 1px solid rgba(248, 113, 113, 0.25);
    color: #ffe5e5;
}

.confirm-page .btn-primary {
    min-width: 160px;
}

.confirm-page .btn-secondary {
    min-width: 140px;
}

.confirm-page .btn-warning {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    border-color: transparent;
    color: #fff;
}

/* Forms layout */
.simple-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.simple-form .btn {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 10px;
}

/* Keep the sales filters together on one row without changing other forms. */
.sales-filter-form {
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(180px, 0.7fr) auto;
    align-items: end;
}

.sales-filter-form .btn {
    grid-column: auto;
    margin-top: 0;
    min-height: 48px;
}

.readonly-field {
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    font-weight: 600;
}

/* Tables styling */
.data-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin-top: 16px;
    overflow: hidden;
    border-radius: 20px;
}

.data-table th,
.data-table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 0.95rem;
    word-break: normal;
    overflow-wrap: normal;
}

    .data-table th:first-child,
    .data-table td:first-child {
        text-align: center;
        width: 80px;
    }

    .data-table th:last-child,
    .data-table td:last-child {
        text-align: center;
        white-space: nowrap;
    }

    .data-table td {
        vertical-align: middle;
    
    top: 0;
    z-index: 1;
    backdrop-filter: blur(8px);
}

.data-table tbody tr {
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(var(--accent-rgb), 0.05);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table td:last-child {
    white-space: nowrap;
}

/* Billing specific total amount */
.amount-display {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--success);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 8px 16px;
    display: inline-block;
}

/* Dashboard chart adjustments */
.chart-card {
    padding: 26px;
    border-radius: 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    margin-top: 16px;
}

.dashboard-chart {
    width: 100%;
    height: auto;
}

.chart-axis {
    stroke: var(--border);
    stroke-width: 1.5;
}

.chart-grid {
    stroke: var(--border);
    stroke-dasharray: 4 6;
    opacity: 0.5;
}

.chart-label {
    fill: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.chart-line {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-line-sales {
    stroke: var(--chart-sales);
    filter: drop-shadow(0 4px 10px rgba(var(--accent-rgb), 0.3));
}

.chart-line-items {
    stroke: var(--chart-items);
    filter: drop-shadow(0 4px 10px rgba(34, 197, 94, 0.3));
}

.chart-dot {
    stroke: var(--bg-panel);
    stroke-width: 3;
    r: 6;
}

.chart-dot-sales {
    fill: var(--chart-sales);
}

.chart-dot-items {
    fill: var(--chart-items);
}

.chart-legend {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    justify-content: center;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

.legend-sales {
    background: var(--chart-sales);
}

.legend-items {
    background: var(--chart-items);
}

/* Section headers */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 18px 20px;
    border-radius: 18px;
    border: 1px solid var(--border);
}

.section-header.space-between {
    justify-content: space-between;
}

.section-header h3 {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.section-header p {
    color: var(--muted);
    font-size: 0.85rem;
}

.inline-filter select {
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

/* Showrooms management list */
.showroom-cards {
    margin-top: 32px;
}

.showroom-card {
    padding: 24px;
    border-radius: 24px;
}

.showroom-card h4 {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.showroom-card p {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 8px;
}

.showroom-card p strong {
    color: var(--text);
}

/* Flash Messages */
.flash-message {
    margin-bottom: 24px;
    padding: 16px 24px;
    border-radius: 18px;
    border: 1px solid var(--border-glow);
    background: var(--accent-soft);
    color: var(--text);
    font-weight: 600;
    animation: interface-reveal 0.3s ease;
}

.content > .flash-message {
    position: relative;
    z-index: 1205;
}

.flash-card-notification {
    position: relative;
    z-index: 1300;
    margin: 0 0 24px 0;
    padding: 20px 22px;
    border-radius: 18px;
    border: 1px solid rgba(var(--danger-rgb, 239, 68, 68), 0.35);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(254, 242, 242, 0.98));
    color: #7f1d1d;
    box-shadow: 0 18px 50px rgba(127, 29, 29, 0.14);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px 18px;
    align-items: start;
    animation: interface-reveal 0.25s ease;
}

.flash-card-error {
    border-color: rgba(239, 68, 68, 0.38);
}

.flash-card-close {
    appearance: none;
    border: none;
    background: transparent;
    color: inherit;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    justify-self: end;
}

.flash-card-close:hover {
    background: rgba(127, 29, 29, 0.08);
}

.flash-card-body {
    min-width: 0;
}

.flash-card-title {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.flash-card-message {
    font-size: 0.95rem;
    line-height: 1.55;
    margin-bottom: 12px;
}

.flash-card-details {
    margin: 0;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(127, 29, 29, 0.12);
    color: #991b1b;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.82rem;
    line-height: 1.5;
    max-height: 180px;
    overflow: auto;
}

.flash-card-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.flash-card-actions .btn {
    min-width: 96px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(var(--accent-rgb), 0.12);
    border: 1px solid rgba(var(--accent-rgb), 0.16);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.status-pill::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: none;
}

.status-pill-success {
    background: rgba(52, 211, 153, 0.12);
    border-color: rgba(52, 211, 153, 0.22);
    color: var(--success);
}

.status-pill-danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.22);
    color: #f87171;
}

.status-pill-muted {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.18);
    color: var(--muted-strong);
}

.user-role-pill {
    font-size: 0.72rem;
    padding: 7px 11px;
}

.users-list-header {
    align-items: flex-start;
    gap: 18px;
}

.users-summary {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 10px;
    align-items: center;
    white-space: nowrap;
}

.users-summary-card {
    min-width: auto;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.users-summary-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    font-weight: 800;
}

.users-summary-card strong {
    font-size: 1.2rem;
    line-height: 1;
}

@media (max-width: 960px) {
    .users-list-header {
        flex-wrap: wrap;
    }

    .users-summary {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
}

.users-table td {
    vertical-align: middle;
}

.users-table th:last-child,
.users-table td:last-child {
    white-space: nowrap;
    width: 1%;
}

.user-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    width: max-content;
    min-width: max-content;
}

.user-action-form {
    display: inline-flex;
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

.user-actions .btn {
    white-space: nowrap;
}

.user-actions > * {
    flex: 0 0 auto;
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(var(--accent-rgb), 0.22);
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.stacked-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Invoice Receipt Details */
.invoice-card {
    padding: 34px;
    border-radius: 28px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    user-select: none;
    -webkit-user-select: none;
}

.invoice-card * {
    user-select: none;
    -webkit-user-select: none;
}

.showroom-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 14px;
    border: 1px solid var(--border);
}

.invoice-card-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 24px;
}

.invoice-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.invoice-brand h3 {
    font-size: 1.8rem;
    font-weight: 800;
}

.invoice-statement {
    color: var(--muted);
    font-size: 0.9rem;
}

.invoice-meta {
    display: grid;
    gap: 8px;
    text-align: right;
    font-size: 0.9rem;
}

.invoice-meta div {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.invoice-business-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.invoice-business-block {
    padding: 20px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.invoice-business-block h4 {
    margin-bottom: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-strong);
}

.invoice-business-block p {
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.6;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 32px;
    overflow: hidden;
    border-radius: 18px;
}

.invoice-table th,
.invoice-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.invoice-table th {
    background: linear-gradient(180deg, var(--surface), transparent);
    color: var(--text);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.invoice-summary {
    display: grid;
    gap: 12px;
    justify-content: end;
    text-align: right;
}

.invoice-summary-row {
    display: flex;
    justify-content: flex-end;
    gap: 24px;
    color: var(--muted);
    font-size: 0.95rem;
}

.invoice-summary-row strong {
    color: var(--text);
}

.invoice-summary-total {
    display: flex;
    justify-content: flex-end;
    gap: 24px;
    padding: 16px 24px;
    border-radius: 14px;
    background: var(--accent-soft);
    border: 1px solid var(--border-glow);
    color: var(--text);
    font-weight: 800;
    font-size: 1.25rem;
}

.invoice-section {
    padding: 18px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.invoice-section h4 {
    margin-bottom: 10px;
    color: var(--muted-strong);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.8rem;
}

.invoice-section p {
    color: var(--text);
    font-size: 0.92rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.detail-value {
    color: var(--text);
    font-weight: 600;
    text-align: right;
}

.settings-card-body {
    background: transparent;
}

.ticket-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.status-form {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.status-form select {
    min-width: 140px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(2, 6, 23, 0.74);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
}

.modal-card {
    width: min(720px, 100%);
    max-height: 90vh;
    overflow: auto;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: none;
    padding: 28px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.modal-kicker {
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.modal-body {
    display: grid;
    gap: 14px;
}

/* Theme Selection Cards (Settings Page) */
.theme-selector-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 12px;
}

.theme-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    background: var(--surface);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    position: relative;
    overflow: hidden;
}

.theme-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.theme-card.active {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: none;
}

.theme-card h4 {
    font-weight: 800;
    margin-bottom: 6px;
    font-size: 1.1rem;
}

.theme-card p {
    font-size: 0.8rem;
    color: var(--muted);
}

.theme-swatch-preview {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
}

.theme-preview-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Custom Theme Color Pickers */
.custom-theme-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 12px;
}

.custom-color-field {
    display: grid;
    gap: 8px;
}

.custom-color-field label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.custom-color-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.custom-color-input-wrap input[type="color"] {
    width: 42px;
    height: 42px;
    padding: 0;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: transparent;
}

.custom-color-input-wrap input[type="text"] {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text);
    font-family: var(--font-primary);
    font-size: 0.92rem;
    font-weight: 600;
}

.custom-color-input-wrap input[type="text"]:focus {
    outline: none;
}

.custom-theme-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.theme-label {
    font-size: clamp(1.4rem, 2vw, 1.8rem) !important;
    font-weight: 800 !important;
    color: var(--primary, var(--accent)) !important;
    text-transform: capitalize;
}

.theme-copy {
    font-size: 0.88rem;
    color: var(--muted);
    margin-top: 8px;
    line-height: 1.5;
}

/* Responsive Media Queries */
@media (max-width: 1080px) {

    .dashboard-grid,
    .showroom-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .simple-form {
        grid-template-columns: 1fr;
    }

    .sales-filter-form .btn {
        grid-column: auto;
    }
}

@media (max-width: 860px) {
    .app-page {
        flex-direction: column;
    }

    .sidebar-mobile-toggle {
        display: inline-flex;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 300;
        background: rgba(2, 6, 23, 0.52);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(84vw, 320px);
        height: 100vh;
        min-height: auto;
        padding: calc(14px + env(safe-area-inset-top)) 14px 14px;
        border-right: none;
        border-bottom: none;
        box-shadow: none;
        border-radius: 0 24px 24px 0;
        z-index: 360;
        gap: 12px;
        transform: translateX(-102%);
        transition: transform 0.28s ease;
        overflow-y: auto;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar-brand {
        padding-bottom: 12px;
        align-items: center;
        gap: 12px;
    }

    .brand-mark {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .brand-mark-image {
        padding: 3px;
    }

    .sidebar-brand-text {
        gap: 2px;
    }

    .sidebar-brand h1 {
        font-size: 1rem;
    }

    .sidebar-user {
        margin-left: auto;
        padding: 8px 10px;
        border-radius: 999px;
        font-size: 0.74rem;
    }

    .sidebar-nav {
        display: flex;
        flex-direction: column;
        gap: 8px;
        overflow: visible;
        padding-bottom: 0;
    }

    .sidebar-label {
        padding-left: 2px;
    }

    .sidebar-item {
        min-height: 40px;
        padding: 9px 12px;
        font-size: 0.88rem;
        border-radius: 14px;
        width: 100%;
    }

    .sidebar-footer {
        display: grid;
        gap: 8px;
        padding-top: 12px;
    }

    .content {
        margin-left: 0;
        padding: 68px 12px calc(26px + env(safe-area-inset-bottom));
    }

    .dashboard-grid,
    .showroom-grid,
    .theme-selector-grid,
    .invoice-business-grid,
    .invoice-details-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .page-header,
    .section-header,
    .card,
    .form-panel,
    .showroom-card,
    .chart-card,
    .login-card,
    .modal-card {
        border-radius: 20px;
    }

    .hero-stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .hero-stat {
        padding: 12px 14px;
        border-radius: 16px;
    }

    .page-header,
    .section-header {
        padding: 15px;
        gap: 10px;
        align-items: flex-start;
    }

    .page-header h2 {
        font-size: clamp(1.3rem, 5vw, 1.8rem);
    }

    .page-header p,
    .section-header p {
        font-size: 0.84rem;
    }

    .page-actions,
    .stacked-actions,
    .ticket-actions,
    .status-form,
    .flash-card-actions {
        gap: 8px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .card {
        padding: 18px;
    }

    .card .card-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        margin-bottom: 12px;
    }

    .card p {
        font-size: clamp(1.5rem, 7vw, 2rem);
    }

    .section {
        padding: 0;
    }

    .section > .section-header,
    .section > .dashboard-grid,
    .section > .showroom-grid,
    .section > .chart-card {
        margin-left: 0;
        margin-right: 0;
    }

    .data-table,
    .invoice-table,
    .summary-table,
    .meta-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        min-width: 640px;
    }

    .data-table th,
    .data-table td,
    .invoice-table th,
    .invoice-table td,
    .summary-table th,
    .summary-table td,
    .meta-table th,
    .meta-table td {
        padding: 10px 12px;
        font-size: 0.84rem;
    }

    .data-table th,
    .data-table td {
        white-space: nowrap;
    }

    .users-table th:last-child,
    .users-table td:last-child,
    .support-table th:last-child,
    .support-table td:last-child {
        white-space: normal;
        width: auto;
        min-width: 0;
    }

    .user-actions,
    .ticket-actions {
        width: 100%;
        min-width: 0;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: stretch;
    }

    .user-action-form,
    .ticket-actions .status-form {
        width: 100%;
        min-width: 0;
    }

    .user-actions .btn,
    .ticket-actions .btn,
    .ticket-actions .status-form select,
    .ticket-actions .status-form .btn,
    .user-action-form .btn {
        width: 100%;
        justify-content: center;
    }

    .table-search-input {
        width: 100% !important;
        max-width: none !important;
    }

    .users-list-header {
        gap: 12px;
    }

    .users-list-header,
    .section-header,
    .page-header {
        flex-direction: column;
    }

    .users-summary {
        justify-content: flex-start;
        width: 100%;
        flex-wrap: wrap;
    }

    .flash-card-notification {
        grid-template-columns: 1fr;
        border-radius: 18px;
        padding: 14px;
    }

    .flash-card-actions {
        justify-content: stretch;
        width: 100%;
    }

    .flash-card-actions .btn {
        width: 100%;
    }

    .modal-backdrop {
        padding: 12px;
    }

    .modal-card {
        padding: 18px;
    }

    .theme-selector-grid {
        grid-template-columns: 1fr;
    }

    .invoice-card {
        padding: 18px;
        border-radius: 20px;
    }

    .invoice-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .invoice-brand {
        width: 100%;
        align-items: flex-start;
        justify-content: flex-start;
    }

    .invoice-meta {
        text-align: left;
        width: 100%;
    }

    .invoice-meta div {
        justify-content: space-between;
    }

    .invoice-business-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .invoice-table th,
    .invoice-table td {
        padding: 10px 12px;
        font-size: 0.82rem;
    }

    .invoice-summary {
        justify-content: stretch;
        text-align: left;
    }

    .invoice-summary-row,
    .invoice-summary-total {
        justify-content: space-between;
        gap: 12px;
    }
}

@media (max-width: 560px) {
    body {
        background-attachment: scroll;
    }

    .login-card,
    .form-panel,
    .section {
        padding: 18px;
    }

    .login-container {
        width: 100%;
    }

    .theme-selector-grid {
        grid-template-columns: 1fr;
    }

    body::before,
    body::after {
        opacity: 0.12;
    }

    .sidebar {
        width: min(88vw, 300px);
        padding: calc(12px + env(safe-area-inset-top)) 12px 12px;
        border-radius: 0 20px 20px 0;
    }

    .sidebar-brand {
        flex-wrap: wrap;
    }

    .sidebar-brand h1 {
        font-size: 0.95rem;
    }

    .sidebar-user {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }

    .content {
        padding: 64px 10px 22px;
    }

    .page-hero {
        padding: 18px 18px 20px;
        border-radius: 20px;
        margin-bottom: 18px;
    }

    .page-header,
    .section-header,
    .card,
    .form-panel,
    .showroom-card,
    .chart-card,
    .login-card,
    .modal-card {
        border-radius: 18px;
    }

    .page-header h2 {
        font-size: clamp(1.2rem, 6vw, 1.55rem);
    }

    .page-header p,
    .section-header p {
        font-size: 0.82rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-header .inline-filter {
        width: 100%;
    }

    .section-header .inline-filter select {
        width: 100%;
    }

    .page-actions,
    .stacked-actions,
    .ticket-actions,
    .status-form {
        flex-direction: column;
        align-items: stretch;
    }

    .page-actions .btn,
    .stacked-actions .btn,
    .ticket-actions .btn,
    .status-form .btn {
        width: 100%;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }

    .data-table th,
    .data-table td,
    .invoice-table th,
    .invoice-table td,
    .summary-table th,
    .summary-table td,
    .meta-table th,
    .meta-table td {
        padding: 9px 10px;
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        white-space: nowrap;
    }

    .users-table th:last-child,
    .users-table td:last-child,
    .support-table th:last-child,
    .support-table td:last-child {
        white-space: normal;
        width: auto;
        min-width: 0;
    }

    .user-actions,
    .ticket-actions {
        width: 100%;
        min-width: 0;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: stretch;
    }

    .user-action-form,
    .ticket-actions .status-form {
        width: 100%;
        min-width: 0;
    }

    .user-actions .btn,
    .ticket-actions .btn,
    .ticket-actions .status-form select,
    .ticket-actions .status-form .btn,
    .user-action-form .btn {
        width: 100%;
        justify-content: center;
    }

    .showroom-card,
    .chart-card {
        padding: 16px;
    }

    .invoice-card {
        padding: 20px;
        border-radius: 18px;
    }

    .invoice-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 22px;
        padding-bottom: 18px;
    }

    .invoice-meta {
        text-align: left;
    }

    .invoice-meta div {
        justify-content: flex-start;
    }

    .invoice-business-block,
    .invoice-section {
        padding: 16px;
    }

    .invoice-summary-row,
    .invoice-summary-total {
        gap: 14px;
    }

    .modal-body {
        gap: 10px;
    }

    .modal-card {
        padding: 16px;
    }
}

@media (max-width: 420px) {
    .login-card,
    .form-panel,
    .section {
        padding: 16px;
    }

    .page-hero {
        padding: 16px;
    }

    .sidebar-nav {
        gap: 6px;
    }

    .sidebar-item {
        padding: 8px 10px;
        font-size: 0.84rem;
    }

    .page-header,
    .section-header,
    .card,
    .form-panel,
    .showroom-card,
    .chart-card,
    .login-card,
    .modal-card {
        border-radius: 16px;
    }

    .card {
        padding: 16px;
    }

    .page-actions,
    .stacked-actions,
    .ticket-actions,
    .status-form {
        gap: 8px;
    }
}

/* App Version Badge Styling */
.app-version-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--surface-strong, rgba(59, 130, 246, 0.12));
    border: 1px solid var(--border-glow, rgba(59, 130, 246, 0.35));
    color: var(--accent, #3b82f6);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
}

.settings-version-top {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 14px;
}



