:root {
    --bg-color: #0e0f14;
    --sidebar-bg: #141416;
    --card-bg: #1c1c1f;
    --border-color: #2a2a2e;
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --text-color: #f3f4f6;
    --text-muted: #9ca3af;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Authentication Screen */
.auth-screen {
    margin: auto;
    background: var(--card-bg);
    padding: 40px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.auth-screen input {
    width: 100%;
    padding: 12px;
    margin: 20px 0;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: white;
    border-radius: 8px;
    outline: none;
}
.auth-screen input:focus { border-color: var(--primary-color); }
.auth-screen button {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}
.auth-screen button:hover { background: var(--primary-hover); }

/* Layout */
.app-layout {
    display: flex;
    width: 100%;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    padding: 0 24px;
    margin-bottom: 40px;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}

.logo-icon {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-right: 10px;
    font-size: 24px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item ion-icon {
    font-size: 20px;
    margin-right: 12px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-color);
}

.sidebar-footer {
    padding: 0 16px;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    background: var(--bg-color);
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
}

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

.btn-create {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn-create:hover {
    background: var(--primary-hover);
}

/* --- Modern Admin Table UX Enhancements --- */
.modern-badge {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}
.modern-badge-id {
    color: #818cf8;
    background: rgba(99,102,241,0.1);
    cursor: pointer;
    transition: 0.2s;
    font-family: monospace;
}
.modern-badge-id:hover { background: rgba(99,102,241,0.2); }

.modern-badge-gray {
    color: #94a3b8;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
}

.master-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: bold; font-size: 14px;
    box-shadow: 0 4px 10px rgba(99,102,241,0.3);
}

.booking-link-pill {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    background: rgba(16,185,129,0.05);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(16,185,129,0.1);
    cursor: pointer; transition: 0.2s;
}
.booking-link-pill:hover { background: rgba(16,185,129,0.15); }

.status-indicator {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
}
.status-active { background: rgba(16,185,129,0.15); color: #10b981; border-color: rgba(16,185,129,0.3); }
.status-trial { background: rgba(245,158,11,0.15); color: #f59e0b; border-color: rgba(245,158,11,0.3); }
.status-inactive { background: rgba(239,68,68,0.15); color: #ef4444; border-color: rgba(239,68,68,0.3); }

.status-dot {
    width: 6px; height: 6px; border-radius: 50%; background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

.actions-toolbar {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}

.action-icon {
    font-size: 18px; cursor: pointer; transition: transform 0.2s, opacity 0.2s;
}
.action-icon:hover { transform: scale(1.15); opacity: 0.8; }
.action-edit { color: #818cf8; }
.action-notes { color: #f59e0b; }
.action-login { color: #a855f7; }

.toolbar-divider {
    width: 1px; height: 16px; background: rgba(255,255,255,0.1);
}

.welcome-btn {
    display: flex; align-items: center; gap: 6px;
    background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(16,185,129,0.2));
    border: 1px solid rgba(16,185,129,0.3);
    color: #10b981; font-size: 12px; font-weight: 600;
    padding: 7px 12px; border-radius: 8px;
    cursor: pointer; transition: all 0.2s;
}
.welcome-btn:hover {
    background: rgba(16,185,129,0.25);
    box-shadow: 0 4px 12px rgba(16,185,129,0.2);
    transform: translateY(-1px);
}

/* --- Schedule UI --- */
.schedule-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: opacity 0.3s;
}

.schedule-day-name {
    width: 90px;
    font-weight: 600;
    font-size: 14px;
}

.schedule-time-input {
    background: #000 !important;
    color: #fff !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px;
    padding: 10px 12px !important;
    font-family: inherit;
    font-size: 15px;
    width: 100px !important; /* Forces enough width for HH:MM */
    min-width: 95px;
    text-align: center;
    cursor: pointer;
    box-sizing: border-box;
    margin: 0 !important;
}

.schedule-time-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

@media (max-width: 480px) {
    .schedule-row {
        gap: 8px;
        padding: 12px 10px;
    }
    .schedule-day-name {
        width: 75px;
        font-size: 13px;
    }
    .schedule-time-input {
        width: 85px !important; 
        min-width: 85px;
        padding: 8px 4px !important;
        font-size: 14px;
    }
}

/* Tables */
.table-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    padding: 16px 24px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
text-transform: uppercase;
}

.data-table td {
    padding: 16px 24px;
    color: #fff;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.data-table tbody tr:hover {
    background: rgba(255,255,255,0.02);
}

.action-block {
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 500;
}
.action-block:hover { text-decoration: underline; }

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}
.modal {
    background: var(--sidebar-bg);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 450px;
}
.modal h3 { margin-bottom: 15px; }
.modal input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: white;
    border-radius: 8px;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.btn-cancel {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
}

.btn-submit {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
}

/* Premium Action Pills */
.ux-pill {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-color);
    user-select: none;
}
.ux-pill:hover {
    background: rgba(255, 255, 255, 0.1);
}
.active-pill {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

/* Schedule UI */
.schedule-row {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 8px;
    gap: 16px;
    transition: 0.2s;
}
.schedule-day-name {
    width: 70px;
    font-weight: 600;
    font-size: 13px;
}
.schedule-time-input {
    background: #000;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 6px 10px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    width: 90px;
    text-align: center;
}
.schedule-time-input:disabled { opacity: 0.3; }

.toggle-switch {
    display: inline-block;
    width: 44px;
    height: 24px;
    background: rgba(255,255,255,0.1);
    border-radius: 24px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}
.toggle-switch.on { background: var(--primary-color); }
.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}
.toggle-switch.on::after { transform: translateX(20px); }

/* MOBILE RESPONSIVENESS */
@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 100;
        padding: 5px 0;
        border-right: none;
        border-top: 1px solid var(--border-color);
    }
    .sidebar-logo, .sidebar-footer {
        display: none;
    }
    .sidebar-nav {
        flex-direction: row;
        justify-content: space-around;
        padding: 0;
    }
    .nav-item {
        flex-direction: column;
        padding: 8px;
        font-size: 11px;
    }
    .nav-item ion-icon {
        margin-right: 0;
        margin-bottom: 4px;
        font-size: 22px;
    }
    .main-content {
        padding: 20px;
        padding-bottom: 90px; /* space for bottom nav */
    }
    .top-header {
        flex-direction: column;
        gap: 15px;
    }
    .schedule-row {
        gap: 8px;
        padding: 10px;
    }
    .schedule-time-input {
        width: 75px;
        padding: 4px;
        font-size: 13px;
    }
    .pill-group {
        gap: 5px;
    }
}

/* Wizard Step Dots */
.wiz-step-dot {
    flex: 1;
    height: 4px;
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    transition: background 0.3s;
}
.wiz-step-dot.active {
    background: var(--primary-color);
}
.wiz-step-dot.done {
    background: #10b981;
}

/* Filter Pills */
.filter-pill {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.filter-pill:hover {
    border-color: var(--primary-color);
    color: #fff;
    background: rgba(99, 102, 241, 0.1);
}
.filter-pill.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* Empty state for filtered results */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-state ion-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

/* 📅 Daily Schedule UX */
.date-carousel {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 15px;
    margin-bottom: 10px;
}
.date-carousel::-webkit-scrollbar { height: 4px; }
.date-carousel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.date-pill {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    min-width: 60px;
    transition: all 0.2s;
    user-select: none;
}
.date-pill:hover { background: rgba(255,255,255,0.08); }
.date-pill.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}
.date-pill .day-name { font-size: 11px; text-transform: uppercase; opacity: 0.7; margin-bottom: 4px; }
.date-pill .day-number { font-size: 18px; font-weight: 700; }

.appointment-time-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.time-col {
    min-width: 55px;
    text-align: right;
    border-right: 2px solid rgba(255,255,255,0.05);
    padding-right: 12px;
    padding-top: 4px;
}
.time-col .time-start { font-size: 18px; font-weight: 700; color: #fff; }
.time-col .time-end { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.details-col {
    flex: 1;
}
.details-col .client-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; display:flex; align-items:center; gap:6px; }
.details-col .service-info { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.details-col .appt-actions { display: flex; gap: 8px; margin-top:12px; }

.empty-daily {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255,255,255,0.02);
    border: 1px dashed var(--border-color);
    border-radius: 16px;
    color: var(--text-muted);
}

/* 📱 MOBILE RESPONSIVE TABLES (CARDS) */
@media (max-width: 768px) {
    .data-table, .data-table tbody, .data-table tr, .data-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    .data-table thead {
        display: none;
    }
    .data-table tr {
        margin-bottom: 16px;
        background: rgba(255,255,255,0.02);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        padding: 6px 16px;
    }
    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 0;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        text-align: right;
    }
    .data-table td:last-child {
        border-bottom: none;
    }
    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        font-size: 11px;
        margin-right: 15px;
        text-align: left;
    }
    .table-container {
        border: none;
        background: transparent;
        padding: 0;
        overflow-x: hidden;
    }
}
