/* ==========================================================================
   Estilos Panel de Administración
   ========================================================================== */

:root {
    --admin-bg: #f4f6f9;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #38bdf8;
    --card-bg: #ffffff;
    --text-color: #334155;
    --border-color: #e2e8f0;
    --primary-blue: #2563eb;
    --primary-hover: #1d4ed8;
    --success-green: #16a34a;
    --danger-red: #dc2626;
    --warning-yellow: #ca8a04;
    --radius-sm: 6px;
    --radius-md: 10px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --font: system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background-color: var(--admin-bg);
    color: var(--text-color);
    line-height: 1.5;
}

/* Login Screen Layout */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 16px;
}

.login-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    padding: 32px;
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo {
    max-height: 60px;
    margin-bottom: 12px;
}

.login-logo-placeholder {
    font-size: 40px;
    margin-bottom: 8px;
}

.login-header h2 {
    font-size: 1.4rem;
    color: #0f172a;
}

.login-header p {
    color: #64748b;
    font-size: 0.9rem;
}

.login-form .form-group {
    margin-bottom: 16px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
}

/* Admin Wrapper & Layout */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 900;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid #334155;
    text-align: center;
}

.sidebar-logo {
    max-height: 48px;
    margin-bottom: 8px;
}

.sidebar-logo-placeholder {
    font-size: 32px;
}

.sidebar-header h3 {
    font-size: 1.1rem;
    margin-bottom: 2px;
}

.sidebar-header small {
    color: var(--sidebar-text);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    gap: 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background-color: #334155;
    color: #ffffff;
}

.sidebar-nav a.active {
    border-left: 4px solid var(--sidebar-active);
}

.sidebar-divider {
    height: 1px;
    background-color: #334155;
    margin: 12px 0;
}

.link-logout {
    color: #ef4444 !important;
}

/* Topbar & Main */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.admin-topbar {
    background-color: #ffffff;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
}

.btn-icon-mobile {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
}

.admin-content {
    padding: 24px;
    flex: 1;
}

.admin-footer {
    padding: 16px 24px;
    background: #fff;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: #64748b;
    text-align: center;
}

/* Cards & Tables */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 12px 20px;
    background-color: #f8fafc;
    border-top: 1px solid var(--border-color);
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.icon-blue { background: #dbeafe; color: #1e40af; }
.icon-purple { background: #f3e8ff; color: #6b21a8; }
.icon-orange { background: #ffedd5; color: #c2410c; }
.icon-green { background: #dcfce7; color: #15803d; }

.stat-info h3 {
    font-size: 1.5rem;
    color: #0f172a;
}

.stat-info p {
    font-size: 0.85rem;
    color: #64748b;
}

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

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th,
.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    text-align: left;
}

.thumb-img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 4px;
}

.thumb-placeholder {
    width: 44px;
    height: 44px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef9c3; color: #a16207; }
.badge-danger { background: #fee2e2; color: #b91c1c; }

/* Buttons & Form Inputs */
.btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-primary { background: var(--primary-blue); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #64748b; color: #fff; }
.btn-danger { background: var(--danger-red); color: #fff; }
.btn-outline { background: transparent; border: 1px solid #cbd5e1; color: #334155; }
.btn-block { width: 100%; justify-content: center; }

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.form-control-color {
    width: 50px;
    height: 38px;
    padding: 2px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
}

.form-row {
    display: flex;
    gap: 16px;
}

.col-4 { flex: 0 0 33.33%; }
.col-6 { flex: 0 0 50%; }
.col-8 { flex: 0 0 66.66%; }

/* Modal Admin */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal.active {
    display: flex;
}

.modal-dialog {
    background: #fff;
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
}

.modal-dialog.modal-lg {
    max-width: 800px;
}

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

.modal-body {
    padding: 20px;
}

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

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-success { background: #dcfce7; color: #166534; }

@media (max-width: 768px) {
    .admin-sidebar {
        position: fixed;
        left: -260px;
        height: 100vh;
    }
    .admin-sidebar.open {
        transform: translateX(260px);
    }
    .btn-icon-mobile {
        display: block;
    }
    .form-row {
        flex-direction: column;
        gap: 8px;
    }
    .col-4, .col-6, .col-8 {
        flex: 1 1 100%;
    }
}
