/* Custom styles not covered by Tailwind CDN (if needed) */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

:root {
    --brand-navy: #07111f;
    --brand-panel: #101827;
    --brand-panel-2: #162235;
    --brand-orange: #ff8a00;
    --brand-orange-2: #ffb347;
    --brand-cyan: #54d7ff;
    --brand-line: rgba(125, 211, 252, 0.14);
    --brand-text: #f8fafc;
    --brand-muted: #aeb8cf;
}

.login-shell,
.app-shell {
    color: var(--brand-text);
    background:
        linear-gradient(rgba(125, 211, 252, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(125, 211, 252, 0.03) 1px, transparent 1px),
        radial-gradient(circle at 50% 0%, rgba(255, 138, 0, 0.09), transparent 30rem),
        linear-gradient(145deg, #070d16 0%, #0b1422 52%, #111b2a 100%);
    background-size: 46px 46px, 46px 46px, auto, auto;
}

.login-stage {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 420px);
    align-items: center;
    gap: 2rem;
    max-width: 1120px;
    margin: 0 auto;
    padding: 2rem;
}

.login-brand-panel,
.login-card,
.app-shell section.bg-white,
.app-shell #scheduleModal > div {
    background: linear-gradient(180deg, #121c2d 0%, #0a1220 100%);
    border: 1px solid rgba(125, 211, 252, 0.2);
    box-shadow: 0 22px 52px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(255, 138, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.055);
    color: var(--brand-text);
    border-radius: 8px;
}

.login-brand-panel {
    position: relative;
    overflow: hidden;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-brand-panel::before,
.login-brand-panel::after {
    content: "";
    position: absolute;
    inset: 24px;
    border: 1px solid rgba(84, 215, 255, 0.16);
    pointer-events: none;
}

.login-brand-panel::after {
    inset: auto 24px 24px 24px;
    height: 54px;
    border-top-color: rgba(255, 138, 0, 0.5);
    border-left-color: transparent;
    border-right-color: transparent;
    border-bottom-color: transparent;
}

.login-logo {
    width: min(100%, 560px);
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.35));
}

.login-signal-lines {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent 0 14%, rgba(255, 138, 0, 0.22) 14% 14.4%, transparent 14.4%),
        linear-gradient(180deg, transparent 0 68%, rgba(84, 215, 255, 0.14) 68% 68.3%, transparent 68.3%);
    pointer-events: none;
}

.login-card {
    padding: 2rem;
}

.login-card-heading {
    margin-bottom: 1.5rem;
}

.login-card-heading h1 {
    font-size: 1.8rem;
    line-height: 1.1;
    font-weight: 800;
}

.eyebrow,
.brand-kicker {
    color: var(--brand-orange-2);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.login-card label,
.app-shell label {
    color: #dbe7ff !important;
}

.login-card input,
.app-shell input,
.app-shell select,
.app-shell textarea {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
    color: var(--brand-text) !important;
    box-shadow: none !important;
}

.login-card input:focus,
.app-shell input:focus,
.app-shell select:focus,
.app-shell textarea:focus {
    outline: 2px solid rgba(255, 138, 0, 0.45);
    outline-offset: 1px;
}

.login-card input::placeholder,
.app-shell input::placeholder,
.app-shell textarea::placeholder {
    color: rgba(248, 250, 252, 0.55);
}

.app-shell textarea {
    min-height: 7rem;
    resize: vertical;
}

.equipment-tags {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.65rem;
}

.equipment-tags.hidden {
    display: none;
}

.equipment-tag {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    min-height: 2.25rem;
    padding: 0.45rem 0.6rem;
    background: rgba(84, 215, 255, 0.11);
    border: 1px solid rgba(84, 215, 255, 0.24);
    border-radius: 8px;
    color: #edf4ff;
}

.equipment-tag button {
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    color: #ffdede;
    background: rgba(248, 80, 80, 0.18);
    border: 1px solid rgba(248, 80, 80, 0.28);
    font-weight: 800;
    line-height: 1;
    flex: 0 0 auto;
}

.equipment-tag button:hover {
    background: rgba(248, 80, 80, 0.3);
}

.app-shell select option {
    background: var(--brand-panel);
    color: var(--brand-text);
}

.login-card .text-gray-600,
.app-shell .text-gray-500,
.app-shell .text-gray-600,
.app-shell .text-gray-700,
.app-shell .text-gray-800 {
    color: var(--brand-muted) !important;
}

.login-card button[type="submit"],
.app-shell .bg-blue-500,
.app-shell .bg-green-500 {
    background: linear-gradient(135deg, var(--brand-orange), #ff6b00) !important;
    color: #071244 !important;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.login-card button[type="submit"] {
    min-height: 48px;
}

.login-card button[type="submit"]:hover,
.app-shell .hover\:bg-blue-700:hover,
.app-shell .hover\:bg-green-700:hover {
    background: linear-gradient(135deg, #ffb347, var(--brand-orange)) !important;
}

.app-nav {
    background: rgba(7, 13, 22, 0.94);
    border-bottom: 1px solid rgba(125, 211, 252, 0.14);
    backdrop-filter: blur(12px);
}

body:not(.employee-shell) > nav.app-nav {
    position: relative;
    z-index: 100;
}

.app-nav-primary {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.app-nav-primary .brand-lockup {
    flex: 1 1 auto;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}

.brand-refresh {
    color: inherit;
    text-decoration: none;
    border-radius: 8px;
    cursor: pointer;
}

.brand-refresh:hover .brand-logo {
    border-color: rgba(255, 138, 0, 0.55);
    box-shadow: 0 0 0 2px rgba(255, 138, 0, 0.12);
}

.brand-refresh:focus-visible {
    outline: 2px solid rgba(255, 138, 0, 0.7);
    outline-offset: 4px;
}

.brand-logo {
    width: 112px;
    max-width: 34vw;
    height: 42px;
    object-fit: contain;
    background: #080d1d;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 0.22rem 0.35rem;
}

.export-control {
    position: relative;
    flex: 0 0 auto;
}

.export-toggle-button,
.export-download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: 1px solid rgba(84, 215, 255, 0.45);
    border-radius: 7px;
    background: rgba(84, 215, 255, 0.12);
    color: #dff8ff;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
    padding: 0.7rem 0.85rem;
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
    min-height: 44px;
}

.export-toggle-button:hover,
.export-toggle-button[aria-expanded="true"] {
    background: rgba(84, 215, 255, 0.24);
    border-color: rgba(84, 215, 255, 0.72);
}

.export-toggle-button:focus-visible,
.export-download-button:focus-visible {
    outline: 2px solid rgba(255, 138, 0, 0.85);
    outline-offset: 2px;
}

.export-toggle-button svg {
    width: 1rem;
    height: 1rem;
}

.export-panel {
    position: absolute;
    z-index: 80;
    top: calc(100% + 0.75rem);
    right: 0;
    width: min(23rem, calc(100vw - 2rem));
    padding: 1rem;
    border: 1px solid rgba(84, 215, 255, 0.38);
    border-radius: 10px;
    background-color: #0a1220;
    background-image: linear-gradient(180deg, #162235, #0a1220);
    color: #edf4ff;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
}

.export-panel.hidden {
    display: none;
}

.export-panel h2 {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
}

.export-panel-description {
    margin-top: 0.25rem;
    color: #b9c7e2;
    font-size: 0.8rem;
}

.export-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 0.9rem;
}

.export-panel label {
    display: grid;
    gap: 0.35rem;
    color: #dbe7ff;
    font-size: 0.78rem;
    font-weight: 700;
}

.export-panel input,
.export-panel select {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.6rem 0.65rem;
}

.export-panel select option {
    background: #162235;
    color: #ffffff;
}

.export-status-field {
    margin-top: 0.7rem;
}

.export-feedback {
    margin-top: 0.7rem;
    border-radius: 6px;
    padding: 0.55rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
}

.export-feedback.is-error {
    background: rgba(248, 80, 80, 0.16);
    color: #ffc4c4;
}

.export-download-button {
    width: 100%;
    margin-top: 0.8rem;
    border-color: rgba(255, 138, 0, 0.58);
    background: linear-gradient(135deg, var(--brand-orange), #ff6b00);
    color: #071244;
}

.export-download-button:hover {
    background: linear-gradient(135deg, #ffb347, var(--brand-orange));
}

.export-download-button:disabled {
    cursor: wait;
    opacity: 0.62;
}

.app-shell main {
    color: var(--brand-text);
}

.app-shell section.bg-white {
    position: relative;
    overflow: hidden;
}

.app-shell section.bg-white::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-orange), var(--brand-cyan), transparent);
}

.app-shell .border-b,
.app-shell .border-t,
.app-shell .border {
    border-color: rgba(255, 255, 255, 0.14) !important;
}

.app-shell table {
    background: transparent !important;
}

.app-shell thead {
    background: rgba(255, 138, 0, 0.14) !important;
    color: #fff !important;
}

.app-shell tbody {
    color: #e6edf8 !important;
}

.app-shell tr:hover {
    background: rgba(84, 215, 255, 0.08) !important;
}

.app-shell article,
.app-shell #employeeList > div,
.app-shell #userList > div {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14) !important;
    border-radius: 8px;
}

.app-shell .bg-yellow-200 {
    background: rgba(255, 179, 71, 0.3) !important;
    border: 1px solid rgba(255, 179, 71, 0.42);
    color: #ffe3ad !important;
}

.app-shell .bg-blue-200 {
    background: rgba(84, 215, 255, 0.28) !important;
    border: 1px solid rgba(84, 215, 255, 0.42);
    color: #93e7ff !important;
}

.app-shell .bg-green-200 {
    background: rgba(74, 222, 128, 0.28) !important;
    border: 1px solid rgba(74, 222, 128, 0.42);
    color: #86efac !important;
}

.app-shell .bg-cyan-200 {
    background: rgba(84, 215, 255, 0.3) !important;
    border: 1px solid rgba(84, 215, 255, 0.46);
    color: #a9efff !important;
}

.app-shell .status-not-started {
    background: rgba(148, 163, 184, 0.24) !important;
    border: 1px solid rgba(203, 213, 225, 0.38);
    color: #e2e8f0 !important;
}

.schedule-status-badge {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.app-shell .bg-gray-100,
.app-shell .bg-gray-200,
.app-shell .bg-white {
    background: rgba(255, 255, 255, 0.08) !important;
}

.app-shell .text-blue-600,
.app-shell .text-blue-500 {
    color: var(--brand-cyan) !important;
}

.app-shell .text-red-500 {
    color: #ff8b8b !important;
}

.app-shell .bg-red-500 {
    background: rgba(248, 80, 80, 0.18) !important;
    border: 1px solid rgba(248, 80, 80, 0.3);
    color: #ffdede !important;
}

.app-shell .bg-red-500:hover {
    background: rgba(248, 80, 80, 0.3) !important;
}

.app-shell #scheduleModal {
    background: rgba(3, 8, 15, 0.9) !important;
    backdrop-filter: blur(3px);
}

.app-shell #scheduleModal > div {
    background: linear-gradient(180deg, #162235, #0a1220) !important;
    max-height: calc(100vh - 2rem);
    overflow-y: auto !important;
}

.app-shell #scheduleModal .bg-blue-600 {
    background: rgba(255, 138, 0, 0.32) !important;
}

.app-shell #modalContent,
.app-shell #scheduleModal .bg-gray-100 {
    background: rgba(13, 23, 37, 0.98) !important;
}

.status-final-message {
    color: #a9efff;
    font-weight: 800;
    text-align: center;
}

.registration-panel-inline {
    margin-bottom: 1rem;
    box-shadow: none !important;
    background: rgba(255, 255, 255, 0.055) !important;
}

.date-range-control {
    min-width: min(100%, 28rem);
}

.date-range-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 0.5rem;
}

.date-range-panel {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    padding: 0.9rem;
}

.schedule-day-group {
    border: 1px solid rgba(255, 179, 71, 0.34);
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(180deg, #162235 0%, #0d1725 100%);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(125, 211, 252, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.schedule-day-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(90deg, rgba(255, 138, 0, 0.3), rgba(255, 255, 255, 0.045));
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.schedule-day-heading h3 {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
}

.schedule-day-heading span {
    color: #dbe7ff;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.schedule-day-list {
    display: grid;
    gap: 0.8rem;
    padding: 0.9rem;
    background: #0d1725;
}

.schedule-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

.schedule-day-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    background: #0d1725 !important;
}

.schedule-day-table th,
.schedule-day-table td {
    min-width: 0;
    padding-right: 0.65rem !important;
    padding-left: 0.65rem !important;
    overflow-wrap: anywhere;
    word-break: normal;
}

.schedule-day-table th:nth-child(1),
.schedule-day-table td:nth-child(1) { width: 17%; }

.schedule-day-table th:nth-child(2),
.schedule-day-table td:nth-child(2) { width: 8%; }

.schedule-day-table th:nth-child(3),
.schedule-day-table td:nth-child(3) { width: 11.5%; }

.schedule-day-table th:nth-child(4),
.schedule-day-table td:nth-child(4) { width: 22.5%; }

.schedule-day-table th:nth-child(5),
.schedule-day-table td:nth-child(5) { width: 9%; }

.schedule-day-table th:nth-child(6),
.schedule-day-table td:nth-child(6) { width: 9.5%; }

.schedule-day-table th:nth-child(7),
.schedule-day-table td:nth-child(7) { width: 9.5%; }

.schedule-day-table th:nth-child(8),
.schedule-day-table td:nth-child(8) { width: 13%; }

.schedule-day-table .schedule-status-badge {
    justify-content: center;
    max-width: 100%;
    text-align: center;
    white-space: normal;
    line-height: 1.15;
}

.schedule-day-table thead th {
    background: rgba(255, 138, 0, 0.28);
    border-bottom: 1px solid rgba(255, 179, 71, 0.44);
    color: #ffffff;
    vertical-align: top;
}

.schedule-day-table tbody tr {
    background: #142033;
}

.schedule-day-table tbody tr:nth-child(even) {
    background: #101a2a;
}

.app-shell .schedule-day-table tbody,
.app-shell .schedule-day-table tbody td {
    color: #edf4ff !important;
    vertical-align: top;
}

.app-shell .schedule-day-table tbody td:first-child {
    color: #ffffff !important;
    font-weight: 600;
}

.schedule-day-table .schedule-date-cell {
    min-width: 0;
    white-space: normal;
    color: #ffffff !important;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.35;
}

.schedule-day-table .schedule-date-cell > span,
.schedule-day-table .schedule-date-cell .schedule-row-time,
.schedule-day-table .schedule-date-cell .schedule-row-subtitle {
    display: block;
    max-width: none;
    margin-top: 0.22rem;
    overflow: visible;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    text-overflow: clip;
}

.schedule-day-table .schedule-date-cell > span:first-child {
    margin-top: 0;
}

.schedule-row-time {
    display: block;
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 800;
    margin-top: 0.12rem;
}

.schedule-row-subtitle {
    display: block;
    color: #b9c7e2;
    font-size: 0.78rem;
    font-weight: 700;
    margin-top: 0.18rem;
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-equipment-lines {
    display: grid;
    gap: 0.2rem;
    margin-top: 0.25rem;
    list-style: disc;
    padding-left: 1rem;
}

.schedule-equipment-lines li {
    color: #edf4ff;
    padding-left: 0.1rem;
}

.schedule-equipment-lines li::marker {
    color: #a9efff;
    font-size: 0.8em;
}

.schedule-day-table tbody tr + tr td {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.schedule-row-actions {
    flex-wrap: wrap;
}

#scheduleTodayButton,
.app-nav button,
.app-shell button.bg-blue-500,
.app-shell button.bg-green-500,
.app-shell button.bg-red-500,
.schedule-row-actions button,
.schedule-actions button,
.schedule-day-table td[data-label="Ações"] button,
#employeeList button,
#userList button,
#scheduleModal button {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.date-range-fields input,
.date-range-fields select {
    min-height: 44px;
}

.schedule-card {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2) !important;
    border-radius: 8px;
}

.schedule-card-details {
    display: grid;
    gap: 0.35rem;
    margin-top: 0.75rem;
}

.schedule-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.9rem;
}

.schedule-empty-day {
    color: var(--brand-muted);
    font-size: 0.9rem;
    padding: 0.45rem 0.1rem;
}

@media (max-width: 820px) {
    .login-stage {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .login-brand-panel {
        min-height: 230px;
        padding: 1.2rem;
    }

    .login-card {
        padding: 1.25rem;
    }

    .export-toggle-button span {
        display: none;
    }

    .export-toggle-button {
        width: 2.55rem;
        height: 2.55rem;
        padding: 0;
    }

    .schedule-day-table,
    .schedule-day-table tbody {
        display: block;
        width: 100%;
    }

    .schedule-day-table thead {
        display: none;
    }

    .schedule-day-table tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0;
        padding: 0.35rem;
    }

    .schedule-day-table tbody tr + tr {
        border-top: 1px solid rgba(255, 255, 255, 0.24);
    }

    .schedule-day-table tbody tr + tr td {
        border-top: 0;
    }

    .schedule-day-table th,
    .schedule-day-table td,
    .schedule-day-table .schedule-date-cell {
        display: block;
        width: auto !important;
        min-width: 0;
        padding: 0.55rem 0.65rem !important;
        white-space: normal;
    }

    .schedule-day-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.22rem;
        color: #9edff3;
        font-size: 0.67rem;
        font-weight: 800;
        letter-spacing: 0.035em;
        line-height: 1.2;
        text-transform: uppercase;
    }

    .schedule-day-table td:nth-child(1),
    .schedule-day-table td:nth-child(4) {
        grid-column: 1 / -1;
    }

    .schedule-day-table .schedule-status-badge {
        justify-content: flex-start;
        text-align: left;
    }
}

@media (max-width: 520px) {
    .brand-logo {
        width: 86px;
        height: 34px;
    }

    .brand-kicker {
        display: none;
    }

    .date-range-fields {
        grid-template-columns: 1fr;
    }

    .export-panel {
        position: fixed;
        top: 4.7rem;
        right: 1rem;
        left: 1rem;
        width: auto;
        box-shadow: 0 0 0 100vmax rgba(1, 3, 26, 0.68), 0 18px 48px rgba(0, 0, 0, 0.5);
    }

    .export-filter-grid {
        grid-template-columns: 1fr;
    }

    .schedule-day-heading {
        align-items: flex-start;
    }

    .schedule-day-heading h3 {
        line-height: 1.35;
    }

    .schedule-day-table tbody tr {
        grid-template-columns: 1fr;
        padding: 0.4rem;
    }

    .schedule-day-table td {
        grid-column: 1 / -1;
    }
}

/* Hide scrollbar for cleaner mobile look */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #555;
}
