/* ============================================================
   SISTEMA CONSULTAS DRA. ISABELA PILLON
   Paleta: dorado #C4A747, blanco #FFFFFF, gris oscuro #2D2D2D
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=Playfair+Display:wght@400;600&display=swap');

:root {
    --gold:        #C4A747;
    --gold-light:  #E8D89A;
    --gold-dark:   #9A7F2E;
    --dark:        #2D2D2D;
    --mid:         #5A5A5A;
    --light:       #F7F5F0;
    --white:       #FFFFFF;
    --border:      #E0D9C8;
    --success:     #4A7C59;
    --error:       #C0392B;
    --warning:     #E67E22;
    --shadow:      0 2px 12px rgba(0,0,0,0.08);
    --radius:      8px;
}

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

body {
    font-family: 'Lato', sans-serif;
    background: var(--light);
    color: var(--dark);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.6;
}

/* ── NAVBAR ── */
.navbar {
    background: var(--dark);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.navbar-brand img { height: 32px; }
.navbar-brand span {
    font-family: 'Playfair Display', serif;
    color: var(--gold);
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}
.navbar-menu { display: flex; align-items: center; gap: 8px; }
.navbar-menu a {
    color: #ccc;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: all 0.2s;
}
.navbar-menu a:hover, .navbar-menu a.active {
    background: var(--gold);
    color: var(--dark);
    font-weight: 700;
}
.navbar-user {
    color: #aaa;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 12px;
}
.navbar-user strong { color: var(--gold-light); }
.btn-logout {
    background: transparent;
    border: 1px solid #555;
    color: #aaa;
    padding: 4px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.btn-logout:hover { border-color: var(--gold); color: var(--gold); }

/* ── LAYOUT ── */
.container { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }
.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.7rem;
    color: var(--dark);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gold);
    display: flex;
    align-items: center;
    gap: 10px;
}
.page-title span { font-size: 1.4rem; }

/* ── CARDS ── */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── BOTONES ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-primary   { background: var(--gold); color: var(--dark); }
.btn-primary:hover { background: var(--gold-dark); color: var(--white); }
.btn-dark      { background: var(--dark); color: var(--white); }
.btn-dark:hover { background: #111; }
.btn-outline   { background: transparent; border: 1.5px solid var(--gold); color: var(--gold-dark); }
.btn-outline:hover { background: var(--gold); color: var(--dark); }
.btn-danger    { background: var(--error); color: var(--white); }
.btn-danger:hover { background: #a93226; }
.btn-success   { background: var(--success); color: var(--white); }
.btn-success:hover { background: #3a6347; }
.btn-sm        { padding: 5px 12px; font-size: 0.82rem; }
.btn-lg        { padding: 12px 28px; font-size: 1rem; }
.btn:disabled  { opacity: 0.5; cursor: not-allowed; }

/* ── FORMULARIOS ── */
.form-group { margin-bottom: 1.2rem; }
.form-label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.4rem;
    font-size: 0.88rem;
    color: var(--mid);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
    color: var(--dark);
    background: var(--white);
    transition: border-color 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(196,167,71,0.15);
}
textarea.form-control { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ── TABLA ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--dark); }
thead th {
    padding: 10px 14px;
    text-align: left;
    color: var(--gold-light);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.15s; }
tbody tr:hover { background: #faf8f2; }
tbody td { padding: 10px 14px; font-size: 0.92rem; vertical-align: middle; }

/* ── BADGE ── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.badge-gold    { background: #fdf3d0; color: var(--gold-dark); }
.badge-green   { background: #d4edda; color: var(--success); }
.badge-gray    { background: #eee; color: #666; }
.badge-red     { background: #fde8e6; color: var(--error); }

/* ── ALERTS ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.92rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.alert-success { background: #d4edda; color: #155724; border-left: 4px solid var(--success); }
.alert-error   { background: #fde8e6; color: #721c24; border-left: 4px solid var(--error); }
.alert-info    { background: #fdf3d0; color: #7d6008; border-left: 4px solid var(--gold); }

/* ── LOGIN PAGE ── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--dark) 0%, #1a1a1a 100%);
}
.login-card {
    background: var(--white);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    text-align: center;
}
.login-logo { margin-bottom: 0.5rem; }
.login-logo img { height: 60px; }
.login-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--dark);
    margin-bottom: 0.3rem;
}
.login-subtitle { color: var(--mid); font-size: 0.88rem; margin-bottom: 2rem; }

/* ── GRABACIÓN ── */
.recorder-box {
    text-align: center;
    padding: 2rem;
    background: var(--dark);
    border-radius: 12px;
    margin: 1.5rem 0;
}
.record-btn {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 2rem;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}
.record-btn.idle     { background: var(--gold); color: var(--dark); }
.record-btn.recording { background: var(--error); color: var(--white); animation: pulse 1.5s infinite; }
.record-btn.processing { background: #555; color: #aaa; cursor: not-allowed; }

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(192,57,43,0.4); }
    70%  { box-shadow: 0 0 0 16px rgba(192,57,43,0); }
    100% { box-shadow: 0 0 0 0 rgba(192,57,43,0); }
}

.record-status {
    color: #ccc;
    font-size: 0.95rem;
    min-height: 24px;
}
.record-timer {
    color: var(--gold);
    font-size: 1.4rem;
    font-weight: 700;
    font-family: monospace;
    margin: 8px 0;
}

/* ── SECCIONES RESUMEN ── */
.seccion-resumen {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.2rem;
    overflow: hidden;
}
.seccion-header {
    background: var(--light);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}
.seccion-titulo {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}
.seccion-body { padding: 16px; }
.seccion-body textarea {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    padding: 10px;
    font-family: 'Lato', sans-serif;
    font-size: 0.93rem;
    line-height: 1.6;
    color: var(--dark);
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s;
}
.seccion-body textarea:focus {
    outline: none;
    border-color: var(--gold);
}
.seccion-body textarea[readonly] {
    background: #fafafa;
    color: #888;
}

/* ── SEPARADOR INFORME ── */
.informe-separator {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0 1.5rem;
}
.informe-separator::before,
.informe-separator::after {
    content: '';
    flex: 1;
    height: 2px;
    background: var(--gold);
}
.informe-separator span {
    font-family: 'Playfair Display', serif;
    color: var(--gold-dark);
    font-size: 0.95rem;
    white-space: nowrap;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ── INFORME CAMPOS ── */
.informe-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
.informe-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--mid);
    margin-bottom: 4px;
}
.informe-field input,
.informe-field textarea {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    font-family: 'Lato', sans-serif;
    font-size: 0.92rem;
    color: var(--dark);
    transition: border-color 0.2s;
}
.informe-field input:focus,
.informe-field textarea:focus {
    outline: none;
    border-color: var(--gold);
}
.informe-field.readonly input,
.informe-field.readonly textarea {
    background: #f5f5f5;
    color: #777;
}
.informe-field.full { grid-column: 1 / -1; }

/* ── PROCESSING OVERLAY ── */
.processing-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
}
.processing-overlay.show { display: flex; }
.processing-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(196,167,71,0.3);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.processing-text { color: var(--white); font-size: 1rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── UTILIDADES ── */
.flex         { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-end     { display: flex; justify-content: flex-end; gap: 8px; }
.gap-8        { gap: 8px; }
.gap-12       { gap: 12px; }
.mt-1         { margin-top: 0.5rem; }
.mt-2         { margin-top: 1rem; }
.mt-3         { margin-top: 1.5rem; }
.mb-1         { margin-bottom: 0.5rem; }
.mb-2         { margin-bottom: 1rem; }
.text-gold    { color: var(--gold); }
.text-mid     { color: var(--mid); }
.text-sm      { font-size: 0.85rem; }
.text-center  { text-align: center; }
.w-full       { width: 100%; }

@media (max-width: 700px) {
    .form-row, .informe-grid { grid-template-columns: 1fr; }
    .navbar-menu { display: none; }
    .container { padding: 1rem; }
}
