﻿/* =========================================================
   UTI2Fator - estilos
   ========================================================= */
:root {
  --sidebar-w: 240px;
  --sidebar-bg: #0f172a;
  --sidebar-fg: #cbd5e1;
  --sidebar-active: #1e293b;
  --topbar-h: 56px;
  --primary: #2563eb;
}
[data-bs-theme="dark"] {
  --sidebar-bg: #020617;
  --sidebar-active: #0f172a;
}

html, body { height: 100%; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }

.muted { color: var(--bs-secondary-color); font-size: .9rem; }

/* ===== Shell ===== */
.app-shell { display: flex; min-height: 100vh; }
.app-main  { flex: 1; display: flex; flex-direction: column; min-width: 0;
             margin-left: var(--sidebar-w); }
.app-content { padding: 1.25rem; flex: 1; }
.app-footer { display: flex; justify-content: space-between; padding: .75rem 1.25rem;
              font-size: .85rem; color: var(--bs-secondary-color);
              border-top: 1px solid var(--bs-border-color); }

/* ===== Sidebar ===== */
.app-sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg); color: var(--sidebar-fg);
  position: fixed; inset: 0 auto 0 0; overflow-y: auto;
  display: flex; flex-direction: column;
  z-index: 1030;
  transition: transform .2s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: .5rem;
  padding: 1rem 1.25rem; font-weight: 700; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand i { color: var(--primary); font-size: 1.4rem; }
.sidebar-nav ul { list-style: none; padding: .5rem; margin: 0; }
.sidebar-nav li { margin: 2px 0; }
.sidebar-nav a {
  display: flex; align-items: center; gap: .65rem;
  color: var(--sidebar-fg); text-decoration: none;
  padding: .55rem .75rem; border-radius: 6px;
  font-size: .92rem;
}
.sidebar-nav a:hover { background: var(--sidebar-active); color: #fff; }
.sidebar-nav .chev { margin-left: auto; font-size: .75rem; transition: transform .2s; }
.sidebar-nav .has-children a[aria-expanded="true"] .chev { transform: rotate(180deg); }
.sidebar-nav .collapse ul, .sidebar-nav ul ul { padding-left: 1rem; }
.sidebar-nav ul ul a { font-size: .85rem; padding: .4rem .65rem; }

/* ===== Topbar ===== */
.app-topbar {
  height: var(--topbar-h);
  background: var(--bs-body-bg); border-bottom: 1px solid var(--bs-border-color);
  display: flex; align-items: center; padding: 0 1rem; gap: .5rem;
  position: sticky; top: 0; z-index: 100;
}
.topbar-title { font-weight: 600; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .25rem; }
.btn-icon { background: transparent; border: 1px solid transparent;
            color: var(--bs-body-color); padding: .35rem .55rem; border-radius: 6px; }
.btn-icon:hover { background: var(--bs-tertiary-bg); }

/* ===== Page ===== */
.page-head { margin-bottom: 1rem; }
.page-head h1 { font-size: 1.4rem; margin: 0; font-weight: 700; }

/* ===== Cards / stats ===== */
.card { border: 1px solid var(--bs-border-color); border-radius: 8px;
        background: var(--bs-body-bg); }
.stat-card { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color);
             border-radius: 8px; padding: 1rem; display: flex; align-items: center; gap: .9rem; }
.stat-icon { width: 44px; height: 44px; border-radius: 8px;
             display: grid; place-items: center; font-size: 1.25rem; }
.stat-label { font-size: .8rem; color: var(--bs-secondary-color); text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1; }

/* ===== Flash ===== */
.flash-stack { margin-bottom: 1rem; }

/* ===== Auth ===== */
.auth-body {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  min-height: 100vh; display: grid; place-items: center; padding: 1rem;
}
.auth-wrap { width: 100%; max-width: 420px; }
.auth-card { background: #fff; border-radius: 12px; padding: 2rem;
             box-shadow: 0 20px 50px rgba(0,0,0,.25); color: #0f172a; }
.auth-brand { text-align: center; margin-bottom: 1.25rem; }
.auth-brand i { font-size: 2.2rem; color: var(--primary); }
.auth-brand h1 { font-size: 1.4rem; margin: .25rem 0 0; }
.auth-brand .muted { color: #64748b; }
.auth-title { font-size: 1.05rem; margin-bottom: 1rem; font-weight: 600; }
.auth-foot { text-align: center; color: rgba(255,255,255,.7); margin-top: 1rem; font-size: .85rem; }

/* ===== TOTP ===== */
.totp-card { background: var(--bs-body-bg); }
.totp-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 3rem; font-weight: 700; letter-spacing: .4rem;
  color: var(--primary); margin: 1rem 0 .5rem;
  user-select: all; cursor: pointer;
}
.totp-progress {
  width: 100%; height: 6px; background: var(--bs-tertiary-bg);
  border-radius: 4px; overflow: hidden; margin: .5rem 0;
}
.totp-progress .bar {
  height: 100%; background: var(--primary);
  width: 100%; transition: width 1s linear;
}

/* ===== Erros ===== */
.error-page { text-align: center; padding: 4rem 1rem; }
.error-page i { font-size: 4rem; color: var(--bs-secondary-color); }
.error-page h1 { font-size: 3rem; font-weight: 700; margin: 1rem 0 .25rem; }

/* ===== Mobile ===== */
@media (max-width: 991px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-shell.sidebar-open .app-sidebar { transform: translateX(0); }
  .app-main { margin-left: 0; }
}
