/* ============================================================
   EXTO — Sistema de Recepção
   Identidade visual: #B31C1C | #4A4A4A | #F5F5F5
   ============================================================ */

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

:root {
    --red:        #B31C1C;
    --red-dark:   #8f1616;
    --gray:       #4A4A4A;
    --gray-lt:    #F5F5F5;
    --gray-md:    #E0E0E0;
    --white:      #FFFFFF;
    --black:      #1A1A1A;
    --sidebar-w:  220px;
    --success:    #2e7d32;
    --warning:    #e65100;
    --info:       #1565c0;
    --radius:     6px;
    --shadow:     0 2px 8px rgba(0,0,0,.10);
}

body {
    font-family: 'Barlow', sans-serif;
    background: var(--gray-lt);
    color: var(--gray);
    min-height: 100vh;
}

/* ── LAYOUT ─────────────────────────────────────────── */
.layout {
    min-height: 100vh;
}

/* ── SIDEBAR ────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--black);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    box-shadow: 2px 0 12px rgba(0,0,0,.25);
}

.sidebar-logo {
    padding: 28px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

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

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: #aaa;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    transition: background .15s, color .15s;
}

.sidebar-link:hover {
    background: rgba(255,255,255,.07);
    color: var(--white);
}

.sidebar-link.active {
    background: var(--red);
    color: var(--white);
}

.sidebar-link svg { flex-shrink: 0; opacity: .8; }
.sidebar-link.active svg { opacity: 1; }

/* Sidebar footer — usuário + logout */
.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    background: var(--red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--white);
    flex-shrink: 0;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-cargo {
    font-size: 11px;
    color: #777;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout {
    color: #666;
    display: flex;
    align-items: center;
    padding: 6px;
    border-radius: var(--radius);
    transition: color .15s, background .15s;
    flex-shrink: 0;
}

.sidebar-logout:hover { color: var(--red); background: rgba(179,28,28,.1); }

/* ── MAIN CONTENT ───────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-w);
    padding: 32px 40px;
    min-height: 100vh;
}

.content-inner {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

/* ── FOOTER ─────────────────────────────────────────── */
.footer {
    margin-left: var(--sidebar-w);
    background: var(--black);
    color: #666;
    font-size: 12px;
    padding: 14px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-site { color: var(--red); }

/* ── PAGE HEADER ────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--red);
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray);
}

.page-title span { color: var(--red); }

/* ── CARDS ──────────────────────────────────────────── */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-md);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background: var(--red);
    border-radius: 2px;
}

/* ── GRID ───────────────────────────────────────────── */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── BUTTONS ────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: background .15s, transform .1s;
}

.btn:active { transform: scale(.98); }

.btn-primary   { background: var(--red); color: var(--white); }
.btn-primary:hover   { background: var(--red-dark); }

.btn-secondary { background: var(--gray-md); color: var(--gray); }
.btn-secondary:hover { background: #ccc; }

.btn-success   { background: var(--success); color: var(--white); }
.btn-success:hover   { background: #1b5e20; }

.btn-danger    { background: #c62828; color: var(--white); }
.btn-danger:hover    { background: #b71c1c; }

.btn-outline {
    background: transparent;
    border: 2px solid var(--red);
    color: var(--red);
}
.btn-outline:hover { background: var(--red); color: var(--white); }

.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ── FORMULÁRIOS ────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    color: var(--gray);
    background: var(--white);
    border: 1.5px solid var(--gray-md);
    border-radius: var(--radius);
    transition: border-color .15s;
    outline: none;
}

.form-control:focus { border-color: var(--red); }
.form-control::placeholder { color: #aaa; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-row   { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.form-row-3 { display: grid; gap: 16px; grid-template-columns: 1fr 1fr 1fr; }

/* ── TABELAS ────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

thead th {
    background: var(--black);
    color: var(--white);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .5px;
    text-transform: uppercase;
}

tbody tr { border-bottom: 1px solid var(--gray-md); }
tbody tr:hover { background: #fafafa; }
tbody td { padding: 12px 16px; }

/* ── BADGES ─────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.badge-success { background: #e8f5e9; color: var(--success); }
.badge-danger  { background: #ffebee; color: #c62828; }
.badge-warning { background: #fff3e0; color: var(--warning); }
.badge-info    { background: #e3f2fd; color: var(--info); }
.badge-gray    { background: var(--gray-md); color: var(--gray); }

/* ── ALERTAS ────────────────────────────────────────── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid;
}

.alert-success { background: #e8f5e9; border-color: var(--success); color: var(--success); }
.alert-danger  { background: #ffebee; border-color: var(--red); color: var(--red); }
.alert-info    { background: #e3f2fd; border-color: var(--info); color: var(--info); }

/* ── SALAS ──────────────────────────────────────────── */
.sala-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    border-top: 4px solid var(--gray-md);
    transition: border-color .2s, box-shadow .2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.sala-card:hover { border-color: var(--red); box-shadow: 0 4px 16px rgba(179,28,28,.15); }
.sala-card .sala-nome { font-size: 16px; font-weight: 700; color: var(--gray); margin-bottom: 6px; }
.sala-card .sala-info { font-size: 13px; color: #888; }
.sala-card .sala-status { margin-top: 12px; }

/* Agenda de horários */
.agenda-grid { display: grid; gap: 4px; }

.slot {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    border: 1px solid var(--gray-md);
}

.slot-time { font-weight: 600; min-width: 100px; color: var(--gray); }
.slot-livre   { background: #f1fff1; border-color: #c8e6c9; }
.slot-ocupado { background: #fff0f0; border-color: #ffcdd2; }
.slot-ocupado .slot-info { color: var(--red); font-weight: 600; }

/* ── STAT CARDS ─────────────────────────────────────── */
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 24px;
    border-left: 5px solid var(--red);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: #888; }
.stat-value { font-size: 32px; font-weight: 700; color: var(--gray); }
.stat-sub   { font-size: 12px; color: #aaa; }

/* ── LOGIN ──────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--black);
}

.login-box {
    background: var(--white);
    border-radius: 10px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 40px rgba(0,0,0,.4);
}

.login-logo {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo .logo-sub {
    display: block;
    font-size: 10px;
    letter-spacing: 5px;
    color: #aaa;
    text-transform: uppercase;
    margin-top: 10px;
}

.login-logo .logo-divider {
    width: 40px;
    height: 2px;
    background: var(--red);
    margin: 12px auto 0;
}

/* ── UTILS ──────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8  { gap: 8px; }
.gap-16 { gap: 16px; }
.flex-1 { flex: 1; }

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #aaa;
    font-size: 14px;
}
