/* =======================================================
   admin.css - Panel de Administración de Turnos Médicos
   periodico.visitasmedicas.com.ar
   ======================================================= */

:root {
    --adm-blue: #0078d4;
    --adm-blue-hover: #106ebe;
    --adm-blue-dark: #004578;
    --adm-dark: #201f1e;
    --adm-gray-bg: #f3f2f1;
    --adm-border: #edebe9;
    --adm-success: #107c41;
    --adm-danger: #a80000;
    --adm-warning: #797775;
    --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--adm-gray-bg);
    color: var(--adm-dark);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.adm-sidebar {
    width: 250px;
    background: #ffffff;
    border-right: 1px solid var(--adm-border);
    display: flex;
    flex-direction: column;
}

.adm-brand {
    padding: 20px;
    border-bottom: 1px solid var(--adm-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.adm-brand-icon {
    width: 36px;
    height: 36px;
    background: var(--adm-blue);
    color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.adm-brand h2 {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.adm-brand span {
    font-size: 12px;
    color: #605e5c;
}

.adm-menu {
    list-style: none;
    padding: 16px 10px;
    flex: 1;
}

.adm-menu li {
    margin-bottom: 4px;
}

.adm-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    color: #323130;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.15s;
}

.adm-menu a:hover {
    background-color: #f3f2f1;
    color: var(--adm-blue);
}

.adm-menu a.active {
    background-color: #eff6fc;
    color: var(--adm-blue);
}

.adm-sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--adm-border);
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Contenido Principal */
.adm-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.adm-topbar {
    background: white;
    border-bottom: 1px solid var(--adm-border);
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.adm-topbar h1 {
    font-size: 18px;
    font-weight: 700;
}

.adm-content {
    padding: 28px;
    flex: 1;
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
}

/* Tarjetas de Métricas */
.adm-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.adm-stat-card {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--adm-border);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.adm-stat-label {
    font-size: 12px;
    font-weight: 600;
    color: #605e5c;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.adm-stat-val {
    font-size: 26px;
    font-weight: 700;
    color: var(--adm-dark);
}

/* Tarjetas Generales */
.adm-card {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--adm-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 24px;
    overflow: hidden;
}

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

.adm-card-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--adm-dark);
}

.adm-card-body {
    padding: 20px;
}

/* Tablas */
.adm-table-wrapper {
    overflow-x: auto;
}

.adm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.adm-table th {
    background: #faf9f8;
    color: #605e5c;
    font-weight: 700;
    padding: 10px 14px;
    border-bottom: 2px solid var(--adm-border);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.adm-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--adm-border);
    vertical-align: middle;
}

.adm-table tr:hover td {
    background-color: #fcfcfc;
}

/* Badges de Estado */
.adm-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.adm-badge.confirmado { background: #eff6fc; color: #0078d4; }
.adm-badge.asistio { background: #dff6dd; color: #107c41; }
.adm-badge.ausente { background: #fed9cc; color: #d13438; }
.adm-badge.cancelado { background: #edebe9; color: #605e5c; }

/* Botones */
.adm-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
}

.adm-btn-primary { background: var(--adm-blue); color: white; }
.adm-btn-primary:hover { background: var(--adm-blue-hover); }

.adm-btn-secondary { background: #f3f2f1; color: var(--adm-dark); border-color: #d2d0ce; }
.adm-btn-secondary:hover { background: #edebe9; }

.adm-btn-success { background: var(--adm-success); color: white; }
.adm-btn-danger { background: var(--adm-danger); color: white; }

.adm-btn-sm { padding: 4px 8px; font-size: 11px; }

/* Formularios y Grids */
.adm-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.adm-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 14px;
}

.adm-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--adm-dark);
}

.adm-form-group input, 
.adm-form-group select, 
.adm-form-group textarea {
    font-family: inherit;
    font-size: 13px;
    padding: 8px 12px;
    border: 1px solid #8a8886;
    border-radius: 4px;
    outline: none;
}

.adm-form-group input:focus, 
.adm-form-group select:focus, 
.adm-form-group textarea:focus {
    border-color: var(--adm-blue);
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.25);
}

.adm-form-help {
    font-size: 11px;
    color: #605e5c;
}

/* Switches para Días */
.adm-days-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 8px 0;
}

.adm-day-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #faf9f8;
    border: 1px solid #d2d0ce;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.adm-day-checkbox:hover {
    border-color: var(--adm-blue);
}

.adm-day-checkbox input:checked + span {
    color: var(--adm-blue);
    font-weight: 700;
}

/* Mensajes de Alerta */
.adm-alert {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.adm-alert-success { background: #dff6dd; color: #107c41; border: 1px solid #a7e3a5; }
.adm-alert-danger { background: #fde7e9; color: #a80000; border: 1px solid #f8b8bc; }

/* Responsive */
@media (max-width: 768px) {
    body { flex-direction: column; }
    .adm-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--adm-border); }
    .adm-content { padding: 16px; }
}
