/* ============================================================
   SEGUR-TECH — Sistema de Presupuestos CCTV
   Hoja de estilos compartida del panel
   ============================================================ */

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

:root {
    --ink: #0f172a;          /* azul muy oscuro (navbar, títulos) */
    --ink-soft: #1e293b;
    --accent: #2563eb;       /* azul acción */
    --accent-dark: #1d4ed8;
    --bg: #f1f5f9;           /* fondo general */
    --surface: #ffffff;
    --border: #e2e8f0;
    --muted: #64748b;
    --radius: 10px;
}

body {
    background-color: var(--bg);
    font-family: 'Inter', 'Segoe UI', sans-serif;
    color: var(--ink);
}

/* ---------- Barra superior ---------- */
.topbar {
    background: linear-gradient(180deg, #111c2e 0%, #0f172a 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.8rem 0;
    margin-bottom: 2rem;
}
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}
.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.brand-text {
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
    line-height: 1.1;
}
.brand-text small {
    display: block;
    font-weight: 500;
    font-size: 0.72rem;
    letter-spacing: 0.3px;
    color: #94a3b8;
    text-transform: none;
}
.topbar-meta {
    color: #94a3b8;
    font-size: 0.82rem;
}
.topbar-meta i { color: var(--accent); }

/* ---------- Títulos de página ---------- */
.page-title {
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0;
}
.page-subtitle {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0;
}

/* ---------- Tarjetas ---------- */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--muted);
    padding: 0.7rem 1rem;
}

/* ---------- Tarjetas de estadísticas ---------- */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    height: 100%;
}
.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.stat-icon.blue   { background: #dbeafe; color: #1d4ed8; }
.stat-icon.amber  { background: #fef3c7; color: #b45309; }
.stat-icon.green  { background: #dcfce7; color: #15803d; }
.stat-icon.dark   { background: #e2e8f0; color: #0f172a; }
.stat-value { font-weight: 800; font-size: 1.15rem; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 0.75rem; font-weight: 500; }

/* ---------- Tabla principal ---------- */
.table thead th {
    background: #f8fafc;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
    white-space: nowrap;
}
.table tbody td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.table-hover tbody tr:hover { background-color: #f8fafc; }

/* ---------- Badges de estado ---------- */
.badge-estado {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.35em 0.8em;
    border-radius: 20px;
}
.badge-pendiente { background: #fef3c7; color: #92400e; }
.badge-aprobado  { background: #dcfce7; color: #166534; }
.badge-otro      { background: #e2e8f0; color: #475569; }

/* ---------- Botones ---------- */
.btn { border-radius: 8px; font-weight: 600; }
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}
.btn-action {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    transition: all 0.15s ease;
}
.btn-action:hover { border-color: currentColor; }
.btn-action.editar:hover   { color: var(--accent); background: #eff6ff; }
.btn-action.imprimir:hover { color: #dc2626; background: #fef2f2; }
.btn-action.whatsapp:hover { color: #16a34a; background: #f0fdf4; }
.btn-action.aprobar:hover  { color: #16a34a; background: #f0fdf4; }
.btn-action.revertir:hover { color: #b45309; background: #fffbeb; }
.btn-action.duplicar:hover { color: #7c3aed; background: #f5f3ff; }
.btn-action.eliminar:hover { color: #dc2626; background: #fef2f2; }

/* ---------- Formularios ---------- */
.form-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 0.3rem;
}
.form-control, .form-select {
    border-color: var(--border);
    border-radius: 8px;
    font-size: 0.88rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.form-control::placeholder { color: #cbd5e1; }

/* Inputs dentro de la tabla de items */
#tablaItems .form-control {
    border-radius: 6px;
    font-size: 0.85rem;
}
#tablaItems td { padding: 0.45rem 0.5rem; }
#tablaItems .subtotal-cell {
    font-weight: 600;
    background: transparent;
    border: none;
}

/* ---------- Barra de total / acciones del formulario ---------- */
.total-bar {
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.total-bar .total-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    font-weight: 600;
}
.total-bar .total-monto {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
}

/* ---------- Buscador ---------- */
.search-box {
    position: relative;
    max-width: 320px;
}
.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.85rem;
}
.search-box input { padding-left: 34px; }

/* ---------- Alertas ---------- */
.alert { border: none; border-radius: var(--radius); }
.alert-success { background: #dcfce7; color: #166534; }

/* ---------- Footer ---------- */
.footer-panel {
    text-align: center;
    color: #94a3b8;
    font-size: 0.78rem;
    padding: 2.5rem 0 1.5rem;
}

/* ---------- Login ---------- */
.login-body {
    background: linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.login-wrap { width: 100%; max-width: 380px; }
.login-card {
    background: #fff;
    border-radius: 14px;
    padding: 2.25rem 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.login-card .brand-icon { display: flex; }

/* ---------- Estado vacío ---------- */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--muted);
}
.empty-state i { font-size: 2.5rem; opacity: 0.3; display: block; margin-bottom: 0.5rem; }
