/* ==================== DASHBOARD - BRIGHT THEME ==================== */

/* Layout */
.dashboard {
    min-height: 100vh;
    background: var(--bg-page);
}

/* Navigation */
.dashboard-nav {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1.5px solid var(--border-color);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 1px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-divider {
    width: 1.5px;
    height: 24px;
    background: var(--border-color);
}

.nav-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

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

.nav-time {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    padding: 24px 24px 16px;
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeInUp 0.5s ease;
}

.stat-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: all var(--transition-normal);
    cursor: default;
    box-shadow: var(--shadow-card);
}

.stat-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stat-icon.total {
    background: linear-gradient(135deg, #FFE0EB, #FFC8DD);
}

.stat-icon.today {
    background: linear-gradient(135deg, #E0DFFE, #D1C4E9);
}

.stat-icon.arrived {
    background: linear-gradient(135deg, #D5F5E3, #A9DFBF);
}

.stat-icon.pending {
    background: linear-gradient(135deg, #FFF3CD, #FFE69C);
}

.stat-icon.no-show {
    background: linear-gradient(135deg, #FDEDEC, #FADBD8);
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.stat-value.total-val {
    color: var(--accent-primary);
}

.stat-value.today-val {
    color: #6c5ce7;
}

.stat-value.arrived-val {
    color: var(--status-arrived);
}

.stat-value.pending-val {
    color: #d4a017;
}

.stat-value.no-show-val {
    color: var(--status-no-show);
}

/* Toolbar */
.dashboard-toolbar {
    padding: 0 24px 14px;
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeInUp 0.5s ease 0.1s backwards;
}

.toolbar-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-card);
}

.search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 38px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: #fff;
}

.search-box .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.82rem;
}

.filter-select {
    padding: 10px 32px 10px 12px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23636E72' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    min-width: 140px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.filter-date {
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
}

.filter-date:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.toolbar-divider {
    width: 1.5px;
    height: 28px;
    background: var(--border-color);
}

.result-count {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

/* Data Table */
.dashboard-table-section {
    padding: 0 24px 40px;
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeInUp 0.5s ease 0.2s backwards;
}

.table-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table thead {
    background: var(--bg-input);
    border-bottom: 1.5px solid var(--border-color);
}

.data-table th {
    padding: 13px 16px;
    text-align: left;
    font-weight: 700;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: color var(--transition-fast);
}

.data-table th:hover {
    color: var(--accent-primary);
}

.data-table th .sort-arrow {
    margin-left: 3px;
    opacity: 0.3;
    font-size: 0.7rem;
}

.data-table th.active .sort-arrow {
    opacity: 1;
    color: var(--accent-primary);
}

.data-table td {
    padding: 13px 16px;
    border-bottom: 1px solid rgba(232, 67, 147, 0.06);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Cell styles */
.cell-name {
    font-weight: 600;
    color: var(--text-primary);
}

.cell-phone {
    font-variant-numeric: tabular-nums;
    color: var(--accent-primary);
    font-weight: 600;
}

.cell-phone a {
    color: inherit;
    text-decoration: none;
}

.cell-phone a:hover {
    text-decoration: underline;
}

.cell-service {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cell-service .service-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-gradient);
    flex-shrink: 0;
}

.cell-date {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.cell-actions {
    display: flex;
    gap: 6px;
    white-space: nowrap;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    display: block;
    opacity: 0.6;
}

.empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.empty-text {
    font-size: 0.85rem;
}

/* Landing Links Card */
.landing-links-section {
    padding: 0 24px 14px;
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeInUp 0.5s ease 0.05s backwards;
}

.links-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    box-shadow: var(--shadow-card);
}

.links-title {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.landing-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.landing-link:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.landing-link .link-icon {
    font-size: 1rem;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 245, 247, 0.88);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

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

.modal-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 420px;
    width: 100%;
    margin: 0 24px;
    animation: fadeInUp 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ==================== MOBILE CARD SYSTEM ==================== */

/* On mobile, hide the table and show booking cards */
.booking-cards {
    display: none;
}

@media (max-width: 768px) {
    .dashboard-nav {
        padding: 0 12px;
        height: 52px;
    }

    .nav-brand {
        gap: 8px;
    }

    .nav-logo {
        font-size: 0.9rem;
        letter-spacing: 0;
    }

    .nav-divider,
    .nav-title {
        display: none;
    }

    .nav-time {
        display: none;
    }

    .nav-actions {
        gap: 6px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 12px;
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
        gap: 10px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .landing-links-section {
        padding: 0 12px 8px;
    }

    .links-card {
        padding: 10px 12px;
    }

    .links-title {
        font-size: 0.7rem;
        margin-bottom: 8px;
    }

    .landing-link {
        padding: 6px 10px;
        font-size: 0.72rem;
    }

    .dashboard-toolbar {
        padding: 0 12px 8px;
    }

    .toolbar-card {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 12px;
        gap: 8px;
    }

    .search-box {
        min-width: unset;
    }

    .search-box input {
        padding: 9px 14px 9px 34px;
        font-size: 0.82rem;
    }

    .filter-select {
        padding: 9px 32px 9px 10px;
        font-size: 0.78rem;
        min-width: unset;
    }

    .filter-date {
        padding: 9px 10px;
        font-size: 0.78rem;
    }

    .toolbar-divider {
        display: none;
    }

    /* Hide table, show cards */
    .table-card {
        display: none;
    }

    .booking-cards {
        display: block;
    }

    .dashboard-table-section {
        padding: 0 12px 24px;
    }

    .booking-card {
        background: var(--bg-card);
        border: 1.5px solid var(--border-color);
        border-radius: 14px;
        padding: 14px;
        margin-bottom: 8px;
        box-shadow: var(--shadow-card);
    }

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

    .bc-name {
        font-size: 0.95rem;
        font-weight: 700;
        color: var(--text-primary);
    }

    .bc-id {
        font-size: 0.68rem;
        color: var(--text-muted);
        font-weight: 600;
        background: var(--bg-input);
        padding: 2px 8px;
        border-radius: 20px;
    }

    .bc-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px 12px;
        margin-bottom: 10px;
    }

    .bc-field {
        display: flex;
        flex-direction: column;
    }

    .bc-label {
        font-size: 0.62rem;
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .bc-val {
        font-size: 0.82rem;
        color: var(--text-primary);
        font-weight: 500;
    }

    .bc-val a {
        color: var(--accent-primary);
        text-decoration: none;
        font-weight: 700;
    }

    .bc-val .badge {
        font-size: 0.72rem;
    }

    .bc-notes {
        font-size: 0.75rem;
        color: var(--text-muted);
        font-style: italic;
        padding: 6px 0 0;
        border-top: 1px dashed var(--border-color);
        margin-top: 4px;
        margin-bottom: 8px;
    }

    .bc-service {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .bc-service .service-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--accent-gradient);
    }

    .bc-actions {
        display: flex;
        gap: 6px;
        border-top: 1px solid rgba(232, 67, 147, 0.06);
        padding-top: 10px;
    }

    .bc-actions .btn {
        flex: 1;
        padding: 9px 4px;
        font-size: 0.78rem;
        border-radius: 10px;
        border: 1.5px solid var(--border-color);
        background: var(--bg-input);
        cursor: pointer;
        font-family: 'Inter', sans-serif;
        font-weight: 600;
        transition: all 0.15s;
        text-align: center;
    }

    .bc-actions .btn:active {
        transform: scale(0.95);
    }

    .bc-actions .btn-success {
        background: #D5F5E3;
        border-color: #A9DFBF;
        color: #2E7D32;
    }

    .bc-actions .btn-danger {
        background: #FDEDEC;
        border-color: #FADBD8;
        color: #E17055;
    }

    .bc-actions .btn-warning {
        background: #FFF3CD;
        border-color: #FFE69C;
        color: #B87D00;
    }

    .bc-actions .btn-ghost {
        background: #F8F8F8;
        color: var(--text-muted);
    }

    .empty-cards {
        text-align: center;
        padding: 40px 16px;
        color: var(--text-muted);
    }

    .empty-cards .ei {
        font-size: 2rem;
        display: block;
        margin-bottom: 8px;
    }

    .empty-cards p {
        font-size: 0.85rem;
    }

    /* Modal mobile */
    .modal-card {
        margin: 0 12px;
        padding: 20px;
    }
}

@media (max-width: 380px) {
    .stats-grid {
        gap: 6px;
    }

    .stat-card {
        padding: 10px;
        gap: 8px;
    }

    .stat-icon {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .stat-value {
        font-size: 1rem;
    }

    .bc-body {
        grid-template-columns: 1fr;
    }
}