:root {
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
    --header-height: 56px;
}

html, body {
    margin: 0;
    padding: 0;
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    padding-top: calc(var(--header-height) + var(--safe-top));
    padding-bottom: calc(72px + var(--safe-bottom));
    overflow-x: hidden;
}

.main-content {
    min-height: calc(100vh - var(--header-height) - var(--safe-top) - 72px - var(--safe-bottom));
    padding-top: 4px;
    padding-bottom: calc(16px + var(--safe-bottom));
}

.navbar-today {
    background-color: #fd7e14 !important;
}

.bg-orange {
    background-color: #fd7e14 !important;
}

.navbar {
    height: calc(var(--header-height) + var(--safe-top));
    min-height: calc(var(--header-height) + var(--safe-top));
    padding-top: var(--safe-top);
}

.navbar-brand {
    font-size: 1.05rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90vw;
    color: #fff !important;
}

.today-date {
    color: #fff !important;
    font-weight: 700;
}

.normal-date {
    color: #fff;
}

.booking-table {
    font-size: 16px;
    table-layout: fixed;
    width: 100%;
    margin-bottom: 0;
}

.booking-table thead th {
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
    font-weight: 600;
    padding: 0.6rem 0.25rem;
    border-bottom: 2px solid #dee2e6;
}

.booking-table td {
    vertical-align: middle;
    padding: 0.5rem 0.25rem;
    height: 60px;
    border-bottom: 1px solid #e9ecef;
}

.time-cell {
    width: 22%;
}

.time-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.time-btn {
    font-size: 16px;
    color: #212529;
    text-decoration: none;
    text-align: left;
    font-weight: 600;
    padding: 0;
    border: none;
    background: none;
    line-height: 1.2;
}

.item-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    line-height: 1.2;
    margin-top: 2px;
}

.name-display, .phone-display {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-row-disabled {
    background-color: #e9ecef !important;
}

.item-row-disabled .name-display,
.item-row-disabled .phone-display,
.item-row-disabled .time-btn,
.item-row-disabled .item-label,
.item-row-disabled .contact-phone {
    color: #212529;
}

.booking-row.item-row-disabled td {
    background-color: #e9ecef !important;
}

.booking-modal-time {
    color: #dc3545;
    font-weight: 700;
}

.floating-day-actions {
    position: fixed;
    top: calc(var(--header-height) + 4px);
    right: 4px;
    z-index: 1020;
}

.floating-right-btn {
    border-radius: 20px;
    padding: 2px 12px;
    font-size: 13px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.bottom-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(60px + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: #fff;
    border-top: 1px solid #dee2e6;
    z-index: 1000;
}

.menu-item {
    color: #6c757d;
    text-decoration: none;
    padding: 6px 2px;
    flex: 1;
    min-width: 0;
    text-align: center;
}

.menu-item.active {
    color: #0d6efd;
}

.menu-icon {
    font-size: 20px;
    line-height: 1;
}

.nav-arrow {
    color: #0d6efd;
    text-decoration: none;
    padding: 6px 8px;
    min-width: 36px;
    text-align: center;
}

.nav-arrow.disabled {
    color: #adb5bd;
    pointer-events: none;
}

.nav-arrow-icon {
    font-size: 20px;
    line-height: 1;
    font-weight: bold;
}

.calendar-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.calendar-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f8f9fa;
    text-decoration: none;
    color: #212529;
    position: relative;
    font-size: 15px;
}

.calendar-cell.empty {
    background: transparent;
}

.calendar-header .calendar-cell {
    aspect-ratio: auto;
    height: 36px;
    font-weight: bold;
    background: #e9ecef;
}

.calendar-cell.has-booking {
    background: #d1e7ff;
    color: #0d6efd;
    font-weight: 500;
}

.calendar-cell.rest-day {
    background: #f8d7da;
    color: #842029;
}

.calendar-cell.today {
    border: 2px solid #0d6efd;
}

.color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(0,0,0,0.1);
}

.color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid transparent;
    padding: 0;
}

.selected-color {
    border-color: #212529;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #212529;
}

.selected-day {
    box-shadow: 0 0 0 2px #0d6efd inset;
}

.calendar-cell.rest-day {
    background-color: #f8d7da;
    color: #842029;
}

.calendar-cell .day-number {
    font-weight: 500;
}

.batch-day-floating {
    position: fixed;
    right: 12px;
    bottom: calc(72px + var(--safe-bottom) + 12px);
    z-index: 1020;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.contact-item {
    padding: 0.75rem 0.5rem;
}

.modal-title {
    font-size: 1.1rem;
}

.contact-info {
    min-width: 0;
}

.toast-container {
    z-index: 1100;
}

@media (max-width: 360px) {
    .booking-table td {
        padding: 0.45rem 0.15rem;
    }
    .menu-icon {
        font-size: 18px;
    }
    .navbar-brand {
        font-size: 0.95rem;
    }
}

@media (max-width: 320px) {
    .navbar-brand {
        font-size: 0.85rem;
    }
    .booking-table td {
        padding: 0.4rem 0.1rem;
    }
}
