* {
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    margin: 0;
    background: #f4f6fb;
    color: #0f172a;
}

body.nav-open {
    overflow: hidden;
}

.blank-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: #0f172a;
    color: #fff;
    position: relative;
}

.navbar__links--desktop {
    display: flex;
    gap: 1rem;
}

.navbar__links--desktop a {
    margin-right: 0;
}

.navbar__brand {
    display: flex;
    align-items: center;
}

.navbar__brand-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.15rem;
}

.navbar__logo {
    height: 36px;
    width: auto;
    display: block;
}

.navbar a {
    color: inherit;
    text-decoration: none;
    margin-right: 1rem;
    font-weight: 500;
}

.navbar__links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar__user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-right: 3rem;
}

.navbar__user form {
    margin: 0;
}

.navbar__user button {
    background: #f87171;
    border: none;
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
}

.navbar__toggle {
    display: none;
    flex-direction: column;
    gap: 0.3rem;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    cursor: pointer;
    padding: 0.6rem;
    margin-left: auto;
    z-index: 1100;
}

.navbar__toggle span {
    width: 22px;
    height: 2px;
    background: #fff;
    display: block;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    z-index: 999;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 4rem 1.5rem 1.5rem;
}

.nav-modal.is-open {
    display: flex;
}

.nav-modal__panel {
    background: #0f172a;
    border-radius: 18px;
    padding: 2rem;
    width: min(340px, 90vw);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.4);
}

.nav-modal__links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.nav-modal__links a {
    font-size: 1.1rem;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

.nav-modal__user {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.nav-modal__close {
    align-self: flex-end;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0;
    margin-left: auto;
}

.nav-modal__close span {
    width: 28px;
    height: 3px;
    background: rgba(255, 255, 255, 0.85);
}

.nav-modal__close span:first-child {
    transform: rotate(45deg) translate(6px, 6px);
}

.nav-modal__close span:last-child {
    transform: rotate(-45deg) translate(6px, -6px);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.button-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.button-row .btn {
    flex-shrink: 0;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    margin-bottom: 1.5rem;
}

.card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.grid {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.grid--2 {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.grid--3 {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.grid--4 {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.metric-card {
    text-align: center;
}

.metric-number {
    font-size: 2.5rem;
    margin: 0;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form label {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    font-weight: 500;
    color: #475569;
    letter-spacing: 0.02em;
}

.form input,
.form select,
.form textarea {
    margin-top: 0.4rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 1px solid transparent;
    font-size: 1rem;
    background: linear-gradient(145deg, #f8fafc, #ffffff);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35), 0 10px 25px rgba(15, 23, 42, 0.05);
    transition: box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.75);
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.45), 0 10px 30px rgba(99, 102, 241, 0.25);
    background: #fff;
}

.form input::placeholder,
.form textarea::placeholder {
    color: #94a3b8;
}

.form select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235865F2' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    padding-right: 2.5rem;
}

.form textarea {
    resize: vertical;
    min-height: 120px;
}

.form__group h3 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #1e293b;
}

.form__group {
    background: linear-gradient(135deg, #fdfcff, #f5f7ff);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
    margin-top: 1.25rem;
}

.feed-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feed-form {
    background: rgba(255, 255, 255, 0.92);
    padding: 1.25rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feed-form__section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feed-form__section--sync {
    align-items: flex-end;
}

.feed-form__section--delete {
    align-items: flex-end;
}

.task-filter {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.task-filter__grid {
    margin-bottom: 0;
}

.form__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.btn {
    border: none;
    border-radius: 999px;
    padding: 0.75rem 1.35rem;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #fff;
    box-shadow: 0 15px 35px rgba(37, 99, 235, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.4);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.35);
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.7), 0 20px 40px rgba(37, 99, 235, 0.4);
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    box-shadow: none;
}

.btn--primary {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}

.btn--ghost {
    border: 1px solid rgba(148, 163, 184, 0.6);
    color: #0f172a;
    background: rgba(248, 250, 252, 0.8);
    box-shadow: none;
}

.btn--ghost:hover {
    border-color: rgba(99, 102, 241, 0.7);
    color: #1d4ed8;
}

.btn--danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 15px 35px rgba(239, 68, 68, 0.35);
}

.btn--small {
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
}

.w-full {
    width: 100%;
}

.alert {
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
}

.alert--success {
    background: #dcfce7;
    color: #14532d;
}

.alert--error {
    background: #fee2e2;
    color: #991b1b;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

th {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #64748b;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.table-actions form {
    margin: 0;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: #94a3b8;
}

.status-pill {
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    text-transform: capitalize;
    color: #fff;
}

.status-pill--active {
    background: #22c55e;
}

.status-pill--inactive {
    background: #f97316;
}

.feed-tag {
    padding: 0.3rem 0;
    font-size: 0.85rem;
}

.badge--source {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 6px;
    text-transform: capitalize;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table-responsive table {
    min-width: 600px;
}

.list-unstyled {
    list-style: none;
    margin: 0;
    padding: 0;
}

.employee-inline-form input {
    width: 100%;
}

.employee-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.employee-form .grid--2 {
    margin: 0;
}

.employee-form .form__actions {
    justify-content: flex-start;
}

.settings-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.employee-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.employee-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    background: #fff;
}

.employee-card__toggles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.5rem;
}

.employee-card__actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.employee-card__actions .btn {
    flex: 1;
    min-width: 120px;
}

.timeline {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.timeline li {
    border-left: 3px solid #dbeafe;
    padding-left: 0.75rem;
}

.empty-state {
    max-width: 480px;
    margin: 4rem auto;
    text-align: center;
}

.auth-card {
    max-width: 360px;
    margin: auto;
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.2);
}

.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.calendar-shell {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    margin-bottom: 2rem;
    padding: 2rem 3rem 3rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border-radius: 18px;
    box-shadow: 0 25px 65px rgba(15, 23, 42, 0.15);
}

#calendar-empty {
    display: none;
    text-align: center;
    font-weight: 600;
    color: #0f172a;
    background: rgba(248, 250, 252, 0.95);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.3);
    margin-bottom: 1rem;
}
@media (max-width: 768px) {
    .calendar-shell {
        margin: 0 0 2rem;
        padding: 1rem;
        border-radius: 14px;
    }

    #calendar-empty {
        display: block;
        background: rgba(248, 250, 252, 0.95);
        border-radius: 12px;
        padding: 1.5rem;
        text-align: center;
        color: #0f172a;
        font-weight: 600;
        box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.3);
        margin-bottom: 1rem;
    }

    #calendar {
        min-height: 400px;
    }
}

#calendar {
    min-height: calc(100vh - 280px);
    width: 100%;
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #0f172a;
}

.legend-note {
    font-weight: 500;
    color: #475569;
}

.legend-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot--booking {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.legend-dot--task {
    background: linear-gradient(135deg, #22c55e, #15803d);
}

#calendar .fc-toolbar.fc-header-toolbar {
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

#calendar .fc-toolbar-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
}

#calendar .fc-button-primary {
    background: #0f172a;
    border: none;
    border-radius: 999px;
    padding: 0.45rem 1.25rem;
    font-weight: 600;
}

#calendar .fc-daygrid-event,
#calendar .fc-timegrid-event {
    border: none;
    border-radius: 10px;
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
}

#calendar .fc-daygrid-event .fc-event-time,
#calendar .fc-daygrid-event .fc-event-title {
    display: block;
    white-space: normal;
}

#calendar .fc .fc-col-header-cell {
    padding: 0.5rem 0;
    background: #f8fafc;
    font-weight: 600;
}

#calendar .fc-theme-standard .fc-scrollgrid {
    border-radius: 14px;
    border-color: #e2e8f0;
    overflow: hidden;
}

#tasks-table.is-loading {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

@media (max-width: 1024px) {
    .container {
        padding: 1rem;
    }

    .navbar {
        padding: 1rem;
    }

    .navbar__links--desktop {
        display: none;
    }

    .navbar__toggle {
        display: flex;
        position: fixed;
        top: 1rem;
        right: 1rem;
    }

    .navbar__user {
        padding-right: 0;
        margin-right: 3rem;
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .button-row,
    .page-header > div:last-child {
        width: 100%;
    }

    .button-row .btn,
    .page-header .btn {
        width: 100%;
        justify-content: center;
    }

    .card {
        padding: 1.25rem;
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    table thead {
        display: none;
    }

    table tbody tr {
        margin-bottom: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 1rem;
        box-shadow: 0 10px 20px rgba(15, 23, 42, 0.05);
        background: #fff;
    }

    table tbody tr td {
        border: none;
        border-bottom: 1px solid rgba(226, 232, 240, 0.6);
        padding: 0.5rem 0;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 1rem;
        font-size: 0.95rem;
    }

    table tbody tr td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    table tbody tr td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #475569;
        text-transform: uppercase;
        font-size: 0.75rem;
        letter-spacing: 0.05em;
        flex: 1;
    }

    table tbody tr td > *:not(form) {
        flex: 2;
    }

    .table-actions {
        width: 100%;
        gap: 0.5rem;
    }

    .table-actions .btn {
        flex: 1;
    }

    #calendar {
        min-height: 520px;
    }

    .feed-form {
        padding: 1rem;
    }

    .feed-form__section--sync {
        align-items: stretch;
    }

.feed-form__section--delete {
    align-items: stretch;
}
}

/* Tutorial helper */
.tutorial-fab {
    position: fixed;
    bottom: 18px;
    right: 18px;
    z-index: 1100;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.85rem 1.4rem;
    box-shadow: 0 18px 35px rgba(79, 70, 229, 0.35);
    cursor: pointer;
    font-weight: 600;
}

.tutorial-fab:hover {
    box-shadow: 0 22px 40px rgba(99, 102, 241, 0.45);
    transform: translateY(-1px);
}

.tutorial-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
}

.tutorial-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.tutorial-modal__panel {
    position: absolute;
    right: 24px;
    bottom: 24px;
    max-width: 420px;
    width: min(90vw, 420px);
    background: #fff;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tutorial-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.tutorial-modal__close {
    border: none;
    background: #f1f5f9;
    border-radius: 999px;
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
    cursor: pointer;
}

.tutorial-steps {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.tutorial-steps li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.65rem;
    align-items: start;
}

.tutorial-steps__badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #0ea5e9;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.tutorial-steps p {
    margin: 0;
    color: #1f2937;
}

/* Calendar filter + modal */
.calendar-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.calendar-filters .form--inline {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
}

.calendar-filters select {
    min-width: 200px;
}

.cal-modal {
    position: fixed;
    inset: 0;
    z-index: 1250;
}

.cal-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.cal-modal__panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 16px;
    padding: 1.25rem;
    width: min(520px, 92vw);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.35);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cal-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cal-modal__close {
    border: none;
    background: #f1f5f9;
    border-radius: 999px;
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
    cursor: pointer;
}

.cal-modal__body p {
    margin: 0.25rem 0;
}

.cal-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

@media (max-width: 720px) {
    .cal-modal__panel {
        top: auto;
        bottom: 12px;
        transform: translate(-50%, 0);
    }
}
@media (max-width: 720px) {
    .tutorial-fab {
        right: 12px;
        bottom: 12px;
    }

    .tutorial-modal__panel {
        left: 50%;
        transform: translateX(-50%);
        right: 12px;
        bottom: 12px;
        width: calc(100% - 24px);
    }
}
.nav-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 4rem 1.5rem 1.5rem;
}

.nav-modal.is-open {
    display: flex;
}

.nav-modal__panel {
    background: #0f172a;
    border-radius: 18px;
    padding: 2rem;
    width: min(320px, 80vw);
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.4);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.nav-modal__links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.nav-modal__links a {
    font-size: 1.1rem;
}

.nav-modal__user {
    margin-top: auto;
}
