/* ============================================
   Twigem Admin Dashboard Styles
   Theme: Light (Option 1 - Modern Classic)
   Inspired by: Nadalab.ai
   ============================================ */

/* ---- CSS Variables ---- */
:root {
    /* Colors - More Vibrant Palette */
    --bg-primary: #F8FAFC;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F1F5F9;

    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;

    --accent-primary: #6366f1;
    --accent-secondary: #d946ef;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #d946ef 100%);
    --accent-glow: 0 0 20px rgba(99, 102, 241, 0.3);

    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #0ea5e9;

    --border-color: #E2E8F0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Typography */
    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Spacing */
    --sidebar-width: 260px;
    --header-height: 72px;

    /* Borders */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    /* Transitons */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html,
body {
    height: 100%;
}

body {
    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    background-image:
        radial-gradient(at 0% 0%, hsla(231, 100%, 90%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 100%, 85%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 100%, 85%, 1) 0, transparent 50%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ---- Login Page ---- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 24px;
}

.login-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
}

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

.login-header .logo {
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: var(--font-family);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.error-message {
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fee2e2;
    border-radius: var(--radius-md);
    color: var(--error);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 12px;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    line-height: 1.25;
}

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

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    gap: 10px;
    border-radius: var(--radius-lg);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.2), 0 2px 4px -2px rgba(99, 102, 241, 0.1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3), 0 4px 6px -4px rgba(217, 70, 239, 0.2), var(--accent-glow);
    filter: brightness(1.1);
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

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

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

.btn-secondary:active {
    background: var(--bg-tertiary);
}

.btn-warning {
    background-color: var(--warning);
    border-color: var(--warning);
    color: white;
}

.btn-warning:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.2);
}

.footer-actions-right {
    display: flex;
    gap: 12px;
    margin-left: auto;
}

.btn-full {
    width: 100%;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ---- Dashboard Layout ---- */
.dashboard {
    display: flex;
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transition: transform var(--transition-base);
}

.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .logo {
    width: 36px;
    height: 36px;
}

.sidebar-header h1 {
    font-size: 18px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.15s;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
    text-decoration: none;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.nav-item:hover svg {
    transform: translateX(2px);
}

.nav-item.active {
    background: var(--accent-gradient);
    color: white;
}

.nav-item.active svg {
    color: white;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

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

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

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    min-width: 0;
    width: calc(100% - var(--sidebar-width));
    transition: margin-left var(--transition-base), width var(--transition-base);
}

.sidebar-collapsed .main-content {
    margin-left: 0;
    width: 100%;
}

.content-header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.8);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-toggle {
    display: flex;
    color: var(--text-primary);
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.search-box input {
    border: none;
    background: none;
    font-size: 13px;
    font-family: var(--font-family);
    width: 200px;
}

.search-box input:focus {
    outline: none;
}

.search-box svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.content-body {
    padding: 32px;
}

/* ---- Cards ---- */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-premium);
}

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

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

.card-body {
    padding: 24px;
}

/* ---- Stats Grid ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-premium);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.purple {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.stat-icon.orange {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

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

.stat-change {
    font-size: 12px;
    margin-top: 4px;
}

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

.stat-change.negative {
    color: var(--error);
}

/* ---- Table ---- */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-primary);
}

td {
    font-size: 14px;
    color: var(--text-primary);
}

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

/* ---- Status Badge ---- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}

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

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

.badge.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

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

.badge.neutral {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* ---- Utilities ---- */
.text-muted {
    color: var(--text-muted);
}

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

.font-mono {
    font-family: 'SF Mono', 'Consolas', monospace;
}

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

/* ---- Loading State ---- */
.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px;
}

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

/* ---- Modal ---- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-content.modal-small {
    max-width: 400px;
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

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

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

#test-phone {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: var(--font-family);
    transition: all 0.2s;
    background: var(--bg-primary);
}

#test-phone:focus {
    outline: none;
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ---- Form Enhancements ---- */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group select,
.filter-group select,
.form-group input[type="date"],
.filter-group input[type="date"],
.filter-group input[type="text"] {
    padding: 11px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: var(--font-family);
    background: var(--bg-secondary);
    cursor: pointer;
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    min-width: 140px;
}

.filter-group input[type="text"] {
    background-image: none;
    padding-right: 16px;
}

.form-group select:focus,
.filter-group select:focus,
.form-group input[type="date"]:focus,
.filter-group input[type="date"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input[type="file"] {
    font-size: 13px;
    color: var(--text-secondary);
}

.form-group input[type="file"]::file-selector-button {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    margin-right: 12px;
    transition: all 0.2s;
}

.form-group input[type="file"]::file-selector-button:hover {
    background: var(--bg-primary);
    border-color: var(--text-muted);
}

.form-group textarea {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: var(--font-family);
    resize: vertical;
    min-height: 100px;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    accent-color: var(--accent-primary);
}

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

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

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

.btn-icon.text-error:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.text-error {
    color: var(--error);
}

/* ---- Wide Modal & Form Sections ---- */
.modal-content.modal-wide {
    max-width: 700px;
}

.form-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

/* Auto-fill Container */
.config-auto-fill {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.config-auto-fill label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.config-auto-fill .input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.config-auto-fill textarea {
    flex: 1;
    min-height: 42px !important;
    padding: 10px 14px;
}

.config-auto-fill .file-group {
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: 4px;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

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

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

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

/* ---- Filters Bar ---- */
.filters-bar {
    padding: 20px 24px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.filters-row {
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
    /* Force single row */
    align-items: flex-end;
    overflow-x: auto;
    /* Allow internal scroll if viewport is extremely narrow */
    padding-bottom: 4px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* ---- Pagination ---- */
.pagination {
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.pagination span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Range input styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* ---- Status Switch (Modern Toggle) ---- */
.status-switch-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 0;
    margin-top: 16px;
    gap: 8px;
    border-top: 1px solid var(--border-color);
}

.status-switch-container {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: center;
}

.status-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.3s;
    user-select: none;
}

.status-label.off-label {
    color: var(--text-muted);
}

.status-label.on-label {
    color: var(--success);
}

.status-switch {
    position: relative;
    display: inline-block;
    width: 100px;
    height: 32px;
}

/* Hide the checkbox completely */
.status-switch input {
    opacity: 0;
    width: 0 !important;
    height: 0 !important;
    position: absolute;
    z-index: -1;
}

.status-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #D1D5DB;
    /* Light gray for inactive */
    transition: .4s;
    border-radius: 32px;
}

.status-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.status-switch input:checked+.status-slider {
    background-color: var(--success);
    /* Green for active */
}

.status-switch input:checked+.status-slider:before {
    transform: translateX(68px);
    /* 100 - 24 - 8 = 68 */
}

.status-switch-text {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    font-weight: 800;
    color: white;
    text-transform: uppercase;
    transition: opacity 0.2s;
    pointer-events: none;
    letter-spacing: 0.5px;
}

.status-switch-text.on {
    left: 12px;
    opacity: 0;
}

.status-switch-text.off {
    right: 10px;
    opacity: 1;
}

.status-switch input:checked+.status-slider .status-switch-text.off {
    opacity: 0;
}

.status-switch input:checked+.status-slider .status-switch-text.on {
    opacity: 1;
}

/* Sidebar Backdrop */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 900;
    display: none;
    opacity: 0;
    transition: opacity var(--transition-base);
}

/* Sidebar open logic moved to media query for mobile only */

/* Responsive Queries */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 64px;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: var(--shadow-premium);
    }

    .sidebar-open .sidebar-backdrop {
        display: block;
        opacity: 1;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .content-header {
        padding: 0 16px;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .content-body {
        padding: 20px 16px;
    }

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

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

    .modal-content {
        max-width: 95vw;
        border-radius: var(--radius-lg);
    }

    .modal-content.modal-wide {
        max-width: 95vw;
    }

    .header-actions {
        gap: 8px;
    }

    .header-actions .btn span {
        display: none;
    }

    .header-actions .btn {
        padding: 10px;
        min-width: 40px;
    }

    .header-actions .btn svg {
        margin: 0;
    }

    .filters-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .filter-group {
        flex: 1 1 calc(50% - 4px);
    }

    .filter-group select,
    .filter-group input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .filter-group {
        flex: 1 1 100%;
    }

    .modal-header h3 {
        font-size: 16px;
    }

    .stat-value {
        font-size: 24px;
    }
}