/* ==========================================================================
   SIRF — Base Stylesheet (Mobile-First & SaaS Enterprise)
   Cumple estrictamente con la Regla de Oro #1: Cero CSS en HTML
   ========================================================================== */

:root {
    --bg-main: #0b0f19;
    --bg-card: #151d30;
    --bg-card-hover: #1c2742;
    --bg-input: #0b0f19;
    --border-color: #24324f;
    --border-card: #2d3e63;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-verde: #10b981;
    --color-amarillo: #f59e0b;
    --color-rojo: #ef4444;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header & Navigation */
header.app-header {
    background-color: rgba(21, 29, 48, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #fff;
    text-decoration: none;
}

.brand-badge {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-tag {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: none;
}

@media (min-width: 640px) {
    .user-tag {
        display: inline-block;
    }
}

.btn-logout {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fff;
}

/* Main Container */
main.app-container {
    flex: 1;
    padding: 1.25rem;
    max-width: 1024px;
    margin: 0 auto;
    width: 100%;
}

/* Alerts & Messages */
.alerts-wrapper {
    margin-bottom: 1.25rem;
}

.alert-item {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-info {
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(37, 99, 235, 0.3);
    color: #93c5fd;
}

/* Status Semáforo */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
}

.status-badge.verde,
.status-badge.verde_obs {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.status-badge.amarillo {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.status-badge.naranja {
    background: rgba(249, 115, 22, 0.2);
    color: #fb923c;
    border: 1px solid rgba(249, 115, 22, 0.4);
}

.status-badge.rojo {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.verde .status-dot,
.verde_obs .status-dot {
    background-color: #34d399;
    box-shadow: 0 0 6px #34d399;
}

.amarillo .status-dot {
    background-color: #fbbf24;
    box-shadow: 0 0 6px #fbbf24;
}

.naranja .status-dot {
    background-color: #fb923c;
    box-shadow: 0 0 6px #fb923c;
}

.rojo .status-dot {
    background-color: #f87171;
    box-shadow: 0 0 6px #f87171;
}

/* Cards & Generic Layout */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.25rem;
}

.page-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.btn-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-success:hover {
    background: rgba(16, 185, 129, 0.35);
    color: #fff;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

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

table.data-table th {
    background: #172138;
    padding: 0.85rem 1rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

table.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

/* Empty states */
.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2.5rem 1rem;
}

/* Footer */
footer.app-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}
