/* ================================================================
   Facturação AGT — Sistema de design (inspirado no Cegid Vendus)
   Tema claro, cor de marca teal, cards, cantos suaves, sombras leves.
   Este ficheiro estiliza o layout e TODOS os componentes PrimeFaces,
   pelo que todas as páginas/formulários herdam o mesmo visual.
   ================================================================ */

:root {
    /* Marca (teal Vendus) */
    --brand:        #00a99d;
    --brand-dark:   #00897b;
    --brand-700:    #007c72;
    --brand-soft:   #e6f6f4;

    /* Superfícies */
    --sidebar-bg:   #0f2e35;   /* teal-slate escuro */
    --sidebar-bg-2: #0c262c;
    --sidebar-txt:  #a9c2c6;
    --sidebar-active: #ffffff;
    --topbar-bg:    #ffffff;
    --app-bg:       #eef1f5;
    --card-bg:      #ffffff;

    /* Texto */
    --text:         #37474f;
    --text-strong:  #1f2d33;
    --muted:        #7a8b93;

    /* Linhas / estados */
    --border:       #e4e9ef;
    --danger:       #e5484d;
    --success:      #2e9e5b;
    --warning:      #f0973a;
    --info:         #2a7de1;

    --radius:       10px;
    --radius-sm:    7px;
    --shadow:       0 1px 3px rgba(16,42,50,.08), 0 1px 2px rgba(16,42,50,.06);
    --shadow-md:    0 6px 20px rgba(16,42,50,.10);
    --sidebar-w:    238px;
    --topbar-h:     64px;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--app-bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-dark); text-decoration: none; }
a:hover { color: var(--brand-700); }
h1,h2,h3,h4 { color: var(--text-strong); font-weight: 600; margin: 0 0 .6rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

/* ================================================================
   LAYOUT — topbar + sidebar + conteúdo
   ================================================================ */
.topbar {
    position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; background: var(--topbar-bg); z-index: 1000;
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
}
.topbar .brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 1.05rem; color: var(--text-strong); letter-spacing: .2px;
}
.topbar .brand .logo {
    width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff; font-size: 1.05rem; box-shadow: 0 2px 6px rgba(0,169,157,.4);
}
.topbar .brand .logo i { color:#fff; }
.topbar .menu-toggle {
    background: none; border: none; color: var(--muted); font-size: 1.15rem;
    cursor: pointer; margin-right: 6px; display: none;
}
.topbar .user-area { display: flex; align-items: center; gap: 14px; }
.topbar .user-chip {
    display: flex; align-items: center; gap: 9px; padding: 5px 6px 5px 12px;
    border: 1px solid var(--border); border-radius: 30px; background: #fff;
}
.topbar .user-chip .u-name { font-size: .82rem; font-weight: 600; color: var(--text); }
.topbar .user-chip .avatar {
    width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
    background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; font-size: .8rem;
}
/* Topbar estilo SmartGest: empresa à esquerda, utilizador/relógio/idioma à direita */
.topbar .company { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar .company .co-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-dark); display: grid; place-items: center; font-size: 1.1rem; flex-shrink: 0; overflow: hidden; }
.topbar .company .co-ic .co-logo { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; background: #fff; }
.topbar .company .co-name { font-weight: 700; color: var(--text-strong); font-size: .95rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.topbar .company .co-sub { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.topbar .welcome { display: flex; flex-direction: column; text-align: right; line-height: 1.25; }
.topbar .welcome span { font-size: .78rem; color: var(--text); }
.topbar .welcome strong { color: var(--brand-dark); }
.topbar .welcome .perfil { font-size: .7rem; color: var(--muted); }
.topbar .clock { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--text); font-variant-numeric: tabular-nums; }
.topbar .clock i { color: var(--success); }
.topbar .lang { display: flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 600; color: var(--text); border: 1px solid var(--border); border-radius: 20px; padding: 3px 10px; }
/* Botão Sair — bem visível no topbar */
.topbar .btn-sair.ui-button {
    background: #fdecec; border: 1.5px solid #f0b9b9; color: #b3261e;
    padding: 3px 16px; border-radius: 10px; font-weight: 700; font-size: .88rem;
    box-shadow: none; transition: all .15s;
}
.topbar .btn-sair.ui-button .ui-button-text { padding-top: 3px; padding-bottom: 3px; }
.topbar .btn-sair.ui-button .ui-button-text, .topbar .btn-sair.ui-button .ui-icon { color: #b3261e; font-weight: 700; }
.topbar .btn-sair.ui-button:enabled:hover { background: #b3261e; border-color: #b3261e; }
.topbar .btn-sair.ui-button:enabled:hover .ui-button-text, .topbar .btn-sair.ui-button:enabled:hover .ui-icon { color: #fff; }

/* Cabeçalho da sidebar (logótipo da aplicação) */
.side-brand { display: flex; align-items: center; gap: 11px; padding: 4px 18px 16px; margin-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,.08); }
.side-brand .logo { width: 38px; height: 38px; border-radius: 10px; background: #fff; display: grid; place-items: center; color: var(--brand); font-size: 1.2rem; flex-shrink: 0; overflow: hidden; }
.side-brand .logo .brand-logo { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
.mono { font-family: 'Consolas','Courier New',monospace; font-size: .82rem; word-break: break-all; }
.conf-panel { margin-bottom: 16px; }
.conf-lbl { color: var(--muted); width: 42%; padding: 6px 8px; }
.conf-val { font-weight: 600; padding: 6px 8px; }
.integridade-ok { background:#e8f7f0; color:#1e7d52; border:1px solid #b7e4cd; border-radius:8px; padding:10px 12px; margin:10px 0; font-weight:600; }
.integridade-erro { background:#fdecec; color:#b3261e; border:1px solid #f5c2c0; border-radius:8px; padding:10px 12px; margin:10px 0; font-weight:600; }
.side-brand .sb-name { color: #fff; font-weight: 700; font-size: .95rem; line-height: 1.1; }
.side-brand .sb-tag { color: #89a7ac; font-size: .68rem; }

@media (max-width: 820px) {
    .topbar .company .co-sub, .topbar .welcome .perfil, .topbar .clock { display: none; }
    .topbar .company .co-name { max-width: 46vw; }
}

.sidebar {
    position: fixed; top: var(--topbar-h); left: 0; bottom: 0; width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-2));
    overflow-y: auto; padding: 14px 0 30px; z-index: 900;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 8px; }
.sidebar .nav-section {
    padding: 16px 22px 6px; font-size: .66rem; font-weight: 700; letter-spacing: 1.4px;
    text-transform: uppercase; color: #5c7d84;
}
.sidebar a, .sidebar .menu-item {
    display: flex; align-items: center; gap: 12px; margin: 2px 12px; padding: 10px 14px;
    color: var(--sidebar-txt); font-size: .86rem; font-weight: 500;
    border-radius: 9px; transition: all .15s ease; cursor: pointer;
}
.sidebar a i, .sidebar .menu-item i { width: 18px; text-align: center; font-size: 1rem; opacity: .9; }
.sidebar a:hover, .sidebar .menu-item:hover {
    background: rgba(255,255,255,.07); color: var(--sidebar-active);
}
.sidebar a.active, .sidebar .menu-item.active {
    background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(0,169,157,.35);
}
.sidebar a.active i, .sidebar .menu-item.active i { opacity: 1; color: #fff; }

.main-content {
    margin-left: var(--sidebar-w); margin-top: var(--topbar-h);
    padding: 26px 30px; min-height: calc(100vh - var(--topbar-h));
}
.page-header { margin-bottom: 18px; }
.page-header h2 { display: flex; align-items: center; gap: 10px; margin: 0; }
.page-header .subtitle { color: var(--muted); font-size: .85rem; margin-top: 3px; }

/* Cartão base — envolve o conteúdo das páginas */
.card, .content-card {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 22px; margin-bottom: 20px;
}

/* KPI / cartões de estatística */
.stat-card {
    background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px;
    position: relative; overflow: hidden;
}
.stat-card .label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; }
.stat-card .value { font-size: 1.7rem; font-weight: 700; color: var(--text-strong); }
.stat-card .icon {
    position: absolute; right: 16px; top: 16px; width: 42px; height: 42px; border-radius: 12px;
    display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-dark); font-size: 1.2rem;
}

/* Métricas do Dashboard */
.metric {
    background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
    padding: 16px 18px; display: flex; align-items: center; gap: 14px; margin-bottom: 16px;
}
.metric-ic { width: 48px; height: 48px; border-radius: 13px; background: var(--brand-soft); color: var(--brand-dark); display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0; }
.metric-val { font-size: 1.5rem; font-weight: 700; color: var(--text-strong); line-height: 1.1; }
.metric-lbl { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-top: 4px; }
.metric.warn .metric-ic { background: #fdecec; color: var(--danger); }

/* Painéis do dashboard */
.dash-panel { background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.dash-panel .dp-head { padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 700; color: var(--text-strong); font-size: .92rem; display: flex; align-items: center; gap: 8px; }
.dash-panel .dp-body { padding: 16px; }
.alert-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.alert-row:last-child { border-bottom: none; }
.alert-row .nm { flex: 1; font-size: .85rem; font-weight: 600; color: var(--text-strong); }
.alert-row .nm small { display: block; color: var(--muted); font-weight: 500; font-size: .72rem; }
.alert-row .qt { font-weight: 700; color: var(--danger); font-size: .9rem; }
.alert-row .abadge { width: 30px; height: 30px; border-radius: 9px; background: #fdecec; color: var(--danger); display: grid; place-items: center; }

/* ================================================================
   GRELHA — reimplementa .ui-g do PrimeFaces (offline-safe, flexbox)
   ================================================================ */
.ui-g { display: flex; flex-wrap: wrap; margin: -.5rem; }
.ui-g > [class*="ui-g-"], .ui-g > .ui-g { padding: .5rem; }
[class*="ui-g-"] { flex: 0 0 auto; }
.ui-g-12 { width: 100%; } .ui-g-11 { width: 91.6667%; } .ui-g-10 { width: 83.3333%; }
.ui-g-9 { width: 75%; } .ui-g-8 { width: 66.6667%; } .ui-g-7 { width: 58.3333%; }
.ui-g-6 { width: 50%; } .ui-g-5 { width: 41.6667%; } .ui-g-4 { width: 33.3333%; }
.ui-g-3 { width: 25%; } .ui-g-2 { width: 16.6667%; } .ui-g-1 { width: 8.3333%; }
@media (min-width: 641px) {
    .ui-md-12{width:100%;}.ui-md-8{width:66.6667%;}.ui-md-6{width:50%;}
    .ui-md-4{width:33.3333%;}.ui-md-3{width:25%;}.ui-md-2{width:16.6667%;}
}
@media (min-width: 1025px) {
    .ui-lg-12{width:100%;}.ui-lg-6{width:50%;}.ui-lg-4{width:33.3333%;}
    .ui-lg-3{width:25%;}.ui-lg-2{width:16.6667%;}
}
@media (max-width: 640px) { [class*="ui-g-"] { width: 100%; } }

/* ================================================================
   COMPONENTES PRIMEFACES — botões, inputs, tabelas, diálogos…
   ================================================================ */

/* Botões */
.ui-button, .ui-button.ui-widget {
    background: var(--brand); border: 1px solid var(--brand); color: #fff;
    border-radius: var(--radius-sm); font-weight: 600; font-size: .85rem;
    padding: .55rem .95rem; transition: all .16s ease; box-shadow: 0 1px 2px rgba(16,42,50,.08);
}
.ui-button:enabled:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.ui-button:enabled:active { background: var(--brand-700); }
.ui-button.ui-button-icon-only { border-radius: 50%; width: 2.2rem; height: 2.2rem; }
.ui-button .ui-icon, .ui-button .ui-button-icon { color: #fff; }
/* Visibilidade dos ícones dos botões: maiores, nítidos e sem transparência */
.ui-button .ui-icon, .ui-button .ui-button-icon, .ui-button .pi {
    font-size: 1.15rem; opacity: 1; font-weight: 700; text-shadow: 0 1px 1px rgba(0,0,0,.18);
}
.ui-button.ui-button-secondary .ui-icon, .ui-button.ui-button-secondary .pi { text-shadow: none; }
/* Botões secundários (outline) */
.ui-button.ui-button-secondary, .ui-button.ui-button-flat, .btn-outline {
    background: #fff; color: var(--brand-dark); border-color: var(--border);
}
.ui-button.ui-button-secondary:enabled:hover { background: var(--brand-soft); border-color: var(--brand); }
.ui-button.ui-button-secondary .ui-icon { color: var(--brand-dark); }
/* Variantes por severidade */
.ui-button.ui-button-danger { background: var(--danger); border-color: var(--danger); }
.ui-button.ui-button-success { background: var(--success); border-color: var(--success); }
.ui-button.ui-button-warning { background: var(--warning); border-color: var(--warning); }
/* p:button (links de navegação) */
.ui-button.ui-link, a.ui-button { text-decoration: none; }

/* Widgets do CRM Central no dashboard */
.crm-update { display:flex; align-items:center; gap:10px; background:#e8f6f4; border:1px solid #b6e3dd;
    color:var(--brand-dark); border-radius:10px; padding:10px 14px; margin-bottom:12px; font-size:.9rem; }
.crm-update .pi { font-size:1.2rem; }
.crm-update .crm-obrig { color:var(--danger); font-weight:700; }
.crm-update-btn { margin-left:auto; background:var(--brand); color:#fff; padding:6px 14px;
    border-radius:8px; text-decoration:none; font-weight:700; white-space:nowrap; }
.crm-ad { display:flex; align-items:center; gap:10px; background:#fff8e6; border:1px solid #f0dca0;
    color:#7a5b00; border-radius:10px; padding:9px 14px; margin-bottom:10px; font-size:.88rem; }
.crm-ad .pi { font-size:1.1rem; }
.crm-ad a { margin-left:auto; color:#8a6a00; font-size:.8rem; }

/* Inputs / selects / textarea */
.ui-inputfield, .ui-inputtext, .ui-selectonemenu, .ui-inputnumber-input,
.ui-password input, .ui-calendar input, .ui-chips, .ui-autocomplete-input {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: .55rem .7rem; font-size: .88rem; color: var(--text);
    background: #fff; transition: border-color .15s, box-shadow .15s; width: 100%;
}
.ui-inputtext:enabled:hover, .ui-selectonemenu:not(.ui-state-disabled):hover { border-color: #c7d0da; }
.ui-inputtext:enabled:focus, .ui-inputfield:focus, .ui-inputnumber-input:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(0,169,157,.15);
}
.ui-selectonemenu { display: inline-flex; align-items: center; }
.ui-selectonemenu .ui-selectonemenu-trigger { color: var(--muted); }
label, .ui-outputlabel { font-size: .82rem; font-weight: 600; color: var(--text); }

/* DataTable */
.ui-datatable { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border); background:#fff; }
.ui-datatable table { border-collapse: collapse; width: 100%; }
.ui-datatable thead th, .ui-datatable .ui-datatable-header {
    background: #f7f9fb; color: var(--text-strong); font-weight: 700; font-size: .78rem;
    text-transform: uppercase; letter-spacing: .4px; border: none; border-bottom: 2px solid var(--border);
    padding: .8rem .9rem; text-align: left;
}
.ui-datatable tbody td { border: none; border-bottom: 1px solid var(--border); padding: .7rem .9rem; font-size: .87rem; }
.ui-datatable tbody tr.ui-widget-content { background: #fff; }
.ui-datatable tbody tr:hover { background: var(--brand-soft) !important; }
.ui-datatable tbody tr:nth-child(even) { background: #fbfcfd; }
.ui-datatable .ui-paginator {
    background: #fff; border: none; border-top: 1px solid var(--border); padding: .55rem; }
.ui-paginator .ui-paginator-page.ui-state-active { background: var(--brand); color: #fff; border-radius: 6px; }

/* Painéis / PanelGrid / Fieldset */
.ui-panel, .ui-fieldset, .ui-panelgrid {
    border: 1px solid var(--border); border-radius: var(--radius); background: #fff;
}
.ui-panel .ui-panel-titlebar, .ui-fieldset-legend {
    background: #f7f9fb; color: var(--text-strong); font-weight: 700;
    border: none; border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0;
}
.ui-panelgrid td { border-color: var(--border); padding: .5rem .7rem; }

/* Diálogos */
.ui-dialog { border-radius: var(--radius); box-shadow: var(--shadow-md); border: none; overflow: hidden; }
.ui-dialog .ui-dialog-titlebar {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff;
    border: none; padding: .9rem 1.1rem; font-weight: 600;
}
.ui-dialog .ui-dialog-titlebar .ui-icon { color: #fff; }
.ui-dialog .ui-dialog-content { padding: 1.2rem; }

/* Tags / badges / chips de estado */
.ui-tag { border-radius: 30px; padding: .2rem .6rem; font-size: .72rem; font-weight: 700; }
.ui-tag.ui-tag-info, .ui-tag-info { background: var(--brand-soft); color: var(--brand-dark); }
.ui-tag.ui-tag-danger { background: #fde8e8; color: var(--danger); }
.ui-tag.ui-tag-success { background: #e6f5ec; color: var(--success); }

/* Mensagens */
.ui-messages, .ui-message { border-radius: var(--radius-sm); }
.ui-messages-error { background: #fdecec; border: 1px solid #f5c2c2; color: #b3261e; }
.ui-messages-info  { background: var(--brand-soft); border: 1px solid #bfe8e3; color: var(--brand-700); }

/* Checkbox / radio activos */
.ui-chkbox-box.ui-state-active, .ui-radiobutton-box.ui-state-active { background: var(--brand); border-color: var(--brand); }

/* ---------- Formulários (panelGrid como formulário) ---------- */
.content-card .ui-panelgrid, .ui-panelgrid.form-grid {
    border: none; background: transparent; width: 100%; box-shadow: none;
}
.content-card .ui-panelgrid tr, .ui-panelgrid.form-grid tr { border: none; background: transparent; }
.content-card .ui-panelgrid td, .ui-panelgrid.form-grid td {
    border: none; padding: .5rem .55rem; vertical-align: middle;
}
/* 1ª coluna = rótulo */
.content-card .ui-panelgrid td:first-child, .ui-panelgrid.form-grid td:first-child {
    color: var(--muted); font-weight: 600; font-size: .84rem; width: 190px; text-align: right; white-space: nowrap;
}
.content-card .ui-panelgrid .ui-inputtext,
.content-card .ui-panelgrid .ui-inputnumber,
.content-card .ui-panelgrid .ui-selectonemenu,
.content-card .ui-panelgrid .ui-inputtextarea,
.content-card .ui-panelgrid .ui-password { width: 100%; max-width: 360px; }
.content-card .ui-inputtextarea { min-height: 70px; }

/* Barra de acções do formulário (botões centrados) */
.form-actions {
    display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 22px;
    padding-top: 18px; border-top: 1px solid var(--border);
}

/* TabView */
.ui-tabs, .ui-tabs.ui-widget { border: none; background: transparent; }
.ui-tabs .ui-tabs-nav { background: transparent; border: none; border-bottom: 2px solid var(--border); padding: 0; }
.ui-tabs .ui-tabs-nav li { background: transparent; border: none; margin: 0 2px -2px 0; top: 0; }
.ui-tabs .ui-tabs-nav li a { color: var(--muted); font-weight: 600; font-size: .88rem; padding: .7rem 1.1rem; border: none; }
.ui-tabs .ui-tabs-nav li.ui-state-active { background: transparent; border-bottom: 3px solid var(--brand); }
.ui-tabs .ui-tabs-nav li.ui-state-active a { color: var(--brand-dark); }
.ui-tabs .ui-tabs-nav li:not(.ui-state-active):hover a { color: var(--text-strong); }
.ui-tabs .ui-tabs-panels, .ui-tabs .ui-tabs-panel { background: transparent; border: none; padding: 1.3rem .2rem 0; }

/* Utilitários */
.text-center { text-align: center; } .text-right { text-align: right; }
.mt-2 { margin-top: .5rem; } .mb-2 { margin-bottom: .5rem; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }

/* ================================================================
   POS — Ponto de Venda (grelha de produtos + carrinho)
   ================================================================ */
/* Estrutura SmartGest: catálogo à ESQUERDA (maior), carrinho/cliente à DIREITA */
.pos-layout { display: grid; grid-template-columns: minmax(0,1fr) 380px; gap: 16px; align-items: start; }
.pos-layout .pos-catalog { order: 1; }
.pos-layout .pos-cart { order: 2; }
/* Botões de acção do POS — compactos, alinhados numa única linha */
.pos-actions { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; white-space: nowrap; }
.pos-actions .pos-btn.ui-button {
    padding: 2px 13px; font-size: .8rem; font-weight: 700; border-radius: 8px;
    border: 1.5px solid transparent; box-shadow: 0 2px 6px rgba(0,0,0,.22);
    transition: transform .12s, box-shadow .12s, background .12s;
}
.pos-actions .pos-btn.ui-button .ui-button-text { font-weight: 700; white-space: nowrap; padding-top: 3px; padding-bottom: 3px; }
.pos-actions .pos-btn.ui-button .ui-icon, .pos-actions .pos-btn.ui-button .ui-button-icon-left { font-size: .85rem; }
.pos-actions .pos-btn.ui-button:enabled:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.3); }
/* Em janelas estreitas a barra empilha: info em cima, botões em linha por baixo */
.pos-status { flex-wrap: wrap; row-gap: 10px; }
.pos-status .pos-actions { margin-left: auto; }
/* Movimento de Caixa — verde marca (acção principal da barra) */
.pos-btn.btn-mov.ui-button { background: var(--brand); border-color: var(--brand); color: #fff; }
.pos-btn.btn-mov.ui-button:enabled:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
/* Bloqueio do Ponto de Venda (configuração PIN/inactividade) — contorno claro */
.pos-btn.btn-lockcfg.ui-button { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.55); color: #fff; }
.pos-btn.btn-lockcfg.ui-button:enabled:hover { background: rgba(255,255,255,.22); border-color: #fff; }
/* Bloquear — âmbar de aviso */
.pos-btn.btn-lock.ui-button { background: #f2a33c; border-color: #f2a33c; color: #24313a; }
.pos-btn.btn-lock.ui-button:enabled:hover { background: #f7b45c; border-color: #f7b45c; }
.pos-btn.btn-lock.ui-button .ui-button-text, .pos-btn.btn-lock.ui-button .ui-icon { color: #24313a; }
/* Fechar Caixa — vermelho */
.pos-btn.btn-fechar.ui-button { background: #e35b5b; border-color: #e35b5b; color: #fff; }
.pos-btn.btn-fechar.ui-button:enabled:hover, .pos-btn.btn-fechar.ui-button:not(.ui-state-disabled):hover { background: #d64545; border-color: #d64545; }
/* Estado desactivado ainda legível na barra escura */
.pos-actions .pos-btn.ui-button.ui-state-disabled { opacity: .55; background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.25); color: #dfe9ea; }

/* Barra de ícones do catálogo (leitor, pesquisa, vista, actualizar, ecrã inteiro) */
.pos-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.pos-toolbar .tb-btn {
    width: 40px; height: 40px; border-radius: 9px; border: 1px solid var(--border); background: #fff;
    color: var(--muted); display: grid; place-items: center; cursor: pointer; font-size: 1rem; transition: all .15s;
}
.pos-toolbar .tb-btn:hover { border-color: var(--brand); color: var(--brand-dark); }
.pos-toolbar .tb-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pos-toolbar .tb-search {
    flex: 1; min-width: 180px; display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid var(--border); border-radius: 9px; padding: 2px 12px; box-shadow: var(--shadow);
}
.pos-toolbar .tb-search i { color: var(--muted); }
.pos-toolbar .tb-search .ui-inputtext { border: none !important; box-shadow: none !important; background: transparent; width: 100%; }

/* Estado vazio grande do catálogo (estilo SmartGest) */
.pos-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 56px 20px; color: var(--muted); text-align: center; }
.pos-empty i { font-size: 3rem; opacity: .35; }
.pos-empty .em-sub { font-size: .8rem; }

/* Cabeçalho do cliente no topo do carrinho */
.cart-client { padding: 12px 16px; border-bottom: 1px solid var(--border); background: #fff; }
.cart-client .cc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cart-client .cc-label { font-size: .7rem; letter-spacing: .5px; color: var(--muted); text-transform: uppercase; font-weight: 700; }
.cart-client .cc-novo { color: var(--brand-dark); font-size: .8rem; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.cart-client .cc-novo:hover { text-decoration: underline; }
.cart-client .cc-box { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px; font-size: .85rem; color: var(--text-strong); font-weight: 600; }
.cart-client .cc-box .cc-nif { color: var(--muted); font-size: .76rem; font-weight: 500; }
/* Overlay de bloqueio do POS */
.pos-lock {
    position: fixed; inset: 0; z-index: 3000; background: rgba(12,38,44,.95);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; color: #fff;
}
.pos-lock .lk-ic { width: 84px; height: 84px; border-radius: 50%; background: rgba(255,255,255,.08); display: grid; place-items: center; font-size: 2.4rem; color: var(--brand); }
.pos-lock .lk-msg { font-size: 1.15rem; font-weight: 600; }
.pos-lock .lk-sub { font-size: .85rem; color: #a9c2c6; margin-top: -10px; }
/* Carrossel de media no ecrã de bloqueio: ocupa o ecrã e auto-ajusta (autoresize) */
.pos-lock .lk-media { width: 100vw; flex: 1 1 auto; min-height: 0; display: flex; align-items: center;
    justify-content: center; margin-bottom: 4px; }
.pos-lock .lk-slide { display: none; flex-direction: column; align-items: center; gap: 10px;
    width: 100%; height: 100%; justify-content: center; animation: pcFade .4s ease; }
.pos-lock .lk-slide.active { display: flex; }
.pos-lock .lk-media-el { width: auto; height: auto; max-width: 96vw; max-height: 68vh;
    border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.5); object-fit: contain; }
.pos-lock .lk-media-cap { font-size: 1rem; color: #d7e6e8; text-align: center; max-width: 90vw; }

/* Ecrã completo de Comunicados do CRM (após 30s de inactividade) */
.pos-comunicados { position: fixed; inset: 0; z-index: 2900; background: rgba(8,30,36,.97);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
    color: #fff; padding: 4vh 4vw; cursor: pointer; }
.pos-comunicados .pc-header { font-size: 1.5rem; font-weight: 800; color: var(--brand);
    display: flex; align-items: center; gap: 10px; }
.pos-comunicados .pc-body { display: flex; flex-direction: column; gap: 16px; width: 100%;
    max-width: 920px; max-height: 74vh; overflow: auto; }
.pos-comunicados .pc-item { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
    border-radius: 14px; padding: 16px 22px; }
.pos-comunicados .pc-item.pc-priv { border-color: #6366f1; background: rgba(99,102,241,.12); }
.pos-comunicados .pc-assunto { font-size: 1.2rem; font-weight: 700; margin-bottom: 6px; }
.pos-comunicados .pc-badge { font-size: .68rem; background: #4338ca; color: #e0e7ff;
    padding: 2px 9px; border-radius: 20px; margin-left: 8px; vertical-align: middle; }
.pos-comunicados .pc-msg { font-size: 1.05rem; color: #dbe7ea; white-space: pre-wrap; }
/* Media do carrossel: auto-ajusta ao ecrã completo mantendo a proporção */
.pos-comunicados .pc-media { width: auto; height: auto; max-width: 92vw; max-height: 62vh;
    border-radius: 10px; margin-top: 12px; display: block; object-fit: contain; }
.pos-comunicados .pc-foot { font-size: .9rem; color: #9fb6ba; display: flex; align-items: center; gap: 8px; }
/* Carrossel: um slide de cada vez */
.pos-comunicados .pc-carousel { width: 100%; max-width: 920px; display: flex; align-items: center; justify-content: center; }
.pos-comunicados .pc-slide { display: none; flex-direction: column; align-items: center; gap: 12px;
    text-align: center; width: 100%; max-height: 78vh; overflow: auto; animation: pcFade .4s ease; }
.pos-comunicados .pc-slide.active { display: flex; }
.pos-comunicados .pc-slide.pc-priv .pc-header { color: #a5b4fc; }
@keyframes pcFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pos-comunicados .pc-dots { display: flex; gap: 8px; }
.pos-comunicados .pc-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.25); }
.pos-comunicados .pc-dot.on { background: var(--brand); }
.pos-pin-input.ui-inputfield, .pos-pin-input input { text-align: center; letter-spacing: 8px; font-size: 1.2rem; width: 170px; }

/* Gate de abertura de caixa — obrigatório antes de operar. Cobre apenas a área
   de conteúdo (sidebar/topbar continuam utilizáveis); em ecrã inteiro cobre tudo. */
.pos-gate {
    position: fixed; left: var(--sidebar-w); top: var(--topbar-h); right: 0; bottom: 0;
    z-index: 2500; background: rgba(15,46,53,.45); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
body.pos-fullscreen .pos-gate { left: 0; top: 0; }
.gate-card {
    background: #fff; border-radius: 16px; padding: 28px 32px; width: min(430px, 92vw);
    text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.35);
    display: flex; flex-direction: column; gap: 12px;
}
.gate-card .gt-ic { width: 64px; height: 64px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); display: grid; place-items: center; font-size: 1.6rem; margin: 0 auto; }
.gate-card h2 { margin: 0; font-size: 1.2rem; color: var(--text-strong); }
.gate-card p { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.55; }
.gate-card label { font-size: .74rem; font-weight: 700; color: #55636a; text-transform: uppercase; letter-spacing: .5px; text-align: left; margin-top: 4px; }

/* Campos dos diálogos do POS (bloqueio / movimento de caixa) */
.dlg-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.dlg-field label { font-size: .74rem; font-weight: 700; color: #55636a; text-transform: uppercase; letter-spacing: .5px; display: flex; align-items: center; gap: 6px; }
.dlg-field label i { color: var(--brand); }
.dlg-field small { color: var(--muted); font-size: .74rem; }
.dlg-actions { display: flex; justify-content: center; gap: 8px; margin-top: 4px; }

/* Resumo do movimento de caixa */
.mov-resumo { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 10px; }
.mov-resumo .row { display: flex; justify-content: space-between; align-items: center; font-size: .87rem; padding: 4px 0; color: var(--text); }
.mov-resumo .row i { margin-right: 6px; }
.mov-resumo .row.in i, .mov-resumo .row.in span:last-child { color: var(--brand-dark); font-weight: 700; }
.mov-resumo .row.out i, .mov-resumo .row.out span:last-child { color: #c62828; font-weight: 700; }
.mov-resumo .row.saldo { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 9px; font-weight: 700; color: var(--text-strong); }
.pos-status {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--sidebar-bg); color: #fff; padding: 10px 16px; border-radius: 12px; margin-bottom: 14px;
}
.pos-status .dot { font-size: .7rem; }
.pos-status .caixa { background: rgba(255,255,255,.14); padding: 3px 10px; border-radius: 20px; font-size: .75rem; }

.pos-search {
    display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border);
    border-radius: 10px; padding: 2px 12px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.pos-search i { color: var(--muted); }
.pos-search .ui-inputtext { border: none !important; box-shadow: none !important; background: transparent; }

/* Filtros de categoria (chips) */
.pos-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pos-cat {
    border: 1px solid var(--border); background: #fff; border-radius: 30px; padding: 6px 15px;
    font-size: .8rem; font-weight: 600; color: var(--text); cursor: pointer; text-decoration: none; transition: all .15s;
}
.pos-cat:hover { border-color: var(--brand); color: var(--brand-dark); }
.pos-cat.sel { background: var(--brand); border-color: var(--brand); color: #fff; }

.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.pos-prod {
    display: block; background: #fff; border: 1px solid var(--border); border-radius: 12px;
    padding: 14px 10px; text-align: center; cursor: pointer; transition: all .15s ease; text-decoration: none;
}
.pos-prod:hover { border-color: var(--brand); box-shadow: 0 6px 16px rgba(0,169,157,.18); transform: translateY(-2px); }
.pos-prod .ic {
    width: 46px; height: 46px; border-radius: 13px; background: var(--brand-soft); color: var(--brand-dark);
    display: grid; place-items: center; margin: 0 auto 9px; font-size: 1.25rem;
}
.pos-prod .nm { font-size: .82rem; font-weight: 600; color: var(--text-strong); line-height: 1.3; min-height: 2.1em; }
.pos-prod .pr { margin-top: 6px; font-size: .92rem; font-weight: 700; color: var(--brand-dark); }

.pos-cart { background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; position: sticky; top: 76px; }
.pos-cart .cart-head { background: var(--brand); color: #fff; padding: 12px 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.pos-cart .cart-body { padding: 6px 16px; max-height: 42vh; overflow-y: auto; }
.cart-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.cart-item .nm { flex: 1; font-size: .83rem; font-weight: 600; color: var(--text-strong); }
.cart-item .nm small { display: block; color: var(--muted); font-weight: 500; font-size: .72rem; }
.cart-item .lt { font-weight: 700; color: var(--text-strong); font-size: .85rem; white-space: nowrap; }
.cart-item .qty { display: flex; align-items: center; gap: 4px; }
.cart-item .qty .qv { min-width: 22px; text-align: center; font-weight: 700; font-size: .82rem; }
.qty-btn.ui-button { width: 1.7rem; height: 1.7rem; padding: 0; border-radius: 50%; background: #fff; color: var(--brand-dark); border: 1px solid var(--border); box-shadow: none; }
.qty-btn.ui-button:enabled:hover { background: var(--brand-soft); border-color: var(--brand); }
.qty-btn.ui-button .ui-icon, .qty-btn .ui-button-icon { color: var(--brand-dark); }
.cart-empty { text-align: center; color: var(--muted); padding: 34px 10px; font-size: .85rem; }
.cart-empty i { display: block; font-size: 2rem; margin-bottom: 8px; opacity: .5; }

.pos-totals { padding: 12px 16px; background: #f7f9fb; border-top: 1px solid var(--border); }
.pos-totals .row { display: flex; justify-content: space-between; font-size: .85rem; padding: 3px 0; color: var(--text); }
.pos-totals .grand { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 10px; border-top: 2px solid var(--brand); font-size: 1.3rem; font-weight: 700; color: var(--brand-dark); }

.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px 16px 4px; }
.pay-opt { border: 1.5px solid var(--border); border-radius: 10px; padding: 10px 6px; text-align: center; cursor: pointer; transition: all .15s; background: #fff; text-decoration: none; display: block; }
.pay-opt i { font-size: 1.25rem; color: var(--muted); display: block; margin-bottom: 5px; }
.pay-opt span { font-size: .72rem; font-weight: 600; color: var(--text); }
.pay-opt.sel { border-color: var(--brand); background: var(--brand-soft); }
.pay-opt.sel i, .pay-opt.sel span { color: var(--brand-dark); }
.pos-pay-wrap { padding: 12px 16px 16px; }
.pos-pay-btn.ui-button { width: 100%; padding: 14px; font-size: 1rem; font-weight: 700; border-radius: 10px; justify-content: center; }

/* Em janelas mais estreitas o carrinho encolhe mas MANTÉM-SE à direita;
   só passa a coluna única em ecrãs muito pequenos (tablet vertical/telemóvel). */
@media (max-width: 1240px) { .pos-layout { grid-template-columns: minmax(0,1fr) 320px; } }
@media (max-width: 980px)  { .pos-layout { grid-template-columns: minmax(0,1fr) 290px; } }
@media (max-width: 760px)  { .pos-layout { grid-template-columns: 1fr; } .pos-cart { position: static; } }

/* ================================================================
   POS em ECRÃ INTEIRO — esconde a sidebar e a topbar, o POS ocupa
   toda a largura. A classe é activada por JS (fullscreenchange).
   ================================================================ */
body.pos-fullscreen .sidebar,
body.pos-fullscreen .topbar,
body.pos-fullscreen .app-footer { display: none !important; }
body.pos-fullscreen .main-content { margin-left: 0 !important; margin-top: 0 !important; padding: 12px !important; min-height: 100vh; }
body.pos-fullscreen .pos-cart { top: 12px; }

/* ================================================================
   Ecrã de Produtos (estilo SmartGest): cartões, filtros e badges
   ================================================================ */
.prod-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.pstat {
    background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
    padding: 14px 16px; display: flex; align-items: center; gap: 12px;
}
.pstat .ic {
    width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center;
    font-size: 1.1rem; background: var(--brand-soft); color: var(--brand-dark); flex-shrink: 0;
}
.pstat .ic.ok   { background: #e8f5e9; color: #2e7d32; }
.pstat .ic.warn { background: #fdf3e0; color: #b26a00; }
.pstat .v { font-size: 1.22rem; font-weight: 700; color: var(--text-strong); line-height: 1.15; }
.pstat .l { font-size: .74rem; color: var(--muted); }

.prod-toolbar { flex-wrap: wrap; row-gap: 10px; }
.prod-toolbar .filtro { min-width: 170px; }

.prod-nome { font-weight: 600; color: var(--text-strong); }
.prod-desc { font-size: .74rem; color: var(--muted); margin-top: 2px; }

.badge-estado { padding: 3px 12px; border-radius: 20px; font-size: .72rem; font-weight: 700; display: inline-block; }
.badge-estado.on  { background: var(--brand-soft); color: var(--brand-700); }
.badge-estado.off { background: #fdecec; color: #b3261e; }

.stock-pill {
    padding: 3px 10px; border-radius: 20px; font-size: .76rem; font-weight: 700;
    background: #e8f5e9; color: #2e7d32; display: inline-flex; align-items: center; gap: 5px;
}
.stock-pill.baixo { background: #fdecec; color: #c62828; }

/* Formulários em abas (produto, etc.): grelha de 2 colunas */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.form-grid-2 .span-2 { grid-column: 1 / -1; }
.form-grid-2 .ui-inputtext, .form-grid-2 .ui-selectonemenu, .form-grid-2 .ui-inputnumber,
.form-grid-2 .ui-inputtextarea, .form-grid-2 .ui-inputnumber .ui-inputfield { width: 100%; box-sizing: border-box; }
.dlg-field .req { color: #c62828; font-weight: 700; }
@media (max-width: 760px) { .form-grid-2 { grid-template-columns: 1fr; } }

/* Selector de idioma no topbar (dropdown por hover) */
.lang-menu { position: relative; }
.lang-menu .lang { cursor: pointer; user-select: none; }
.lang-menu .lang-drop {
    display: none; position: absolute; right: 0; top: 100%; padding-top: 8px; z-index: 1500;
    background: transparent; border: none; margin: 0;
}
.lang-menu:hover .lang-drop { display: block; }
.lang-box {
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    box-shadow: var(--shadow-md); min-width: 175px; padding: 6px;
    display: flex; flex-direction: column; gap: 2px;
}
.lang-box a { padding: 8px 12px; border-radius: 8px; font-size: .85rem; color: var(--text); text-decoration: none; white-space: nowrap; }
.lang-box a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.lang-box a.sel { background: var(--brand); color: #fff; font-weight: 600; }

/* Diálogo Gerir Categorias */
.cat-add { display: flex; gap: 8px; margin-bottom: 14px; }
.cat-row {
    display: flex; align-items: center; gap: 10px; padding: 8px 4px;
    border-bottom: 1px solid var(--border); font-size: .87rem;
}
.cat-row .cat-nome { flex: 1; font-weight: 600; color: var(--text-strong); }
.cat-row .cat-total { color: var(--muted); font-size: .76rem; white-space: nowrap; }

/* Diálogo Inserção Múltipla */
.lote-head, .lote-row {
    display: grid; grid-template-columns: 100px 1fr 130px 110px 80px 100px 40px;
    gap: 8px; align-items: center; margin-bottom: 8px;
}
.lote-head span { font-size: .7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.lote-row .ui-inputtext, .lote-row .ui-selectonemenu, .lote-row .ui-inputnumber,
.lote-row .ui-inputnumber .ui-inputfield { width: 100%; box-sizing: border-box; }

/* Resumo de produtos na lista de vendas (elipse com tooltip) */
.venda-produtos {
    display: inline-block; max-width: 240px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
    color: var(--text); font-size: .82rem;
}

/* POS — vista em lista do catálogo */
.pos-toolbar .tb-group { display: flex; gap: 6px; }
.pos-list { display: flex; flex-direction: column; gap: 8px; }
.pos-lrow {
    display: flex; align-items: center; gap: 12px; background: #fff;
    border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px;
    cursor: pointer; text-decoration: none; transition: all .15s ease;
}
.pos-lrow:hover { border-color: var(--brand); box-shadow: 0 4px 12px rgba(0,169,157,.16); transform: translateX(2px); }
.pos-lrow .ic {
    width: 38px; height: 38px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-dark);
    display: grid; place-items: center; font-size: 1.05rem; flex-shrink: 0;
}
.pos-lrow .nm { flex: 1; font-size: .87rem; font-weight: 600; color: var(--text-strong); min-width: 0; }
.pos-lrow .nm small { display: block; color: var(--muted); font-weight: 500; font-size: .72rem; font-family: monospace; }
.pos-lrow .st { font-size: .74rem; color: var(--muted); white-space: nowrap; }
.pos-lrow .pr { font-size: .95rem; font-weight: 700; color: var(--brand-dark); white-space: nowrap; }

/* Upload do logótipo (Configurações › Dados da Empresa) */
.logo-box { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.logo-preview {
    width: 150px; height: 100px; border: 1px dashed var(--border); border-radius: 10px;
    display: grid; place-items: center; background: #fafbfc; overflow: hidden; flex-shrink: 0;
}
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-preview .logo-vazio { color: var(--muted); font-size: .8rem; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.logo-preview .logo-vazio i { font-size: 1.6rem; opacity: .5; }
.logo-actions { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 220px; }
.logo-actions small { color: var(--muted); font-size: .74rem; }

/* Rodapé */
.app-footer { text-align: center; padding: 18px; color: var(--muted); font-size: .75rem; }

/* Responsivo — o menu principal mantém-se SEMPRE como coluna vertical à
   esquerda (aplicação de secretária). Em janelas estreitas fica apenas um
   pouco mais compacto, nunca escondido. */
@media (max-width: 1000px) {
    :root { --sidebar-w: 200px; }
    .sidebar { width: 200px; }
    .sidebar a, .sidebar .menu-item { padding: 10px 16px; font-size: .82rem; }
    .main-content { padding: 20px 16px; }
}
@media (max-width: 680px) {
    :root { --sidebar-w: 168px; }
    .sidebar { width: 168px; }
    .main-content { padding: 16px 12px; }
}
