/*
 * SysConveniência - folha de estilos central
 * Todas as telas usam este arquivo. As seções estão agrupadas por finalidade
 * para facilitar alterações de identidade visual, layout e responsividade.
 */

/* 1. Variáveis e normalização */
:root {
    --primary: #153448;
    --primary-2: #1f536f;
    --accent: #f4a261;
    --success: #278664;
    --warning: #d89216;
    --danger: #c94b4b;
    --info: #3278a8;
    --surface: #ffffff;
    --surface-2: #f3f6f8;
    --line: #dce3e8;
    --text: #20303a;
    --muted: #6d7b84;
    --shadow: 0 10px 30px rgba(26, 48, 61, .09);
    --radius: 14px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--surface-2); }
body { margin: 0; color: var(--text); background: var(--surface-2); font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: 15px; }
a { color: var(--primary-2); text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }

/* 2. Estrutura principal */
.app-shell { min-height: 100vh; display: flex; }
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: 250px; overflow-y: auto; color: #fff; background: linear-gradient(180deg, var(--primary), #0f2938); transition: transform .25s ease; }
.brand { min-height: 82px; padding: 18px; display: flex; align-items: center; gap: 12px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.11); }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--primary); background: var(--accent); font-weight: 800; }
.brand strong, .brand small, .user-menu strong, .user-menu small { display: block; }
.brand small { margin-top: 3px; color: rgba(255,255,255,.68); font-size: 11px; }
.nav-menu { padding: 15px 10px; }
.nav-menu a { display: block; margin: 3px 0; padding: 11px 14px; color: rgba(255,255,255,.79); border-radius: 9px; }
.nav-menu a:hover, .nav-menu a.active { color: #fff; background: rgba(255,255,255,.12); }
.main { width: calc(100% - 250px); min-height: 100vh; margin-left: 250px; display: flex; flex-direction: column; }
.topbar { min-height: 82px; padding: 14px 26px; display: flex; align-items: center; gap: 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar h1 { margin-bottom: 3px; font-size: 22px; }
.topbar p { margin: 0; color: var(--muted); font-size: 12px; }
.user-menu { margin-left: auto; display: flex; align-items: center; gap: 14px; text-align: right; }
.user-menu small { color: var(--muted); font-size: 11px; }
.content { width: 100%; max-width: 1600px; margin: 0 auto; padding: 24px; flex: 1; }
.footer { padding: 18px 24px; color: var(--muted); text-align: center; font-size: 12px; }
.menu-toggle { display: none; }

/* 3. Componentes de conteúdo */
.page-actions { margin-bottom: 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.page-actions h2 { margin: 0; font-size: 19px; }
.card { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card-header { margin: -20px -20px 18px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.card-header h2, .card-header h3 { margin: 0; font-size: 17px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { padding: 18px; color: #fff; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--primary-2); }
.stat-card.success { background: var(--success); }
.stat-card.warning { background: var(--warning); }
.stat-card.danger { background: var(--danger); }
.stat-card.info { background: var(--info); }
.stat-card small { display: block; margin-bottom: 8px; opacity: .82; }
.stat-card strong { display: block; font-size: 25px; }
.stat-card span { display: block; margin-top: 7px; font-size: 12px; opacity: .8; }

/* 4. Formulários */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 15px; }
.field { grid-column: span 12; }
.field.col-2 { grid-column: span 2; }
.field.col-3 { grid-column: span 3; }
.field.col-4 { grid-column: span 4; }
.field.col-6 { grid-column: span 6; }
.field.col-8 { grid-column: span 8; }
.field label { display: block; margin-bottom: 6px; font-weight: 650; font-size: 13px; }
.field small { display: block; margin-top: 5px; color: var(--muted); }
.form-control { width: 100%; min-height: 42px; padding: 9px 11px; color: var(--text); background: #fff; border: 1px solid #cbd6dc; border-radius: 8px; outline: none; transition: border .2s, box-shadow .2s; }
.form-control:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(31,83,111,.13); }
textarea.form-control { min-height: 90px; resize: vertical; }
.checkbox { min-height: 42px; display: flex; align-items: center; gap: 8px; }
.form-actions { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; }
.filters { margin-bottom: 18px; padding: 14px; display: flex; flex-wrap: wrap; gap: 10px; background: #edf2f5; border-radius: 10px; }
.filters .form-control { width: auto; min-width: 180px; }
.payment-shortcuts { margin: 16px 0 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.payment-summary { margin-top: 14px; padding: 12px; color: var(--text); background: #edf2f5; border-radius: 8px; }
.payment-summary strong { color: var(--primary-2); }
.pdv-search { display: grid; grid-template-columns: minmax(360px, 1fr) auto; }
.pdv-search .form-control { width: 100%; min-width: 0; font-size: 17px; }
.quantity-actions { display: flex; align-items: center; gap: 7px; }
.quantity-actions strong { min-width: 48px; text-align: center; }
.tabs { margin-bottom: 18px; display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 12px 18px; color: var(--muted); border: 1px solid transparent; border-bottom: 0; border-radius: 9px 9px 0 0; font-weight: 700; }
.tabs a:hover { color: var(--primary-2); background: #edf2f5; }
.tabs a.active { margin-bottom: -1px; color: var(--primary); background: var(--surface); border-color: var(--line); }

/* 5. Botões, avisos e etiquetas */
.button { min-height: 40px; padding: 9px 15px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: #fff; background: var(--primary-2); border: 0; border-radius: 8px; cursor: pointer; font-weight: 650; }
.button:hover { filter: brightness(.94); }
.button-success { background: var(--success); }
.button-warning { background: var(--warning); }
.button-danger { background: var(--danger); }
.button-light { color: var(--text); background: #edf2f5; }
.button-sm { min-height: 32px; padding: 6px 10px; font-size: 12px; }
.icon-button { width: 40px; height: 40px; padding: 0; border: 0; border-radius: 8px; cursor: pointer; background: #edf2f5; }
.alert { margin-bottom: 16px; padding: 13px 15px; border-radius: 9px; transition: opacity .4s; }
.alert-success { color: #155c43; background: #dff3eb; }
.alert-danger { color: #8e2929; background: #fde4e4; }
.alert-warning { color: #7d570b; background: #fff0c9; }
.alert-info { color: #205a7e; background: #dceffa; }
.alert.fade { opacity: .25; }
.badge { padding: 4px 8px; display: inline-block; border-radius: 999px; color: #fff; background: var(--muted); font-size: 11px; font-weight: 700; }
.badge-success { background: var(--success); }
.badge-warning { background: var(--warning); }
.badge-danger { background: var(--danger); }
.badge-info { background: var(--info); }

/* 6. Tabelas */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.table th { color: var(--muted); background: #f7f9fa; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.table tbody tr:hover { background: #fafcfd; }
.table-actions { display: flex; gap: 6px; }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.inline-form { display: inline; margin: 0; }
.empty-state { padding: 50px 20px; text-align: center; color: var(--muted); }
.w-full { width: 100%; }
.mt-12 { margin-top: 12px; }
.mt-15 { margin-top: 15px; }
.mt-18 { margin-top: 18px; }
.mb-8 { margin-bottom: 8px; }
.my-15-8 { margin: 15px 0 8px; }
.m-18-0-0 { margin: 18px 0 0; }
.font-sm { font-size: 12px; }
.font-xl { font-size: 28px; }

/* 7. PDV e mesas */
.pdv-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(340px, .8fr); gap: 18px; }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-height: 62vh; overflow-y: auto; }
.product-button { min-height: 105px; padding: 12px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.product-button:hover { border-color: var(--primary-2); box-shadow: var(--shadow); }
.product-button strong, .product-button small { display: block; }
.product-button small { margin-top: 6px; color: var(--muted); }
.cart-total { margin: 16px 0; padding: 15px; display: flex; justify-content: space-between; background: var(--primary); color: #fff; border-radius: 10px; font-size: 22px; }
.table-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.table-card { padding: 17px; color: #fff; border-radius: var(--radius); background: var(--success); box-shadow: var(--shadow); }
.table-card.ocupada { color: var(--text); background: #f5cb65; }
.table-card.aguardando { background: var(--info); }
.table-card.inativa { background: #86949c; }
.table-card h3 { margin-bottom: 6px; }
.table-card .table-meta { min-height: 54px; margin: 12px 0; font-size: 12px; line-height: 1.6; }
.table-card .button { background: rgba(255,255,255,.93); color: var(--text); }

/* 8. Login e impressão */
.login-page { min-height: 100vh; padding: 20px; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), #27627e); }
.login-card { width: min(430px, 100%); padding: 30px; background: #fff; border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.login-logo { margin-bottom: 25px; text-align: center; }
.login-logo .brand-mark { margin: 0 auto 12px; width: 58px; height: 58px; }
.login-logo h1 { margin-bottom: 4px; }
.login-logo p { color: var(--muted); font-size: 13px; }
.receipt { width: 80mm; margin: 0 auto; padding: 10px; color: #000; background: #fff; font-family: "Courier New", monospace; font-size: 12px; }
.receipt h1, .receipt p { text-align: center; }
.receipt hr { border: 0; border-top: 1px dashed #000; }

/* 9. Responsividade */
@media (max-width: 1100px) {
    .stats-grid, .table-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pdv-layout { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
    .sidebar { transform: translateX(-100%); box-shadow: 15px 0 35px rgba(0,0,0,.2); }
    .sidebar.open { transform: translateX(0); }
    .main { width: 100%; margin-left: 0; }
    .menu-toggle { display: inline-grid; place-items: center; flex: 0 0 auto; }
    .topbar { padding: 12px 15px; }
    .topbar p, .user-menu span { display: none; }
    .content { padding: 15px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .field.col-2, .field.col-3, .field.col-4, .field.col-6, .field.col-8 { grid-column: span 12; }
}

@media (max-width: 520px) {
    .stats-grid, .table-grid, .product-grid { grid-template-columns: 1fr; }
    .filters { display: grid; }
    .filters .form-control, .filters .button { width: 100%; }
    .page-actions { align-items: stretch; flex-direction: column; }
    .page-actions .button { width: 100%; }
    .pdv-search { grid-template-columns: 1fr; }
}

@media print {
    body { background: #fff; }
    .sidebar, .topbar, .footer, .no-print, .page-actions { display: none !important; }
    .main { width: 100%; margin: 0; }
    .content { padding: 0; }
    .card { border: 0; box-shadow: none; }
}
.login-page{
    margin:0;
    min-height:100vh;
    background:linear-gradient(135deg,#0b2447,#19376d);
    font-family:Arial,Helvetica,sans-serif;
}

.login-wrapper{
    display:flex;
    min-height:100vh;
}

.login-left{
    width:50%;
    color:#fff;
    padding:60px;
    display:flex;
    flex-direction:column;
    justify-content:center;
}

.logo-circle{
    width:100px;
    height:100px;
    border-radius:50%;
    background:#fff;
    color:#19376d;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:42px;
    font-weight:bold;
    margin-bottom:20px;
}

.brand-area h1{
    font-size:48px;
    margin:0;
}

.brand-area p{
    font-size:20px;
    opacity:.9;
}

.features{
    margin-top:40px;
}

.feature-item{
    padding:12px 0;
    font-size:18px;
}

.login-right{
    width:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:40px;
}

.login-card{
    width:100%;
    max-width:450px;
    background:rgba(255,255,255,.95);
    border-radius:24px;
    padding:40px;
    box-shadow:0 20px 60px rgba(0,0,0,.25);
}

.login-card h2{
    text-align:center;
    margin-bottom:30px;
}

.input-group{
    margin-bottom:18px;
}

.input-group label{
    display:block;
    margin-bottom:8px;
    font-weight:600;
}

.form-control{
    width:100%;
    padding:14px;
    border-radius:10px;
    border:1px solid #ddd;
}

.password-box{
    position:relative;
}

.toggle-password{
    position:absolute;
    right:10px;
    top:8px;
    border:none;
    background:none;
    cursor:pointer;
    font-size:20px;
}

.button-login{
    width:100%;
    background:#19376d;
    color:#fff;
    border:none;
    border-radius:10px;
    padding:14px;
    font-size:16px;
    font-weight:700;
    cursor:pointer;
}

.button-login:hover{
    background:#0b2447;
}

.login-footer{
    margin-top:20px;
    text-align:center;
    color:#777;
}

@media(max-width:900px){

    .login-left{
        display:none;
    }

    .login-right{
        width:100%;
    }
}