:root {
    --primary-pink: #ff8fa3;
    --dark-pink: #e05e74;
    --bg-pink: #fff0f3;
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.55);
    --text-color: #3a3a3a;
    --muted: #7b7b7b;

    --shadow-sm: 0 8px 20px rgba(255, 143, 163, 0.12);
    --shadow-md: 0 16px 40px rgba(255, 143, 163, 0.18);

    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html, body {
    height: 100%;
}

body {
    background:
        radial-gradient(1200px 600px at 20% 10%, rgba(255, 143, 163, 0.20), transparent 60%),
        radial-gradient(900px 500px at 90% 20%, rgba(224, 94, 116, 0.18), transparent 55%),
        linear-gradient(135deg, #fff0f3 0%, #ffe3e8 55%, #fff6f8 100%);
    color: var(--text-color);
    min-height: 100vh;
    padding-top: 92px; /* Space for navbar */
}

/* Glass Navbar */
.glass-nav {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 1200px;
    padding: 14px 22px;
    background: rgba(255, 255, 255, 0.70);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.glass-nav h1 {
    color: var(--dark-pink);
    font-size: clamp(1.2rem, 1.2rem + 0.6vw, 1.6rem);
    font-weight: 700;
    letter-spacing: 0.6px;
}

/* Layout */
.main-container {
    width: 92%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 0 40px;
}

.center-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: calc(100vh - 120px);
}

/* Glass Card Style */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
}

/* Login Specific */
.login-card {
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-card h2 {
    color: var(--dark-pink);
    margin-bottom: 18px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.login-card p {
    color: var(--muted);
    margin-bottom: 18px;
    font-size: 0.95rem;
}

/* Forms */
.input-group {
    margin-bottom: 14px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.9rem;
    color: var(--dark-pink);
    font-weight: 700;
}

input, select, textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.65);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    color: var(--text-color);
}

textarea {
    min-height: 96px;
    resize: vertical;
}

input::placeholder, textarea::placeholder {
    color: rgba(122, 122, 122, 0.75);
}

input:focus, select:focus, textarea:focus {
    border-color: rgba(255, 143, 163, 0.85);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 0 4px rgba(255, 143, 163, 0.18);
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-pink), var(--dark-pink));
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 800;
    font-size: 1rem;
    transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
    width: 100%;
    box-shadow: 0 10px 24px rgba(224, 94, 116, 0.22);
}

.btn-primary:hover {
    filter: brightness(1.02);
    transform: translateY(-2px);
}

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

.error {
    color: #c62828;
    margin-top: 10px;
    font-size: 0.9rem;
}

.hidden { display: none !important; }

/* Dashboard Specifics */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 12px;
}

.action-bar h2 {
    color: var(--dark-pink);
    font-weight: 900;
    letter-spacing: 0.2px;
}

.action-bar .btn-primary {
    width: auto;
    padding: 10px 16px;
}

/* Calendar */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 14px;
    margin-bottom: 26px;
}

.cal-day {
    background: rgba(255, 255, 255, 0.82);
    padding: 14px 14px;
    border-radius: 18px;
    text-align: center;
    border: 1px solid rgba(255, 143, 163, 0.14);
    box-shadow: 0 10px 24px rgba(255, 143, 163, 0.10);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cal-day:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(255, 143, 163, 0.14);
}

.cal-day h4 {
    color: var(--dark-pink);
    margin-bottom: 6px;
    font-weight: 900;
}

.cal-day span {
    font-size: 0.9rem;
    color: var(--muted);
}

/* Monthly Calendar (Advanced) */
.calendar-section {
    margin-bottom: 18px;
    padding: 22px;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.calendar-title h3 {
    color: var(--dark-pink);
    font-weight: 900;
    letter-spacing: 0.2px;
    margin-bottom: 4px;
}

.calendar-subtitle {
    color: var(--muted);
    font-size: 0.92rem;
}

.calendar-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 143, 163, 0.45);
    color: var(--dark-pink);
    padding: 10px 14px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 900;
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 10px 18px rgba(255, 143, 163, 0.10);
}

.btn-secondary:hover {
    background: rgba(255, 143, 163, 0.10);
    transform: translateY(-1px);
}

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

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.calendar-weekdays > div {
    text-align: center;
    font-weight: 900;
    color: var(--dark-pink);
    font-size: 0.9rem;
    opacity: 0.92;
}

.month-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
}

.day-cell {
    position: relative;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(255, 143, 163, 0.14);
    border-radius: 18px;
    padding: 12px 12px;
    min-height: 92px;
    box-shadow: 0 10px 24px rgba(255, 143, 163, 0.10);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    overflow: hidden;
}

.day-cell:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(255, 143, 163, 0.14);
}

.day-cell.is-outside {
    opacity: 0.45;
}

.day-cell.is-selected {
    border-color: rgba(224, 94, 116, 0.55);
    box-shadow: 0 18px 36px rgba(224, 94, 116, 0.18);
}

.day-cell.today {
    border-color: rgba(224, 94, 116, 0.65);
    background: rgba(255, 143, 163, 0.10);
}

.day-num {
    font-weight: 900;
    color: var(--text-color);
    font-size: 0.98rem;
    line-height: 1;
}

.day-meta {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.order-count {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 900;
    color: var(--dark-pink);
    font-size: 0.9rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 143, 163, 0.18);
    border: 1px solid rgba(255, 143, 163, 0.35);
    color: var(--dark-pink);
    font-weight: 900;
    font-size: 0.82rem;
}

.client-preview {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.calendar-legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.today-dot {
    background: rgba(224, 94, 116, 0.8);
}

.has-orders-dot {
    background: rgba(255, 143, 163, 0.95);
}

.day-cell.has-orders::after {
    content: "";
    position: absolute;
    top: 10px;
    right: 10px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 143, 163, 0.95);
    box-shadow: 0 8px 16px rgba(255, 143, 163, 0.25);
}

/* Selected Day Orders Panel */
.day-orders-section {
    padding: 22px;
}

.day-orders-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.day-orders-header h3 {
    color: var(--dark-pink);
    font-weight: 900;
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 143, 163, 0.16);
    border: 1px solid rgba(255, 143, 163, 0.30);
    color: var(--dark-pink);
    font-weight: 900;
    font-size: 0.9rem;
    white-space: nowrap;
}

.day-orders-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.order-item {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 143, 163, 0.14);
    border-radius: 16px;
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.order-item strong {
    color: var(--text-color);
}

.order-item .order-sub {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

.empty-state {
    padding: 14px;
    border-radius: 16px;
    border: 1px dashed rgba(255, 143, 163, 0.35);
    background: rgba(255, 255, 255, 0.65);
    color: var(--muted);
}

/* Tables */
.table-section {
    margin-bottom: 22px;
}

.table-section h3 {
    margin-bottom: 14px;
    color: var(--dark-pink);
    font-weight: 900;
}

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

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 0.95rem;
}

th {
    color: var(--dark-pink);
    font-weight: 900;
    letter-spacing: 0.2px;
}

tbody tr:hover td {
    background: rgba(255, 143, 163, 0.05);
}

/* Edit button */
.btn-edit {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 143, 163, 0.55);
    color: var(--dark-pink);
    padding: 7px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 800;
    transition: transform 0.18s ease, background 0.18s ease;
}

.btn-edit:hover {
    background: rgba(255, 143, 163, 0.16);
    transform: translateY(-1px);
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.35);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 16px;
    overscroll-behavior: contain;
    touch-action: none;
}

.modal-content {
    width: 100%;
    max-width: 640px;
    position: relative;
    background: rgba(255, 245, 247, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Lock background scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

.close-btn {
    position: absolute;
    top: 14px; right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark-pink);
    box-shadow: 0 10px 20px rgba(255, 143, 163, 0.16);
    transition: transform 0.18s ease, background 0.18s ease;
}

.close-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.95);
}

.form-row {
    display: flex;
    gap: 14px;
}

.form-row .input-group {
    flex: 1;
}

/* Responsive */
@media (max-width: 720px) {
    body {
        padding-top: 82px;
    }

    .main-container {
        width: 94%;
        padding: 14px 0 32px;
    }

    .glass-nav {
        top: 14px;
        padding: 12px 16px;
        border-radius: 20px;
    }

    .glass-nav h1 {
        font-size: 1.18rem;
    }

    .glass-card {
        padding: 18px;
        border-radius: 20px;
    }

    /* Headings tighten */
    .action-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 14px;
    }

    .action-bar h2 {
        font-size: 1.18rem;
        line-height: 1.2;
    }

    .action-bar .btn-primary {
        width: 100%;
        padding: 12px 16px;
        border-radius: 16px;
    }

    /* Forms */
    .form-row {
        flex-direction: column;
    }

    input, select, textarea {
        padding: 12px 12px;
        border-radius: 14px;
    }

    /* Calendar header layout */
    .calendar-section {
        padding: 18px;
    }

    .calendar-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 12px;
    }

    .calendar-title h3 {
        font-size: 1.22rem;
    }

    .calendar-subtitle {
        font-size: 0.92rem;
    }

    .calendar-controls {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1.2fr 1fr;
        gap: 10px;
    }

    .btn-secondary {
        width: 100%;
        padding: 12px 14px;
        border-radius: 16px;
    }

    /* Weekday labels */
    .calendar-weekdays {
        gap: 8px;
    }

    .calendar-weekdays > div {
        font-size: 0.82rem;
        letter-spacing: 0.2px;
        opacity: 0.95;
    }

    /* Calendar grid */
    .month-calendar {
        gap: 8px;
    }

    /* Hide order count + client preview on mobile */
    .day-meta {
        display: none;
    }

    .day-cell {
        min-height: 64px;
        padding: 12px;
        border-radius: 16px;
        display: flex;
        align-items: flex-start;
        justify-content: flex-start;
        box-shadow: 0 8px 18px rgba(255, 143, 163, 0.10);
    }

    .day-cell:hover {
        transform: none;
    }

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

    .day-cell.is-outside {
        opacity: 0.28;
    }

    .day-cell.today {
        background: rgba(255, 143, 163, 0.08);
        border-color: rgba(224, 94, 116, 0.55);
    }

    .day-cell.is-selected {
        box-shadow: 0 14px 28px rgba(224, 94, 116, 0.14);
        border-color: rgba(224, 94, 116, 0.50);
    }

    .day-cell.has-orders::after {
        top: 10px;
        right: 10px;
        width: 9px;
        height: 9px;
        box-shadow: 0 6px 12px rgba(255, 143, 163, 0.22);
    }

    .calendar-legend {
        gap: 12px;
        margin-top: 12px;
    }

    /* Selected day panel spacing */
    .day-orders-section {
        padding: 18px;
    }

    .day-orders-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .pill {
        padding: 9px 12px;
        border-radius: 999px;
    }

    .order-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* Tables: comfortable mobile scroll */
    .table-section {
        margin-bottom: 18px;
    }

    th, td {
        padding: 10px;
        font-size: 0.92rem;
        white-space: nowrap;
    }

    .table-responsive {
        -webkit-overflow-scrolling: touch;
        border-radius: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
        scroll-behavior: auto !important;
    }
    .modal {
        align-items: flex-start;
        padding: 12px;
    }

    .modal-content {
        max-height: calc(100vh - 24px);
        border-radius: 18px;
    }

    .close-btn {
        top: 10px;
        right: 10px;
        width: 38px;
        height: 38px;
    }
}