/* ============================================
   CAMERA MONITOR — style.css
   Dark surveillance theme
   ============================================ */

*,*::before,*::after { margin:0; padding:0; box-sizing:border-box; }

:root {
    --bg: #0a0e17;
    --bg-elevated: #111827;
    --bg-card: #151c2c;
    --bg-card-hover: #1a2236;

    --sidebar-bg: #080c14;
    --sidebar-text: #7a8599;
    --sidebar-active: #e0e7ff;
    --sidebar-active-bg: rgba(99,130,255,.12);
    --sidebar-hover: rgba(255,255,255,.04);
    --sidebar-w: 250px;

    --border: #1e2a3d;
    --border-light: #16202f;

    --text: #e2e8f0;
    --text-muted: #64748b;
    --text-xs: #475569;
    --text-bright: #f8fafc;

    --primary: #6382ff;
    --primary-dim: rgba(99,130,255,.15);
    --accent-green: #22c55e;
    --accent-green-dim: rgba(34,197,94,.15);
    --accent-red: #ef4444;
    --accent-red-dim: rgba(239,68,68,.15);
    --accent-amber: #f59e0b;
    --accent-amber-dim: rgba(245,158,11,.15);

    --shadow-sm: 0 1px 4px rgba(0,0,0,.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,.4);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.5);

    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;

    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', monospace;

    --t-fast: .15s ease;
    --t-normal: .25s ease;
}

/* === BASE === */
html { font-size: 14px; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
.hidden { display: none !important; }

/* === LOGIN === */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 30% 20%, #111b30 0%, var(--bg) 70%);
    padding: 1.5rem;
}
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo-icon { font-size: 2.5rem; display: block; margin-bottom: .5rem; }
.login-logo h1 { font-size: 1.6rem; font-weight: 600; color: var(--text-bright); letter-spacing: -.02em; }
.login-logo p { color: var(--text-muted); font-size: .85rem; margin-top: .25rem; }
.login-error { color: var(--accent-red); font-size: .82rem; text-align: center; margin-top: .75rem; min-height: 1.2em; }

/* === FORM FIELDS === */
.field { margin-bottom: 1rem; }
.field label {
    display: block;
    font-size: .78rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: .35rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.field input[type="text"],
.field input[type="password"] {
    width: 100%;
    padding: .65rem .85rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: .92rem;
    transition: border var(--t-fast);
    outline: none;
}
.field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .55rem 1.1rem;
    font-family: var(--font);
    font-size: .85rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all var(--t-fast);
    outline: none;
    white-space: nowrap;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-full { width: 100%; padding: .75rem; }
.btn-sm { padding: .35rem .7rem; font-size: .8rem; }
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border);
}
.btn-ghost:hover { background: var(--sidebar-hover); color: var(--text); }
.btn-ghost-danger {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: .25rem .5rem;
}
.btn-ghost-danger:hover { color: var(--accent-red); background: var(--accent-red-dim); }

/* === APP SHELL === */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform var(--t-normal);
}
.sidebar.open { transform: translateX(0); }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1.1rem 1.2rem;
    border-bottom: 1px solid var(--border);
}
.brand-icon { font-size: 1.4rem; }
.brand-text { font-weight: 600; color: var(--text-bright); font-size: 1rem; flex: 1; }
.sidebar-close {
    display: none;
    background: none; border: none; color: var(--text-muted);
    font-size: 1.2rem; cursor: pointer; padding: .25rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: .6rem 0;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    padding: .6rem 1.2rem;
    background: none;
    border: none;
    color: var(--sidebar-text);
    font-family: var(--font);
    font-size: .88rem;
    cursor: pointer;
    transition: all var(--t-fast);
    text-align: left;
}
.nav-link:hover { background: var(--sidebar-hover); color: var(--sidebar-active); }
.nav-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active);
    font-weight: 500;
}
.nav-ico { font-size: 1.05rem; width: 1.4rem; text-align: center; flex-shrink: 0; }
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge {
    background: var(--accent-red);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    padding: .1rem .4rem;
    border-radius: 99px;
    min-width: 1.2rem;
    text-align: center;
}
.nav-divider {
    height: 1px;
    background: var(--border);
    margin: .5rem 1rem;
}
.nav-section-title {
    padding: .6rem 1.2rem .3rem;
    font-size: .68rem;
    font-weight: 600;
    color: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: .06em;
}
.nav-logout { color: var(--accent-red) !important; opacity: .7; }
.nav-logout:hover { opacity: 1; background: var(--accent-red-dim) !important; }

.sidebar-footer {
    padding: .75rem 1.2rem;
    border-top: 1px solid var(--border);
}
.text-xs { font-size: .72rem; }
.text-muted { color: var(--text-muted); }

/* === SIDEBAR BACKDROP (mobile) === */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-normal);
}
.sidebar-backdrop.open { opacity: 1; pointer-events: auto; }

/* === MAIN WRAP === */
.main-wrap {
    flex: 1;
    margin-left: 0;
    transition: margin-left var(--t-normal);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.main-wrap.sidebar-open { margin-left: var(--sidebar-w); }

/* === TOPBAR === */
.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .75rem 1.5rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-muted);
    border-radius: 1px;
    transition: var(--t-fast);
}
.hamburger:hover span { background: var(--text); }
.topbar-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-bright);
    flex: 1;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.topbar-clock {
    font-family: var(--mono);
    font-size: .8rem;
    color: var(--text-muted);
}
.topbar-user {
    font-size: .82rem;
    color: var(--text-muted);
}

/* === CONTENT === */
.content {
    flex: 1;
    padding: 1.25rem;
}

/* === CAMERA GRID === */
.cam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1rem;
}
.cam-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    transition: border-color var(--t-fast);
    position: relative;
}
.cam-card:hover { border-color: #2a3a54; }
.cam-card.has-person { border-color: var(--accent-red); box-shadow: 0 0 12px var(--accent-red-dim); }

.cam-header {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem .85rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}
.cam-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    flex-shrink: 0;
    animation: pulse-dot 2s infinite;
}
.cam-status-dot.offline { background: var(--text-xs); animation: none; }
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}

.cam-info { flex: 1; min-width: 0; }
.cam-name {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-bright);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cam-location {
    font-size: .7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cam-person-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .15rem .5rem;
    border-radius: 99px;
    font-size: .7rem;
    font-weight: 600;
    font-family: var(--mono);
}
.cam-person-badge.active {
    background: var(--accent-red-dim);
    color: var(--accent-red);
}
.cam-person-badge.idle {
    background: var(--accent-green-dim);
    color: var(--accent-green);
}
.cam-close-btn {
    background: none;
    border: none;
    color: var(--text-xs);
    font-size: 1rem;
    cursor: pointer;
    padding: .15rem;
    line-height: 1;
    transition: color var(--t-fast);
}
.cam-close-btn:hover { color: var(--accent-red); }

.cam-image-wrap {
    position: relative;
    background: #000;
    aspect-ratio: 16/9;
    overflow: hidden;
}
.cam-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.cam-image-wrap .cam-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-xs);
    font-size: .85rem;
}
.cam-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: .4rem .7rem;
    background: linear-gradient(transparent, rgba(0,0,0,.7));
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
.cam-overlay-time {
    font-family: var(--mono);
    font-size: .68rem;
    color: rgba(255,255,255,.7);
}
.cam-overlay-count {
    font-family: var(--mono);
    font-size: .68rem;
    color: var(--accent-red);
    font-weight: 600;
}

.cam-footer {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .85rem;
    border-top: 1px solid var(--border);
    font-size: .7rem;
    color: var(--text-xs);
    font-family: var(--mono);
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}
.empty-ico { font-size: 3rem; margin-bottom: 1rem; opacity: .5; }
.empty-state p { font-size: .92rem; }

/* === STATS ROW === */
.stats-row {
    display: flex;
    gap: .75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: .85rem 1.1rem;
    flex: 1;
    min-width: 120px;
}
.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-bright);
    font-family: var(--mono);
}
.stat-label {
    font-size: .72rem;
    color: var(--text-muted);
    margin-top: .15rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.stat-card.alert .stat-value { color: var(--accent-red); }

/* === SPINNER === */
.spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .6s linear infinite;
    margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === TOAST === */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: .6rem 1.2rem;
    border-radius: var(--r-md);
    font-size: .85rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.toast-error { border-color: var(--accent-red); }
.toast.toast-error #toastIcon { color: var(--accent-red); }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .sidebar-close { display: block; }
    .main-wrap.sidebar-open { margin-left: 0; }
    .cam-grid { grid-template-columns: 1fr; }
    .topbar { padding: .6rem 1rem; }
    .content { padding: .75rem; }
    .stats-row { gap: .5rem; }
    .stat-card { padding: .6rem .8rem; }
    .stat-value { font-size: 1.2rem; }
}

@media (min-width: 769px) {
    .sidebar { transform: translateX(0); }
    .sidebar.open { transform: translateX(0); }
    .main-wrap { margin-left: var(--sidebar-w); }
}

@media (min-width: 1400px) {
    .cam-grid { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
}

/* ============================================
   HISTÓRICO — Modal de imagens do dia
   ============================================ */

/* Overlay */
.hist-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .75);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .25s ease;
    padding: 1rem;
}
.hist-overlay.hist-visible { opacity: 1; }

/* Modal */
.hist-modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: scale(.96) translateY(10px);
    transition: transform .25s ease;
}
.hist-overlay.hist-visible .hist-modal {
    transform: scale(1) translateY(0);
}

/* Header */
.hist-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1.1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}
.hist-header-info { flex: 1; min-width: 0; }
.hist-title {
    font-size: .95rem;
    font-weight: 600;
    color: var(--text-bright);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hist-subtitle {
    font-size: .72rem;
    color: var(--text-muted);
}
.hist-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: .2rem .5rem;
    line-height: 1;
    transition: color var(--t-fast);
    flex-shrink: 0;
}
.hist-close-btn:hover { color: var(--accent-red); }

/* Date bar */
.hist-date-bar {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .55rem 1.1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
}
.hist-date-label {
    flex: 1;
    font-size: .82rem;
    color: var(--text);
    text-transform: capitalize;
}
.hist-today-btn {
    background: var(--primary-dim);
    color: var(--primary);
    border: none;
    border-radius: var(--r-sm);
    padding: .25rem .65rem;
    font-size: .72rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: all var(--t-fast);
}
.hist-today-btn:hover { background: var(--primary); color: #fff; }

/* Body / Gallery */
.hist-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    min-height: 200px;
}

.hist-loading {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.hist-loading p { margin-top: .75rem; font-size: .85rem; }

.hist-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.hist-empty-ico { font-size: 2.5rem; margin-bottom: .75rem; opacity: .5; }
.hist-empty p { font-size: .88rem; }

/* Grid de miniaturas */
.hist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .65rem;
}

.hist-thumb {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    overflow: hidden;
    cursor: pointer;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.hist-thumb:hover {
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--primary-dim);
}
.hist-thumb.has-person {
    border-color: var(--accent-red);
}
.hist-thumb.has-person:hover {
    box-shadow: 0 0 8px var(--accent-red-dim);
}

.hist-thumb-img-wrap {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
    overflow: hidden;
}
.hist-thumb-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity .3s ease;
}
.hist-thumb-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-xs);
}

.hist-thumb-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .3rem .5rem;
    gap: .35rem;
}
.hist-thumb-time {
    font-family: var(--mono);
    font-size: .65rem;
    color: var(--text-muted);
}
.hist-thumb-person {
    font-size: .65rem;
    font-weight: 600;
    color: var(--accent-red);
}

/* Barra de navegação inferior */
.hist-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .6rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}
.hist-nav-group {
    display: flex;
    gap: .35rem;
}
.hist-nav-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: var(--mono);
    font-size: .68rem;
    padding: .35rem .55rem;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all var(--t-fast);
    white-space: nowrap;
}
.hist-nav-btn:hover {
    background: var(--primary-dim);
    color: var(--primary);
    border-color: var(--primary);
}
.hist-nav-date {
    font-family: var(--mono);
    font-size: .75rem;
    color: var(--text);
    text-align: center;
    min-width: 80px;
}

/* ============================================
   POPUP — Imagem em tamanho real
   ============================================ */
.hist-popup {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .25s ease;
}
.hist-popup.hist-popup-visible { opacity: 1; }

.hist-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .88);
}

.hist-popup-content {
    position: relative;
    max-width: 95vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(.95);
    transition: transform .25s ease;
}
.hist-popup.hist-popup-visible .hist-popup-content {
    transform: scale(1);
}

.hist-popup-close {
    position: absolute;
    top: -2rem;
    right: -1rem;
    background: rgba(0,0,0,.6);
    border: 1px solid rgba(255,255,255,.15);
    color: #fff;
    font-size: 1.4rem;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: background var(--t-fast);
}
.hist-popup-close:hover { background: var(--accent-red); }

.hist-popup-content img {
    max-width: 95vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-lg);
}

.hist-popup-meta {
    margin-top: .5rem;
    font-family: var(--mono);
    font-size: .75rem;
    color: rgba(255, 255, 255, .7);
    text-align: center;
    padding: .3rem .75rem;
    background: rgba(0, 0, 0, .5);
    border-radius: var(--r-sm);
}

/* Navegação no popup */
.hist-popup-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 310;
    background: rgba(0, 0, 0, .45);
    border: 1px solid rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 2.8rem;
    line-height: 1;
    width: 3rem;
    height: 4.5rem;
    border-radius: var(--r-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, transform .15s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.hist-popup-nav:hover {
    background: rgba(255, 255, 255, .15);
}
.hist-popup-nav:active {
    transform: translateY(-50%) scale(.92);
}
.hist-popup-prev { left: .75rem; }
.hist-popup-next { right: .75rem; }

.hist-popup-counter {
    margin-top: .35rem;
    font-family: var(--mono);
    font-size: .7rem;
    color: rgba(255, 255, 255, .5);
    text-align: center;
}

.hist-popup-content img {
    transition: opacity .2s ease;
}

/* Responsivo histórico */
@media (max-width: 768px) {
    .hist-overlay { padding: 0; }
    .hist-modal {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        height: 100vh;
    }
    .hist-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: .5rem;
    }
    .hist-nav-btn { font-size: .6rem; padding: .3rem .4rem; }
    .hist-nav-date { font-size: .68rem; }
    .hist-popup-content img { max-width: 100vw; max-height: 85vh; }
    .hist-popup-close { top: .5rem; right: .5rem; }
	.hist-popup-nav {
        width: 2.4rem;
        height: 3.5rem;
        font-size: 2.2rem;
    }
    .hist-popup-prev { left: .3rem; }
    .hist-popup-next { right: .3rem; }
}

/* Histórico: carregar mais */
.hist-load-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 0 10px;
}
.hist-load-more-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .85rem;
    color: rgba(255,255,255,.7);
}
.hist-perpage-input {
    width: 64px;
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,.15);
    background: rgba(255,255,255,.07);
    color: #fff;
    font-size: .85rem;
    text-align: center;
}
.hist-perpage-input:focus {
    outline: none;
    border-color: rgba(99,179,237,.5);
}
.hist-load-more-btn {
    padding: 10px 28px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.08);
    color: #fff;
    font-size: .9rem;
    cursor: pointer;
    transition: background .2s;
}
.hist-load-more-btn:hover {
    background: rgba(255,255,255,.15);
}