/* ADEMA RRHH — corporate dark style inherited from ms-adema-template. */
:root {
    --adema-bg: #0b131a;
    --adema-surface: #111e28;
    --adema-border: #1e2d3b;
    --adema-text: #e2e8f0;
    --adema-muted: #94a3b8;
    --adema-accent: #00c853;
    --adema-blue: #0284c7;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background-color: var(--adema-bg);
    color: var(--adema-text);
    font-size: 0.95rem;
}

body.has-bottom-nav { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
@media (min-width: 992px) { body.has-bottom-nav { padding-bottom: 24px; } }

.skip-link { position: absolute; left: 8px; top: 8px; z-index: 2000; background: #fff; color: #000; padding: 6px 10px; }
.text-accent { color: var(--adema-accent); }
.text-muted { color: var(--adema-muted) !important; }
.brand-logo { height: 26px; width: auto; }

.navbar-custom {
    background: linear-gradient(135deg, #16242e 0%, #0d1720 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid var(--adema-accent);
}
.navbar-custom .navbar-brand { font-weight: 700; color: #fff; }
.navbar-custom .nav-link { color: var(--adema-muted); font-size: 0.88rem; padding: 0.4rem 0.6rem; border-radius: 6px; }
.navbar-custom .nav-link.active, .navbar-custom .nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }

.main-content { max-width: 1400px; margin-left: auto; margin-right: auto; }

.card, .card-custom {
    background: var(--adema-surface);
    border: 1px solid var(--adema-border);
    border-radius: 12px;
    color: var(--adema-text);
}
.card-header { background: transparent; border-bottom: 1px solid var(--adema-border); font-weight: 600; }
.kpi .value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.kpi .label { color: var(--adema-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }

.btn { min-height: 40px; }
.btn-sm { min-height: 34px; }
.btn-custom-primary { background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%); border: none; color: #fff; font-weight: 600; }
.btn-custom-primary:hover { color: #fff; opacity: 0.92; }
.btn-custom-success { background: linear-gradient(135deg, #00c853 0%, #009624 100%); border: none; color: #fff; font-weight: 600; }
.btn-custom-success:hover { color: #fff; filter: brightness(1.08); }
.btn-custom-secondary { background-color: #1e2d3b; border: 1px solid #2d3f4f; color: var(--adema-text); }
.btn-custom-secondary:hover { background-color: #2a3c4e; color: #fff; }

.form-control, .form-select { background-color: #0f1a23; border-color: #2d3f4f; color: var(--adema-text); min-height: 40px; }
.form-control:focus, .form-select:focus { border-color: var(--adema-accent); box-shadow: 0 0 0 0.2rem rgba(0, 200, 83, 0.25); }
.form-label { font-weight: 500; font-size: 0.85rem; color: var(--adema-muted); }
.errorlist { color: #f87171; list-style: none; padding-left: 0; font-size: 0.85rem; margin: 0.25rem 0 0; }

.table { --bs-table-bg: transparent; --bs-table-color: var(--adema-text); }
.table > :not(caption) > * > * { border-bottom-color: var(--adema-border); }
.table thead th { color: var(--adema-muted); font-weight: 500; font-size: 0.8rem; text-transform: uppercase; white-space: nowrap; }
.table-sm td, .table-sm th { padding: 0.45rem 0.5rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Status badges (ADEMA palette) */
.badge-st { border: 1px solid; font-weight: 500; }
.st-green { background: #0c3e1e; color: #4ade80; border-color: #00c853; }
.st-blue { background: #0d385c; color: #38bdf8; border-color: #0284c7; }
.st-yellow { background: #42310c; color: #facc15; border-color: #ca8a04; }
.st-orange { background: #452109; color: #fb923c; border-color: #ea580c; }
.st-red { background: #4c1d1d; color: #f87171; border-color: #dc2626; }
.st-gray { background: #1e293b; color: #94a3b8; border-color: #475569; }

/* Planner */
.planner { table-layout: fixed; min-width: 900px; }
.planner th.emp { width: 190px; }
.planner td { vertical-align: top; height: 64px; }
.planner .cell-link { display: block; min-height: 52px; border-radius: 8px; padding: 4px 6px; color: inherit; text-decoration: none; border: 1px dashed #2d3f4f; }
.planner .cell-link:hover, .planner .cell-link:focus { border-color: var(--adema-accent); }
.planner .cell-link.filled { border-style: solid; background: #0f1a23; }
.seg { font-size: 0.78rem; line-height: 1.2; }
.today-col { background: rgba(0, 200, 83, 0.05); }
.day-tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
.day-tabs .nav-link { white-space: nowrap; color: var(--adema-muted); }
.day-tabs .nav-link.active { background: var(--adema-accent); color: #04130a; }

.agenda-item { border: 1px solid var(--adema-border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: var(--adema-surface); }

/* Attendance sheet */
.att-row { border: 1px solid var(--adema-border); border-radius: 10px; padding: 10px; margin-bottom: 10px; background: var(--adema-surface); }
.att-row.has-error { border-color: #dc2626; }
.status-group .btn { min-width: 44px; }
.minutes-input { max-width: 110px; }

.save-bar { position: sticky; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 20; background: var(--adema-bg); padding: 8px 0; }
@media (min-width: 992px) { .save-bar { bottom: 0; } }
@media (max-width: 575.98px) { .kpi .value { font-size: 1.25rem; } }

/* Bottom navigation (PWA) */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030;
    height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--adema-surface); border-top: 1px solid var(--adema-border);
    display: flex; justify-content: space-around; align-items: stretch;
}
.bottom-nav-link {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--adema-muted); text-decoration: none; font-size: 0.72rem; border: 0; background: none; min-height: 48px;
}
.bottom-nav-link i { font-size: 1.2rem; margin-bottom: 2px; }
.bottom-nav-link.active { color: var(--adema-accent); }
.more-menu { height: auto !important; max-height: 80vh; background: var(--adema-surface); }
.more-menu .nav-link { color: var(--adema-text); padding: 0.75rem 0.5rem; border-bottom: 1px solid var(--adema-border); }

.offline-banner { position: sticky; top: 0; z-index: 1100; background: #7c2d12; color: #fff; padding: 8px 12px; font-size: 0.85rem; text-align: center; }

.loader-overlay { position: fixed; inset: 0; background: rgba(11, 19, 26, 0.75); z-index: 9999; display: none; align-items: center; justify-content: center; }
.loader-overlay.show { display: flex; }

.draft-mark { border: 2px dashed #ca8a04; }
.amount-hidden { color: var(--adema-muted); font-style: italic; }
.small-print { font-size: 0.78rem; color: var(--adema-muted); }

@media (max-width: 575.98px) {
    h1, .h1 { font-size: 1.35rem; }
    .table-responsive-stack thead { display: none; }
    .table-responsive-stack tr { display: block; border: 1px solid var(--adema-border); border-radius: 10px; margin-bottom: 8px; padding: 6px; }
    .table-responsive-stack td { display: flex; justify-content: space-between; gap: 8px; border: 0 !important; padding: 4px 6px; }
    .table-responsive-stack td::before { content: attr(data-label); color: var(--adema-muted); font-size: 0.78rem; }
}
