
    :root {
      --primary: #1F4E79;
      --primary-dark: #173b5c;
      --secondary: #2F7D6B;
      --secondary-hover: #276756;
      --bg-color: #F5F7FA;
      --text-dark: #111827;
      --text-muted: #6b7280;
      --danger: #dc2626;
      --danger-dark: #b91c1c;
      --warning: #ca8a04;
      --success: #16a34a;
      --border: #d1d5db;
      --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, .09), 0 2px 4px -1px rgba(0, 0, 0, .05);
    }

    * { box-sizing: border-box; }

    html, body { min-height: 100%; }

    body {
      margin: 0;
      font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
      background: var(--bg-color);
      color: var(--text-dark);
    }

    button, input, select, textarea { font-family: inherit; }

    /* LOGIN */
    .login-page {
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px;
      background: linear-gradient(135deg, #1F4E79 0%, #2F7D6B 100%);
    }

    .login-card {
      background: #fff;
      width: min(420px, 100%);
      padding: 40px;
      border-radius: 16px;
      box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .12), 0 10px 10px -5px rgba(0, 0, 0, .05);
    }

    .login-icon {
      width: 64px;
      height: 64px;
      margin: 0 auto 14px;
      display: grid;
      place-items: center;
      border-radius: 18px;
      background: #eef6f4;
      color: var(--secondary);
      font-size: 28px;
    }

    .login-card h2 {
      color: var(--primary);
      margin: 0;
      text-align: center;
      font-size: 25px;
    }

    .login-subtitle {
      text-align: center;
      color: var(--secondary);
      font-weight: 700;
      margin: 7px 0 24px;
      font-size: 14px;
    }

    .login-footer {
      text-align: center;
      font-size: 12px;
      color: var(--text-muted);
      margin-top: 24px;
      line-height: 1.5;
    }

    /* FORMULÁRIOS */
    label {
      display: block;
      color: #4b5563;
      font-weight: 700;
      font-size: 13px;
      margin-bottom: 6px;
    }

    input, select, textarea {
      width: 100%;
      padding: 11px 14px;
      font-size: 15px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: #fff;
      transition: border-color .2s, box-shadow .2s;
    }

    textarea { min-height: 90px; resize: vertical; }

    input:focus, select:focus, textarea:focus {
      outline: none;
      border-color: var(--secondary);
      box-shadow: 0 0 0 3px rgba(47, 125, 107, .16);
    }

    input:disabled, select:disabled, textarea:disabled {
      background: #f3f4f6;
      color: #6b7280;
      cursor: not-allowed;
    }

    .field { min-width: 0; }
    .field-help { color: var(--text-muted); font-size: 12px; margin-top: 5px; }

    button {
      background: var(--secondary);
      color: #fff;
      padding: 11px 15px;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      font-weight: 700;
      font-size: 14px;
      transition: background .2s, transform .2s, opacity .2s;
    }

    button:hover:not(:disabled) {
      background: var(--secondary-hover);
      transform: translateY(-1px);
    }

    button:disabled {
      background: #94a3b8 !important;
      cursor: not-allowed;
      opacity: .78;
      transform: none !important;
    }

    .btn-primary { background: var(--primary); }
    .btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
    .btn-danger { background: var(--danger); }
    .btn-danger:hover:not(:disabled) { background: var(--danger-dark); }
    .btn-muted { background: #6b7280; }
    .btn-muted:hover:not(:disabled) { background: #4b5563; }
    .btn-light { background: #e5e7eb; color: #374151; }
    .btn-light:hover:not(:disabled) { background: #d1d5db; }
    .btn-block { width: 100%; }
    .btn-lg { padding: 14px 18px; font-size: 16px; }
    .btn-sm { padding: 7px 10px; font-size: 12px; }

    .app { display: none; min-height: 100vh; }

    /* SIDEBAR */
    .sidebar {
      width: 270px;
      background: var(--primary);
      color: #fff;
      padding: 22px 18px;
      position: fixed;
      inset: 0 auto 0 0;
      overflow-y: auto;
      z-index: 20;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 3px 6px 18px;
      border-bottom: 1px solid rgba(255,255,255,.12);
    }

    .brand-icon {
      flex: 0 0 44px;
      width: 44px;
      height: 44px;
      display: grid;
      place-items: center;
      border-radius: 12px;
      background: rgba(255,255,255,.13);
      font-size: 20px;
    }

    .brand h3 { margin: 0 0 2px; font-size: 18px; }
    .brand small { color: #cbd5e1; font-size: 11px; line-height: 1.25; display: block; }

    .usuario-info {
      font-size: 13px;
      color: #cbd5e1;
      margin: 16px 6px 20px;
      line-height: 1.5;
    }

    .menu-section-title {
      font-size: 10px;
      letter-spacing: .08em;
      color: #94a3b8;
      text-transform: uppercase;
      margin: 18px 10px 7px;
      font-weight: 800;
    }

    .menu-btn {
      width: 100%;
      background: transparent;
      color: #e2e8f0;
      border: none;
      text-align: left;
      margin: 2px 0;
      padding: 11px 13px;
      border-radius: 8px;
      font-weight: 500;
      transform: none !important;
    }

    .menu-btn i { margin-right: 10px; width: 20px; text-align: center; }
    .menu-btn:hover, .menu-btn.active { background: rgba(255,255,255,.14); color: #fff; }
    .menu-btn.sair { background: var(--danger); margin-top: 22px; text-align: center; }
    .menu-btn.sair:hover { background: var(--danger-dark); }
    .menu-btn.estoque { border: 1px solid rgba(255,255,255,.22); margin-top: 12px; }

    /* CONTEÚDO */
    .content {
      margin-left: 270px;
      padding: 30px;
      min-height: 100vh;
    }

    .content-inner { max-width: 1450px; margin: 0 auto; }

    .page-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 16px;
      margin-bottom: 20px;
    }

    .page-header h1 {
      margin: 0;
      color: var(--primary);
      font-size: 24px;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .page-header p { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; }

    .card {
      background: #fff;
      padding: 22px;
      border-radius: 12px;
      box-shadow: var(--card-shadow);
      margin-bottom: 20px;
    }

    .card.compact { padding: 17px; }

    .card h3 {
      margin: 0 0 16px;
      color: var(--primary);
      border-bottom: 2px solid #f3f4f6;
      padding-bottom: 10px;
      font-size: 17px;
    }

    .grid-cards {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 15px;
      margin-bottom: 20px;
    }

    .mini-card {
      background: #fff;
      border-top: 4px solid var(--primary);
      padding: 18px;
      border-radius: 12px;
      box-shadow: var(--card-shadow);
      min-height: 116px;
      display: flex;
      align-items: center;
      gap: 15px;
    }

    .mini-card-icon {
      width: 46px;
      height: 46px;
      border-radius: 12px;
      display: grid;
      place-items: center;
      background: #eff6ff;
      color: var(--primary);
      font-size: 20px;
      flex: 0 0 auto;
    }

    .mini-card small { display: block; color: var(--text-muted); font-size: 12px; }
    .mini-card strong { display: block; color: var(--primary); font-size: 29px; line-height: 1.1; margin-top: 5px; }

    .form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
    .form-grid-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 15px; }
    .form-grid-4 { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 13px; align-items: end; }
    .layout-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
    .layout-main-side { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(270px, .65fr); gap: 20px; }

    .actions-row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 17px; flex-wrap: wrap; }
    .actions-row.left { justify-content: flex-start; }

    .divider { height: 1px; background: #e5e7eb; margin: 20px 0; }

    /* MENSAGENS */
    .message {
      display: none;
      padding: 12px 14px;
      border-radius: 9px;
      margin-top: 14px;
      font-size: 14px;
      font-weight: 700;
      border: 1px solid transparent;
    }

    .message.show { display: block; }
    .message.info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
    .message.success { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
    .message.error { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
    .message.warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }

    .status-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 5px 9px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
    }

    .status-pill.success { background: #dcfce7; color: #15803d; }
    .status-pill.danger { background: #fee2e2; color: #b91c1c; }
    .status-pill.warning { background: #fef3c7; color: #92400e; }
    .status-pill.neutral { background: #e5e7eb; color: #4b5563; }

    /* TABELAS */
    .table-wrap { width: 100%; overflow-x: auto; }
    .table-moderna { width: 100%; border-collapse: collapse; font-size: 13px; }
    .table-moderna th {
      text-align: left;
      padding: 11px 9px;
      border-bottom: 2px solid #e5e7eb;
      color: var(--text-muted);
      background: #f9fafb;
      white-space: nowrap;
    }
    .table-moderna td { padding: 11px 9px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
    .table-moderna tr:hover td { background: #f9fafb; }
    .text-right { text-align: right !important; }
    .text-center { text-align: center !important; }

    /* CADASTRO */
    .titular-preview {
      padding: 13px 15px;
      border: 1px dashed #bfdbfe;
      border-radius: 10px;
      background: #f8fbff;
      color: #374151;
      margin-bottom: 13px;
    }

    .titular-preview strong { color: var(--primary); }

    /* ENTREGA */
    .cpf-search-card {
      background: linear-gradient(135deg, #ffffff 0%, #f5fbf9 100%);
      border-left: 5px solid var(--secondary);
    }

    .cpf-search-wrap { display: grid; grid-template-columns: minmax(300px, 650px) 1fr; gap: 18px; align-items: end; }

    .cpf-input {
      font-size: 26px;
      letter-spacing: .07em;
      font-weight: 700;
      padding: 15px 18px;
      color: var(--primary);
    }

    .search-state {
      min-height: 58px;
      display: flex;
      align-items: center;
      color: var(--text-muted);
      font-weight: 600;
    }

    .family-info-card {
      border-left: 5px solid var(--primary);
      height: 100%;
    }

    .family-info-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }

    .info-box {
      background: #f9fafb;
      border: 1px solid #e5e7eb;
      border-radius: 9px;
      padding: 12px;
    }

    .info-box small { color: var(--text-muted); display: block; font-size: 11px; margin-bottom: 4px; }
    .info-box strong { color: #1f2937; font-size: 14px; }

    .marmita-card {
      height: 100%;
      min-height: 190px;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      background: linear-gradient(145deg, #1F4E79, #2F7D6B);
      color: #fff;
      border-radius: 12px;
      box-shadow: var(--card-shadow);
      padding: 20px;
    }

    .marmita-card small { display: block; opacity: .87; font-weight: 700; letter-spacing: .07em; }
    .marmita-card strong { display: block; font-size: 66px; line-height: 1; margin: 10px 0; }
    .marmita-card span { font-weight: 700; }

    .members-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 11px;
    }

    .member-option {
      border: 1px solid #dbe3ea;
      border-radius: 10px;
      padding: 13px;
      background: #fff;
      transition: border-color .2s, background .2s, transform .2s;
      display: flex;
      align-items: center;
      gap: 11px;
      min-height: 76px;
    }

    .member-option.selectable { cursor: pointer; }
    .member-option.selectable:hover { border-color: var(--secondary); background: #f5fbf9; transform: translateY(-1px); }
    .member-option.selected { border: 2px solid var(--secondary); background: #edf8f5; }
    .member-option.blocked { background: #f3f4f6; color: #9ca3af; }
    .member-option input[type="radio"] { width: 19px; height: 19px; margin: 0; flex: 0 0 auto; accent-color: var(--secondary); }
    .member-option .member-name { font-weight: 800; color: #1f2937; font-size: 13px; }
    .member-option.blocked .member-name { color: #6b7280; }
    .member-option .member-meta { color: var(--text-muted); font-size: 11px; margin-top: 4px; }

    .delivery-confirm {
      display: grid;
      grid-template-columns: 1fr minmax(300px, 450px);
      gap: 16px;
      align-items: center;
      margin-top: 18px;
    }

    .duplicate-card {
      background: #fff7ed;
      border: 1px solid #fed7aa;
      border-left: 6px solid #f97316;
      padding: 18px;
      border-radius: 10px;
    }
    .duplicate-card h3 { color: #c2410c; border: 0; margin-bottom: 9px; padding: 0; }

    /* MODAL */
    .modal-fundo {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, .58);
      z-index: 9999;
      align-items: center;
      justify-content: center;
      padding: 24px;
    }

    .modal-fundo.show { display: flex; }
    .modal-card {
      background: #fff;
      width: min(980px, 100%);
      max-height: 90vh;
      overflow-y: auto;
      padding: 25px;
      border-radius: 15px;
      box-shadow: 0 22px 55px rgba(0,0,0,.28);
      border-top: 6px solid var(--primary);
    }
    .modal-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 18px; }
    .modal-header h2 { color: var(--primary); margin: 0; font-size: 21px; }
    .modal-close { background: #e5e7eb; color: #374151; padding: 8px 11px; }


    .marmita-card.editable {
      cursor: pointer;
      position: relative;
      transition: transform .2s, box-shadow .2s;
    }
    .marmita-card.editable:hover {
      transform: translateY(-2px);
      box-shadow: 0 15px 34px rgba(31,78,121,.2);
    }
    .marmita-edit-hint {
      margin-top: 11px;
      font-size: 11px;
      font-weight: 700;
      opacity: .78;
    }
    .marmita-editor { width: min(230px, 100%); }
    .marmita-editor input {
      margin: 12px 0 8px;
      text-align: center;
      font-size: 34px;
      font-weight: 800;
      color: var(--primary);
      background: #fff;
    }
    .marmita-editor-actions { display:flex; gap:8px; justify-content:center; }
    .marmita-editor-actions button { margin:0; }

    .member-option.manage { position: relative; padding-right: 90px; }
    .member-option.inactive {
      background: #f3f4f6;
      border-style: dashed;
      opacity: .8;
    }
    .member-actions {
      position: absolute;
      top: 9px;
      right: 9px;
      display: flex;
      gap: 6px;
    }
    .icon-btn {
      width: 31px;
      height: 31px;
      padding: 0;
      display: grid;
      place-items: center;
      border-radius: 8px;
      font-size: 12px;
    }
    .info-box.editable-info { position: relative; padding-right: 48px; }
    .info-box.editable-info .icon-btn { position:absolute; right:9px; top:9px; }
    .family-actions-bar {
      display:flex;
      justify-content:flex-end;
      gap:9px;
      flex-wrap:wrap;
      margin:-2px 0 17px;
    }
    .modal-card.modal-card-sm { width:min(520px, 100%); }
    .modal-secundario { z-index: 10050; }
    .modal-action-text { color:#4b5563; line-height:1.55; margin-bottom:15px; }

    /* RELATÓRIO */
    .report-summary {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
      margin: 17px 0;
    }
    .report-summary .info-box { text-align: center; }
    .report-summary .info-box strong { display: block; color: var(--primary); font-size: 25px; margin-top: 3px; }
    .report-title { text-align: center; margin-bottom: 18px; }
    .report-title h2 { color: var(--primary); margin: 0 0 5px; }
    .report-title p { margin: 3px 0; color: #4b5563; }

    .empty-state {
      text-align: center;
      color: var(--text-muted);
      padding: 34px 15px;
    }
    .empty-state i { display: block; font-size: 34px; color: #cbd5e1; margin-bottom: 10px; }

    @media (max-width: 1150px) {
      .grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .members-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .form-grid-3 { grid-template-columns: 1.5fr 1fr 1fr; }
    }

    @media (max-width: 800px) {
      .sidebar { position: relative; width: 100%; inset: auto; }
      .content { margin-left: 0; padding: 18px; }
      .app { flex-direction: column; }
      .layout-2, .layout-main-side, .form-grid-2, .form-grid-3, .form-grid-4,
      .cpf-search-wrap, .delivery-confirm { grid-template-columns: 1fr; }
      .members-grid { grid-template-columns: 1fr; }
      .grid-cards { grid-template-columns: 1fr; }
      .report-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .page-header { align-items: flex-start; flex-direction: column; }
      .cpf-input { font-size: 21px; }
    }

    @media print {
      body { background: #fff; }
      body * { visibility: hidden !important; }
      #areaRelatorio, #areaRelatorio * { visibility: visible !important; }
      #areaRelatorio {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        box-shadow: none;
        margin: 0;
        padding: 0;
      }
      #areaRelatorio .no-print { display: none !important; }
      .table-moderna { font-size: 11px; }
      .table-moderna th, .table-moderna td { padding: 7px 6px; }
    }
  
[hidden]{display:none!important}.entrada{min-height:100svh;display:flex;flex-direction:column;background:#f3f5f1;color:#183b32}
.inst{display:flex;align-items:center;gap:12px;padding:24px max(5vw,20px);border-bottom:1px solid #dbe1da;font-size:15px;font-weight:750}
.inst small{display:block;font-size:12px;font-weight:450;color:#5b7169;margin-top:2px}.marca-unidade{display:grid;place-items:center;width:37px;height:37px;border-radius:10px;color:white;background:#235746;font-size:22px}
.entrada-main{flex:1;display:grid;place-items:center;padding:36px 16px}.acesso-card{width:min(432px,100%);background:#fff;padding:36px;border:1px solid #d4ded5;border-radius:18px;box-shadow:0 7px 24px #213d2910}
.emblema{height:50px;width:50px;display:grid;place-items:center;background:#e6efe5;color:#28593c;font-size:25px;border-radius:14px}
.acesso-card h1{letter-spacing:-1.4px;margin:23px 0 9px;font-size:clamp(27px,5vw,35px);line-height:1.12}.intro{color:#53675e;margin:0 0 26px;line-height:1.55}
.acesso-card .field{margin-top:16px}.acesso-card input{border:1px solid #bccac0;border-radius:7px}.acesso-card button{width:100%;background:#235746;display:flex;align-items:center;justify-content:space-between;padding:14px 17px;margin-top:22px}
.rodape{text-align:center;font-size:12px;color:#607369;padding:17px}.acesso-card label{color:#344c40}.acesso-card input:focus-visible{outline:2px solid #34775f}
