:root {
    --pdv-bg: #f3f6f5;
    --pdv-panel: #ffffff;
    --pdv-panel-soft: #f7faf9;
    --pdv-ink: #16302f;
    --pdv-muted: #6d807e;
    --pdv-line: #e1e9e7;
    --pdv-primary: #0d7a72;
    --pdv-primary-dark: #075e59;
    --pdv-primary-soft: #e5f5f2;
    --pdv-sidebar: #073e3d;
    --pdv-sidebar-deep: #052f2f;
    --pdv-accent: #f4a83a;
    --pdv-danger: #dc4b52;
    --pdv-good: #16845b;
    --pdv-blue: #3478e5;
    --pdv-shadow-sm: 0 4px 16px rgba(14, 54, 51, .05);
    --pdv-shadow: 0 18px 55px rgba(14, 54, 51, .11);
    --pdv-radius: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--pdv-bg); }
body {
    background: var(--pdv-bg);
    color: var(--pdv-ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
button, input, select, textarea { transition: border-color .18s ease, box-shadow .18s ease, background .18s ease, transform .18s ease; }

/* Login */
.login-screen {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(440px, 1.05fr) minmax(440px, .95fr);
    background: #fff;
}
.login-visual {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background:
        radial-gradient(circle at 80% 18%, rgba(74, 211, 190, .2), transparent 25%),
        radial-gradient(circle at 8% 82%, rgba(244, 168, 58, .16), transparent 28%),
        linear-gradient(145deg, #0a4d49 0%, #063b3b 48%, #052d2e 100%);
    color: #fff;
    padding: clamp(34px, 5vw, 72px);
}
.login-visual::before,
.login-visual::after {
    content: "";
    position: absolute;
    z-index: -1;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 50%;
}
.login-visual::before { width: 540px; height: 540px; right: -250px; top: 8%; }
.login-visual::after { width: 380px; height: 380px; left: -190px; bottom: -140px; }
.login-brand, .mobile-login-brand {
    display: flex;
    align-items: center;
    gap: 13px;
}
.brand-symbol {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(145deg, #22a89e, #0d7a72);
    color: #fff;
    font-size: 21px;
    font-weight: 900;
    box-shadow: 0 9px 26px rgba(4, 37, 36, .24), inset 0 1px rgba(255,255,255,.28);
}
.login-brand strong { display: block; font-size: 18px; letter-spacing: -.2px; }
.login-brand small { display: block; margin-top: 2px; color: rgba(255,255,255,.6); font-size: 11px; }
.login-presentation { width: min(590px, 100%); margin: auto 0; padding: 64px 0; }
.login-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: #a9e9df;
    padding: 0 13px;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.login-presentation h1 {
    max-width: 560px;
    margin: 22px 0 16px;
    font-size: clamp(42px, 5.1vw, 68px);
    line-height: .98;
    letter-spacing: -.055em;
}
.login-presentation > p {
    max-width: 550px;
    margin: 0;
    color: rgba(255,255,255,.68);
    font-size: 17px;
    line-height: 1.7;
}
.login-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 40px; }
.login-features > div {
    min-height: 128px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 16px;
    background: rgba(255,255,255,.055);
    padding: 16px;
    backdrop-filter: blur(8px);
}
.login-features span {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(59, 208, 187, .16);
    color: #76e0d0;
    font-weight: 900;
}
.login-features strong { margin-top: 15px; font-size: 13px; }
.login-features small { margin-top: 5px; color: rgba(255,255,255,.5); font-size: 11px; line-height: 1.4; }
.login-proof { display: flex; align-items: center; gap: 9px; color: rgba(255,255,255,.5); font-size: 11px; }
.proof-dot { width: 8px; height: 8px; border-radius: 50%; background: #4bd1a0; box-shadow: 0 0 0 5px rgba(75,209,160,.1); }
.login-panel {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 100% 0%, rgba(13,122,114,.055), transparent 25%),
        #fff;
    padding: 32px clamp(28px, 6vw, 90px);
}
.login-card {
    width: min(440px, 100%);
    display: grid;
    gap: 17px;
}
.mobile-login-brand { display: none; margin-bottom: 18px; }
.mobile-login-brand strong { font-size: 18px; }
.login-heading { margin-bottom: 8px; }
.login-heading > span { color: var(--pdv-primary); font-size: 12px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.login-heading h2 { margin: 8px 0 8px; color: #12302e; font-size: 31px; line-height: 1.1; letter-spacing: -.035em; }
.login-heading p, .login-card > p { margin: 0; color: var(--pdv-muted); line-height: 1.6; }
.setup-card {
    max-height: calc(100vh - 64px);
    overflow: auto;
    border: 1px solid var(--pdv-line);
    border-radius: 20px;
    background: #fff;
    padding: 28px;
    box-shadow: var(--pdv-shadow);
}
.brand-mark { display: flex; align-items: center; gap: 11px; font-size: 18px; }
.brand-mark span {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--pdv-primary);
    color: #fff;
    font-weight: 900;
}
label { display: grid; gap: 7px; color: #405654; font-size: 12px; font-weight: 800; }
input, select, textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid #dce6e4;
    border-radius: 11px;
    background: #fff;
    color: var(--pdv-ink);
    padding: 0 13px;
    outline: none;
}
input::placeholder, textarea::placeholder { color: #a5b1af; }
textarea { min-height: 96px; padding-top: 12px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #bdcfcc; }
input:focus, select:focus, textarea:focus { border-color: var(--pdv-primary); box-shadow: 0 0 0 4px rgba(13,122,114,.1); }
.form-error { min-height: 18px; color: var(--pdv-danger) !important; font-size: 12px; }
.login-support { display: block; margin-top: 5px; color: #91a09e; text-align: center; }

.primary, .secondary, .ghost, .danger {
    min-height: 43px;
    border: 0;
    border-radius: 11px;
    padding: 0 16px;
    font-weight: 850;
}
.primary { background: linear-gradient(135deg, #10877e, #087068); color: #fff; box-shadow: 0 7px 18px rgba(13,122,114,.2); }
.primary:hover { background: linear-gradient(135deg, #0c776f, #075e59); transform: translateY(-1px); box-shadow: 0 9px 23px rgba(13,122,114,.25); }
.secondary { border: 1px solid var(--pdv-line); background: #fff; color: var(--pdv-ink); }
.secondary:hover { border-color: #c5d6d3; background: #f8fbfa; }
.ghost { background: transparent; color: var(--pdv-primary); }
.ghost:hover { background: var(--pdv-primary-soft); }
.danger { background: #fff0f0; color: var(--pdv-danger); }
.danger:hover { background: #ffe5e6; }
.login-submit { min-height: 51px; display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 2px; font-size: 14px; }
.login-submit span { font-size: 19px; line-height: 0; }

/* Shell e navegação */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 266px minmax(0, 1fr); }
.sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background:
        radial-gradient(circle at 15% 5%, rgba(41,173,158,.14), transparent 22%),
        linear-gradient(180deg, var(--pdv-sidebar) 0%, var(--pdv-sidebar-deep) 100%);
    color: #fff;
    padding: 22px 16px 16px;
}
.brand-button {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 0;
    background: transparent;
    color: #fff;
    padding: 0 6px 20px;
    text-align: left;
}
.brand-button .brand-symbol { width: 40px; height: 40px; flex-basis: 40px; border-radius: 12px; font-size: 19px; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 17px; letter-spacing: -.2px; }
.brand-copy small { color: rgba(255,255,255,.45); font-size: 10px; }
.store-pill {
    display: grid;
    grid-template-columns: 35px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 13px;
    background: rgba(255,255,255,.06);
    padding: 10px;
}
.store-avatar {
    width: 35px;
    height: 35px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(41,173,158,.2);
    color: #72d7ca;
    font-weight: 900;
}
.store-pill small, .store-pill strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-pill small { color: rgba(255,255,255,.42); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.store-pill strong { margin-top: 3px; color: rgba(255,255,255,.86); font-size: 12px; }
.store-chevron { color: rgba(255,255,255,.4); }
.nav-label { margin: 25px 10px 10px; color: rgba(255,255,255,.3); font-size: 9px; font-weight: 850; letter-spacing: .12em; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav button, .logout-button {
    position: relative;
    width: 100%;
    min-height: 43px;
    display: flex;
    align-items: center;
    gap: 11px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: rgba(255,255,255,.62);
    padding: 0 11px;
    font-weight: 720;
    text-align: left;
}
.sidebar nav button:hover { background: rgba(255,255,255,.055); color: #fff; }
.sidebar nav button i, .logout-button i {
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    color: rgba(255,255,255,.52);
    font-style: normal;
    font-size: 16px;
}
.sidebar nav button.active { background: linear-gradient(90deg, rgba(42,174,159,.25), rgba(42,174,159,.1)); color: #fff; }
.sidebar nav button.active::before {
    content: "";
    position: absolute;
    left: 0;
    width: 3px;
    height: 22px;
    border-radius: 0 3px 3px 0;
    background: #48c7b7;
    box-shadow: 0 0 14px rgba(72,199,183,.5);
}
.sidebar nav button.active i { color: #6fe0d2; }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.07); padding-top: 13px; }
.sidebar-user { display: grid; grid-template-columns: 34px minmax(0,1fr); align-items: center; gap: 10px; padding: 7px 10px 10px; }
.sidebar-user > span, .top-user > span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(145deg, #2bb4a5, #16867e);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}
.sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { color: rgba(255,255,255,.84); font-size: 11px; }
.sidebar-user small { margin-top: 2px; color: rgba(255,255,255,.36); font-size: 9px; }
.logout-button { min-height: 38px; color: rgba(255,255,255,.46); font-size: 11px; }
.logout-button:hover { background: rgba(220,75,82,.1); color: #ff999e; }

.main { min-width: 0; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid rgba(218,229,227,.82);
    background: rgba(243,246,245,.88);
    padding: 13px 25px;
    backdrop-filter: blur(16px);
}
.topbar h1, .topbar p { margin: 0; }
.topbar h1 { font-size: 24px; line-height: 1.15; letter-spacing: -.035em; }
.topbar p { margin-top: 5px; color: var(--pdv-muted); font-size: 12px; }
.icon-button {
    width: 41px;
    height: 41px;
    display: none;
    border: 1px solid var(--pdv-line);
    border-radius: 11px;
    background: #fff;
    color: var(--pdv-ink);
}
.top-actions { display: flex; align-items: center; gap: 10px; }
.cash-status {
    position: relative;
    border: 1px solid var(--pdv-line);
    border-radius: 999px;
    background: rgba(255,255,255,.88);
    color: var(--pdv-muted);
    padding: 9px 13px 9px 28px;
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
}
.cash-status::before { content: ""; position: absolute; left: 12px; top: 50%; width: 7px; height: 7px; transform: translateY(-50%); border-radius: 50%; background: #a1afad; }
.cash-status.open { border-color: rgba(22,132,91,.2); background: #eaf8f1; color: var(--pdv-good); }
.cash-status.open::before { background: #21a873; box-shadow: 0 0 0 4px rgba(33,168,115,.1); }
.install-button { white-space: nowrap; }
.top-user { display: grid; grid-template-columns: 34px auto; align-items: center; gap: 9px; border-left: 1px solid var(--pdv-line); padding-left: 11px; }
.top-user strong, .top-user small { display: block; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-user strong { font-size: 11px; }
.top-user small { margin-top: 2px; color: var(--pdv-muted); font-size: 9px; }
.content { padding: 23px 25px 34px; }

/* Conteúdo */
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.metric-card, .panel, .table-panel {
    border: 1px solid rgba(220,231,229,.92);
    border-radius: var(--pdv-radius);
    background: var(--pdv-panel);
    box-shadow: var(--pdv-shadow-sm);
}
.metric-card { position: relative; overflow: hidden; padding: 19px 20px; }
.metric-card::after { content: ""; position: absolute; top: -29px; right: -26px; width: 82px; height: 82px; border-radius: 50%; background: rgba(13,122,114,.06); }
.metric-card:nth-child(2)::after { background: rgba(52,120,229,.07); }
.metric-card:nth-child(3)::after { background: rgba(244,168,58,.09); }
.metric-card:nth-child(4)::after { background: rgba(22,132,91,.07); }
.metric-card small { color: var(--pdv-muted); font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.metric-card strong { display: block; margin-top: 9px; font-size: 25px; line-height: 1.1; letter-spacing: -.035em; }
.metric-card em { display: block; margin-top: 7px; color: #8b9b99; font-size: 11px; font-style: normal; }

.panel { padding: 18px; }
.panel-head, .section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 13px;
    margin-bottom: 15px;
}
.panel-head h2, .panel-head h3, .section-head h2, .section-head p { margin: 0; }
.panel-head h2, .section-head h2 { font-size: 18px; letter-spacing: -.025em; }
.panel-head p, .section-head p { margin-top: 4px; color: var(--pdv-muted); font-size: 11px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, .48fr); gap: 16px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.plan-grid { grid-template-columns: 1fr; gap: 9px; }
.plan-grid .metric-card { min-height: 92px; padding: 15px 16px; }
.plan-grid .metric-card strong { margin-top: 6px; font-size: 21px; }
.plan-grid .metric-card em { margin-top: 5px; }

.pos-grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; align-items: start; }
.pos-grid > .panel:first-child { min-height: 560px; }
.pos-search { display: grid; grid-template-columns: minmax(0, 1fr) 138px; gap: 9px; margin-bottom: 13px; }
.pos-search input { min-height: 48px; padding-left: 16px; background: var(--pdv-panel-soft); }
.category-tabs { display: flex; gap: 7px; overflow: auto; padding: 0 1px 12px; scrollbar-width: none; }
.category-tabs::-webkit-scrollbar { display: none; }
.category-tabs button {
    flex: none;
    min-height: 34px;
    border: 1px solid var(--pdv-line);
    border-radius: 999px;
    background: #fff;
    padding: 0 13px;
    color: #657876;
    font-size: 11px;
    font-weight: 800;
}
.category-tabs button:hover { border-color: #bdd1ce; }
.category-tabs button.active { border-color: rgba(13,122,114,.18); background: var(--pdv-primary-soft); color: var(--pdv-primary); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.product-tile {
    position: relative;
    min-height: 132px;
    display: grid;
    align-content: space-between;
    overflow: hidden;
    border: 1px solid var(--pdv-line);
    border-radius: 14px;
    background: linear-gradient(180deg, #fff, #fbfdfc);
    padding: 15px;
    text-align: left;
}
.product-tile::after { content: "+"; position: absolute; right: 12px; bottom: 12px; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 9px; background: var(--pdv-primary-soft); color: var(--pdv-primary); font-size: 17px; font-weight: 800; opacity: 0; transform: translateY(4px); transition: .18s ease; }
.product-tile:hover { border-color: rgba(13,122,114,.35); transform: translateY(-2px); box-shadow: 0 10px 28px rgba(13,122,114,.11); }
.product-tile:hover::after { opacity: 1; transform: translateY(0); }
.product-tile strong { max-width: 90%; line-height: 1.3; font-size: 13px; }
.product-tile span { color: var(--pdv-muted); font-size: 10px; line-height: 1.4; }
.product-tile em { color: var(--pdv-primary); font-size: 18px; font-style: normal; font-weight: 900; letter-spacing: -.02em; }
.product-tile.low { border-color: rgba(244,168,58,.42); background: linear-gradient(180deg, #fff, #fffaf2); }
.cart-panel { position: sticky; top: 99px; padding: 19px; }
.cart-panel > label { margin-bottom: 13px; }
.cart-list { display: grid; gap: 8px; max-height: 37vh; overflow: auto; margin-bottom: 14px; padding-right: 2px; }
.cart-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 94px 26px;
    gap: 8px;
    align-items: center;
    border: 1px solid var(--pdv-line);
    border-radius: 12px;
    background: #fcfdfd;
    padding: 10px;
}
.cart-row strong, .cart-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-row strong { font-size: 12px; }
.cart-row small { margin-top: 4px; color: var(--pdv-muted); font-size: 9px; }
.qty-stepper { display: grid; grid-template-columns: 27px 1fr 27px; align-items: center; overflow: hidden; border: 1px solid var(--pdv-line); border-radius: 9px; background: #fff; }
.qty-stepper button { height: 31px; border: 0; background: #f2f7f6; color: var(--pdv-primary); font-weight: 900; }
.qty-stepper button:hover { background: var(--pdv-primary-soft); }
.qty-stepper span { text-align: center; font-size: 11px; font-weight: 850; }
.remove-mini { width: 26px; height: 31px; border: 0; border-radius: 8px; background: transparent; color: #b88c8f; font-weight: 900; }
.remove-mini:hover { background: #fff0f0; color: var(--pdv-danger); }
.totals { display: grid; gap: 8px; border-top: 1px dashed #d8e3e1; padding-top: 14px; }
.totals div { display: flex; justify-content: space-between; gap: 12px; color: var(--pdv-muted); font-size: 12px; }
.totals .grand { align-items: flex-end; margin-top: 3px; color: var(--pdv-ink); font-size: 16px; font-weight: 900; }
.totals .grand strong { color: var(--pdv-primary); font-size: 26px; letter-spacing: -.035em; }
.cart-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.cart-actions .primary { grid-column: 1 / -1; min-height: 50px; font-size: 14px; }

.table-panel { overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { border-bottom: 1px solid #e8efed; padding: 13px 15px; text-align: left; vertical-align: middle; }
.data-table th { background: #f7faf9; color: #758683; font-size: 9px; font-weight: 900; letter-spacing: .065em; text-transform: uppercase; }
.data-table td { font-size: 12px; }
.data-table tbody tr { transition: background .15s ease; }
.data-table tbody tr:hover { background: #fafcfb; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td small { color: var(--pdv-muted); }
.data-table .secondary { min-height: 34px; border-radius: 9px; font-size: 10px; }
.status {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    border-radius: 999px;
    background: #edf2f1;
    color: #657674;
    padding: 0 9px;
    font-size: 9px;
    font-weight: 900;
    text-transform: capitalize;
}
.status.active, .status.open, .status.paid { background: #e9f8f1; color: var(--pdv-good); }
.status.trial { background: #edf4ff; color: var(--pdv-blue); }
.status.blocked, .status.cancelled, .status.past_due { background: #fff0f0; color: var(--pdv-danger); }
.status.low { background: #fff5e6; color: #bd6d12; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.check-line { display: flex; align-items: center; gap: 9px; min-height: 43px; color: var(--pdv-muted); font-weight: 750; }
.check-line input { width: 17px; min-height: 17px; accent-color: var(--pdv-primary); }
.empty {
    min-height: 180px;
    display: grid;
    place-items: center;
    grid-column: 1 / -1;
    border: 1px dashed #cbdad7;
    border-radius: 14px;
    background: #fafcfb;
    color: var(--pdv-muted);
    text-align: center;
    padding: 22px;
}

/* Modais e mensagens */
.modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    background: rgba(5, 34, 33, .62);
    padding: 20px;
    backdrop-filter: blur(5px);
}
.modal-card {
    width: min(690px, 100%);
    max-height: min(790px, calc(100vh - 40px));
    overflow: auto;
    border: 1px solid rgba(255,255,255,.6);
    border-radius: 19px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(4,35,33,.3);
}
.modal-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--pdv-line);
    background: rgba(255,255,255,.94);
    padding: 19px 20px;
    backdrop-filter: blur(10px);
}
.modal-head h2, .modal-head p { margin: 0; }
.modal-head h2 { font-size: 20px; letter-spacing: -.025em; }
.modal-head p { margin-top: 4px; color: var(--pdv-muted); font-size: 11px; }
.modal-close { width: 36px; height: 36px; border: 1px solid var(--pdv-line); border-radius: 10px; background: #fff; color: var(--pdv-muted); font-size: 18px; }
.modal-close:hover { border-color: #c9d7d5; background: #f7faf9; }
.modal-body { display: grid; gap: 13px; padding: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 0 20px 20px; }
.toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 90;
    max-width: 350px;
    transform: translateY(15px) scale(.98);
    opacity: 0;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 13px;
    background: #092f2e;
    color: #fff;
    padding: 14px 17px;
    box-shadow: 0 16px 42px rgba(4,35,33,.25);
    transition: .2s ease;
    pointer-events: none;
}
.toast.show { transform: translateY(0) scale(1); opacity: 1; }

@media (max-width: 1180px) {
    .app-shell { grid-template-columns: 238px minmax(0, 1fr); }
    .pos-grid { grid-template-columns: minmax(0, 1fr) 365px; }
    .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-2 { grid-template-columns: 1fr; }
    .cart-panel { position: static; }
}

@media (max-width: 920px) {
    .login-screen { grid-template-columns: 1fr; }
    .login-visual { display: none; }
    .login-panel { min-height: 100vh; padding: 30px; }
    .mobile-login-brand { display: flex; }
    .pos-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 266px;
        transform: translateX(-104%);
        transition: transform .22s ease;
        box-shadow: 18px 0 45px rgba(4,35,33,.2);
    }
    body.sidebar-open::after { content: ""; position: fixed; inset: 0; z-index: 35; background: rgba(5,34,33,.36); backdrop-filter: blur(2px); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .icon-button { display: grid; place-items: center; flex: 0 0 41px; }
    .topbar { min-height: 72px; align-items: center; padding: 11px 14px; }
    .topbar h1 { font-size: 20px; }
    .topbar p { display: none; }
    .cash-status, .top-user { display: none; }
    .top-actions { margin-left: auto; }
    .top-actions .install-button { min-height: 38px; padding: 0 11px; }
    .content { padding: 14px 12px 26px; }
    .metrics-grid { gap: 9px; }
    .metric-card { padding: 15px; }
    .metric-card strong { font-size: 21px; }
    .grid-3 { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: auto; }
    .pos-search { grid-template-columns: 1fr; }
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-tile { min-height: 125px; padding: 13px; }
    .data-table { min-width: 680px; }
    .table-panel { overflow: auto; }
    .section-head { align-items: flex-end; }
    .section-head .primary { min-height: 39px; white-space: nowrap; }
    .modal { padding: 10px; }
    .modal-card { max-height: calc(100vh - 20px); border-radius: 15px; }
}

@media (max-width: 480px) {
    .login-panel { padding: 25px 20px; }
    .login-heading h2 { font-size: 28px; }
    .metrics-grid { grid-template-columns: 1fr 1fr; }
    .metric-card small { font-size: 8px; }
    .metric-card strong { font-size: 18px; }
    .metric-card em { font-size: 9px; }
    .panel { padding: 13px; }
    .product-grid { gap: 8px; }
    .product-tile { min-height: 116px; }
    .cart-row { grid-template-columns: minmax(0,1fr) 88px 24px; }
    .modal-actions { display: grid; grid-template-columns: 1fr 1fr; }
}

/* ======================================================================
   Componentes acrescentados na revisao: status de rede, faixa de cobranca,
   pagamento multiplo, graficos, importacao e novos estados de tabela.
   ====================================================================== */

/* Situacao da conexao e da fila offline */
.network-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.network-chip::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}
.network-chip.online { background: var(--pdv-primary-soft); color: var(--pdv-primary-dark); }
.network-chip.offline { background: #fdecec; color: var(--pdv-danger); }

/* Aviso de assinatura */
.billing-banner {
    margin: 0 clamp(16px, 3vw, 32px);
    padding: 11px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}
.billing-banner.aviso { background: #fff6e6; color: #8a5a10; border: 1px solid #f6dfb4; }
.billing-banner.bloqueio { background: #fdecec; color: #9b2c31; border: 1px solid #f4c4c6; }

/* Barra de filtros das telas de consulta */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 14px;
}
.filter-bar label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--pdv-muted);
}
.filter-bar input {
    padding: 10px 12px;
    border: 1px solid var(--pdv-line);
    border-radius: 10px;
    background: #fff;
    min-width: 190px;
}
.filter-bar input:focus { outline: none; border-color: var(--pdv-primary); box-shadow: 0 0 0 3px var(--pdv-primary-soft); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Pagamento dividido em varias formas */
.payment-lines { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.payment-line {
    display: grid;
    grid-template-columns: 1.2fr 1fr auto;
    gap: 8px;
    align-items: center;
}
.payment-line select,
.payment-line input {
    padding: 11px 12px;
    border: 1px solid var(--pdv-line);
    border-radius: 10px;
    background: #fff;
    width: 100%;
}
.payment-line input { text-align: right; font-variant-numeric: tabular-nums; }
.totals .pendente strong { color: var(--pdv-danger); }

/* Quantidade editavel no carrinho */
.qty-stepper .qty-input {
    width: 62px;
    padding: 6px 4px;
    text-align: center;
    border: 1px solid var(--pdv-line);
    border-radius: 8px;
    background: #fff;
    font-variant-numeric: tabular-nums;
}
.cart-row.alerta { border-left: 3px solid var(--pdv-accent); }
.cart-row .cart-desc { min-width: 0; }
.cart-row .cart-desc strong { display: block; overflow: hidden; text-overflow: ellipsis; }

/* Produtos sem estoque */
.product-tile.zerado { opacity: .55; }
.product-tile.zerado::after {
    content: 'sem estoque';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    font-weight: 700;
    color: var(--pdv-danger);
}
.product-tile { position: relative; }

/* Graficos simples, sem biblioteca externa */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 190px;
    padding-top: 10px;
    overflow-x: auto;
}
.bar-chart.pequeno { height: 130px; }
.bar {
    flex: 1 0 26px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
    gap: 6px;
}
.bar-fill {
    width: 100%;
    max-width: 34px;
    background: linear-gradient(180deg, var(--pdv-primary) 0%, var(--pdv-primary-dark) 100%);
    border-radius: 6px 6px 2px 2px;
    min-height: 4px;
}
.bar small { font-size: 10px; color: var(--pdv-muted); white-space: nowrap; }

.split-list { display: flex; flex-direction: column; gap: 10px; }
.split-row {
    display: grid;
    grid-template-columns: 110px 1fr auto;
    gap: 10px;
    align-items: center;
    font-size: 13px;
}
.split-bar { height: 9px; background: var(--pdv-panel-soft); border-radius: 999px; overflow: hidden; }
.split-bar i { display: block; height: 100%; background: var(--pdv-primary); border-radius: 999px; }

/* Estados de valor */
.negativo { color: var(--pdv-danger); font-weight: 600; }
.positivo { color: var(--pdv-good); font-weight: 600; }
tr.cancelada { opacity: .6; }
tr.cancelada td:first-child { text-decoration: line-through; }
.acoes-linha { display: flex; gap: 6px; justify-content: flex-end; }
.acoes-linha button { padding: 7px 12px; font-size: 12px; }

/* Selos de status */
.status.trial, .status.classe-B { background: #eef3ff; color: var(--pdv-blue); }
.status.past_due, .status.classe-C { background: #fff6e6; color: #8a5a10; }
.status.blocked, .status.cancelled, .status.cancelled { background: #fdecec; color: var(--pdv-danger); }
.status.classe-A { background: var(--pdv-primary-soft); color: var(--pdv-primary-dark); }

/* Texto de apoio dentro de formularios */
.dica {
    font-size: 12px;
    line-height: 1.55;
    color: var(--pdv-muted);
    background: var(--pdv-panel-soft);
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 10px;
}
.dica code {
    background: #fff;
    border: 1px solid var(--pdv-line);
    border-radius: 4px;
    padding: 1px 4px;
    font-size: 11px;
}
.import-result { margin-top: 12px; font-size: 13px; }
.import-result ul { margin: 8px 0 0; padding-left: 18px; color: var(--pdv-danger); }
.import-result details summary { cursor: pointer; margin-top: 6px; }

/* Toast com estado */
.toast.ok { border-left: 4px solid var(--pdv-good); }
.toast.erro { border-left: 4px solid var(--pdv-danger); }

@media (max-width: 720px) {
    .payment-line { grid-template-columns: 1fr; }
    .split-row { grid-template-columns: 90px 1fr; }
    .split-row strong { grid-column: 2; text-align: right; }
    .filter-bar input { min-width: 0; width: 100%; }
    .acoes-linha { justify-content: flex-start; flex-wrap: wrap; }
}
