/**
 * Sistema de Gestión de Arrendamientos - Condominio
 * Estilos Premium Responsive
 */

/* =====================================================
   CSS Variables - Paleta de Colores Premium
   ===================================================== */
:root {
    /* Colores principales - Costamai Uno */
    --primary: #1a3a4a;
    --primary-light: #2a5566;
    --accent: #c4a962;
    --accent-dark: #a89050;
    --accent-light: rgba(196, 169, 98, 0.1);

    /* Fondos */
    --bg-main: #f5f0e8;
    --bg-card: #FFFFFF;
    --bg-alternate: #faf8f4;

    /* Textos */
    --text-primary: #1a3a4a;
    --text-secondary: #6b7c85;
    --text-light: #FFFFFF;

    /* Bordes */
    --border-color: #e5dfd4;
    --border-light: #f0ebe3;

    /* Estados */
    --success: #2E7D5E;
    --success-light: rgba(46, 125, 94, 0.1);
    --error: #C0392B;
    --error-light: rgba(192, 57, 43, 0.1);
    --warning: #D4A017;
    --warning-light: rgba(212, 160, 23, 0.1);

    /* Sombras */
    --shadow-sm: 0 2px 8px rgba(26, 58, 74, 0.04);
    --shadow-md: 0 2px 12px rgba(26, 58, 74, 0.06);
    --shadow-lg: 0 4px 24px rgba(26, 58, 74, 0.08);
    --shadow-accent: 0 4px 12px rgba(196, 169, 98, 0.25);

    /* Tipografía */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Dimensiones */
    --sidebar-width: 260px;
    --sidebar-collapsed: 80px;
    --header-height: 70px;
    --mobile-header: 80px;

    /* Transiciones */
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;

    /* Border radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* =====================================================
   Reset y Base
   ===================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--text-primary);
    background-color: var(--bg-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

ul,
ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
}

/* =====================================================
   Tipografía
   ===================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.125rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

/* =====================================================
   Layout Principal
   ===================================================== */
.app-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
}

/* =====================================================
   Sidebar
   ===================================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--primary);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition-slow);
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-link {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.logo-link:hover {
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.logo-img {
    max-height: 100px;
    width: auto;
    height: auto;
    display: block;
}

.logo-divider {
    width: 40px;
    height: 3px;
    background: var(--accent);
    margin-top: 0.75rem;
    border-radius: 2px;
}

.close-sidebar {
    display: none;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    padding: 0.5rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    font-size: 0.9375rem;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item.active {
    background: rgba(201, 169, 110, 0.1);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
}

.nav-item.active .nav-link {
    color: var(--accent);
    font-weight: 500;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.logout-link:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.05);
}

.logout-link svg {
    width: 18px;
    height: 18px;
}

/* =====================================================
   Mobile Header
   ===================================================== */
.mobile-header {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--mobile-header);
    background: var(--primary);
    padding: 0 1rem;
    align-items: center;
    justify-content: space-between;
    z-index: 999;
}

.hamburger-btn {
    color: var(--text-light);
    padding: 0.5rem;
}

.hamburger-btn svg {
    width: 24px;
    height: 24px;
}

.mobile-logo-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-md);
    padding: 4px 8px;
}

.mobile-logo-img {
    height: 70px;
    width: auto;
    display: block;
    object-fit: contain;
}

.mobile-user {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* =====================================================
   Main Content
   ===================================================== */
.main-content {
    flex: 1;
    margin-left: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: calc(var(--mobile-header) + 20px);
}

.content-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 100;
}

.page-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-name {
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.logout-btn:hover {
    color: var(--error);
    background: var(--error-light);
}

.logout-btn svg {
    width: 20px;
    height: 20px;
}

.content-area {
    flex: 1;
    padding: 2rem;
}

/* =====================================================
   Cards
   ===================================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
}

.card-lg {
    padding: 2rem;
}

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

.card-title {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
}

/* =====================================================
   Botones
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--accent);
    color: var(--text-light);
}

.btn-primary:hover {
    background: var(--accent-dark);
    box-shadow: var(--shadow-accent);
}

.btn-secondary {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-secondary:hover {
    background: var(--accent-light);
}

.btn-danger {
    background: transparent;
    color: var(--error);
    border: 1px solid var(--error);
}

.btn-danger:hover {
    background: var(--error-light);
}

.btn-warning {
    background: #c0392b;
    color: #ffffff;
    border: 1px solid #c0392b;
}

.btn-warning:hover {
    background: #a93226;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-sm svg {
    width: 16px;
    height: 16px;
}

.btn-icon {
    padding: 0.5rem;
    width: 36px;
    height: 36px;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

/* =====================================================
   Formularios
   ===================================================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-input::placeholder {
    color: var(--text-secondary);
}

.form-input.error,
.form-select.error {
    border-color: var(--error);
}

.form-error {
    font-size: 0.8125rem;
    color: var(--error);
    margin-top: 0.375rem;
}

.form-hint {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.375rem;
}

.form-row {
    display: grid;
    gap: 1rem;
}

.form-row-2 {
    grid-template-columns: repeat(2, 1fr);
}

.form-row-3 {
    grid-template-columns: repeat(3, 1fr);
}

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

/* =====================================================
   Tablas
   ===================================================== */
.table-container {
    overflow-x: auto;
    margin: -0.5rem;
    padding: 0.5rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
}

.table th {
    background: var(--primary);
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table th:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.table th:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.table tbody tr:nth-child(even) {
    background: var(--bg-alternate);
}

.table tbody tr:hover {
    background: var(--accent-light);
}

.table td {
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

/* =====================================================
   Badges / Estados
   ===================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-error {
    background: var(--error-light);
    color: var(--error);
}

.badge-neutral {
    background: var(--bg-alternate);
    color: var(--text-secondary);
}

/* =====================================================
   Alertas
   ===================================================== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
}

.alert-error {
    background: var(--error-light);
    color: var(--error);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning);
}

/* =====================================================
   Stats Cards
   ===================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: var(--radius-md);
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* =====================================================
   Search Box
   ===================================================== */
.search-box {
    position: relative;
    max-width: 500px;
}

.search-box .form-input {
    padding-left: 3rem;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-icon svg {
    width: 20px;
    height: 20px;
}

/* =====================================================
   Empty State
   ===================================================== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    color: var(--text-secondary);
    opacity: 0.5;
}

.empty-state-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto 1.5rem;
}

/* =====================================================
   Modal
   ===================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: var(--transition);
    margin: 1rem;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

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

.modal-title {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    color: var(--text-secondary);
    padding: 0.25rem;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

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

/* =====================================================
   Link Box (para copiar links)
   ===================================================== */
.link-box {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.link-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-alternate);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.copy-btn {
    padding: 0.75rem 1rem;
    background: var(--primary);
    color: var(--text-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.copy-btn:hover {
    background: var(--primary-light);
}

.copy-btn svg {
    width: 16px;
    height: 16px;
}

/* =====================================================
   Login Page
   ===================================================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    padding: 2rem;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(26, 58, 74, 0.05) 0%, rgba(196, 169, 98, 0.05) 100%);
    border-radius: var(--radius-lg);
}

.auth-logo-img {
    max-height: 120px;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
}

.auth-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-top: 1.5rem;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-top: 0.5rem;
}

/* =====================================================
   Vehicle Form (Dynamic)
   ===================================================== */
.vehicle-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.vehicle-item {
    background: var(--bg-alternate);
    border-radius: var(--radius-md);
    padding: 1rem;
    position: relative;
}

.vehicle-item .form-row {
    margin-bottom: 0;
}

.remove-vehicle {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    color: var(--error);
    padding: 0.25rem;
    transition: var(--transition);
}

.remove-vehicle:hover {
    background: var(--error-light);
    border-radius: var(--radius-sm);
}

.add-vehicle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: var(--transition);
    width: 100%;
    margin-top: 0.5rem;
}

.add-vehicle:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

/* =====================================================
   History Section
   ===================================================== */
.history-timeline {
    position: relative;
    padding-left: 1.5rem;
}

.history-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.history-item {
    position: relative;
    padding-bottom: 1.5rem;
    padding-left: 1rem;
}

.history-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0.25rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-card);
}

.history-date {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.history-content {
    background: var(--bg-alternate);
    padding: 1rem;
    border-radius: var(--radius-md);
}

.history-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.history-details {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* =====================================================
   Responsive - Tablet (layout general)
   ===================================================== */
@media (max-width: 1024px) {
    .content-area {
        padding: 1.5rem;
    }

    .form-row-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =====================================================
   Responsive - Tablet (sidebar colapsado)
   Excluye iPad Air 5 (820px) donde el sidebar se
   mantiene expandido
   ===================================================== */
@media (min-width: 831px) and (max-width: 1024px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }

    .sidebar:hover {
        width: var(--sidebar-width);
    }

    .sidebar .nav-link span,
    .sidebar .logout-link span {
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
    }

    .sidebar:hover .nav-link span,
    .sidebar:hover .logout-link span {
        opacity: 1;
        visibility: visible;
    }

    .sidebar .logo-link {
        padding: 0.5rem;
    }

    .sidebar:hover .logo-link {
        padding: 0.75rem 1rem;
    }

    .sidebar .logo-img {
        max-height: 40px;
    }

    .sidebar:hover .logo-img {
        max-height: 80px;
    }

    .main-content {
        margin-left: var(--sidebar-collapsed);
        padding-top: 0;
    }
}

/* =====================================================
   Responsive - DESKTOP (>= 769px)
   ===================================================== */
@media (min-width: 769px) {

    /* MOSTRAR sidebar en desktop */
    .sidebar {
        display: flex;
        transform: translateX(0);
    }

    /* OCULTAR mobile header en desktop */
    .mobile-header {
        display: none;
    }

    /* OCULTAR overlay en desktop */
    .sidebar-overlay {
        display: none;
    }

    /* Layout CON sidebar */
    .main-content {
        margin-left: var(--sidebar-width);
        padding-top: 0;
    }

    /* MOSTRAR content-header para admin en desktop */
    body.admin-view .content-header {
        display: flex;
    }

    /* OCULTAR bottom navbar en desktop */
    .bottom-navbar {
        display: none !important;
    }

    .content-area {
        padding: 2rem;
    }
}

/* =====================================================
   Responsive - MOBILE (<= 768px)
   ===================================================== */
@media (max-width: 768px) {

    /* OCULTAR sidebar completamente en mobile */
    .sidebar,
    .sidebar-overlay {
        display: none !important;
    }

    /* MOSTRAR mobile header */
    .mobile-header {
        display: flex;
    }

    /* Layout SIN sidebar */
    .main-content {
        margin-left: 0;
        padding-top: calc(var(--mobile-header) + 20px);
    }

    /* OCULTAR content-header en mobile */
    .content-header {
        display: none;
    }

    /* MOSTRAR bottom navbar en mobile */
    .bottom-navbar {
        display: flex !important;
    }

    /* Padding para que el contenido no se corte con la bottom navbar */
    .content-area {
        padding: 1rem;
        padding-bottom: 6rem;
        /* Espacio para bottom navbar */
    }

    .form-row-2,
    .form-row-3 {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Cards como tablas en mobile */
    .table-responsive {
        display: none;
    }

    .mobile-cards {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .mobile-card {
        background: var(--bg-card);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-sm);
        padding: 1rem;
    }

    .mobile-card-row {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border-light);
    }

    .mobile-card-row:last-child {
        border-bottom: none;
    }

    .mobile-card-label {
        font-size: 0.8125rem;
        color: var(--text-secondary);
    }

    .mobile-card-value {
        font-weight: 500;
        text-align: right;
    }

    .mobile-card-actions {
        display: flex;
        gap: 0.5rem;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border-color);
    }

    .modal {
        margin: 1rem;
        max-height: 85dvh;
    }

    .modal-footer {
        flex-wrap: wrap;
    }

    .auth-card {
        padding: 2rem 1.5rem;
    }
}

/* =====================================================
   Utility Classes
   ===================================================== */
.text-center {
    text-align: center;
}

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

.text-muted {
    color: var(--text-secondary);
}

.text-success {
    color: var(--success);
}

.text-error {
    color: var(--error);
}

.text-accent {
    color: var(--accent);
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

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

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.gap-3 {
    gap: 1.5rem;
}

/* =====================================================
   Animations
   ===================================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-in {
    animation: slideIn 0.3s ease;
}

/* =====================================================
   Bottom Navbar (Visible solo en Mobile)
   ===================================================== */
.bottom-navbar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary);
    padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    justify-content: space-around;
    align-items: center;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
    transition: var(--transition);
    flex: 1;
    text-decoration: none;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--accent);
}

.bottom-nav-icon {
    width: 26px;
    height: 26px;
    stroke-width: 2;
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

.bottom-nav-item:hover .bottom-nav-icon,
.bottom-nav-item.active .bottom-nav-icon {
    color: var(--accent);
}

.bottom-nav-label {
    font-size: 0.6875rem;
    font-weight: 500;
    text-align: center;
}

/* =====================================================
   Site Footer
   ===================================================== */
.site-footer {
    background: var(--primary);
    color: var(--text-light);
    padding: 2rem 0 1.5rem;
    margin-top: auto;
    width: 100%;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
}

.footer-section-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.footer-section-center h4 {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-light);
}

.footer-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--text-light);
    text-decoration: underline;
}

.footer-copyright {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .site-footer {
        padding: 1.5rem 0 calc(70px + 1rem);
        margin-top: 2rem;
    }

    .footer-section-center {
        gap: 0.5rem;
    }

    body {
        padding-bottom: 0;
    }
}

/* =====================================================
   Print Styles
   ===================================================== */
@media print {

    .sidebar,
    .mobile-header,
    .content-header,
    .btn,
    .table-actions {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}