/* ==========================================================================
   1. CONFIGURAÇÕES GERAIS E LAYOUT BASE
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'IBM Plex Sans', 'Segoe UI', sans-serif;
}

body {
    display: flex;
    width: 100vw;
    height: 100vh;
    background-color: #f4f5f7;
    color: #3f3e3e;
    overflow: hidden;
}

/* Menu Lateral Oficial iFood */
aside {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid #e8e9eb;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    flex-shrink: 0;
    height: 100vh;
}

aside .brand {
    padding: 0 24px 20px 24px;
    font-size: 20px;
    font-weight: 700;
    color: #000;
}

aside .brand span {
    color: #ea1d2c;
    font-weight: 800;
}

aside .nav-link {
    padding: 12px 24px;
    color: #585757;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

aside .nav-link:hover {
    background: #f8f9fa;
    color: #ea1d2c;
}

aside .nav-link.active {
    background: #fee2e2;
    color: #ea1d2c;
    border-right: 4px solid #ea1d2c;
}

/* Área de Conteúdo Principal à Direita */
main {
    flex-grow: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f4f5f7;
}

/* Cabeçalho superior padrão iFood */
.top-bar {
    background: #ffffff;
    padding: 20px 25px;
    border-bottom: 1px solid #e8e9eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    width: 100%;
}

.top-bar h1 {
    font-size: 22px;
    font-weight: 600;
    color: #1f2937;
}

/* Rolagem interna independente por tela ativa */
#viewPedidos, #viewCardapio {
    flex-grow: 1;
    height: calc(100vh - 80px);
    overflow-y: auto;
    padding: 25px;
}

/* Botões Padrão iFood */
.btn-primary, .btn-secondary, .btn-save, .btn-cancel {
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: filter 0.2s;
}

.btn-primary, .btn-save { background: #ea1d2c; color: white; }
.btn-secondary { background: #344154; color: white; }
.btn-cancel { background: #e2e8f0; color: #334155; }
.btn-primary:hover, .btn-secondary:hover, .btn-save:hover { filter: brightness(0.9); }

/* Status da Loja */
.status-loja {
    font-weight: 700;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 20px;
}
.status-loja.aberto { background: #dcfce7; color: #16a34a; }

/* ==========================================================================
   2. TELA 1: GESTOR DE PEDIDOS (KANBAN)
   ========================================================================== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 25px;
    width: 100%;
}

.metric-box {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e8e9eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.metric-label { font-size: 13px; color: #6b7280; font-weight: 600; }
.metric-box h3 { font-size: 24px; font-weight: 700; color: #1f2937; margin-top: 4px; }
.txt-alert { color: #ea1d2c !important; }

.kanban-container {
    display: flex;
    gap: 20px;
    height: calc(100vh - 270px);
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 10px;
    width: 100%;
}

.kanban-column {
    flex: 1;
    min-width: 320px;
    background: #eef0f3;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    padding: 15px;
    border: 1px solid #e2e8f0;
    height: 100%;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid #cbd5e1;
    padding-bottom: 8px;
    flex-shrink: 0;
}

.column-header h2 { font-size: 15px; font-weight: 700; color: #475569; }
.badge { background: #cbd5e1; color: #334155; font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 12px; }

.cards-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ==========================================================================
   3. TELA 2: CARDÁPIO DIGITAL (GRADE HORIZONTAL)
   ========================================================================== */
.toolbar {
    margin-bottom: 25px;
    width: 100%;
}

.search-box input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: white;
}
.search-box input:focus { border-color: #ea1d2c; }

.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.filter-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: #475569;
    transition: all 0.2s;
}
.filter-btn:hover { background: #f1f5f9; }
.filter-btn.active { background: #ea1d2c; color: white; border-color: #ea1d2c; }

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 20px;
    width: 100%;
}

.card-produto-item:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1 !important;
}

/* ==========================================================================
   4. MODAIS E ESTRUTURAS DE FORMULÁRIO
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white; padding: 25px; border-radius: 12px;
    width: 430px; display: flex; flex-direction: column; gap: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.modal-header {
    display: flex; justify-content: space-between; align-items: center;
}

.modal-header h2 { font-size: 18px; font-weight: 600; }
.btn-icon { background: none; border: none; font-size: 16px; cursor: pointer; color: #64748b; }

.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 12px; font-weight: 700; color: #475569; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 6px; outline: none; background: white;
}
.form-group textarea { resize: none; }
.modal-actions { display: flex; gap: 10px; margin-top: 10px; }
.modal-actions button { flex: 1; padding: 10px; }
