/* ================================================
   LavanderiaGest - Sistema de Gestão
   Estilos Principais - Versão Responsiva
   ================================================ */

:root {
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --blue-50:  #eff6ff;
    --blue-100: #dbeafe;

    --teal-500: #14b8a6;
    --teal-600: #0d9488;
    --teal-50:  #f0fdfa;

    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50:  #f8fafc;

    --green-500: #22c55e;
    --green-50:  #f0fdf4;
    --green-100: #dcfce7;
    --green-600: #16a34a;

    --red-500:  #ef4444;
    --red-50:   #fef2f2;
    --red-100:  #fee2e2;
    --red-600:  #dc2626;

    --yellow-500: #eab308;
    --yellow-50:  #fefce8;
    --yellow-100: #fef9c3;

    --orange-500: #f97316;
    --orange-50:  #fff7ed;

    --sidebar-w: 256px;
    --topbar-h: 60px;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--slate-100);
    color: var(--slate-800);
    font-size: 14px;
    line-height: 1.5;
}

/* ---- SIDEBAR ---- */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--slate-900);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform .3s;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
}
.brand-icon {
    width: 40px; height: 40px;
    background: var(--teal-500);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: white;
    flex-shrink: 0;
}
.brand-name {
    display: block;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 15px; font-weight: 700;
    color: white; letter-spacing: -.3px;
}
.brand-sub { font-size: 11px; color: var(--slate-500); }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    -webkit-overflow-scrolling: touch;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.nav-section {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .08em;
    color: var(--slate-600);
    padding: 14px 18px 4px;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    color: var(--slate-400);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all .15s;
    margin: 1px 8px;
    border-radius: 8px;
    min-height: 44px;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: white; }
.nav-item.active { background: var(--teal-600); color: white; }
.nav-item i { width: 18px; text-align: center; font-size: 15px; flex-shrink: 0; }

/* Overlay para fechar sidebar no mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

.sidebar-footer {
    padding: 14px 18px;
    border-top: 1px solid rgba(255,255,255,.07);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.user-avatar {
    width: 34px; height: 34px;
    background: var(--slate-700);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--slate-400); font-size: 14px;
    flex-shrink: 0;
}
.user-name {
    font-size: 13px; font-weight: 600; color: white;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role { font-size: 11px; color: var(--slate-500); }
.btn-logout {
    margin-left: auto;
    color: var(--slate-500);
    text-decoration: none;
    font-size: 18px;
    transition: color .15s;
    padding: 6px;
    flex-shrink: 0;
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-logout:hover { color: var(--red-500); }

/* ---- MAIN ---- */
.main-wrapper {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex; flex-direction: column;
    transition: margin-left .3s;
}

.topbar {
    position: sticky; top: 0;
    height: var(--topbar-h);
    background: white;
    border-bottom: 1px solid var(--slate-200);
    display: flex; align-items: center;
    padding: 0 20px;
    gap: 12px;
    z-index: 50;
    box-shadow: var(--shadow);
}
.sidebar-toggle {
    background: none; border: none;
    font-size: 20px; color: var(--slate-500);
    cursor: pointer; padding: 6px;
    display: none;
    flex-shrink: 0;
    min-width: 36px; min-height: 36px;
    align-items: center; justify-content: center;
    border-radius: 6px;
    transition: background .15s;
}
.sidebar-toggle:hover { background: var(--slate-100); }
.topbar-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 15px; font-weight: 700;
    color: var(--slate-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}
.topbar-right { flex-shrink: 0; }
.topbar-date { font-size: 13px; color: var(--slate-500); white-space: nowrap; }

.content { padding: 20px; flex: 1; }

/* ---- CARDS ---- */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--slate-200);
}
.card-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--slate-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.card-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--slate-800);
}
.card-body { padding: 16px; }

/* ---- STAT CARDS ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--slate-200);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
}
.stat-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.stat-icon.blue { background: var(--blue-50); color: var(--blue-600); }
.stat-icon.teal { background: var(--teal-50); color: var(--teal-600); }
.stat-icon.green { background: var(--green-50); color: var(--green-600); }
.stat-icon.red { background: var(--red-50); color: var(--red-600); }
.stat-icon.yellow { background: var(--yellow-50); color: var(--yellow-500); }
.stat-icon.orange { background: var(--orange-50); color: var(--orange-500); }

.stat-value {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 20px; font-weight: 700;
    color: var(--slate-800);
    line-height: 1;
}
.stat-label { font-size: 12px; color: var(--slate-500); margin-top: 4px; }

/* ---- TABLE ---- */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 480px;
}
.data-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--slate-50);
    color: var(--slate-600);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--slate-200);
    white-space: nowrap;
}
.data-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--slate-100);
    color: var(--slate-700);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--slate-50); }

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
    min-height: 38px;
}
.btn-primary { background: var(--teal-500); color: white; }
.btn-primary:hover { background: var(--teal-600); }
.btn-blue { background: var(--blue-600); color: white; }
.btn-blue:hover { background: var(--blue-700); }
.btn-danger { background: var(--red-500); color: white; }
.btn-danger:hover { background: var(--red-600); }
.btn-secondary { background: var(--slate-200); color: var(--slate-700); }
.btn-secondary:hover { background: var(--slate-300); }
.btn-success { background: var(--green-500); color: white; }
.btn-success:hover { background: var(--green-600); }
.btn-sm { padding: 5px 10px; font-size: 12px; min-height: 32px; }
.btn-icon { padding: 7px; border-radius: 7px; min-height: 36px; min-width: 36px; justify-content: center; }

.action-btns { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--slate-700);
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--slate-300);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--slate-800);
    transition: border-color .15s, box-shadow .15s;
    background: white;
    min-height: 42px;
    -webkit-appearance: none;
    appearance: none;
}
.form-control:focus {
    outline: none;
    border-color: var(--teal-500);
    box-shadow: 0 0 0 3px rgba(20,184,166,.15);
}
.form-control[readonly] { background: var(--slate-50); }
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* ---- BADGES / STATUS ---- */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-blue { background: var(--blue-100); color: var(--blue-700); }
.badge-green { background: var(--green-100); color: var(--green-600); }
.badge-red { background: var(--red-100); color: var(--red-600); }
.badge-yellow { background: var(--yellow-100); color: #854d0e; }
.badge-slate { background: var(--slate-200); color: var(--slate-600); }
.badge-teal { background: var(--teal-50); color: var(--teal-600); }
.badge-orange { background: var(--orange-50); color: var(--orange-500); }

/* ---- MODAL ---- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.5);
    z-index: 200;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.modal {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 201;
    width: calc(100% - 24px);
    max-width: 680px;
    max-height: 90vh;
    overflow: hidden;
    flex-direction: column;
}
.modal.wide { max-width: 900px; }
.modal.show, .modal-overlay.show { display: flex; }
.modal-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--slate-200);
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0;
}
.modal-header h3 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 15px; font-weight: 700;
    color: var(--slate-800);
    padding-right: 12px;
}
.modal-close {
    background: none; border: none;
    font-size: 18px; color: var(--slate-400);
    cursor: pointer; padding: 6px;
    line-height: 1;
    transition: color .15s;
    flex-shrink: 0;
    min-width: 32px; min-height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
}
.modal-close:hover { color: var(--slate-700); background: var(--slate-100); }
.modal-body {
    padding: 18px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}
.modal-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--slate-200);
    display: flex; justify-content: flex-end; gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ---- SEARCH BAR ---- */
.search-bar {
    display: flex; gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.search-input-wrap {
    position: relative;
    flex: 1; min-width: 180px;
}
.search-input-wrap i {
    position: absolute; left: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--slate-400); font-size: 14px;
    pointer-events: none;
}
.search-input-wrap .form-control { padding-left: 36px; }

/* ---- TABS ---- */
.tabs {
    display: flex; gap: 2px;
    border-bottom: 2px solid var(--slate-200);
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
    padding: 10px 16px;
    border: none; background: none;
    font-size: 13px; font-weight: 600;
    color: var(--slate-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all .15s;
    border-radius: 6px 6px 0 0;
    white-space: nowrap;
    min-height: 42px;
}
.tab-btn:hover { color: var(--slate-700); background: var(--slate-50); }
.tab-btn.active { color: var(--teal-600); border-bottom-color: var(--teal-500); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---- TOAST ---- */
#toast-container {
    position: fixed; bottom: 20px; right: 16px;
    z-index: 999;
    display: flex; flex-direction: column; gap: 10px;
    max-width: calc(100vw - 32px);
}
.toast {
    background: var(--slate-800);
    color: white;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    box-shadow: var(--shadow-lg);
    display: flex; align-items: center; gap: 10px;
    min-width: 220px;
    max-width: 340px;
    animation: slideIn .2s ease;
    word-break: break-word;
}
.toast.success { background: var(--green-600); }
.toast.error { background: var(--red-600); }
.toast.info { background: var(--blue-600); }
@keyframes slideIn { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---- EMPTY STATE ---- */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--slate-400);
}
.empty-state i { font-size: 40px; margin-bottom: 14px; display: block; }
.empty-state h3 { font-size: 15px; color: var(--slate-600); margin-bottom: 8px; }
.empty-state p { font-size: 13.5px; }

/* ---- ORÇAMENTO / OS ITEMS ---- */
.items-table-wrap {
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.items-table { width: 100%; border-collapse: collapse; min-width: 400px; }
.items-table th { padding: 9px 12px; background: var(--slate-50); font-size: 12px; color: var(--slate-500); font-weight: 600; text-align: left; border-bottom: 1px solid var(--slate-200); }
.items-table td { padding: 9px 12px; border-bottom: 1px solid var(--slate-100); font-size: 13.5px; }
.items-table tr:last-child td { border-bottom: none; }

.total-row {
    display: flex; justify-content: flex-end; align-items: center;
    gap: 12px; padding: 10px 0;
    flex-wrap: wrap;
}
.total-label { font-weight: 600; color: var(--slate-600); }
.total-value { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 20px; font-weight: 700; color: var(--teal-600); }

/* ---- PAGE HEADER ---- */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; flex-wrap: wrap; gap: 10px;
}
.page-header h1 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 20px; font-weight: 800;
    color: var(--slate-800);
}

/* ---- DASHBOARD GRID ---- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ---- PRINT ---- */
@media print {
    .sidebar, .topbar, .no-print, .sidebar-overlay { display: none !important; }
    .main-wrapper { margin: 0; }
    .content { padding: 0; }
    body { font-size: 12px; }
    .card { box-shadow: none; border: 1px solid #e2e8f0; }
}

/* ---- FLASH MESSAGES ---- */
.flash-msg {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.flash-error { background: var(--red-50); color: var(--red-600); border: 1px solid var(--red-100); }
.flash-ok    { background: var(--green-50); color: var(--green-600); border: 1px solid var(--green-100); }

/* ---- LOCK / DISABLED ---- */
.btn-locked { opacity: .45; cursor: not-allowed; pointer-events: none; }
.access-denied {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 60px 20px; text-align: center; color: var(--slate-400);
}
.access-denied i { font-size: 52px; margin-bottom: 16px; color: var(--slate-300); }
.access-denied h3 { font-size: 18px; color: var(--slate-600); margin-bottom: 8px; }
.access-denied p { font-size: 14px; }

/* ---- LOGO SIDEBAR ---- */
.brand-logo-wrap {
    width: 40px; height: 40px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: white;
    display: flex; align-items: center; justify-content: center;
}
.brand-logo-img { width: 100%; height: 100%; object-fit: contain; }

/* ---- AUTOCOMPLETE ---- */
.autocomplete-wrap { position: relative; }
.autocomplete-list {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: white;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    z-index: 300;
    max-height: 220px;
    overflow-y: auto;
    display: none;
    -webkit-overflow-scrolling: touch;
}
.autocomplete-list.show { display: block; }
.autocomplete-item {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    border-bottom: 1px solid var(--slate-100);
    transition: background .1s;
    min-height: 44px;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: var(--teal-50); }
.autocomplete-item .ac-code { font-size: 11px; font-weight: 700; color: var(--teal-600); background: var(--teal-50); border: 1px solid var(--teal-500); border-radius: 100px; padding: 1px 8px; flex-shrink:0; }
.autocomplete-item .ac-nome { flex: 1; color: var(--slate-700); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.autocomplete-item .ac-valor { font-weight: 600; color: var(--slate-800); font-size: 13px; flex-shrink:0; }

/* ---- RECIBO PRINT ---- */
.recibo-wrap { max-width: 680px; margin: 0 auto; padding: 30px; font-family: 'Inter', sans-serif; }
.recibo-header { text-align: center; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 3px double #0d9488; }
.recibo-logo { margin-bottom: 10px; }
.recibo-logo img { max-height: 70px; }
.recibo-empresa { font-size: 22px; font-weight: 800; color: #0f172a; }
.recibo-sub { font-size: 13px; color: #64748b; }
.recibo-titulo { font-size: 18px; font-weight: 800; color: #0d9488; margin: 16px 0 4px; letter-spacing: .05em; text-transform: uppercase; }
.recibo-num { font-size: 13px; color: #64748b; }
.recibo-body { margin: 20px 0; }
.recibo-linha { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f1f5f9; font-size: 13.5px; }
.recibo-linha strong { color: #0f172a; }
.recibo-valor-box { background: #f0fdfa; border: 2px solid #14b8a6; border-radius: 10px; padding: 16px 20px; text-align: center; margin: 20px 0; }
.recibo-valor-label { font-size: 12px; color: #64748b; text-transform: uppercase; letter-spacing:.05em; margin-bottom:4px; }
.recibo-valor-num { font-size: 28px; font-weight: 800; color: #0d9488; }
.recibo-assinatura { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 40px; }
.recibo-ass-line { border-top: 1px solid #94a3b8; padding-top: 8px; text-align: center; font-size: 12px; color: #64748b; }
.recibo-footer { text-align: center; margin-top: 24px; font-size: 11px; color: #94a3b8; border-top: 1px solid #e2e8f0; padding-top: 12px; }

/* ================================================
   RESPONSIVIDADE — TABLET (≤ 900px)
   ================================================ */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ================================================
   RESPONSIVIDADE — MOBILE (≤ 768px)
   ================================================ */
@media (max-width: 768px) {
    /* Sidebar deslizante */
    .sidebar {
        transform: translateX(-100%);
        width: min(var(--sidebar-w), 80vw);
        z-index: 101;
    }
    .sidebar.open { transform: translateX(0); }

    /* Conteúdo ocupa tela toda */
    .main-wrapper { margin-left: 0; }

    /* Botão hamburguer visível */
    .sidebar-toggle {
        display: inline-flex;
    }

    /* Topbar compacta */
    .topbar { padding: 0 12px; gap: 8px; }
    .topbar-date { display: none; }

    /* Content com padding menor */
    .content { padding: 12px; }

    /* Page header empilhado */
    .page-header {
        margin-bottom: 14px;
    }
    .page-header h1 { font-size: 17px; }

    /* Stats em 2 colunas */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 14px;
    }
    .stat-card { padding: 12px; gap: 10px; }
    .stat-icon { width: 38px; height: 38px; font-size: 16px; border-radius: 8px; }
    .stat-value { font-size: 17px; }
    .stat-label { font-size: 11px; }

    /* Dashboard grid em coluna única */
    .dashboard-grid { gap: 12px; }

    /* Cards */
    .card-header { padding: 12px 14px; }
    .card-body { padding: 14px; }
    .card-title { font-size: 13px; }

    /* Formulários — coluna única */
    .form-row { grid-template-columns: 1fr; gap: 12px; }

    /* Filtros de relatório empilhados */
    .card .card-body form[method="GET"] {
        flex-direction: column !important;
        gap: 10px !important;
    }
    .card .card-body form[method="GET"] .form-group {
        width: 100% !important;
        min-width: unset !important;
        flex: unset !important;
    }
    #datas-custom {
        flex-direction: column !important;
        gap: 10px !important;
    }
    #filtro-forma {
        width: 100% !important;
    }

    /* Botões de ação */
    .action-btns { gap: 4px; }

    /* Modais full-width no mobile */
    .modal {
        width: 100%;
        max-width: 100%;
        max-height: 92vh;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        border-radius: 16px 16px 0 0;
    }
    .modal.show { display: flex; }

    /* Tabelas com scroll */
    .table-wrapper { margin: 0 -14px; }
    .card-body .table-wrapper { margin: 0 -14px; }

    /* Tabs com scroll horizontal */
    .tabs { margin-bottom: 14px; }

    /* Toast no centro inferior */
    #toast-container {
        bottom: 16px;
        right: 12px;
        left: 12px;
        align-items: stretch;
    }
    .toast { min-width: unset; max-width: 100%; }

    /* Recibo em mobile */
    .recibo-wrap { padding: 16px; }
    .recibo-assinatura { grid-template-columns: 1fr; gap: 24px; }

    /* Resumo por forma de pagamento */
    .card-body > div[style*="slate-50"] > div[style*="flex"] {
        flex-direction: column;
    }
}

/* ================================================
   RESPONSIVIDADE — MOBILE PEQUENO (≤ 480px)
   ================================================ */
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
    .stat-icon { width: 34px; height: 34px; font-size: 15px; }
    .stat-value { font-size: 16px; }

    .page-header h1 { font-size: 16px; }
    .page-header .btn { font-size: 12px; padding: 6px 10px; }

    .btn { font-size: 13px; padding: 7px 12px; }
    .btn-sm { padding: 5px 8px; font-size: 11.5px; }

    .form-control { font-size: 16px; } /* Evita zoom automático no iOS */

    .badge { font-size: 10.5px; padding: 2px 8px; }

    .data-table { font-size: 12px; }
    .data-table th { font-size: 10px; padding: 8px 10px; }
    .data-table td { padding: 10px; }
}

/* ---- LOGIN ---- */
.login-page {
    min-height: 100vh;
    background: var(--slate-900);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.login-card {
    background: white;
    border-radius: 16px;
    padding: 36px 28px;
    width: 100%; max-width: 400px;
    box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .brand-icon { width: 60px; height: 60px; font-size: 26px; margin: 0 auto 12px; }
.login-logo h1 { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 22px; font-weight: 800; color: var(--slate-800); }
.login-logo p { color: var(--slate-500); font-size: 13.5px; }
.login-error {
    background: var(--red-50); color: var(--red-600);
    border: 1px solid var(--red-100); border-radius: 8px;
    padding: 10px 14px; font-size: 13.5px; margin-bottom: 16px;
}
.login-btn { width: 100%; padding: 12px; font-size: 15px; font-weight: 700; border-radius: 10px; margin-top: 8px; }