/* ===== RESET Y BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colores base */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #dbeafe;

    /* Sidebar */
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #ffffff;
    --sidebar-hover-bg: #334155;
    --sidebar-width: 260px;

    /* Layout */
    --header-height: 60px;
    --content-bg: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    /* Estados de servicios */
    --status-active: #10b981;
    --status-active-bg: #d1fae5;
    --status-suspended: #f59e0b;
    --status-suspended-bg: #fef3c7;
    --status-canceled: #ef4444;
    --status-canceled-bg: #fee2e2;
    --status-pending: #6b7280;
    --status-pending-bg: #f3f4f6;

    /* Flash messages */
    --flash-success-bg: #d1fae5;
    --flash-success-border: #10b981;
    --flash-success-text: #065f46;
    --flash-error-bg: #fee2e2;
    --flash-error-border: #ef4444;
    --flash-error-text: #991b1b;
    --flash-warning-bg: #fef3c7;
    --flash-warning-border: #f59e0b;
    --flash-warning-text: #92400e;
    --flash-info-bg: #dbeafe;
    --flash-info-border: #2563eb;
    --flash-info-text: #1e40af;

    /* Alertas de renovación */
    --renewal-urgent: #ef4444;
    --renewal-warning: #f59e0b;
    --renewal-ok: #10b981;

    /* Tipos de servicio */
    --service-hosting: #3b82f6;
    --service-domain: #8b5cf6;
    --service-hosting-domain: #ec4899;

    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);

    /* Bordes redondeados */
    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--content-bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 14px;
}

a {
    color: var(--primary);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* ===== LAYOUT PRINCIPAL ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-logo h1 .logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.sidebar-logo span {
    font-size: 11px;
    color: var(--sidebar-text);
    display: block;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.sidebar-section {
    padding: 0 12px;
    margin-bottom: 8px;
}
.sidebar-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 8px 12px;
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--sidebar-text);
    border-radius: var(--radius);
    transition: all 0.2s;
    font-size: 14px;
    text-decoration: none;
    margin: 2px 0;
}
.sidebar-link:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-active);
    text-decoration: none;
}
.sidebar-link.active {
    background: var(--primary);
    color: var(--white);
    border-left: 3px solid var(--white);
}
.sidebar-link .icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
}
.sidebar-link.disabled {
    opacity: 0.4;
    pointer-events: none;
}

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

/* ===== CONTENIDO PRINCIPAL ===== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== HEADER ===== */
.header {
    background: var(--white);
    height: var(--header-height);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.header-left h2 {
    font-size: 18px;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-admin {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    position: relative;
}
.header-admin:hover {
    background: var(--content-bg);
}
.admin-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}
.admin-info {
    line-height: 1.3;
}
.admin-info .name {
    font-weight: 600;
    font-size: 13px;
}
.admin-info .role {
    font-size: 11px;
    color: var(--text-secondary);
}

.btn-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text);
    padding: 4px;
}

/* ===== CONTENIDO ===== */
.content {
    padding: 24px;
    flex: 1;
}

/* ===== CARDS ===== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h3 {
    font-size: 16px;
    font-weight: 600;
}
.card-body {
    padding: 20px;
}

/* ===== STATS CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.stat-icon.blue { background: var(--primary-soft); color: var(--primary); }
.stat-icon.green { background: var(--status-active-bg); color: var(--status-active); }
.stat-icon.orange { background: var(--status-suspended-bg); color: var(--status-suspended); }
.stat-icon.red { background: var(--status-canceled-bg); color: var(--status-canceled); }
.stat-icon.purple { background: #ede9fe; color: #8b5cf6; }
.stat-info h4 {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}
.stat-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ===== TABLAS ===== */
.table-responsive {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
}
table th, table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
table th {
    background: var(--content-bg);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}
table tr:hover {
    background: #f1f5f9;
}
table tr:last-child td {
    border-bottom: none;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}
.badge-activo { background: var(--status-active-bg); color: var(--status-active); }
.badge-suspendido { background: var(--status-suspended-bg); color: var(--status-suspended); }
.badge-cancelado { background: var(--status-canceled-bg); color: var(--status-canceled); }
.badge-pendiente { background: var(--status-pending-bg); color: var(--status-pending); }
.badge-hosting { background: #dbeafe; color: var(--service-hosting); }
.badge-dominio { background: #ede9fe; color: var(--service-domain); }
.badge-hosting_dominio { background: #fce7f3; color: var(--service-hosting-domain); }
.badge-inactivo { background: var(--status-canceled-bg); color: var(--status-canceled); }
.badge-pagado { background: var(--status-active-bg); color: var(--status-active); }
.badge-vencido { background: var(--status-canceled-bg); color: var(--status-canceled); }
.badge-reembolsado { background: #ede9fe; color: #8b5cf6; }

/* ===== BOTONES ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--status-active); color: var(--white); }
.btn-success:hover { background: #059669; }
.btn-warning { background: var(--status-suspended); color: var(--white); }
.btn-warning:hover { background: #d97706; }
.btn-danger { background: var(--status-canceled); color: var(--white); }
.btn-danger:hover { background: #dc2626; }
.btn-whatsapp { background: #25d366; color: #fff; }
.btn-whatsapp:hover { background: #1da851; color: #fff; }
.btn-secondary { background: var(--content-bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }

.btn-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ===== FORMULARIOS ===== */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--text);
}
.form-group label .required {
    color: var(--status-canceled);
}
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text);
    background: var(--white);
    transition: border-color 0.2s;
    font-family: inherit;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.form-control.is-invalid {
    border-color: var(--status-canceled);
}
.invalid-feedback {
    color: var(--status-canceled);
    font-size: 12px;
    margin-top: 4px;
}
select.form-control {
    appearance: auto;
}
textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ===== SECCIONES DE FORMULARIO ===== */
.form-section {
    margin-top: 20px;
    padding: 16px;
    background: var(--content-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.form-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.input-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.input-password-wrapper .form-control {
    padding-right: 44px;
}
.input-password-wrapper .btn-toggle-password {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    color: var(--text-secondary);
}
.input-password-wrapper .btn-toggle-password:hover {
    color: var(--text);
}
.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== TOOLBAR (búsqueda + acciones) ===== */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}
.toolbar-search {
    display: flex;
    gap: 8px;
    flex: 1;
    max-width: 400px;
}
.toolbar-search .form-control {
    margin-bottom: 0;
}
.toolbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ===== FLASH MESSAGES ===== */
.flash-message {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
}
.flash-message.success {
    background: var(--flash-success-bg);
    border-color: var(--flash-success-border);
    color: var(--flash-success-text);
}
.flash-message.error {
    background: var(--flash-error-bg);
    border-color: var(--flash-error-border);
    color: var(--flash-error-text);
}
.flash-message.warning {
    background: var(--flash-warning-bg);
    border-color: var(--flash-warning-border);
    color: var(--flash-warning-text);
}
.flash-message.info {
    background: var(--flash-info-bg);
    border-color: var(--flash-info-border);
    color: var(--flash-info-text);
}
.flash-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.6;
    color: inherit;
    padding: 0 4px;
}
.flash-close:hover {
    opacity: 1;
}

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

/* ===== PAGINACIÓN ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 16px 0;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius);
    font-size: 13px;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.pagination a:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
}
.pagination .active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}
.pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ===== MODAL CONFIRMACIÓN ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.show {
    display: flex;
}
.modal-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 420px;
    width: 90%;
    box-shadow: var(--shadow-md);
}
.modal-box h3 {
    margin-bottom: 12px;
    font-size: 18px;
}
.modal-box p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ===== PASSWORD TOGGLE ===== */
.password-wrapper {
    position: relative;
}
.password-wrapper .form-control {
    padding-right: 40px;
}
.btn-toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 16px;
    padding: 4px;
}

/* ===== INPUT GROUP PASSWORD ===== */
.input-group-password {
    position: relative;
    display: flex;
    align-items: center;
}
.input-group-password .form-control {
    padding-right: 40px;
}
.input-group-password .btn-toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

/* ===== TOGGLE SWITCH ===== */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}
.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s;
    border-radius: 26px;
}
.toggle-slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary);
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

/* ===== ERRORES DE VALIDACIÓN ===== */
.validation-errors {
    background: var(--flash-error-bg);
    border: 1px solid var(--flash-error-border);
    color: var(--flash-error-text);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
}
.validation-errors strong {
    display: block;
    margin-bottom: 8px;
}
.validation-errors ul {
    margin: 0;
    padding-left: 20px;
}
.validation-errors li {
    margin-bottom: 4px;
    font-size: 14px;
}
.form-group.has-error .form-control,
.form-group.has-error select.form-control {
    border-color: var(--flash-error-border);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}
.form-group.has-error label {
    color: var(--flash-error-text);
}

/* ===== BARRA DE PROGRESO DE PAGOS ===== */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    min-width: 0;
}
.progress-bar.low { background: var(--status-canceled); }
.progress-bar.mid { background: var(--status-suspended); }
.progress-bar.complete { background: var(--status-active); }

/* ===== INPUT CON SÍMBOLO DE MONEDA ===== */
.input-with-currency {
    position: relative;
    display: flex;
    align-items: center;
}
.input-with-currency .currency-symbol {
    position: absolute;
    left: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}
.input-with-currency .form-control {
    padding-left: 36px;
}

/* ===== TOMSELECT OVERRIDES ===== */
.ts-wrapper {
    font-family: inherit;
}
.ts-wrapper .ts-control {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    min-height: 40px;
    background: var(--white);
}
.ts-wrapper.focus .ts-control {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.ts-dropdown {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.ts-dropdown .option.active {
    background-color: var(--primary);
    color: white;
}

/* ===== DETALLE (ver registro) ===== */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.detail-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.detail-item:last-child {
    border-bottom: none;
}
.detail-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.detail-value {
    font-size: 14px;
    font-weight: 500;
}

/* ===== SECCIÓN DE HOSTING ===== */
.hosting-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px dashed var(--border);
}
.hosting-section h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--primary);
}

/* ===== VACÍO ===== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}
.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
    width: 80px;
    height: 80px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--content-bg);
    border-radius: 50%;
}
.empty-state p {
    margin-bottom: 16px;
}

/* ===== DÍAS PARA RENOVACIÓN ===== */
.dias-renovacion {
    font-weight: 600;
    font-size: 13px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}
.dias-renovacion.urgente { color: var(--renewal-urgent); background: var(--status-canceled-bg); }
.dias-renovacion.advertencia { color: var(--renewal-warning); background: var(--status-suspended-bg); }
.dias-renovacion.ok { color: var(--renewal-ok); background: var(--status-active-bg); }
.dias-renovacion.vencido { color: var(--white); background: var(--renewal-urgent); }

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.page-header h2 {
    font-size: 22px;
    font-weight: 700;
}

/* ===== CLASES UTILITARIAS ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
    gap: 24px;
}
.card-body--flush {
    padding: 0;
}
.mb-4 {
    margin-bottom: 24px;
}

/* ===== ACCIONES DE TABLA (desktop) ===== */
table .btn-group {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}
table tr:hover .btn-group {
    opacity: 1;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .btn-menu-toggle {
        display: block;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .toolbar-search {
        max-width: 100%;
        flex-wrap: wrap;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .header-admin .admin-info {
        display: none;
    }
    .header {
        padding: 0 12px;
    }
    .header-left h2 {
        font-size: 16px;
    }

    /* Touch targets más grandes */
    .btn-sm {
        padding: 8px 14px;
        min-height: 36px;
    }
    .btn {
        min-height: 44px;
    }
    .pagination a, .pagination span {
        min-width: 44px;
        height: 44px;
    }

    /* Formularios en móvil */
    .form-actions {
        flex-direction: column;
    }
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Tablas responsivas en modo tarjeta */
    .table-responsive table thead {
        display: none;
    }
    .table-responsive table tbody tr {
        display: block;
        background: var(--white);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        margin-bottom: 12px;
        padding: 12px 16px;
        box-shadow: var(--shadow-sm);
    }
    .table-responsive table tbody tr:hover {
        background: var(--white);
    }
    .table-responsive table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 6px 0;
        border-bottom: 1px solid var(--border);
        font-size: 13px;
        gap: 8px;
    }
    .table-responsive table tbody td:last-child {
        border-bottom: none;
        padding-top: 10px;
    }
    .table-responsive table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        min-width: 100px;
        flex-shrink: 0;
    }
    .table-responsive table tbody td .btn-group {
        flex-wrap: wrap;
        width: 100%;
        opacity: 1;
    }
    .table-responsive table tbody td .btn-group .btn {
        flex: 1;
        justify-content: center;
        min-width: 0;
    }

    /* Dashboard grid a 1 columna */
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== BREAKPOINT 480px (pantallas muy pequeñas) ===== */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .content {
        padding: 12px;
    }
    .card-body {
        padding: 14px;
    }
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ===== SIDEBAR OVERLAY (mobile) ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}
.sidebar-overlay.show {
    display: block;
}
