:root {
    /* Color Palette - Premium & Modern */
    --primary: #3b82f6;
    /* Bright Blue */
    --primary-hover: #2563eb;
    /* Deep Blue */
    --primary-light: #eff6ff;
    /* Very Light Blue */

    --bg-body: #f8fafc;
    /* Slate 50 */
    --bg-card: #ffffff;

    --text-main: #0f172a;
    /* Slate 900 */
    --text-muted: #64748b;
    /* Slate 500 */

    --border: #e2e8f0;
    /* Slate 200 */

    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --success: #10b981;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;

    /* Spacing & Layout */
    --radius: 0.75rem;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --container-max: 1200px;
    --header-height: 4rem;
}

[data-theme="dark"] {
    --primary: #60a5fa;
    --primary-hover: #93c5fd;
    --primary-light: #1e3a8a;

    --bg-body: #0f172a;
    /* Slate 950 */
    --bg-card: #1e293b;
    /* Slate 800 */

    --text-main: #f1f5f9;
    /* Slate 100 */
    --text-muted: #94a3b8;
    /* Slate 400 */

    --border: #334155;
    /* Slate 700 */

    --danger-bg: #450a0a;
    --success-bg: #064e3b;
    --warning-bg: #451a03;
}

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

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

.text-lg {
    font-size: 1.25rem;
}

.m-0 {
    margin: 0 !important;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

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

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
    /* Base size */
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

ul {
    list-style: none;
}

button {
    font-family: inherit;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

h1 {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
}

/* Responsive heading */
h2 {
    font-size: clamp(1.25rem, 3vw, 1.875rem);
}

h3 {
    font-size: 1.25rem;
}

/* Layout Utilities */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

@media (max-width: 640px) {
    .container {
        padding: 0 1rem;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    white-space: nowrap;
    text-align: center;
    min-height: 44px;
    /* Touch target size */
    background-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn:active {
    transform: scale(0.98);
}

.btn:hover {
    background-color: var(--primary-hover);
    box-shadow: var(--shadow);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.85rem;
    min-height: 32px;
}

.btn-danger {
    background-color: var(--danger);
}

.btn-danger:hover {
    background-color: #dc2626;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Hover effect on cards for desktop only */
@media (hover: hover) {
    .card:hover {
        box-shadow: var(--shadow);
    }
}

@media (max-width: 640px) {
    .card {
        padding: 1.25rem;
    }
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 44px;
    /* Touch friendly */
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    /* Ring effect */
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    margin-bottom: 2rem;
}

[data-theme="dark"] .navbar {
    background: rgba(30, 41, 59, 0.9);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.nav-brand {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-link {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}

[data-theme="dark"] .nav-link:hover {
    background: rgba(59, 130, 246, 0.15);
}

.nav-link.active {
    color: var(--primary);
    font-weight: 600;
    background: var(--primary-light);
}

[data-theme="dark"] .nav-link.active {
    background: rgba(59, 130, 246, 0.15);
}


/* Mobile Navigation */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
    padding: 0.5rem;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        animation: slideDown 0.2s ease-out;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-link {
        width: 100%;
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Action Grid */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.action-grid .btn {
    width: 100%;
    justify-content: center;
    padding: 1rem;
    font-size: 1rem;
}

/* Dashboard Grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    text-align: center;
}

.stat-value {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
    letter-spacing: -0.05em;
    color: var(--primary);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    /* Force scroll on small screens */
}

.table th {
    background-color: var(--bg-body);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

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

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

/* Login Page Wrapper */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, var(--bg-body) 0%, rgba(37, 99, 235, 0.05) 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border: none;
    box-shadow: var(--shadow-lg);
}

/* Calendar Specifics */
/* Calendar Specifics */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.cal-day-header {
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cal-day {
    min-height: 100px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 0.5rem;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cal-day:hover:not(.empty) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    z-index: 2;
}

.cal-day.empty {
    background: transparent;
    border: none;
}

.cal-day.cal-today {
    border: 2px solid var(--primary);
    background: var(--primary-light);
}

.day-num {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    display: block;
}

.booking-badge {
    display: block;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 99px;
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    transition: background 0.2s;
    cursor: default;
}

.booking-badge:hover {
    background: var(--primary-hover);
}

[data-theme="dark"] .booking-badge {
    background: var(--primary);
}

@media (max-width: 640px) {
    .calendar-grid {
        gap: 0.25rem;
    }

    .cal-day {
        min-height: 70px;
        padding: 0.25rem;
    }

    .day-num {
        font-size: 0.8rem;
    }

    .booking-badge {
        font-size: 0.6rem;
        padding: 0.15rem 0.25rem;
    }

    .cal-day-header {
        font-size: 0.7rem;
        padding: 0.25rem 0;
    }
}