/* ============================================================
   style.css — Sistema de Gerenciamento de Consultório
   ============================================================ */

/* Reset e base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

/* Container principal */
.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================================================
   HEADER & NAVEGAÇÃO
   ============================================================ */
.header {
    background: #fff;
    border-radius: 15px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
}

.header h1 {
    color: #333;
    font-size: 22px;
    margin-bottom: 2px;
}

.nav-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 9px 18px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background .25s, transform .15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.nav-btn:hover  { background: #764ba2; transform: translateY(-1px); }
.nav-btn.active { background: #764ba2; box-shadow: 0 2px 8px rgba(118,75,162,.4); }

/* ============================================================
   CARDS E LAYOUT
   ============================================================ */
.card {
    background: #fff;
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
}

.card h2 {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
    display: flex;
    align-items: center;
    gap: 8px;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
    font-size: 13px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color .2s, box-shadow .2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,.15);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0 16px;
}

/* ============================================================
   BOTÕES
   ============================================================ */
button {
    background: #667eea;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background .25s, transform .15s;
    font-family: inherit;
}

button:hover { background: #764ba2; transform: translateY(-1px); }
button:active { transform: translateY(0); }

/* ============================================================
   BADGE de contagem
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #667eea;
    color: #fff;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
    min-width: 22px;
    margin-left: 6px;
}

/* ============================================================
   LISTA DE ITENS
   ============================================================ */
.list-item {
    background: #f8f9fa;
    padding: 12px 14px;
    margin-bottom: 8px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border-left: 3px solid transparent;
    transition: border-color .2s;
}

.list-item:hover { border-left-color: #667eea; }

/* ============================================================
   FILA DE ATENDIMENTO
   ============================================================ */
.queue-item {
    background: #f8f9fa;
    padding: 14px;
    margin-bottom: 8px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #667eea;
    transition: border-color .2s, background .2s;
}

.queue-item:first-child {
    border-left-color: #27ae60;
    background: #f0faf4;
}

.queue-info { flex: 1; }
.queue-name { font-weight: 600; color: #333; font-size: 15px; }
.queue-senha { color: #667eea; font-size: 12px; margin-top: 3px; }

.empty-msg { color: #aaa; font-size: 14px; padding: 10px 0; }

/* ============================================================
   BUSCA COM AUTOCOMPLETE
   ============================================================ */
.search-result-item {
    background: #f0f4ff;
    border: 1px solid #d0d9ff;
    border-radius: 7px;
    padding: 8px 12px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: background .15s;
    font-size: 14px;
}
.search-result-item:hover { background: #dce4ff; }

/* ============================================================
   PAINEL DO MÉDICO
   ============================================================ */
.doctor-panel { }

.current-call {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 28px;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(102,126,234,.4);
}

.current-call .call-number {
    font-size: 72px;
    font-weight: 900;
    letter-spacing: 4px;
    line-height: 1;
    margin: 14px 0;
    text-shadow: 0 2px 10px rgba(0,0,0,.2);
}

.call-btn {
    background: #27ae60;
    font-size: 16px;
    padding: 13px 24px;
    margin-top: 8px;
    width: 100%;
    border-radius: 10px;
}
.call-btn:hover { background: #219150; }

/* ============================================================
   MODAL
   ============================================================ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1000;
    animation: fadeIn .2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
    background: #fff;
    width: 90%;
    max-width: 460px;
    margin: 60px auto;
    padding: 28px;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.modal-content h3 { font-size: 18px; margin-bottom: 10px; }
.modal-content p  { color: #555; font-size: 15px; margin-bottom: 18px; line-height: 1.5; }

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 768px) {
    body { padding: 12px; }

    .main-content { grid-template-columns: 1fr; }

    .header h1 { font-size: 18px; }

    .nav-btn { padding: 8px 14px; font-size: 13px; }

    .current-call .call-number { font-size: 52px; }

    .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .list-item { flex-direction: column; align-items: flex-start; }
}
