/* =============================================================================
   style.css — Microgate Restrito
   Todos os estilos customizados do projeto centralizados aqui.
   ============================================================================= */

/* ── Tipografia global ─────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
    background-image: url('/img/background.webp');
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* iOS/Android: background-attachment:fixed causa salto ao rolar */
@media (max-width: 768px) {
    body {
        background-attachment: scroll;
    }
}

body.no-scroll {
    overflow: hidden;
}

:root {
    --app-fixed-nav-height: 4rem;
}

html.light {
    color-scheme: light;
}

html.dark {
    color-scheme: dark;
}

/* ── Layout base ───────────────────────────────────────────────────────────── */

.content-wrapper {
    background-color: #1f1f1fc9 !important;
    width: 100%;
}

.boxed-layout {
    max-width: 1700px;
    margin: 0 auto;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    min-height: 100vh;
}

/* Header injetado via JS deve ficar colado no topo */
#header-placeholder nav {
    top: 0 !important;
}

/* Botao global de alternancia de tema */
.theme-toggle-button {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 80;
    border-radius: 9999px;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(15, 23, 42, 0.88);
    color: #f8fafc;
    font-size: 1.2rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.theme-toggle-button:hover {
    transform: translateY(-1px);
    background: rgba(15, 23, 42, 0.96);
}

html.light .theme-toggle-button {
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
    border-color: rgba(148, 163, 184, 0.45);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
}

/* Espaçamento padrão abaixo do header fixo nas páginas internas */
.page-main {
    padding-top: 5.5rem;
    padding-bottom: 5rem;
}

@media (min-width: 768px) {
    .page-main {
        padding-top: 6.5rem;
    }
}

/* ── Cabeçalho padrão de página ────────────────────────────────────────────── */
/* Usado em todas as páginas: título à esquerda, botões à direita               */

.page-header {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 40px;
}

.page-header-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (min-width: 640px) {
    .page-header-actions {
        flex-direction: row;
        align-items: center;
    }
}

@media (min-width: 768px) {
    .page-header {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
    }
}

/* ── Botões padrão de navegação ────────────────────────────────────────────── */

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 16px;
    text-decoration: none;
    transition: background 0.15s;
    white-space: nowrap;
    cursor: pointer;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #dc2626;
    border: 2px solid #ef4444;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 16px;
    text-decoration: none;
    transition: background 0.15s;
    white-space: nowrap;
    cursor: pointer;
}

.btn-logout:hover {
    background: #b91c1c;
}

/* ── Formulários: inputs e selects no dark mode ────────────────────────────── */

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="number"],
select {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
}

select option {
    background-color: #1f1f1f !important;
    color: #ffffff !important;
}

/* ── Cards de navegação rápida (painel admin) ──────────────────────────────── */

.nav-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    min-height: 64px;
}

.nav-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.nav-card .icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .nav-card {
        padding: 16px 20px;
        min-height: unset;
    }
    .nav-card .icon {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }
}

/* ── Legenda do calendário (painel admin) ──────────────────────────────────── */

.legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
    flex-shrink: 0;
}

.legend-swatch--green  { background: #166534; }
.legend-swatch--blue   { background: #1e40af; }
.legend-swatch--orange { background: #9a3412; }

.legend-label--green  { color: #bbf7d0; }
.legend-label--blue   { color: #bfdbfe; }
.legend-label--orange { color: #fed7aa; }

/* ── Contador de técnicos nas células do calendário ────────────────────────── */

.cal-count {
    font-size: 12px;
}

@media (min-width: 768px) {
    .cal-count {
        font-size: 13px;
    }
}

/* ── Modo claro escopado: calendario e planilha ───────────────────────────── */

html.light .theme-zone-calendar .bg-brand-dark,
html.light .theme-zone-calendar .bg-brand-dark\/95,
html.light .theme-zone-report .bg-brand-dark,
html.light .theme-zone-report .bg-brand-dark\/95 {
    background-color: #ffffff !important;
}

html.light .theme-zone-calendar,
html.light .theme-zone-report,
html.light .theme-zone-calendar #calendar-wrap,
html.light .theme-zone-report #report-wrap,
html.light .theme-zone-report .report-table-scroll,
html.light .theme-zone-report .km-table,
html.light .theme-zone-report .km-table tbody,
html.light .theme-zone-report .km-table tr {
    background-color: #f3f4f6 !important;
}

html.light .theme-zone-calendar table,
html.light .theme-zone-calendar thead,
html.light .theme-zone-calendar tbody,
html.light .theme-zone-calendar tr,
html.light .theme-zone-calendar td {
    background-color: #f3f4f6 !important;
}

html.light .theme-zone-calendar th {
    background-color: #e6ebf2 !important;
}

html.light .theme-zone-calendar .border-white\/10,
html.light .theme-zone-calendar .border-white\/15,
html.light .theme-zone-calendar .border-white\/5,
html.light .theme-zone-calendar .border-white\/20,
html.light .theme-zone-report .border-white\/10,
html.light .theme-zone-report .border-white\/15,
html.light .theme-zone-report .border-white\/5,
html.light .theme-zone-report .border-white\/20 {
    border-color: rgba(148, 163, 184, 0.35) !important;
}

html.light .theme-zone-calendar .text-white,
html.light .theme-zone-report .text-white {
    color: #0f172a !important;
}

html.light .theme-zone-calendar .text-gray-200,
html.light .theme-zone-calendar .text-gray-300,
html.light .theme-zone-calendar .text-gray-400,
html.light .theme-zone-calendar .text-gray-50,
html.light .theme-zone-report .text-gray-400,
html.light .theme-zone-report .text-gray-500,
html.light .theme-zone-report .text-gray-600 {
    color: #475569 !important;
}

html.light .theme-zone-calendar .text-gray-500 {
    color: #64748b !important;
}

html.light .theme-zone-calendar .bg-white\/5,
html.light .theme-zone-report .bg-white\/5 {
    background-color: #eef2f7 !important;
}

html.light .theme-zone-calendar .bg-white\/10,
html.light .theme-zone-calendar .bg-white\/15,
html.light .theme-zone-calendar .hover\:bg-white\/10:hover,
html.light .theme-zone-calendar .hover\:bg-white\/15:hover,
html.light .theme-zone-report .bg-white\/10,
html.light .theme-zone-report .bg-white\/15,
html.light .theme-zone-report .hover\:bg-white\/10:hover,
html.light .theme-zone-report .hover\:bg-white\/15:hover {
    background-color: #e9eef5 !important;
}

html.light .theme-zone-calendar .bg-white\/2,
html.light .theme-zone-calendar .bg-white\/\[0\.015\],
html.light .theme-zone-calendar .bg-white\/\[0\.005\] {
    background-color: #f3f4f6 !important;
}

html.light .theme-zone-calendar .hover\:bg-white\/5:hover {
    background-color: #e5ebf3 !important;
}

html.light .theme-zone-calendar .bg-green-500\/10 {
    background-color: rgba(22, 163, 74, 0.16) !important;
}

html.light .theme-zone-calendar .bg-blue-500\/10 {
    background-color: rgba(37, 99, 235, 0.16) !important;
}

html.light .theme-zone-calendar .bg-orange-500\/10 {
    background-color: rgba(234, 88, 12, 0.16) !important;
}

html.light .theme-zone-calendar .bg-gray-500\/10 {
    background-color: rgba(100, 116, 139, 0.16) !important;
}

html.light .theme-zone-calendar .text-green-400,
html.light .theme-zone-calendar .text-blue-400,
html.light .theme-zone-calendar .text-orange-400 {
    font-weight: 700 !important;
}

html.light .theme-zone-calendar .text-green-400 {
    color: #15803d !important;
}

html.light .theme-zone-calendar .text-blue-400 {
    color: #1d4ed8 !important;
}

html.light .theme-zone-calendar .text-orange-400 {
    color: #c2410c !important;
}

html.light .theme-zone-calendar .ring-white\/30 {
    --tw-ring-color: rgba(59, 130, 246, 0.45) !important;
}

html.light .theme-zone-calendar .legend-label--green { color: #166534; }
html.light .theme-zone-calendar .legend-label--blue { color: #1d4ed8; }
html.light .theme-zone-calendar .legend-label--orange { color: #b45309; }

html.light .theme-zone-calendar .agenda-loading {
    color: #334155;
}

/* ── Modal de edição de usuário ────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
}

.modal-overlay.hidden {
    display: none;
}

.edit-modal-box {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 448px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.edit-modal-cancel-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.edit-modal-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* ── Modal de agenda do técnico (iframe) ───────────────────────────────────── */

#agendaModal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

#agendaModal.hidden {
    display: none;
}

.agenda-box {
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1100px;
    height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.agenda-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    min-height: 52px;
}

.agenda-modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.agenda-modal-title {
    color: #f9fafb;
    font-weight: 600;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-modal-close {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 7px 14px;
    color: #d1d5db;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: 12px;
    transition: background 0.15s;
}

.agenda-modal-close:hover {
    background: rgba(255, 255, 255, 0.12);
}

.agenda-iframe {
    flex: 1;
    width: 100%;
    border: none;
    background: #141414;
    display: block;
}

/* Mobile: modal de agenda ocupa tela inteira */
@media (max-width: 767px) {
    #agendaModal {
        padding: 0;
        align-items: flex-start;
    }

    .agenda-box {
        border-radius: 0;
        border: none;
        height: 100dvh;
        height: 100vh; /* fallback para browsers sem suporte a dvh */
        max-width: 100%;
    }
}

/* ── Edição inline de escala (visualizar_agenda.php) ───────────────────────── */

.day-edit-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    color: #9ca3af;
    cursor: pointer;
    padding: 2px 5px;
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.day-edit-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.edit-popover {
    position: absolute;
    z-index: 1000;
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 130px;
    top: 100%;
    left: 0;
}

.edit-popover button {
    width: 100%;
    padding: 7px 12px;
    border-radius: 6px;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: opacity 0.1s;
}

.edit-popover button:hover { opacity: 0.82; }

.popover-agenda  { background: #166534; color: #bbf7d0; }
.popover-folga   { background: #1e40af; color: #bfdbfe; }
.popover-folga-vendida { background: #a16207; color: #fef08a; }
.popover-ferias  { background: #9a3412; color: #fed7aa; }
.popover-ausente { background: #4b5563; color: #e5e7eb; }
.popover-remover { background: rgba(239, 68, 68, 0.12); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.25) !important; }

.popover-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 2px 0;
}

#schedule-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    z-index: 9999;
    white-space: nowrap;
}

#schedule-toast.show    { opacity: 1; }
#schedule-toast.success { background: #166534; color: #bbf7d0; border: 1px solid #4ade80; }
#schedule-toast.error   { background: #7f1d1d; color: #fecaca; border: 1px solid #ef4444; }

.edit-popover--align-right {
    right: 4px;
    left: auto;
}

.edit-popover.is-saving {
    opacity: 0.5;
    pointer-events: none;
}

/* ── Login ────────────────────────────────────────────────────────────────── */

.login-hero-bg {
    background-image: url('/img/background.webp');
}

/* ── Visualizar agenda (embed) ────────────────────────────────────────────── */

.agenda-embed-page {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background-color: #141414;
    color: #f9fafb;
    background-image: none !important;
}

.agenda-page-shell {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

.agenda-loading {
    padding: 16px;
    text-align: center;
    color: #6b7280;
}

/* ── Quilometragem ────────────────────────────────────────────────────────── */

.km-card {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    padding: 24px;
}

.km-card.done {
    border-color: rgba(74, 222, 128, 0.3);
    background: rgba(74, 222, 128, 0.04);
}

.km-card.locked {
    opacity: 0.55;
    pointer-events: none;
}

.km-input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
    padding: 12px 16px;
    width: 100%;
    text-align: center;
    letter-spacing: 2px;
}

.km-input:focus {
    outline: none;
    border-color: rgba(167, 139, 250, 0.6);
    background: rgba(255, 255, 255, 0.08);
}

.km-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
    font-size: 1rem;
    letter-spacing: 0;
}

.photo-area {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
}

.photo-area:hover {
    border-color: rgba(167, 139, 250, 0.5);
}

.photo-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}

.photo-area .photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.85rem;
}

.km-photo-static {
    cursor: default;
}

.km-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}

.km-preview-note {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 8px;
    border-radius: 4px;
    color: #ffffff;
    font-size: 0.7rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.pending {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.status-badge.done {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
}

.btn-primary {
    background: #7c3aed;
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-weight: 600;
    padding: 14px 24px;
    width: 100%;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s, opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover:not(:disabled) {
    background: #6d28d9;
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 9999;
    white-space: nowrap;
    pointer-events: none;
}

#toast.show {
    opacity: 1;
}

#toast.success {
    background: #166534;
    color: #bbf7d0;
    border: 1px solid #4ade80;
}

#toast.error {
    background: #7f1d1d;
    color: #fecaca;
    border: 1px solid #ef4444;
}

.step-line {
    height: 2px;
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.4s;
}

.step-line.done {
    background: #4ade80;
}

.step-circle-active {
    background: rgba(139, 92, 246, 0.2) !important;
    border-color: #7c3aed !important;
    color: #ffffff !important;
}

.step-circle-done {
    background: #166534 !important;
    border-color: #4ade80 !important;
    color: #bbf7d0 !important;
}

#location-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(6px);
}

#location-overlay.open {
    display: flex;
}

.location-overlay-box {
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #171717;
    padding: 28px 24px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.location-spinner {
    width: 44px;
    height: 44px;
    margin: 0 auto 16px;
    border-radius: 999px;
    border: 3px solid rgba(255, 255, 255, 0.16);
    border-top-color: #4ade80;
    animation: spin 0.9s linear infinite;
}

.location-overlay-note {
    color: #9ca3af;
    font-size: 0.85rem;
    line-height: 1.45;
    margin-top: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-down {
    animation: slideDown 0.2s ease;
}

.manual-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: 10px;
    z-index: 10000;
    font-size: 14px;
    font-weight: 600;
}

.manual-toast-success {
    background: #166534;
    color: #dcfce7;
    border: 1px solid #4ade80;
}

.manual-toast-error {
    background: #7f1d1d;
    color: #fecaca;
    border: 1px solid #ef4444;
}

/* ── Relatório de quilometragem (km_report.php) ─────────────────────────── */

.filter-input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #ffffff;
    padding: 10px 14px;
    font-size: 0.875rem;
    width: 100%;
    transition: border-color 0.2s;
}

.filter-input:focus {
    outline: none;
    border-color: rgba(167, 139, 250, 0.5);
}

.filter-input option {
    background: #1a1a2e;
    color: #ffffff;
}

html.light .theme-zone-report .filter-input {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.55);
    color: #0f172a;
}

html.light .theme-zone-report .filter-input:focus {
    border-color: rgba(59, 130, 246, 0.5);
}

html.light .theme-zone-report .filter-input option {
    background: #ffffff;
    color: #0f172a;
}

.summary-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
}

html.light .theme-zone-report .summary-card {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.35);
}

.report-table-scroll {
    overflow-x: visible;
    overflow-y: visible;
}

@media (max-width: 1279px) {
    .report-table-scroll {
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
    }
}

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

.km-table--sticky-head {
    border-collapse: separate;
    border-spacing: 0;
}

.km-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

html.light .theme-zone-report .km-table th {
    color: #334155;
    background: #f8fafc;
    border-bottom-color: rgba(148, 163, 184, 0.45);
}

.km-table td {
    padding: 12px 16px;
    font-size: 0.875rem;
    color: #d1d5db;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

html.light .theme-zone-report .km-table td {
    color: #0f172a;
    border-bottom-color: rgba(148, 163, 184, 0.32);
    background: #f3f4f6;
}

.km-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

html.light .theme-zone-report .km-table tr:hover td {
    background: #e9eef5;
}

.km-table tr:last-child td {
    border-bottom: none;
}

.km-table--daily {
    table-layout: fixed;
}

.km-table--daily th,
.km-table--daily td {
    padding: 9px 8px;
    font-size: 0.78rem;
    white-space: normal;
    word-break: break-word;
}

.km-table--daily th {
    font-size: 0.65rem;
    letter-spacing: 0.04em;
}

.km-table--sticky-head thead th {
    position: sticky;
    top: var(--app-fixed-nav-height);
    z-index: 15;
    background: #1f1f1f;
    color: #f8fafc;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

html.light .theme-zone-report .km-table--sticky-head thead th {
    background: #e2e8f0;
    color: #0f172a;
    box-shadow: 0 1px 0 rgba(148, 163, 184, 0.4);
}

.km-table--sticky-head tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 14;
    background: #1b1b1b;
    color: #f8fafc;
    box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.08);
}

html.light .theme-zone-report .km-table--sticky-head tfoot td {
    background: #f1f5f9;
    color: #0f172a;
    box-shadow: 0 -1px 0 rgba(148, 163, 184, 0.4);
}

.km-table--daily-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(96, 165, 250, 0.35);
    color: #bfdbfe;
    font-size: 0.68rem;
    line-height: 1;
    white-space: nowrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-done {
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
}

.badge-partial {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
}

.badge-missing {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

.btn-photo {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(167, 139, 250, 0.1);
    color: #a78bfa;
    border: 1px solid rgba(167, 139, 250, 0.2);
    cursor: pointer;
    transition: background 0.2s;
}

.btn-photo:hover {
    background: rgba(167, 139, 250, 0.2);
}

#photo-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#photo-modal.open {
    display: flex;
}

#photo-modal .modal-box {
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    max-width: 600px;
    width: 100%;
}

#photo-modal img {
    width: 100%;
    display: block;
    max-height: 70vh;
    object-fit: contain;
    background: #000000;
}

#photo-modal .modal-footer {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 4px;
    height: 14px;
}

@keyframes shimmer {
    to {
        background-position: -200% 0;
    }
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    background: #7c3aed;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #6d28d9;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #d1d5db;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.km-view-tabs {
    display: inline-flex;
    padding: 4px;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.km-view-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid transparent;
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.km-view-tab:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #f3f4f6;
}

.km-view-tab.active {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.km-view-panel.hidden {
    display: none;
}

.shortcut-btn {
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #d1d5db;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.shortcut-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.shortcut-btn.active {
    background: rgba(167, 139, 250, 0.15);
    border-color: rgba(167, 139, 250, 0.4);
    color: #c4b5fd;
}

#manual-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#manual-modal.open {
    display: flex;
}

#manual-modal .modal-box {
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    overflow: hidden;
}

.manual-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 768px) {
    .manual-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
