/* ============================================
   CARTA DIGITAL — admin.css
   Estilo: Blanco/Claro Profesional + Responsivo
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Cormorant+Garamond:wght@300;400&display=swap');

:root {
    --gold:      #2563eb;
    --gold-l:    #3b82f6;
    --bg:        #ffffff;
    --white:     #ffffff;
    --sidebar:   #f1f3f5;   /* gris muy claro */
    --border:    #e5e7eb;
    --text:      #111827;
    --text2:     #374151;
    --gray:      #6b7280;
    --font:      'Inter', sans-serif;
    --serif:     'Inter', sans-serif;
    --shadow:    0 1px 3px rgba(0,0,0,0.08);
    --sidebar-w: 220px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    -webkit-font-smoothing: antialiased;
    font-weight: 400;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
input, select, textarea, button { font-family: inherit; }

/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    overflow-y: auto;
    transition: transform 0.3s ease;
}
.sidebar-logo {
    padding: 1.4rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
}
.sidebar-logo .brand {
    font-family: var(--serif);
    font-size: 1.2rem;
    letter-spacing: 2px;
    color: #111827;
    text-transform: uppercase;
    display: block;
}
.sidebar-logo .sub {
    font-size: 0.6rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #6b7280;
    margin-top: 2px;
}
.sidebar-nav { flex: 1; padding: 0.8rem 0; }
.nav-sep {
    font-size: 0.58rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #9ca3af;
    padding: 0.8rem 1.4rem 0.3rem;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.4rem;
    font-size: 0.85rem;
    font-weight: 400;
    color: #374151;
    border-left: 2px solid transparent;
    transition: all 0.2s;
}
.nav-item:hover { color: #111827; background: #e5e7eb; }
.nav-item.active {
    color: #2563eb;
    border-left-color: #2563eb;
    background: #eff6ff;
    font-weight: 600;
}
.nav-icon { font-size: 0.85rem; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-user {
    padding: 1rem 1.4rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.75rem;
    color: #6b7280;
    text-align: center;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    background: var(--sidebar);
    z-index: 10;
}
.sidebar-user strong { color: #111827; display: block; margin-bottom: 3px; }
.sidebar-user a {
    color: #ef4444;
    font-size: 0.72rem;
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border: 1px solid #ffcdd2;
    border-radius: 4px;
    margin-top: 4px;
    background: #fff5f5;
}

/* ── OVERLAY MOBILE ── */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
}
.sidebar-overlay.open { display: block; }

/* ── MAIN ── */
.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

/* ── TOPBAR ── */
.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 1.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 1rem;
}
.topbar-title { font-size: 1rem; font-weight: 700; color: var(--text); letter-spacing: 0.3px; }
.topbar-left { display: flex; align-items: center; gap: 0.8rem; }
.btn-menu {
    display: none;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text);
    padding: 0.2rem;
}

/* ── CONTENT ── */
.content {
    padding: 1.8rem;
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* ── STATS ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px,1fr));
    gap: 1rem;
    margin-bottom: 1.8rem;
}
.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    padding: 1.2rem 1.4rem;
    box-shadow: var(--shadow);
    border-radius: 4px;
    text-align: center;
}
.stat-label { font-size: 0.68rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gray); margin-bottom: 0.5rem; font-weight: 600; }
.stat-value { font-family: var(--serif); font-size: 2.2rem; font-weight: 400; color: var(--gold); line-height: 1; }
.stat-sub   { font-size: 0.75rem; color: var(--gray); margin-top: 0.3rem; font-weight: 500; }

/* ── TABLE BOX ── */
.table-box {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.table-head {
    padding: 0.9rem 1.4rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: #fafafa;
}
.table-head h3 { font-size: 0.82rem; font-weight: 600; color: var(--text); }

/* Tabla responsiva */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.82rem; min-width: 500px; }
thead tr { background: #f8f8f8; }
th {
    padding: 0.7rem 1rem;
    text-align: left;
    font-size: 0.68rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #555;
    border-bottom: 2px solid var(--border);
    font-weight: 700;
    white-space: nowrap;
    background: #f5f5f5;
}
td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    color: var(--text);
    vertical-align: middle;
    font-size: 0.88rem;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }
.td-img { width: 46px; height: 36px; object-fit: cover; background: #eee; border-radius: 2px; }

/* ── BADGES ── */
.badge { padding: 0.2rem 0.6rem; font-size: 0.62rem; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; border-radius: 2px; white-space: nowrap; }
.badge-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.badge-danger  { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }
.badge-warning { background: #fff8e1; color: #f57f17; border: 1px solid #ffecb3; }
.badge-info    { background: #e3f2fd; color: #1565c0; border: 1px solid #bbdefb; }

/* ── BOTONES ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    padding: 0.45rem 1rem;
    font-size: 0.72rem; font-weight: 500; letter-spacing: 0.5px;
    text-transform: uppercase;
    border: none; cursor: pointer; transition: all 0.2s;
    border-radius: 3px;
    white-space: nowrap;
}
.btn-gold    { background: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-l); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text2); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.btn-danger  { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }
.btn-danger:hover { background: #ffcdd2; }
.btn-sm { padding: 0.28rem 0.65rem; font-size: 0.65rem; }

/* ── FORMS ── */
.form-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1.4rem;
    margin-bottom: 1.4rem;
    box-shadow: var(--shadow);
}
.form-card h3 {
    font-size: 0.72rem; font-weight: 600; letter-spacing: 1.5px;
    text-transform: uppercase; color: var(--gray);
    margin-bottom: 1.2rem; padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.32rem; }
.form-group.full { grid-column: 1/-1; }
label {
    font-size: 0.72rem; letter-spacing: 0.8px;
    text-transform: uppercase; color: #555; font-weight: 600;
}
input[type=text], input[type=email], input[type=number],
input[type=password], input[type=time], input[type=date],
input[type=tel], select, textarea {
    background: #fff;
    border: 1px solid #ccc;
    color: #111;
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
    font-weight: 400;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    border-radius: 3px;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(184,134,11,0.1);
}
textarea { resize: vertical; min-height: 85px; }
.form-actions {
    display: flex; gap: 0.6rem; flex-wrap: wrap;
    margin-top: 1.1rem; padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.current-img {
    display: flex; align-items: center; gap: 0.7rem;
    font-size: 0.75rem; color: var(--gray); margin-top: 0.4rem;
}
.current-img img { width: 55px; height: 42px; object-fit: cover; border-radius: 2px; }

/* ── TOGGLE ── */
.toggle { position: relative; display: inline-block; width: 34px; height: 19px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0;
    background: #ddd; border-radius: 19px; cursor: pointer; transition: 0.2s;
}
.toggle-slider::before {
    content: ''; position: absolute;
    width: 13px; height: 13px; border-radius: 50%;
    background: #fff; top: 3px; left: 3px; transition: 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle input:checked + .toggle-slider { background: var(--gold); }
.toggle input:checked + .toggle-slider::before { transform: translateX(15px); }

/* ── ALERTS ── */
.alert { padding: 0.75rem 1rem; font-size: 0.82rem; margin-bottom: 1rem; border-radius: 3px; }
.alert-success { background: #e8f5e9; border: 1px solid #c8e6c9; color: #2e7d32; }
.alert-error   { background: #ffebee; border: 1px solid #ffcdd2; color: #c62828; }
.alert-info    { background: #e3f2fd; border: 1px solid #bbdefb; color: #1565c0; }

/* ── HORARIOS ── */
.horarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px,1fr));
    gap: 1rem;
}
.horario-card {
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.9rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}
.horario-dia {
    font-size: 0.72rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 600;
    width: 80px;
    flex-shrink: 0;
}
.horario-card input[type=time] { width: 110px; }

/* ── LOGIN ── */
.login-page {
    min-height: 100vh;
    width: 100%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--white);
    border-radius: 8px;
    padding: 2.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo .brand {
    font-family: var(--font);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 1px;
    text-transform: uppercase;
}
.login-logo p { font-size: 0.75rem; letter-spacing: 1px; text-transform: uppercase; color: var(--gray); margin-top: 6px; font-weight: 500; }
.login-form { display: flex; flex-direction: column; gap: 1rem; }
.login-form .btn-gold { width: 100%; justify-content: center; padding: 0.85rem; letter-spacing: 1px; font-size: 0.85rem; font-weight: 600; border-radius: 6px; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main { margin-left: 0; }
    .btn-menu { display: flex; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .content { padding: 1rem; }
    .form-grid { grid-template-columns: 1fr; }
    .form-group.full { grid-column: 1; }
}

@media (max-width: 768px) {
    .col-hide { display: none; }
    table { min-width: unset; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .topbar { padding: 0.75rem 1rem; }
    .login-card { padding: 1.8rem 1.2rem; }
    .table-head { flex-direction: column; align-items: flex-start; }
    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; }
    .horario-card { flex-wrap: wrap; }
}
