:root {
    --navy: #0f2744;
    --navy-2: #16375e;
    --accent: #e07a14;
    --primary: #1b4f86;
    --bg-soft: #f3f5f8;
}
html { scrollbar-gutter: stable; }
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-soft);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: #1c2330;
    overflow-x: hidden;
}
main { flex: 1; }
.app-nav { background: linear-gradient(135deg, var(--navy), var(--navy-2)); box-shadow: 0 4px 18px rgba(15,39,68,.25); }
.app-nav .nav-link { color: rgba(255,255,255,.82) !important; }
.app-nav .nav-link.active, .app-nav .nav-link:hover { color: #fff !important; }
.brand-logo { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; background: #fff; padding: 2px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text small { font-size: .68rem; font-weight: 400; opacity: .75; }
.navbar-brand { color: #fff !important; }
.app-footer { background: #fff; border-top: 1px solid #e6ebf0; padding: 16px 0; color: #7a8594; }
.card { border: none; border-radius: 14px; box-shadow: 0 8px 24px rgba(15,39,68,.06); }
.card-header { background: #fff; border-bottom: 1px solid #eef1f4; border-radius: 14px 14px 0 0 !important; font-weight: 600; }
.btn { border-radius: 9px; font-weight: 500; }
.btn-primary { background: linear-gradient(135deg, var(--navy-2), var(--navy)); border: none; }
.btn-primary:hover { background: var(--navy); }
.btn-success { background: linear-gradient(135deg, #198754, #146c43); border: none; }
.btn-accent { background: var(--accent); color: #fff; border: none; }
.btn-accent:hover { background: #c86a10; color: #fff; }
.btn-whatsapp { background: linear-gradient(135deg, #25D366, #128C7E); border: none; color: #fff; }
.btn-whatsapp:hover { background: #128C7E; color: #fff; }
.table th { font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: #6c757d; border-top: none; }
.item-row { background: #fff; border-radius: 10px; padding: 12px; margin-bottom: 10px; border: 1px solid #e6ebf0; }
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #0f2744 0%, #1b4f86 55%, #e07a14 160%); }
.login-card { width: 100%; max-width: 420px; border-radius: 18px; overflow: hidden; }
.login-header { background: #0f2744; color: #fff; padding: 2rem 1.5rem 1.5rem; text-align: center; }
.login-logo { max-height: 72px; max-width: 180px; background: #fff; border-radius: 12px; padding: 8px; }
.stat-card { border-left: 4px solid var(--primary); }
.form-control, .form-select { border-radius: 8px; border: 1px solid #d9e0e8; padding: .6rem .9rem; }
.form-control:focus, .form-select:focus { border-color: var(--navy-2); box-shadow: 0 0 0 .2rem rgba(15,39,68,.12); }
.total-box { background: linear-gradient(135deg, #f6f8fb, #eef2f6); border-radius: 12px; padding: 1rem 1.25rem; }
.empty-state { text-align: center; padding: 3rem 1rem; color: #6c757d; }
.empty-state i { font-size: 3.2rem; opacity: .35; }
.status-badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: .28em .7em; border-radius: 999px; }
.status-rascunho { background: #fff3cd; color: #7a5b00; }
.status-aberto { background: #dbeafe; color: #1e40af; }
.status-enviado { background: #e0f2fe; color: #075985; }
.status-aprovado { background: #d1fae5; color: #065f46; }
.status-recusado { background: #fee2e2; color: #991b1b; }
.status-expirado { background: #e5e7eb; color: #374151; }
.status-cancelado { background: #111827; color: #f9fafb; }
.row-draft { background: #fffbeb; }
.save-status { display: flex; align-items: center; gap: 8px; color: #667085; font-size: .9rem; }
.save-status .dot { width: 8px; height: 8px; border-radius: 50%; background: #98a2b3; }
.save-status.saving .dot { background: #e07a14; animation: pulse 1s infinite; }
.save-status.saved .dot { background: #198754; }
.save-status.error .dot, .save-status.offline .dot { background: #dc3545; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }
.alert-soft { background: #fff7ed; border: 1px solid #fed7aa; color: #7c2d12; border-radius: 12px; padding: .85rem 1rem; }
.suggest-box { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid #e6ebf0; border-radius: 10px; box-shadow: 0 12px 30px rgba(15,39,68,.12); max-height: 240px; overflow: auto; }
.suggest-item { display: flex; flex-direction: column; width: 100%; text-align: left; border: 0; background: #fff; padding: .65rem .85rem; border-bottom: 1px solid #f1f4f8; }
.suggest-item span { font-size: .8rem; color: #667085; }
.suggest-item:hover { background: #f4f7fb; }
@media print { .no-print { display: none !important; } body { background: #fff; } }

.login-wrap { width: 100%; max-width: 420px; padding: 16px; }
.login-install {
    margin-top: 16px;
    background: #fff;
    color: #1c2330;
    border-radius: 16px;
    padding: 16px 18px;
}
.login-install-icon {
    width: 42px; height: 42px; border-radius: 12px;
    background: #0f2744; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; flex-shrink: 0;
}
.install-banner {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 14px;
    padding: 14px 16px;
}

[data-install-ui] { display: none !important; }
[data-install-ui].is-visible { display: block !important; }
.install-banner[data-install-ui].is-visible,
.login-install[data-install-ui].is-visible {
    display: flex !important;
}
#install-app-item[data-install-ui].is-visible { display: block !important; }
@media (display-mode: standalone) {
    [data-install-ui] { display: none !important; }
}
