/* =====================================================================
   Turismo Federal — Admin · Fluent Design v2
   Tokens inspirados en Fluent 2 con el color de marca del manual.
   ===================================================================== */
:root {
    /* Marca */
    --oliva:    #6e8736;
    --bosque:   #395931;
    --turquesa: #2d8d8b;
    --celeste:  #8ac2c9;
    --naranja:  #cb6f21;
    --amarillo: #e9a22b;

    /* Color de acento (brand) Fluent */
    --brand:        #2d8d8b;
    --brand-hover:  #267a78;
    --brand-press:  #20696a;

    /* Neutrales Fluent 2 */
    --bg:           #f3f4f1;
    --layer:        #ffffff;
    --layer-alt:    #fafaf8;
    --stroke:       #e6e6e2;
    --stroke-soft:  #efefec;
    --text:         #1f2419;
    --text-2:       #5c6356;
    --text-3:       #8b9183;

    /* Radios Fluent (4 / 8) */
    --r-sm: 4px;
    --r-md: 8px;
    --r-lg: 12px;

    /* Sombras (Fluent depth) */
    --depth-2: 0 1px 2px rgba(0,0,0,.10), 0 0 1px rgba(0,0,0,.08);
    --depth-8: 0 4px 8px rgba(0,0,0,.10), 0 0 2px rgba(0,0,0,.08);
    --depth-16: 0 8px 16px rgba(0,0,0,.12), 0 0 2px rgba(0,0,0,.08);

    --font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;

    --sidebar-w: 260px;
}

* { box-sizing: border-box; }
body {
    margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
    font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

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

.sidebar {
    width: var(--sidebar-w); flex-shrink: 0; background: var(--bosque);
    color: #d8e1cf; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar__brand { padding: 22px 20px; border-bottom: 1px solid rgba(255,255,255,.10); }
.sidebar__brand img { height: 40px; }
.sidebar__nav { padding: 12px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.sidebar__nav a {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r-md);
    color: #cdd8c2; font-weight: 500; transition: background .15s, color .15s; position: relative;
}
.sidebar__nav a .iconify { font-size: 1.25rem; flex-shrink: 0; }
.sidebar__nav a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.sidebar__nav a.is-active { background: var(--brand); color: #fff; box-shadow: var(--depth-2); }
.sidebar__nav a.is-active::before {
    content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
    width: 3px; height: 18px; background: var(--amarillo); border-radius: 0 3px 3px 0;
}
.sidebar__nav a.is-sub { margin-left: 18px; font-size: .9rem; }
.sidebar__nav .badge {
    margin-left: auto; background: var(--naranja); color: #fff; font-size: .72rem; font-weight: 700;
    min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px;
}
.sidebar__foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.10); }
.sidebar__foot a { display: flex; gap: 10px; align-items: center; color: #cdd8c2; padding: 8px 10px; border-radius: var(--r-md); }
.sidebar__foot a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ── Topbar ─────────────────────────────────────────────────────────── */
.topbar {
    height: 60px; background: rgba(255,255,255,.85); backdrop-filter: blur(20px) saturate(150%);
    border-bottom: 1px solid var(--stroke); display: flex; align-items: center; gap: 14px;
    padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.topbar__title { font-size: 1.05rem; font-weight: 600; margin: 0; }
.topbar__user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar__name { font-weight: 600; font-size: .9rem; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff;
    display: grid; place-items: center; font-weight: 700;
}

/* ── Botones ────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: var(--r-md);
    border: 1px solid transparent; font-family: inherit; font-size: .9rem; font-weight: 600;
    cursor: pointer; transition: .15s; background: var(--layer); color: var(--text);
}
.btn .iconify { font-size: 1.15rem; }
.btn--primary { background: var(--brand); color: #fff; box-shadow: var(--depth-2); }
.btn--primary:hover { background: var(--brand-hover); text-decoration: none; color: #fff; }
.btn--primary:active { background: var(--brand-press); }
.btn--ghost { background: var(--layer); border-color: var(--stroke); color: var(--text); }
.btn--ghost:hover { background: var(--layer-alt); text-decoration: none; }
.btn--danger { color: #b3261e; border-color: #f1c9c6; }
.btn--danger:hover { background: #fdecea; }
.btn--block { width: 100%; justify-content: center; }

.icon-btn {
    width: 34px; height: 34px; border-radius: var(--r-md); border: 1px solid transparent;
    background: transparent; color: var(--text-2); display: inline-grid; place-items: center;
    cursor: pointer; transition: .15s;
}
.icon-btn .iconify { font-size: 1.25rem; }
.icon-btn:hover { background: var(--layer-alt); border-color: var(--stroke); color: var(--text); text-decoration: none; }
.icon-btn--danger:hover { background: #fdecea; color: #b3261e; border-color: #f1c9c6; }

/* ── Main / cards ───────────────────────────────────────────────────── */
.main { padding: 24px; max-width: 1200px; width: 100%; margin: 0 auto; }
.card {
    background: var(--layer); border: 1px solid var(--stroke); border-radius: var(--r-lg);
    box-shadow: var(--depth-2); padding: 22px; margin-bottom: 20px;
}
.card__h { margin: 0 0 16px; font-size: 1.05rem; font-weight: 600; }
.muted { color: var(--text-2); }
.volver { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; margin-bottom: 16px; }

.page-actions { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }

/* ── Dashboard ──────────────────────────────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card {
    background: var(--layer); border: 1px solid var(--stroke); border-radius: var(--r-lg); padding: 18px;
    display: flex; flex-direction: column; gap: 6px; box-shadow: var(--depth-2); transition: .18s; color: var(--text);
}
.stat-card:hover { box-shadow: var(--depth-8); transform: translateY(-2px); text-decoration: none; }
.stat-card__icon { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; color: #fff; }
.stat-card__icon .iconify { font-size: 1.5rem; }
.stat-card__num { font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-card__label { color: var(--text-2); font-weight: 500; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ── Tablas ─────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--stroke-soft); }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); font-weight: 600; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--layer-alt); }
.table .t-right { text-align: right; }
.t-actions { white-space: nowrap; }
.row-nuevo { background: #f0f8f2; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--naranja); margin-right: 6px; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; }
.pill--ok { background: #e3f1e1; color: #2f5d2a; }
.pill--mut { background: #ececec; color: #6a6a6a; }

.empty { text-align: center; padding: 50px 20px; color: var(--text-2); }
.empty .iconify { font-size: 3rem; color: var(--stroke); }
.empty p { margin: 10px 0 18px; }

/* ── Formularios ────────────────────────────────────────────────────── */
.form-admin { display: grid; gap: 18px; max-width: 760px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .9rem; }
.field .req { color: var(--naranja); }
.field input[type=text], .field input[type=email], .field input[type=tel],
.field input[type=date], .field input[type=number], .field input[type=password],
.field textarea, .field select {
    width: 100%; padding: 10px 12px; border: 1px solid var(--stroke); border-radius: var(--r-md);
    font-family: inherit; font-size: .92rem; background: var(--layer); color: var(--text); transition: .15s;
}
/* Línea inferior de acento al enfocar (estilo Fluent) */
.field input:focus, .field textarea:focus, .field select:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 2px 0 -1px var(--brand);
}
.field textarea { resize: vertical; }
.field .hint { color: var(--text-3); font-size: .8rem; }
.form-admin__foot { display: flex; gap: 10px; align-items: center; padding-top: 6px; border-top: 1px solid var(--stroke-soft); }

.img-preview { display: inline-flex; flex-direction: column; gap: 6px; }
.img-preview img { width: 180px; height: 120px; object-fit: cover; border-radius: var(--r-md); border: 1px solid var(--stroke); }
.check-borrar { font-size: .82rem; font-weight: 500; display: flex; gap: 6px; align-items: center; }

/* Switch Fluent */
.switch { display: inline-flex; cursor: pointer; }
.switch input { display: none; }
.switch__track {
    width: 44px; height: 24px; background: #c8c8c4; border-radius: 999px; position: relative; transition: .18s;
}
.switch__track::after {
    content: ""; position: absolute; top: 4px; left: 4px; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; transition: .18s;
}
.switch input:checked + .switch__track { background: var(--brand); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }

/* Vista detalle */
.ver-row { display: grid; grid-template-columns: 160px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--stroke-soft); }
.ver-label { font-weight: 600; color: var(--text-2); }

/* ── Gráfico de barras ──────────────────────────────────────────────── */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding-top: 10px; }
.bars__col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 6px; }
.bars__val { font-size: .75rem; font-weight: 700; color: var(--text-2); }
.bars__bar {
    width: 100%; max-width: 38px; background: linear-gradient(var(--turquesa), var(--oliva));
    border-radius: 6px 6px 0 0; transition: height .3s; min-height: 4px;
}
.bars__col:hover .bars__bar { filter: brightness(1.08); }
.bars__lbl { font-size: .72rem; color: var(--text-3); }

/* ── Toasts ─────────────────────────────────────────────────────────── */
.toast {
    display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-md);
    margin-bottom: 18px; font-weight: 600; box-shadow: var(--depth-2);
}
.toast .iconify { font-size: 1.3rem; }
.toast--ok { background: #e3f1e1; color: #2f5d2a; border: 1px solid #bfe0ba; }
.toast--error { background: #fdecea; color: #b3261e; border: 1px solid #f3c5c1; }

/* ── Login ──────────────────────────────────────────────────────────── */
.login-body {
    min-height: 100vh; display: grid; place-items: center; padding: 20px;
    background: linear-gradient(135deg, var(--bosque), var(--turquesa) 70%, var(--oliva));
}
.login-card {
    background: var(--layer); border-radius: var(--r-lg); box-shadow: var(--depth-16);
    padding: 40px 36px; width: 100%; max-width: 400px; text-align: center;
}
.login-logo { height: 56px; margin: 0 auto 18px; }
.login-card h1 { font-size: 1.3rem; margin: 0 0 4px; }
.login-sub { color: var(--text-2); margin: 0 0 22px; }
.login-form { display: grid; gap: 16px; text-align: left; }
.login-form label { font-weight: 600; font-size: .88rem; display: grid; gap: 6px; }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon .iconify { position: absolute; left: 12px; color: var(--text-3); font-size: 1.2rem; }
.input-icon input {
    width: 100%; padding: 11px 12px 11px 40px; border: 1px solid var(--stroke); border-radius: var(--r-md);
    font-family: inherit; font-size: .95rem;
}
.input-icon input:focus { outline: none; border-color: var(--brand); box-shadow: 0 2px 0 -1px var(--brand); }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .cols-2 { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform .22s;
        box-shadow: var(--depth-16);
    }
    .sidebar.is-open { transform: translateX(0); }
}
@media (min-width: 901px) { #menuToggle { display: none; } }
