/* ==========================================================================
   INVENTARIO TI FERROSVEL — BRAND-FAITHFUL DESIGN SYSTEM
   Palette & typography extracted from https://ferrosvel.com/
   ========================================================================== */

/* --- CSS Variables & Theme Tokens --- */
:root {
    /* Ferrosvel uses DM Sans across the board */
    --font-primary: 'DM Sans', system-ui, -apple-system, sans-serif;
    --font-heading: 'DM Sans', sans-serif;

    /* ===== Dark Theme (Default — matches ferrosvel.com dark sections) ===== */
    --bg-main: #111414;
    --bg-surface: #1a1f1f;
    --bg-card: #222626;
    --bg-card-hover: #2c3131;
    --border-color: #3a4040;
    --text-primary: #F2F5F5;
    --text-secondary: #ADADAD;
    --text-muted: #7a7f7f;

    /* Ferrosvel Brand Colors */
    --brand-primary: #C9212B;          /* Teal — main links & CTAs */
    --brand-primary-hover: #A71922;    /* Darker teal on hover */
    --brand-glow: rgba(201, 33, 43, 0.25);

    --brand-secondary: #134B7B;        /* Blue accent */
    --brand-secondary-hover: #0C395F;

    --brand-warm: #FFBC7D;             /* Ferrosvel golden/amber page-transition accent */
    --brand-warm-dark: #7B4713;        /* Dark gold for text or borders */

    /* State Colors — kept functional but with warm-teal harmony */
    --color-disponible: #23A455;
    --color-disponible-bg: rgba(35, 164, 85, 0.15);
    --color-asignado: #4054B2;
    --color-asignado-bg: rgba(64, 84, 178, 0.15);
    --color-mantenimiento: #FFBC7D;
    --color-mantenimiento-bg: rgba(255, 188, 125, 0.15);
    --color-baja: #D94040;
    --color-baja-bg: rgba(217, 64, 64, 0.15);

    /* UI Measurements */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.25);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.35);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.5);
    --transition: all 0.3s ease;
}

/* ===== Light Theme (matches ferrosvel.com light sections) ===== */
body.light-theme {
    --bg-main: #F2F5F5;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #EEF1F1;
    --border-color: #D5D8D8;
    --text-primary: #222626;
    --text-secondary: #555a5a;
    --text-muted: #697171;

    --brand-primary: #C9212B;
    --brand-primary-hover: #A71922;
    --brand-glow: rgba(201, 33, 43, 0.12);

    --color-disponible-bg: rgba(35, 164, 85, 0.1);
    --color-asignado-bg: rgba(64, 84, 178, 0.1);
    --color-mantenimiento-bg: rgba(255, 188, 125, 0.12);
    --color-baja-bg: rgba(217, 64, 64, 0.08);

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
}

/* --- Base & Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

p { color: var(--text-secondary); }

.subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* --- Layout Structure --- */
.app-container {
    max-width: 1320px;       /* Ferrosvel uses 1320px max-width */
    margin: 0 auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ==========================================================================
   HEADER — Ferrosvel-style dark header bar
   ========================================================================== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-surface);
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.brand-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: var(--brand-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
}

.brand-text h1 {
    font-size: 1.3rem;
    line-height: 1.1;
    font-weight: 700;
}

.brand-text h1 span {
    color: var(--brand-primary);
}

.brand-text p {
    font-size: 0.78rem;
    margin-top: 1px;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.datetime-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.datetime-badge i {
    width: 15px;
    height: 15px;
    color: var(--brand-primary);
}

/* ==========================================================================
   NAVIGATION — clean pill tabs with Ferrosvel teal active state
   ========================================================================== */
.app-nav {
    display: flex;
    gap: 0.375rem;
    background: var(--bg-surface);
    padding: 0.375rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.125rem;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-tab i {
    width: 17px;
    height: 17px;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.nav-tab.active {
    background: var(--brand-primary);
    color: #ffffff;
    font-weight: 600;
}

.nav-tab .badge {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 0.72rem;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.nav-tab:not(.active) .badge {
    background: var(--bg-card);
    color: var(--text-muted);
}

/* ==========================================================================
   VIEWS & SECTIONS
   ========================================================================== */
.app-main {
    min-height: 500px;
}

.view-section {
    display: none;
    flex-direction: column;
    gap: 1.25rem;
    animation: fadeIn 0.3s ease-in-out;
}

.view-section.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ==========================================================================
   BUTTONS — Ferrosvel teal primary, clean sans-serif
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.6rem 1.15rem;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}

.btn i {
    width: 17px;
    height: 17px;
}

.btn-primary {
    background: var(--brand-primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--brand-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px var(--brand-glow);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--brand-primary);
}

.btn-success {
    background: var(--color-disponible);
    color: #ffffff;
}
.btn-success:hover { background: #1d8f49; }

.btn-warning {
    background: var(--brand-warm-dark);
    color: #ffffff;
}
.btn-warning:hover { background: #693B0E; }

.btn-danger {
    background: var(--color-baja);
    color: #ffffff;
}
.btn-danger:hover { background: #b93333; }

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
}

.btn-icon {
    padding: 0.5rem;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-icon:hover {
    background: var(--bg-card-hover);
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

/* ==========================================================================
   KPI DASHBOARD CARDS
   ========================================================================== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
}

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.125rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 4px 0 0 4px;
}

.kpi-total::before { background: var(--brand-primary); }
.kpi-disponible::before { background: var(--color-disponible); }
.kpi-asignado::before { background: var(--color-asignado); }
.kpi-mantenimiento::before { background: var(--brand-warm); }
.kpi-baja::before { background: var(--color-baja); }

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon i {
    width: 22px;
    height: 22px;
}

.kpi-total .kpi-icon { background: var(--brand-glow); color: var(--brand-primary); }
.kpi-disponible .kpi-icon { background: var(--color-disponible-bg); color: var(--color-disponible); }
.kpi-asignado .kpi-icon { background: var(--color-asignado-bg); color: var(--color-asignado); }
.kpi-mantenimiento .kpi-icon { background: var(--color-mantenimiento-bg); color: var(--brand-warm-dark); }
.kpi-baja .kpi-icon { background: var(--color-baja-bg); color: var(--color-baja); }

.kpi-content {
    display: flex;
    flex-direction: column;
}

.kpi-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.kpi-value {
    font-size: 1.65rem;
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.15;
    margin: 1px 0;
}

.kpi-subtext {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ==========================================================================
   DASHBOARD ROWS & WIDGETS
   ========================================================================== */
.dashboard-rows {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 992px) {
    .dashboard-rows { grid-template-columns: 1fr; }
}

/* ==========================================================================
   CARDS & CONTAINERS
   ========================================================================== */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.card-header h3 {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.card-header h3 i {
    color: var(--brand-primary);
    width: 18px;
    height: 18px;
}

.card-body {
    padding: 1.25rem;
}

.flex-between {
    justify-content: space-between;
}

/* ==========================================================================
   DATA TABLES
   ========================================================================== */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 260px;
}

.search-box i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 17px;
    height: 17px;
}

.search-box input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

.filter-group {
    display: flex;
    gap: 0.625rem;
}

select, input[type="text"], input[type="email"], textarea {
    padding: 0.6rem 0.875rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    outline: none;
    transition: var(--transition);
}

select:focus, input:focus, textarea:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}

.data-table th {
    background: var(--bg-card);
    padding: 0.75rem 1.125rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 0.875rem 1.125rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.data-table .text-right {
    text-align: right;
}

/* ==========================================================================
   STATUS BADGES — Ferrosvel-palette harmonized
   ========================================================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-disponible {
    background: var(--color-disponible-bg);
    color: var(--color-disponible);
}
.status-disponible::before { background: var(--color-disponible); }

.status-asignado {
    background: var(--color-asignado-bg);
    color: var(--color-asignado);
}
.status-asignado::before { background: var(--color-asignado); }

.status-mantenimiento {
    background: var(--color-mantenimiento-bg);
    color: var(--brand-warm-dark);
}
.status-mantenimiento::before { background: var(--brand-warm); }

.status-baja {
    background: var(--color-baja-bg);
    color: var(--color-baja);
}
.status-baja::before { background: var(--color-baja); }

.type-pill {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

/* ==========================================================================
   GESTIÓN — ACTION CARDS GRID
   ========================================================================== */
.action-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
}

.action-tab-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.125rem;
    cursor: pointer;
    transition: var(--transition);
}

.action-tab-card:hover {
    border-color: var(--brand-primary);
    transform: translateY(-2px);
}

.action-tab-card.active {
    border-color: var(--brand-primary);
    background: var(--bg-card-hover);
    box-shadow: inset 0 0 0 1px var(--brand-primary);
}

.action-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.875rem;
}

.action-icon i { width: 20px; height: 20px; }
.icon-asignar { background: var(--brand-glow); color: var(--brand-primary); }
.icon-devolver { background: var(--color-disponible-bg); color: var(--color-disponible); }
.icon-mantenimiento { background: var(--color-mantenimiento-bg); color: var(--brand-warm-dark); }
.icon-baja { background: var(--color-baja-bg); color: var(--color-baja); }

.action-tab-card h3 {
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.action-tab-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
.gestion-form-card {
    display: none;
    animation: fadeIn 0.3s ease;
}

.gestion-form-card.active {
    display: block;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.125rem;
}

@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
    .form-group.span-2, .form-group.span-4 { grid-column: span 1 !important; }
}

.span-2 { grid-column: span 2; }
.span-4 { grid-column: span 4; }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

.required {
    color: var(--color-baja);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.text-danger { color: var(--color-baja); }

.form-actions {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
}

.form-actions.align-right {
    justify-content: flex-end;
}

/* --- Header Form Card Accents --- */
.header-asignar { border-top: 3px solid var(--brand-primary); }
.header-devolver { border-top: 3px solid var(--color-disponible); }
.header-mantenimiento { border-top: 3px solid var(--brand-warm); }
.header-baja { border-top: 3px solid var(--color-baja); }

/* ==========================================================================
   DISTRIBUTION & ACTIVITY WIDGETS
   ========================================================================== */
.type-distribution {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.type-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.type-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 500;
}

.progress-bar-bg {
    width: 100%;
    height: 7px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-primary), #E44951);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.recent-item:hover {
    border-color: var(--brand-primary);
}

.recent-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.recent-icon i { width: 16px; height: 16px; }

.recent-details {
    flex: 1;
}

.recent-title {
    font-size: 0.85rem;
    font-weight: 600;
}

.recent-time {
    font-size: 0.73rem;
    color: var(--text-muted);
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(17, 20, 20, 0.82);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.25rem;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-lg {
    max-width: 880px;
}

.modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.625rem;
    background: var(--bg-card);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    z-index: 9999;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.125rem;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    border-left: 4px solid var(--brand-primary);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    max-width: 420px;
    animation: slideToast 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideToast {
    from { opacity: 0; transform: translateX(80px); }
    to { opacity: 1; transform: translateX(0); }
}

.toast-success { border-left-color: var(--color-disponible); }
.toast-success i { color: var(--color-disponible); }

.toast-error { border-left-color: var(--color-baja); }
.toast-error i { color: var(--color-baja); }

.toast-warning { border-left-color: var(--brand-warm); }
.toast-warning i { color: var(--brand-warm-dark); }

.toast-content {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ==========================================================================
   ACTA DOCUMENT — OFFICIAL FERROSVEL HEADER (Printable)
   Uses Ferrosvel's teal & warm brand for official document branding
   ========================================================================== */
.acta-document {
    background: #ffffff;
    color: #222626;
    padding: 2.5rem;
    border-radius: 6px;
    font-family: 'DM Sans', Arial, Helvetica, sans-serif;
    font-size: 13px;
    line-height: 1.55;
}

.acta-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #C9212B;
    padding-bottom: 0.875rem;
    margin-bottom: 1.5rem;
}

.acta-brand-title {
    font-size: 20px;
    font-weight: bold;
    color: #222626;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.acta-brand-sub {
    font-size: 12px;
    color: #555a5a;
}

.acta-folio-box {
    text-align: right;
}

.acta-folio-tag {
    font-size: 14px;
    font-weight: bold;
    color: #C9212B;
}

.acta-date {
    font-size: 12px;
    color: #7a7f7f;
}

.acta-title-banner {
    background: #EEF7F8;
    text-align: center;
    padding: 0.55rem;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1.5rem;
    border: 1px solid #C2E2E5;
    color: #A71922;
}

.acta-table-info {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.acta-table-info th, .acta-table-info td {
    border: 1px solid #D5D8D8;
    padding: 7px 11px;
    font-size: 12px;
}

.acta-table-info th {
    background: #F2F5F5;
    color: #222626;
    width: 30%;
    text-align: left;
    font-weight: 600;
}

.acta-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #222626;
    margin-top: 1rem;
    margin-bottom: 0.45rem;
    border-bottom: 1px solid #D5D8D8;
    padding-bottom: 4px;
}

.acta-terms {
    background: #F2F5F5;
    border: 1px solid #D5D8D8;
    padding: 10px 14px;
    font-size: 11px;
    color: #555a5a;
    margin-top: 1.5rem;
    border-radius: 4px;
}

.acta-signatures {
    margin-top: 3rem;
    display: flex;
    justify-content: space-between;
    gap: 3rem;
}

.signature-box {
    flex: 1;
    text-align: center;
    border-top: 1px solid #222626;
    padding-top: 8px;
}

.signature-title {
    font-weight: bold;
    font-size: 12px;
    color: #222626;
}

.signature-sub {
    font-size: 11px;
    color: #7a7f7f;
}

/* ==========================================================================
   PRINT MEDIA
   ========================================================================== */
@media print {
    body * {
        visibility: hidden;
    }
    
    .print-area, .print-area * {
        visibility: visible;
    }

    .modal-overlay {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: auto;
        background: none;
        backdrop-filter: none;
        display: block !important;
    }

    .modal-card {
        max-width: 100% !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    .no-print {
        display: none !important;
    }

    .acta-document {
        padding: 0 !important;
        box-shadow: none !important;
    }
}

/* Corporate identity: official logo and clear, spacious surfaces. */
.app-container { gap: 1.5rem; padding-top: 0; }
.app-header { min-height: 112px; border: 0; border-bottom: 1px solid var(--border-color); border-radius: 0; background: transparent; box-shadow: none; padding: 1.5rem 0; }
.brand { gap: 1.5rem; }
.brand-logo { width: 210px; height: auto; }
.brand-text { border-left: 1px solid var(--border-color); padding-left: 1.5rem; }
.brand-text h1 { font-size: 1rem; }
.brand-text p { font-size: .75rem; }
.app-nav { padding: 0; gap: 1.5rem; background: transparent; border: 0; border-bottom: 1px solid var(--border-color); border-radius: 0; }
.nav-tab { padding: .9rem .4rem; border-radius: 0; border-bottom: 3px solid transparent; }
.nav-tab.active { background: transparent; color: var(--brand-primary); border-bottom-color: var(--brand-primary); box-shadow: none; }
.nav-tab.active .badge { background: var(--brand-glow); color: var(--brand-primary); }
.dashboard-intro { min-height: 175px; padding: 2rem; background: linear-gradient(110deg, #A71922, #C9212B 65%, #DF3B43); border-radius: 8px; gap: 1.5rem; }
.dashboard-intro h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.04em; }
.dashboard-intro .subtitle { color: #fff; opacity: .9; }
.dashboard-intro .eyebrow { color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .16em; margin-bottom: .5rem; }
.dashboard-intro .btn-primary { background: #fff; color: #A71922; border-color: #fff; flex-shrink: 0; }
.dashboard-intro .btn-primary:hover { background: #F9ECEC; }
.kpi-card, .card { border-radius: 8px; box-shadow: 0 2px 8px rgba(20,25,25,.035); }
.kpi-value { font-size: 2rem; }
.kpi-label { letter-spacing: .04em; font-size: .7rem; }
.btn { border-radius: 5px; }
body.light-theme { --color-disponible: #18763D; --color-asignado: #3453A0; --color-baja: #B5212A; }
body.dark-theme { --brand-primary: #FF7D83; --brand-primary-hover: #FFA0A4; --brand-warm-dark: #FFD2A6; --color-asignado: #A5B4FC; --color-disponible: #65D68D; --color-baja: #FF8585; }
/* Overlay only the wordmark; the original red symbol and light logo stay intact. */
.brand-logo-wrap { position: relative; display: inline-flex; flex-shrink: 0; }
.brand-logo-dark-wordmark { display: none; }
body.dark-theme .brand-logo { background: transparent; }
body.dark-theme .brand-logo-dark-wordmark {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
    clip-path: inset(0 0 0 24%);
    pointer-events: none;
}
body.dark-theme .btn-primary { background: #C9212B; color: white; }
body.dark-theme .dashboard-intro .btn-primary { background: white; color: #A71922; }
:focus-visible { outline: 3px solid var(--brand-primary); outline-offset: 3px; }
@media (max-width: 760px) {
    .app-header { flex-wrap: wrap; gap: 1rem; padding: 1.25rem 0; }
    .brand-logo { width: 160px; }
    .brand { gap: .8rem; }
    .brand-text { padding-left: .8rem; }
    .header-actions { width: 100%; justify-content: space-between; }
    .app-nav { gap: .8rem; }
    .dashboard-intro { flex-direction: column; align-items: flex-start; padding: 1.5rem; }
    .filter-group { flex-wrap: wrap; }
}
@media print { .dashboard-intro { display: none; } }

.equipment-choices { max-height: 280px; overflow-y: auto; border: 1px solid var(--border-color); border-radius: 5px; padding: .5rem; }
.equipment-choice { display: flex; align-items: center; gap: .75rem; padding: .75rem; cursor: pointer; border-radius: 4px; }
.equipment-choice:hover, .equipment-choice:has(input:checked) { background: var(--brand-glow); }
.equipment-choice input { width: 18px; height: 18px; accent-color: var(--brand-primary); flex-shrink: 0; }
.equipment-choice small { display: block; color: var(--text-secondary); font-weight: 400; }
.acta-equipment-list { table-layout: fixed; overflow-wrap: anywhere; }
.acta-equipment-list th { width: auto; }
@media print { .modal-card { max-height: none !important; overflow: visible !important; } .modal-body { overflow: visible !important; } .acta-equipment-list tr { break-inside: avoid; } .acta-equipment-list thead { display: table-header-group; } }
/* Equipment editor: one column, scrollable fields and always-visible actions. */
#modal-equipo .modal-card { max-height: min(90vh, 900px); max-height: min(90dvh, 900px); }
#modal-equipo .modal-header,
#form-equipo .modal-footer { flex-shrink: 0; }
#form-equipo { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
#form-equipo .modal-body { min-height: 0; overflow-y: auto; }
#form-equipo .form-grid { grid-template-columns: minmax(0, 1fr); }
#form-equipo .form-group { grid-column: 1 / -1; min-width: 0; }
#form-equipo input,
#form-equipo select { width: 100%; min-width: 0; max-width: 100%; }
#form-equipo .modal-footer { flex-wrap: wrap; }

/* Signature capture stays white so the ink matches the printed document. */
.signature-fields { border: 1px solid var(--border-color); border-radius: 8px; padding: 1rem; margin-top: 1.5rem; min-width: 0; }
.signature-fields legend { padding: 0 .5rem; font-weight: 600; }
.signature-pads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-top: 1rem; }
.signature-pad { min-width: 0; }
.signature-pad label { display: block; font-weight: 600; margin-bottom: .5rem; }
.signature-pad canvas { display: block; width: 100%; height: auto; aspect-ratio: 20 / 7; background: #fff; border: 1px solid var(--border-color); border-radius: 5px; touch-action: none; cursor: crosshair; }
.signature-pad button { margin-top: .5rem; }
.signature-box { border-top: 0; min-width: 0; }
.acta-signature-image, .acta-signature-empty { display: block; width: 100%; height: 95px; object-fit: contain; border-bottom: 1px solid #222626; margin-bottom: 8px; }
.acta-signatures { break-inside: avoid; }
@media (max-width: 640px) { .signature-pads { grid-template-columns: minmax(0, 1fr); } }
