/* ======================================================
   HAREM · Calcolo Ore — Design System (Vanilla CSS)
   ====================================================== */

:root {
    --purple: #c59e75;
    /* PRIMARY = warm gold (logo color) */
    --purple-dark: #a07d56;
    /* darker gold */
    --purple-light: #dfc5a0;
    /* lighter gold */
    --beige: #EDE2D9;
    --gold: #c59e75;
    --gold-dark: #a07d56;
    --dark: #120e07;
    /* warm dark brown-black */
    --dark-2: #1e1509;
    /* slightly lighter warm dark */
    --dark-3: #2e2010;
    /* mid-dark warm */
    --text: #1c1207;
    --text-muted: #7a6150;
    --border: #e8ddd4;
    --surface: #faf7f4;
    --white: #ffffff;
    --red: #ef4444;
    --green: #22c55e;
    --blue: #3b82f6;
    --sidebar-w: 260px;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
    --transition: all 0.2s ease;
}

/* ── Reset ─────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--surface);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

input,
button,
select,
textarea {
    font: inherit;
}

/* ── Layout ─────────────────────────────────────────── */
.layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--dark-2) 0%, var(--dark) 100%);
    border-right: 1px solid rgba(197, 158, 117, 0.18);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.5rem 0.25rem;
    margin-bottom: 2rem;
}

.sidebar-brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(197, 158, 117, 0.4), rgba(197, 158, 117, 0.1));
    border: 1px solid rgba(197, 158, 117, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-brand-icon svg {
    display: block;
}

.sidebar-brand-name {
    color: var(--white);
    font-weight: 800;
    font-size: 1.1rem;
    line-height: 1.2;
}

.sidebar-brand-sub {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.sidebar-user {
    background: rgba(197, 158, 117, 0.1);
    border: 1px solid rgba(197, 158, 117, 0.2);
    border-radius: var(--radius-sm);
    padding: 0.875rem 1rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(197, 158, 117, 0.2);
    border: 2px solid rgba(197, 158, 117, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-avatar-initial {
    color: var(--purple-light);
    font-weight: 800;
    font-size: 1rem;
}

.sidebar-user-name {
    color: var(--white);
    font-weight: 600;
    font-size: 0.875rem;
}

.sidebar-user-role {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.7rem;
}

.sidebar-section-label {
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 0 0.25rem;
    margin-bottom: 0.5rem;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    margin-bottom: 0.2rem;
    border: 1px solid transparent;
}

.sidebar-link:hover {
    background: rgba(197, 158, 117, 0.12);
    color: var(--white);
}

.sidebar-link.active {
    background: linear-gradient(135deg, rgba(197, 158, 117, 0.28), rgba(197, 158, 117, 0.08));
    color: var(--white);
    border-color: rgba(197, 158, 117, 0.3);
}

.sidebar-link svg {
    flex-shrink: 0;
    opacity: 0.8;
}

.sidebar-link.active svg {
    opacity: 1;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    color: rgba(239, 68, 68, 0.7);
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--transition);
    border: 1px solid rgba(239, 68, 68, 0.12);
    background: rgba(239, 68, 68, 0.04);
    margin-top: auto;
    cursor: pointer;
}

.sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.25);
}

/* ── Main content ─────────────────────────────────────── */
.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 2.25rem 2.5rem;
}

/* ── Page header ─────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
}

.page-sub {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.2rem;
}

.page-date {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* ── Card ─────────────────────────────────────────────── */
.card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1.375rem 1.75rem;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 0.975rem;
    font-weight: 700;
    color: var(--text);
}

.card-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.card-body {
    padding: 1.75rem;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

/* ── Grid ─────────────────────────────────────────────── */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
}

.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1.25rem;
}

.grid-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ── Form elements ────────────────────────────────────── */
.field {
    margin-bottom: 1.25rem;
}

.label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.label.blue {
    color: #2563eb;
}

.label.purple {
    color: var(--purple);
}

.label.gold {
    color: var(--gold-dark);
}

.label.green {
    color: #16a34a;
}

.input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.input:focus {
    border-color: var(--gold);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(197, 158, 117, 0.14);
}

.input.mono {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.input.mono.blue:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.input.mono.purple:focus {
    border-color: var(--purple);
}

.input.mono.gold:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(195, 158, 119, 0.12);
}

.input.mono.green:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
}

.input.border-blue {
    border-color: #dbeafe;
}

.input.border-purple {
    border-color: #ede9fe;
}

.input.border-gold {
    border-color: #fef3c7;
}

.input.border-green {
    border-color: #dcfce7;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--white);
    box-shadow: 0 4px 20px rgba(197, 158, 117, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(197, 158, 117, 0.52);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--white);
    box-shadow: 0 4px 20px rgba(195, 158, 119, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(195, 158, 119, 0.45);
}

.btn-secondary:active {
    transform: scale(0.97);
}

.btn-ghost {
    background: transparent;
    color: var(--gold-dark);
    border: 2px solid rgba(197, 158, 117, 0.3);
    padding: 0.75rem 1.5rem;
}

.btn-ghost:hover {
    background: rgba(197, 158, 117, 0.08);
    border-color: var(--gold);
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* ── Badges ─────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.badge-purple {
    background: rgba(197, 158, 117, 0.12);
    color: var(--gold-dark);
}

.badge-gold {
    background: rgba(195, 158, 119, 0.15);
    color: var(--gold-dark);
}

.badge-green {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.badge-blue {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.badge-red {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* ── Alerts ─────────────────────────────────────────── */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
}

.alert-success {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #15803d;
}

.alert-error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

/* ── Table ───────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    padding: 0.875rem 1.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    white-space: nowrap;
}

tbody td {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.9rem;
}

tbody tr:hover {
    background: rgba(197, 158, 117, 0.03);
}

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

/* ── Staff card (admin) ──────────────────────────────── */
.staff-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.staff-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.staff-card-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    overflow: hidden;
    background: #fdf7f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(197, 158, 117, 0.22);
    box-shadow: 0 4px 16px rgba(197, 158, 117, 0.14);
}

.staff-card-avatar.gold-border {
    border-color: rgba(195, 158, 119, 0.35);
    box-shadow: 0 4px 16px rgba(195, 158, 119, 0.15);
}

.staff-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.staff-card-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.staff-card-btn {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 1rem;
    transition: var(--transition);
}

.staff-card-btn:hover {
    background: rgba(197, 158, 117, 0.07);
    border-color: rgba(197, 158, 117, 0.28);
    color: var(--gold-dark);
}

/* ── Row list (recent entries) ───────────────────────── */
.row-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 1.75rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}

.row-list-item:hover {
    background: rgba(155, 77, 202, 0.025);
}

.row-list-item:last-child {
    border-bottom: none;
}

.row-date {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.row-badges {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.35rem;
}

.row-total {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--purple);
    font-variant-numeric: tabular-nums;
}

.row-total-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    text-align: right;
}

/* ── Empty state ─────────────────────────────────────── */
.empty-state {
    padding: 3rem 1.75rem;
    text-align: center;
    color: var(--text-muted);
}

.empty-state svg {
    margin: 0 auto 1rem;
    display: block;
}

/* ── Filter bar ──────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--surface);
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--border);
    align-items: flex-end;
}

.filter-bar .input {
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
}

/* ── Login page ──────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #120e07 0%, #1e1509 45%, #3a2510 100%);
    position: relative;
    overflow: hidden;
}

.login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    animation: floatOrb 8s ease-in-out infinite;
}

@keyframes floatOrb {

    0%,
    100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-28px)
    }
}

.login-card {
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
}

.login-brand {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-brand-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(197, 158, 117, 0.35), rgba(197, 158, 117, 0.08));
    border: 1px solid rgba(197, 158, 117, 0.35);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.login-brand-title {
    color: var(--white);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.login-brand-tagline {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

.login-glass {
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
}

.login-glass h2 {
    color: var(--white);
    font-size: 1.15rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.4rem;
}

.login-glass p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    text-align: center;
    margin-bottom: 2rem;
}

.login-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* PIN dots */
.pin-dots {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.pin-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    transition: var(--transition);
}

.pin-dot.filled {
    background: var(--gold);
    border-color: var(--gold);
    box-shadow: 0 0 12px rgba(197, 158, 117, 0.6);
}

/* PIN numpad */
.numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.numpad-key {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.09);
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.numpad-key:hover {
    background: rgba(197, 158, 117, 0.22);
    border-color: rgba(197, 158, 117, 0.45);
    transform: scale(1.05);
}

.numpad-key:active {
    transform: scale(0.94);
}

.numpad-key.danger {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.15);
}

.numpad-key.danger:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.35);
}

.numpad-key.neutral {
    background: rgba(255, 255, 255, 0.03);
}

/* Login submit */
.login-submit {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(197, 158, 117, 0.42);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(197, 158, 117, 0.58);
}

.login-submit:active {
    transform: scale(0.97);
}

.login-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.18);
    font-size: 0.75rem;
    margin-top: 1.75rem;
}

/* ── Profile avatar grid ─────────────────────────────── */
.avatar-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.avatar-option label {
    display: block;
    cursor: pointer;
    border-radius: 50%;
    overflow: hidden;
    width: 72px;
    height: 72px;
    border: 3px solid transparent;
    transition: var(--transition);
}

.avatar-option input[type=radio] {
    display: none;
}

.avatar-option input[type=radio]:checked+label,
.avatar-option label.selected {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(197, 158, 117, 0.28);
}

.avatar-option label:hover {
    transform: scale(1.08);
}

.avatar-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Upload zone ─────────────────────────────────────── */
.upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    background: var(--surface);
}

.upload-zone:hover {
    border-color: var(--gold);
    background: rgba(197, 158, 117, 0.04);
}

.upload-zone-text {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.upload-zone-text b {
    color: var(--text);
}

.upload-zone-hint {
    color: #9ca3af;
    font-size: 0.75rem;
}

/* ── Inline edit inputs in table ─────────────────────── */
.table-input {
    width: 100%;
    padding: 0.4rem 0.5rem;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    background: var(--white);
    font-size: 0.9rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
    transition: var(--transition);
    outline: none;
}

.table-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(197, 158, 117, 0.14);
}

/* ── Save btn in table ───────────────────────────────── */
.save-btn {
    background: var(--green);
    color: var(--white);
    border: none;
    border-radius: 6px;
    padding: 0.4rem 0.875rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: var(--transition);
    white-space: nowrap;
}

.save-btn:hover {
    background: #16a34a;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main {
        margin-left: 0;
        padding: 1.5rem 1.25rem;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .grid-form {
        grid-template-columns: 1fr 1fr;
    }

    .hamburger {
        display: flex !important;
    }
}

@media (max-width: 540px) {
    .grid-form {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-direction: column;
    }
}

/* ── Timer display ────────────────────────────────────── */
.timer-display {
    font-size: 3.5rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.05em;
    color: var(--text);
    margin: 0.5rem auto 1.25rem;
    line-height: 1;
}

.timer-running-anim {
    color: var(--purple);
    animation: timerPulse 1.5s ease-in-out infinite;
}

@keyframes timerPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.65;
    }
}

.timer-start-btn {
    font-size: 1rem;
    padding: 1.1rem 2rem;
    border-radius: 999px;
    box-shadow: 0 6px 28px rgba(197, 158, 117, 0.4);
    animation: startGlow 3s ease-in-out infinite;
}

@keyframes startGlow {

    0%,
    100% {
        box-shadow: 0 6px 28px rgba(197, 158, 117, 0.4);
    }

    50% {
        box-shadow: 0 8px 40px rgba(197, 158, 117, 0.6);
    }
}

/* ── Shift status banner ─────────────────────────────── */
.shift-status-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.55;
}

.shift-status-banner svg {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.shift-status-partial {
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.28);
    color: #92400e;
}

.shift-status-partial svg {
    stroke: #d97706;
}

.shift-status-full {
    background: rgba(239, 68, 68, 0.07);
    border: 1px solid rgba(239, 68, 68, 0.22);
    color: #991b1b;
}

.shift-status-full svg {
    stroke: #ef4444;
}

/* ── Flatpickr overrides ───────────────────────────────── */
.flatpickr-calendar {
    border-radius: var(--radius-sm) !important;
    box-shadow: var(--shadow-lg) !important;
    border: 1px solid var(--border) !important;
    font-family: inherit !important;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: var(--purple) !important;
    border-color: var(--purple) !important;
}

.flatpickr-day.inRange {
    background: rgba(197, 158, 117, 0.15) !important;
    border-color: transparent !important;
    box-shadow: -5px 0 0 rgba(197, 158, 117, 0.15), 5px 0 0 rgba(197, 158, 117, 0.15) !important;
}

.flatpickr-day:hover {
    background: rgba(197, 158, 117, 0.1) !important;
    border-color: rgba(197, 158, 117, 0.25) !important;
}

.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: var(--white) !important;
    color: var(--text) !important;
}

.flatpickr-weekday {
    color: var(--text-muted) !important;
    font-weight: 700 !important;
    font-size: 0.7rem !important;
}

/* ── Time-detail modal ─────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    background: var(--surface, #fff);
    border-radius: var(--radius);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    padding: 2rem;
    max-width: 380px;
    width: 100%;
    transform: translateY(12px);
    transition: transform 0.18s ease;
}

.modal-overlay.open .modal-box {
    transform: translateY(0);
}

.modal-title {
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    color: var(--text);
}

.modal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.9rem;
}

.modal-row:last-of-type {
    border-bottom: none;
}

.modal-row-label {
    color: var(--text-muted);
}

.modal-row-value {
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.modal-close {
    width: 100%;
    margin-top: 1.25rem;
    padding: 0.75rem;
    background: #f3f4f6;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text);
}

.modal-close:hover {
    background: #e5e7eb;
}

/* Clickable turno badge */
.turno-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.turno-btn:focus-visible {
    outline: 2px solid var(--purple);
    border-radius: 4px;
}