:root {
      --bg: #f4f4f5;
      --surface: #ffffff;
      --soft: #fafafa;
      --black: #080808;
      --black-soft: #18181b;
      --red: #c1121f;
      --red-dark: #8f0d16;
      --red-soft: #fee2e2;
      --text: #111111;
      --muted: #71717a;
      --line: #e4e4e7;
      --green: #15803d;
      --shadow: 0 20px 50px rgba(0, 0, 0, 0.10);
      --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.07);
      --radius: 22px;
    }

    * { box-sizing: border-box; }
    html, body { max-width: 100%; overflow-x: hidden; }
    body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
    button, input, select, textarea { font: inherit; }
    button { cursor: pointer; }
    .hidden { display: none !important; }

    .amf-logo-img { display: block; width: 38px; height: 38px; object-fit: contain; }
    .brand-icon .amf-logo-img { width: 32px; height: 32px; }

    .login-screen { min-height: 100vh; padding: 28px; background: radial-gradient(circle at 12% 10%, rgba(193, 18, 31, 0.22), transparent 34%), linear-gradient(135deg, #ffffff 0%, #f4f4f5 46%, #18181b 100%); display: grid; place-items: center; }
    #nexusScreen { place-items: start center; align-content: start; }
    .login-grid { width: min(1120px, 100%); display: grid; grid-template-columns: 1fr 0.86fr; gap: 44px; align-items: center; }
    .landing-shell { width: min(1240px, 100%); display: grid; gap: 28px; }
    .landing-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
    .landing-title { margin: 22px 0 0; font-size: clamp(42px, 6vw, 76px); line-height: 0.92; letter-spacing: -0.07em; font-weight: 950; color: var(--black); }
    .landing-title em { color: var(--red); font-style: normal; }
    .landing-text { max-width: 720px; margin: 18px 0 0; color: #3f3f46; font-size: 18px; line-height: 1.7; }
    .landing-brand { display: flex; align-items: center; gap: 12px; border-radius: 999px; background: rgba(8,8,8,0.92); color: white; padding: 10px 14px; box-shadow: var(--shadow-soft); font-size: 13px; font-weight: 950; white-space: nowrap; }
    .landing-brand .logo-block { width: 42px; height: 42px; border-radius: 14px; box-shadow: none; }
    .platform-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 18px; }
    .platform-card { position: relative; min-height: 190px; height: 100%; box-sizing: border-box; border: 1px solid var(--line); background: rgba(255,255,255,0.94); border-radius: 28px; padding: 22px; box-shadow: var(--shadow-soft); text-align: left; overflow: hidden; transition: 0.18s ease; }
    .platform-card::after { content: ""; position: absolute; right: -28px; bottom: -34px; width: 120px; height: 120px; border-radius: 999px; background: rgba(193,18,31,0.08); }
    .platform-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #fecaca; }
    .platform-card.enabled { cursor: pointer; }
    .platform-card.disabled { opacity: 0.66; cursor: default; }
    .platform-icon { width: 54px; height: 54px; flex: 0 0 auto; border-radius: 18px; display: grid; place-items: center; background: var(--black); color: white; font-size: 24px; font-weight: 950; margin-bottom: 18px; }
    .platform-card.enabled .platform-icon { background: var(--red); }
    .platform-icon svg { width: 28px; height: 28px; stroke: currentColor; fill: none; }
    .platform-option-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; }
    .platform-card h2 { margin: 0; font-size: 21px; letter-spacing: -0.035em; }
    .platform-card p { margin: 9px 0 0; color: var(--muted); line-height: 1.55; font-size: 14px; }
    .platform-badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; border-radius: 999px; padding: 7px 10px; background: #f4f4f5; color: #3f3f46; font-size: 12px; font-weight: 950; }
    .platform-card.enabled .platform-badge { background: var(--red-soft); color: #991b1b; }
    .platform-category-card { grid-column: span 1; min-height: 190px; cursor: default; padding: 0; border: 0; background: transparent; box-shadow: none; overflow: visible; position: relative; z-index: 1; align-self: stretch; }
    .platform-category-card.open { z-index: 50; }
    .platform-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(8,8,8,0.04); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
    .platform-backdrop.show { opacity: 1; pointer-events: auto; }
    .platform-category-card::after { display: none; }
    .platform-category-card:hover { transform: none; box-shadow: none; border-color: transparent; }
    .platform-category-card.open { border-color: #fecaca; box-shadow: var(--shadow); }
    .platform-category-toggle { position: relative; z-index: 2; width: 100%; height: 100%; min-height: 190px; border: 1px solid var(--line); background: #ffffff; border-radius: 28px; padding: 22px; display: flex; align-items: stretch; justify-content: space-between; gap: 18px; text-align: left; color: inherit; overflow: hidden; box-shadow: var(--shadow-soft); transition: 0.18s ease; }
    .platform-category-toggle::after { content: ""; position: absolute; right: -28px; bottom: -34px; width: 120px; height: 120px; border-radius: 999px; background: rgba(193,18,31,0.08); z-index: 0; }
    .platform-category-toggle > * { position: relative; z-index: 1; }
    .platform-category-card.open .platform-category-toggle, .platform-category-toggle:hover { border-color: #fecaca; box-shadow: var(--shadow); transform: translateY(-2px); }
    .platform-category-main { display: flex; gap: 18px; align-items: flex-start; min-width: 0; }
    .platform-category-copy h2 { margin: 0; font-size: 25px; letter-spacing: -0.045em; }
    .platform-category-copy p { margin: 9px 0 0; color: var(--muted); line-height: 1.55; font-size: 14px; max-width: 520px; }
    .platform-category-chevron { width: 38px; height: 38px; align-self: flex-start; border-radius: 999px; background: #f4f4f5; color: var(--black); display: grid; place-items: center; font-weight: 950; flex: 0 0 auto; transition: 0.18s ease; }
    .platform-category-card.open .platform-category-chevron { background: var(--red); color: white; transform: rotate(180deg); }
    /* Equal-height cards: stretch content and anchor the badge to the bottom so top/bottom spacing match */
    .platform-category-toggle .platform-category-main { flex: 1 1 auto; }
    .platform-category-copy { display: flex; flex-direction: column; height: 100%; }
    .platform-category-copy .platform-badge { margin-top: 24px; align-self: flex-start; }
    /* Flat placeholder cards (e.g. Documentação) reuse the icon-beside-text layout */
    .platform-card-flat { display: flex; padding: 22px; }
    .platform-card-flat .platform-category-main { display: flex; gap: 18px; align-items: flex-start; min-width: 0; width: 100%; }
    .platform-card-flat .platform-icon { margin-bottom: 0; }
    .platform-card-flat .platform-category-copy h2 { margin: 0; font-size: 25px; letter-spacing: -0.045em; }
    .platform-card-flat .platform-category-copy p { margin: 9px 0 0; color: var(--muted); line-height: 1.55; font-size: 14px; }
    .platform-options { position: absolute; left: 14px; right: 14px; top: calc(100% - 20px); z-index: 1; margin: 0; padding: 34px 14px 14px; display: grid; grid-template-columns: 1fr; gap: 12px; border: 1px solid #fecaca; border-top: 0; border-radius: 0 0 24px 24px; background: rgba(255, 250, 250, 0.98); box-shadow: 0 18px 38px rgba(193,18,31,0.12); max-height: 0; opacity: 0; overflow: hidden; pointer-events: none; transform: translateY(-28px) scale(0.98); transform-origin: top center; transition: max-height 0.32s ease, opacity 0.22s ease, transform 0.32s ease, padding 0.32s ease; }
    .platform-options[hidden] { display: grid !important; max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; border-width: 0 1px 1px; }
    .platform-category-card.open .platform-options { max-height: 340px; opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); padding-top: 34px; padding-bottom: 14px; }
    .platform-option { border: 1px solid var(--line); background: white; border-radius: 20px; padding: 16px; text-align: left; display: grid; grid-template-columns: 42px 1fr; gap: 12px; align-items: start; transition: 0.16s ease; box-shadow: 0 8px 18px rgba(0,0,0,0.04); }
    .platform-option:hover { border-color: #fecaca; background: #fffafa; transform: translateY(-2px); }
    .platform-option.unavailable { opacity: 0.68; cursor: not-allowed; background: #f4f4f5; }
    .platform-option.unavailable:hover { border-color: var(--line); background: #f4f4f5; transform: none; }
    .platform-option.unavailable .platform-option-icon { background: #71717a; }
    .platform-option .platform-option-access-label { display: inline-flex; width: fit-content; margin-top: 8px; border-radius: 999px; padding: 5px 8px; background: var(--red-soft); color: #991b1b; font-size: 11px; font-weight: 950; }
    .platform-option .platform-option-access-label.unavailable { background: #e4e4e7; color: #3f3f46; }
    .platform-category-card.unavailable .platform-category-main { opacity: 0.78; }
    .platform-category-card.unavailable .platform-badge { background: #f4f4f5; color: #3f3f46; }
    .platform-option-icon { width: 42px; height: 42px; border-radius: 15px; background: var(--red); color: white; display: grid; place-items: center; font-weight: 950; font-size: 18px; }
    .platform-option strong { display: block; font-size: 15px; letter-spacing: -0.02em; }
    .platform-option span { display: block; margin-top: 4px; color: var(--muted); line-height: 1.45; font-size: 12px; }
    .login-panel-wrap { display: none; width: min(520px, 100%); margin: 0 auto; }
    .login-panel-wrap.show { display: block; }
    .landing-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
    .eyebrow { display: inline-flex; align-items: center; gap: 8px; width: fit-content; border-radius: 999px; padding: 8px 13px; background: #ffffff; border: 1px solid var(--line); font-size: 13px; font-weight: 900; color: var(--black); box-shadow: var(--shadow-soft); }
    .eyebrow span { color: var(--red); }
    .hero-title { margin: 24px 0 0; font-size: clamp(42px, 6vw, 72px); line-height: 0.94; letter-spacing: -0.065em; font-weight: 950; color: var(--black); }
    .hero-title em { color: var(--red); font-style: normal; }
    .hero-text { max-width: 620px; margin-top: 22px; color: #3f3f46; font-size: 18px; line-height: 1.75; }
    .feature-grid { margin-top: 32px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 620px; }
    .feature-card { background: rgba(255, 255, 255, 0.92); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-soft); font-weight: 900; color: var(--black); }
    .feature-card .icon { display: block; margin-bottom: 12px; color: var(--red); font-size: 22px; }
    .made-by-login { margin-top: 24px; display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; background: white; color: var(--black); padding: 9px 13px; font-size: 12px; font-weight: 950; box-shadow: var(--shadow-soft); }
    .made-by-login span { color: var(--red); }

    .login-card { border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(8, 8, 8, 0.92); color: white; backdrop-filter: blur(18px); border-radius: 34px; padding: 30px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.36); }
    .login-header, .topbar-inner, .request-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
    .small-label { margin: 0; color: #fca5a5; text-transform: uppercase; letter-spacing: 0.18em; font-size: 12px; font-weight: 950; }
    .login-card h2 { margin: 8px 0 0; font-size: 28px; letter-spacing: -0.04em; }
    .logo-block { width: 58px; height: 58px; border-radius: 18px; background: var(--red); display: grid; place-items: center; color: white; box-shadow: 0 14px 26px rgba(193, 18, 31, 0.28); }
    .login-form { margin-top: 28px; display: grid; gap: 16px; }
    .login-form label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 900; color: #f4f4f5; }
    .login-input { width: 100%; border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.08); color: white; border-radius: 16px; padding: 13px 14px; outline: none; transition: 0.15s ease; }
    .login-input::placeholder { color: #a1a1aa; }
    .login-input:focus { border-color: #fca5a5; box-shadow: 0 0 0 4px rgba(193, 18, 31, 0.28); }
    .login-error { display: none; border-radius: 16px; background: rgba(193, 18, 31, 0.18); border: 1px solid rgba(252, 165, 165, 0.3); color: #fecaca; padding: 12px 14px; font-size: 13px; font-weight: 800; overflow-wrap: anywhere; }
    .login-error.show { display: block; }
    .api-status { margin-top: 16px; color: #d4d4d8; font-size: 12px; line-height: 1.6; }
    .api-status strong { color: white; }

    .app-shell { min-height: 100vh; }
    .sidebar { position: fixed; inset: 0 auto 0 0; width: 292px; background: var(--black); color: white; border-right: 1px solid #27272a; padding: 22px; z-index: 30; box-shadow: var(--shadow); }
    .brand { display: flex; align-items: center; gap: 12px; }
    .brand-icon { width: 50px; height: 50px; border-radius: 16px; background: var(--red); color: white; display: grid; place-items: center; flex: 0 0 auto; }
    .brand strong { display: block; font-size: 20px; letter-spacing: -0.045em; }
    .brand span { display: block; margin-top: 2px; color: #a1a1aa; font-size: 12px; font-weight: 800; }
    .profile-card { margin-top: 32px; border: 1px solid #27272a; background: #18181b; border-radius: var(--radius); padding: 17px; }
    .profile-card-has-avatar { display: grid; grid-template-columns: 46px minmax(0, 1fr); column-gap: 13px; row-gap: 0; align-items: center; }
    .profile-card-body { display: contents; min-width: 0; }
    .profile-avatar { grid-column: 1; grid-row: 1; width: 46px; height: 46px; flex: 0 0 auto; border-radius: 14px; background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 950; font-size: 16px; letter-spacing: 0.02em; background-size: cover; background-position: center; overflow: hidden; }
    .profile-avatar-photo { color: transparent; }
    .profile-card strong { grid-column: 2; grid-row: 1; display: block; align-self: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .profile-card p { grid-column: 1 / -1; grid-row: 2; min-width: 0; max-width: 100%; margin: 10px 0 0; color: #a1a1aa; font-size: 13px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .nexus-shortcut { width: 100%; margin-top: 18px; border: 1px solid rgba(252, 165, 165, 0.24); background: linear-gradient(135deg, rgba(193, 18, 31, 0.92), rgba(24, 24, 27, 0.96)); color: white; border-radius: 22px; padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; text-align: left; box-shadow: 0 16px 30px rgba(193, 18, 31, 0.18); transition: 0.18s ease; }
    .app-shell .sidebar .nexus-shortcut { display: none !important; }
    .nexus-shortcut:hover { transform: translateY(-2px); box-shadow: 0 22px 44px rgba(193, 18, 31, 0.25); }
    .nexus-shortcut-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
    .nexus-shortcut-icon { width: 42px; height: 42px; border-radius: 15px; background: rgba(255, 255, 255, 0.16); display: grid; place-items: center; font-size: 20px; font-weight: 950; flex: 0 0 auto; }
    .nexus-shortcut strong { display: block; font-size: 14px; letter-spacing: -0.02em; }
    .nexus-shortcut span { display: block; margin-top: 2px; color: #fecaca; font-size: 12px; font-weight: 850; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .nexus-shortcut-arrow { width: 30px; height: 30px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); display: grid; place-items: center; font-weight: 950; flex: 0 0 auto; }
    .topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
    .btn-nexus { background: var(--black); color: white; border: 1px solid #27272a; }
    .btn-nexus:hover { background: #27272a; }
    .btn-nexus { display: inline-flex; align-items: center; gap: 8px; }
    .btn-nexus-icon { width: 16px; height: 16px; flex: 0 0 auto; stroke: currentColor; fill: none; }
    .expense-shell { min-height: 100vh; background: var(--bg); }
    .expense-page { max-width: 1380px; margin: 0 auto; padding: 28px 30px 48px; }
    .expense-hero { background: linear-gradient(135deg, var(--black), #27272a); color: white; border-radius: 32px; padding: 28px; box-shadow: var(--shadow); display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
    .expense-hero h1 { margin: 8px 0 0; font-size: clamp(34px, 4vw, 54px); line-height: 0.96; letter-spacing: -0.06em; }
    .expense-hero p { margin: 14px 0 0; max-width: 720px; color: #d4d4d8; line-height: 1.65; }
    .expense-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
    .expense-grid { margin-top: 22px; display: grid; grid-template-columns: 1fr; gap: 22px; align-items: start; }
    .expense-form-panel { scroll-margin-top: 110px; }
    .expense-form-panel .form-grid { grid-template-columns: repeat(4, 1fr); }
    .expense-form-panel .span-2 { grid-column: span 2; }
    .expense-form-panel .span-3 { grid-column: span 3; }
    .expense-form-panel .span-4 { grid-column: 1 / -1; }
    .expense-form-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
    .expense-form-note { margin: 14px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
    .expense-rule-panel { border-color: #fecaca; background: #fff1f2; color: #7f1d1d; overflow-wrap: anywhere; }
    .expense-doc-warning { margin-top: 18px; border: 1px solid #fecaca; border-left: 5px solid var(--red); background: #fff1f2; color: #7f1d1d; border-radius: 18px; padding: 16px 18px; font-weight: 900; line-height: 1.55; box-shadow: var(--shadow-soft); }
    .expense-doc-warning strong { color: #7f1d1d; }
    .expense-doc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
    .approval-doc-btn { border: 1px solid #fecaca; background: var(--red-soft); color: #991b1b; border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 950; }
    .approval-doc-btn:hover { background: var(--red); color: white; border-color: var(--red); }
    .expense-summary-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
    .expense-table-wrap { margin-top: 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: 20px; background: white; max-width: 100%; }
    .expense-page, .expense-grid, .expense-form-panel, #expenseListPanel, .expense-table-wrap, .expense-rule-panel { min-width: 0; }
    .expense-table { width: 100%; border-collapse: collapse; min-width: 1080px; }
    .expense-table th, .expense-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; vertical-align: top; }
    .expense-table th { background: #fafafa; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; font-weight: 950; }
    .expense-table td strong { display: block; color: var(--black); }
    .expense-table tr:last-child td { border-bottom: 0; }
    .expense-status { display: inline-flex; border-radius: 999px; padding: 5px 9px; background: var(--red-soft); color: #991b1b; font-size: 12px; font-weight: 950; }
    .expense-help { margin-top: 14px; color: var(--muted); font-size: 13px; line-height: 1.6; }
    .expense-filter-grid { margin-top: 18px; display: grid; grid-template-columns: 1.2fr 0.9fr 0.9fr 0.9fr 0.9fr; gap: 10px; align-items: end; }
    .expense-person-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
    .expense-management-grid { margin-top: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
    .expense-management-grid.hidden { display: none !important; }
    .expense-rank-list { margin-top: 18px; display: grid; gap: 10px; }
    .expense-rank-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); background: #fafafa; border-radius: 16px; padding: 13px; }
    .expense-rank-row strong { display: block; color: var(--black); }
    .expense-rank-row small { display: block; margin-top: 3px; color: var(--muted); font-weight: 800; }
    .expense-action-btn { border: 1px solid var(--line); background: white; color: var(--black); border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 950; }
    .expense-action-btn:hover { background: var(--red-soft); border-color: #fecaca; color: #991b1b; }
    .expense-modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(8,8,8,0.58); display: grid; place-items: center; padding: 22px; }
    .expense-modal { width: min(920px, 100%); max-height: min(86vh, 860px); overflow: auto; background: white; border-radius: 28px; box-shadow: 0 34px 90px rgba(0,0,0,0.32); border: 1px solid var(--line); }
    .expense-modal-header { position: sticky; top: 0; z-index: 2; background: white; border-bottom: 1px solid var(--line); padding: 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
    .expense-modal-header h2 { margin: 0; font-size: 24px; letter-spacing: -0.04em; }
    .expense-modal-header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
    .expense-modal-body { padding: 20px; display: grid; gap: 18px; }
    .expense-detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .expense-detail-field { border: 1px solid var(--line); background: #fafafa; border-radius: 16px; padding: 13px; }
    .expense-detail-field small { display: block; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; font-weight: 950; }
    .expense-detail-field strong, .expense-detail-field span { display: block; margin-top: 5px; color: var(--black); font-size: 14px; font-weight: 900; overflow-wrap: anywhere; }
    .expense-detail-field.full { grid-column: 1 / -1; }
    .expense-attachments-panel { border: 1px solid var(--line); background: #fafafa; border-radius: 18px; padding: 16px; }
    .expense-attachments-panel h3 { margin: 0 0 12px; font-size: 16px; letter-spacing: -0.02em; }
    .expense-attachment-list { display: flex; flex-wrap: wrap; gap: 8px; }
    .expense-attachment-list button { border: 1px solid var(--line); background: white; color: var(--red); border-radius: 999px; padding: 8px 11px; font-size: 12px; font-weight: 950; cursor: pointer; }
    .expense-attachment-list button:hover { background: var(--red-soft); border-color: #fecaca; }
    .expense-approval-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 14px; }
    .expense-status-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 950; border: 1px solid #d4d4d8; background: #f4f4f5; color: #3f3f46; white-space: nowrap; }
    .expense-status-waiting { background: #fef3c7; border-color: #fde68a; color: #92400e; }
    .expense-status-approved { background: #dcfce7; border-color: #bbf7d0; color: #166534; }
    .expense-status-rejected { background: #f4f4f5; border-color: #d4d4d8; color: #3f3f46; }
    .exp-placeholder-row { background: #fffdf5; }
    .exp-placeholder-row td strong { display: block; color: var(--black); }
    .expense-status-draft { background: #fef3c7; border-color: #fde68a; color: #92400e; }
    .exp-edit-row > td { padding: 0 !important; background: #fafafa; border-bottom: 1px solid var(--line); }
    .exp-inline-editor { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.34s ease; }
    .exp-edit-row.open .exp-inline-editor { grid-template-rows: 1fr; }
    .exp-inline-editor-inner { overflow: hidden; min-height: 0; }
    .exp-inline-editor-pad { padding: 18px 20px 22px; border-left: 3px solid var(--red); opacity: 0; transition: opacity 0.28s ease 0.06s; }
    .exp-edit-row.open .exp-inline-editor-pad { opacity: 1; }
    .exp-inline-head { display: flex; justify-content: flex-end; margin-bottom: 4px; }
    .exp-inline-close { border: 1px solid var(--line); background: white; color: var(--black); border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 950; cursor: pointer; }
    .exp-inline-close:hover { background: var(--red-soft); border-color: #fecaca; color: #991b1b; }
    .exp-inline-editor .expense-form-panel { border: 0; box-shadow: none; padding: 0; background: transparent; border-radius: 0; }
    .exp-inline-editor .expense-form-panel.hidden { display: block; }
    .exp-inline-editor .expense-form-header .btn[type="submit"] { display: none; }
    .profile-tags { grid-column: 1 / -1; grid-row: 3; margin-top: 12px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; flex-wrap: nowrap; gap: 8px; }
    .pill { display: inline-flex; align-items: center; max-width: 100%; gap: 6px; border-radius: 999px; background: #27272a; color: #f4f4f5; padding: 6px 10px; font-size: 12px; font-weight: 900; border: 1px solid #3f3f46; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .red-pill { background: rgba(193, 18, 31, 0.18); color: #fecaca; border-color: rgba(252, 165, 165, 0.28); }
    .nav { margin-top: 32px; display: grid; gap: 8px; }
    .nav-btn { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: 18px; padding: 13px 14px; background: transparent; color: #d4d4d8; font-size: 14px; font-weight: 900; transition: 0.16s ease; }
    .nav-btn:hover { background: #18181b; color: white; }
    .nav-btn.active { background: var(--red); color: white; box-shadow: 0 14px 24px rgba(193, 18, 31, 0.28); }

    .module-sidebar-nav { margin-top: 32px; display: grid; gap: 8px; }
    .module-side-btn { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: 18px; padding: 13px 14px; background: transparent; color: #d4d4d8; font-size: 14px; font-weight: 900; text-align: left; transition: 0.16s ease; cursor: pointer; }
    .side-icon { width: 18px; height: 18px; flex: 0 0 auto; opacity: 0.95; }
    .nav-btn .side-icon, .maintenance-side-btn .side-icon, .logistics-side-btn .side-icon, .module-side-btn .side-icon { stroke: currentColor; }
    .module-side-btn:hover { background: #18181b; color: white; }
    .module-side-btn.active { background: var(--red); color: white; box-shadow: 0 14px 24px rgba(193, 18, 31, 0.28); }
    .module-side-btn.is-disabled, .module-side-btn:disabled { opacity: 0.48; cursor: not-allowed; box-shadow: none; }
    .module-side-btn.is-disabled:hover, .module-side-btn:disabled:hover { background: transparent; color: #d4d4d8; }
    .expense-main .topbar-inner, .quality-main .topbar-inner, .admin-main .topbar-inner { max-width: 1380px; }
    .logout-btn { position: absolute; left: 22px; right: 22px; bottom: 72px; border: 1px solid #3f3f46; background: #18181b; color: white; padding: 13px; border-radius: 18px; font-weight: 950; }
    .made-by-sidebar { position: absolute; left: 22px; right: 22px; bottom: 22px; color: #a1a1aa; font-size: 12px; font-weight: 850; text-align: center; }
    .made-by-sidebar span { color: #fca5a5; }

    .main { margin-left: 292px; min-height: 100vh; }
    .topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, 0.9); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); padding: 16px 30px; }
    .topbar-inner { max-width: 1380px; margin: 0 auto; }
    .date-line { margin: 0; color: var(--muted); font-size: 13px; font-weight: 800; text-transform: capitalize; }
    .page-title { margin: 4px 0 0; font-size: 26px; letter-spacing: -0.045em; }

    .btn { border: 0; border-radius: 16px; padding: 11px 16px; font-size: 14px; font-weight: 950; transition: 0.16s ease; }
    .btn:has(.btn-icon) { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
    .btn-icon { width: 16px; height: 16px; flex: 0 0 auto; stroke: currentColor; fill: none; }
    .logout-btn { display: flex; align-items: center; justify-content: center; gap: 9px; }
    .logout-icon { width: 17px; height: 17px; flex: 0 0 auto; stroke: currentColor; fill: none; }
    .btn-primary { background: var(--red); color: white; box-shadow: 0 14px 24px rgba(193, 18, 31, 0.18); }
    .btn-primary:hover { background: var(--red-dark); }
    .btn-ghost { background: white; color: var(--black); border: 1px solid var(--line); }
    .btn-green { background: var(--green); color: white; }
    .btn-red { background: var(--red); color: white; }
    .btn-wide { width: 100%; }

    .content { max-width: 1380px; margin: 0 auto; padding: 28px 30px 48px; }
    .stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
    .stat-card, .panel { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-soft); }
    .stat-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
    .stat-card p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 850; }
    .stat-card strong { display: block; margin-top: 9px; font-size: 25px; letter-spacing: -0.05em; }
    .stat-card span { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; }
    .stat-icon { width: 44px; height: 44px; border-radius: 16px; background: var(--red-soft); color: var(--red); display: grid; place-items: center; font-size: 20px; font-weight: 950; }
    .stat-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; }

    .tab-panel { margin-top: 22px; display: grid; gap: 22px; }
    .grid-2 { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 22px; }
    .grid-half { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
    .new-grid { display: grid; grid-template-columns: 0.72fr 0.28fr; gap: 22px; }
    .section-title { display: flex; align-items: center; gap: 12px; }
    .section-icon { width: 44px; height: 44px; border-radius: 16px; background: var(--black); color: white; display: grid; place-items: center; font-size: 20px; font-weight: 950; flex: 0 0 auto; }
    .section-title h2 { margin: 0; font-size: 20px; letter-spacing: -0.03em; }
    .section-title p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }

    .workflow-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .workflow-card { background: #fafafa; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
    .workflow-card strong { display: block; margin-bottom: 15px; }
    .workflow-steps { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: #a1a1aa; }
    .step { border-radius: 999px; background: white; border: 1px solid var(--line); color: var(--black); padding: 7px 10px; font-size: 12px; font-weight: 950; }
    .step.final { background: var(--black); border-color: var(--black); color: white; }
    .rule-highlight { margin-top: 16px; border-left: 4px solid var(--red); background: #fff1f2; border-radius: 16px; padding: 14px 16px; color: #7f1d1d; font-size: 13px; line-height: 1.55; font-weight: 800; }

    .chart-area { margin-top: 22px; min-height: 320px; display: flex; flex-direction: column; justify-content: flex-end; gap: 16px; }
    .bar-row { display: grid; grid-template-columns: 120px 1fr 110px; align-items: center; gap: 12px; font-size: 13px; }
    .bar-label { font-weight: 950; color: var(--black); }
    .bar-track { height: 22px; border-radius: 999px; background: #e4e4e7; overflow: hidden; position: relative; }
    .bar-spend { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--red); min-width: 4px; }
    .bar-value { color: var(--muted); text-align: right; font-weight: 900; }
    .legend { margin-top: 16px; display: grid; gap: 9px; }
    .legend-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: 13px; }
    .legend-left { display: flex; align-items: center; gap: 8px; color: var(--black); font-weight: 900; }
    .dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }
    .budget-list, .supplier-list { margin-top: 22px; display: grid; gap: 16px; }
    .progress { height: 10px; background: #e4e4e7; border-radius: 999px; overflow: hidden; }
    .progress > span { display: block; height: 100%; background: var(--red); border-radius: 999px; }
    .budget-health-item { display: grid; gap: 8px; }
    .budget-health-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
    .budget-health-head strong { color: var(--black); font-weight: 950; }
    .budget-health-head span { color: var(--muted); font-weight: 850; text-align: right; }
    .supplier-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; }
    .rank { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--black); color: white; font-weight: 950; margin-right: 10px; }

    .request-header { align-items: flex-start; }
    .request-header-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
    .request-create-btn { order: 0; }
    .filter-grid { margin-top: 18px; display: grid; grid-template-columns: 1.15fr 0.95fr 0.95fr 0.8fr 0.8fr; gap: 10px; align-items: end; }
    .filter-field label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 950; text-transform: uppercase; letter-spacing: 0.08em; }
    .input, .select, .textarea { width: 100%; border: 1px solid var(--line); background: white; border-radius: 16px; padding: 12px 13px; color: var(--text); outline: none; transition: 0.15s ease; }
    .app-shell:not(.logistics-shell) .input:not([type="file"]),
    .app-shell:not(.logistics-shell) .select,
    .app-shell:not(.logistics-shell) .nexus-select-btn,
    .app-shell:not(.logistics-shell) .nexus-date-btn { height: 48px; min-height: 48px; box-sizing: border-box; }
    .app-shell:not(.logistics-shell) .input:not([type="file"]),
    .app-shell:not(.logistics-shell) .select { padding-top: 0; padding-bottom: 0; }
    .app-shell:not(.logistics-shell) .nexus-select-btn,
    .app-shell:not(.logistics-shell) .nexus-date-btn { display: flex; align-items: center; }
    .app-shell:not(.logistics-shell) .nexus-date-btn { padding-top: 0; padding-bottom: 0; }
    .input:focus, .select:focus, .textarea:focus { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
    .nexus-native-select { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important; border: 0 !important; opacity: 0 !important; pointer-events: none !important; }
    .nexus-select { position: relative; width: 100%; min-width: 0; z-index: 1; }
    .nexus-select.is-open { z-index: 70; }
    .nexus-select-btn { width: 100%; min-height: 46px; border: 1px solid var(--line); background: white; color: var(--text); border-radius: 16px; padding: 11px 44px 11px 13px; text-align: left; font: inherit; font-size: 14px; font-weight: 850; cursor: pointer; position: relative; transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease; }
    .nexus-select-btn span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .nexus-select-btn::after { content: ""; position: absolute; right: 17px; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--black); border-bottom: 2px solid var(--black); transform: translateY(-65%) rotate(45deg); transition: transform 0.18s ease, border-color 0.15s ease; }
    .nexus-select-btn:hover { border-color: #fecaca; }
    .nexus-select-btn:focus-visible, .nexus-select.is-open .nexus-select-btn { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-soft); outline: none; }
    .nexus-select.is-open .nexus-select-btn::after { border-color: var(--red); transform: translateY(-35%) rotate(225deg); }
    .nexus-select.is-disabled .nexus-select-btn, .nexus-select-btn:disabled { color: var(--muted); background: #fafafa; cursor: not-allowed; opacity: 0.72; }
    .nexus-select-menu { position: absolute; left: 0; right: 0; top: calc(100% + 8px); max-height: 320px; overflow: hidden; border: 1px solid var(--line); background: white; border-radius: 18px; padding: 8px; box-shadow: var(--shadow); box-sizing: border-box; }
    .nexus-select-menu[hidden] { display: none; }
    .nexus-select-search-wrap { padding: 2px 2px 8px; }
    .nexus-select-search { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 14px; background: #fafafa; color: var(--text); outline: none; padding: 0 12px; font: inherit; font-size: 13px; font-weight: 850; box-sizing: border-box; transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease; }
    .nexus-select-search:focus { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-soft); background: white; }
    .nexus-select-options { max-height: 248px; overflow: auto; padding-right: 2px; }
    .nexus-select-empty { padding: 14px 12px; color: var(--muted); font-size: 13px; font-weight: 850; text-align: center; }
    .nexus-select-option { width: 100%; border: 0; background: transparent; color: var(--black); border-radius: 14px; padding: 11px 12px; text-align: left; font: inherit; font-size: 14px; font-weight: 850; cursor: pointer; transition: background 0.15s ease, color 0.15s ease; }
    .nexus-select-option:hover, .nexus-select-option:focus-visible { background: var(--red-soft); color: #991b1b; outline: none; }
    .nexus-select-option.is-selected { background: var(--red); color: white; }
    .nexus-select-option.is-selected:hover, .nexus-select-option.is-selected:focus-visible { background: var(--red-dark); color: white; }
    .nexus-select-option:disabled { color: var(--muted); cursor: not-allowed; opacity: 0.64; }
    .textarea { min-height: 128px; resize: vertical; }
    .request-list { margin-top: 22px; display: grid; gap: 16px; }
    .request-card { background: #fafafa; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; transition: 0.16s ease; }
    .request-card:hover { background: white; box-shadow: var(--shadow-soft); }
    .request-main { display: grid; grid-template-columns: 1fr 230px; gap: 22px; align-items: start; }
    .request-tags { display: flex; flex-wrap: wrap; gap: 8px; }
    .request-card h3 { margin: 12px 0 4px; font-size: 20px; letter-spacing: -0.03em; }
    .request-card .notes { margin: 0; color: var(--muted); line-height: 1.55; }
    .request-fields { margin-top: 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
    .field small { display: block; color: #a1a1aa; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 950; }
    .field span { display: block; margin-top: 4px; color: #3f3f46; font-size: 13px; font-weight: 850; }
    .amount-box { background: white; border: 1px solid var(--line); border-radius: 20px; padding: 16px; text-align: right; }
    .amount-box small { color: var(--muted); font-weight: 850; }
    .amount-box strong { display: block; margin-top: 5px; font-size: 25px; letter-spacing: -0.05em; }
    .amount-box p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
    .action-row { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    details { margin-top: 14px; background: white; border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
    summary { font-weight: 950; color: var(--black); }
    details ol { margin: 12px 0 0; padding-left: 20px; color: var(--muted); font-size: 13px; line-height: 1.7; }
    .status { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 950; border: 1px solid; }
    .status-dh { background: #fef3c7; border-color: #fde68a; color: #92400e; }
    .status-board { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
    .status-approved { background: #dcfce7; border-color: #bbf7d0; color: #166534; }
    .status-rejected { background: #f4f4f5; border-color: #d4d4d8; color: #3f3f46; }

    .form-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
    .form-field label, .form-field-label { display: block; margin-bottom: 8px; color: var(--black); font-size: 13px; font-weight: 950; }
    .full-span { grid-column: 1 / -1; }
    .form-actions { margin-top: 22px; display: flex; justify-content: flex-end; gap: 12px; }
    .side-stack { display: grid; gap: 22px; align-content: start; }
    .rule { background: #fafafa; border: 1px solid var(--line); border-radius: 18px; padding: 14px; margin-top: 10px; }
    .rule strong { display: block; }
    .rule p { margin: 5px 0 0; color: var(--muted); line-height: 1.5; font-size: 13px; }
    .red-info { background: var(--red-soft); color: #7f1d1d; border-color: #fecaca; }

    .file-input { display: none; }
    .file-drop-actions { margin-top: 14px; }
    .file-drop-zone { border: 2px dashed #d4d4d8; background: #fafafa; border-radius: 20px; padding: 22px; text-align: center; outline: none; transition: 0.16s ease; cursor: pointer; }
    .file-drop-zone:hover, .file-drop-zone:focus, .file-drop-zone.drag-over { border-color: var(--red); background: var(--red-soft); box-shadow: 0 0 0 4px rgba(193, 18, 31, 0.08); }
    .drop-icon { width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-items: center; background: var(--black); color: white; font-size: 22px; font-weight: 950; }
    .file-list { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
    .file-chip { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; border: 1px solid var(--line); background: white; color: #3f3f46; padding: 7px 10px; font-size: 12px; font-weight: 850; }
    .file-remove { width: 20px; height: 20px; border: 0; border-radius: 999px; display: inline-grid; place-items: center; background: #f4f4f5; color: var(--black); font-weight: 950; line-height: 1; }
    .file-remove:hover { background: var(--red); color: white; }
    .attachment-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
    .attachment-links a, .attachment-links button { color: var(--red); font-weight: 850; font-size: 13px; text-decoration: none; border: 1px solid var(--line); background: white; border-radius: 999px; padding: 7px 10px; cursor: pointer; }
    .muted-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
    .inline-error-text { color: #991b1b; font-weight: 850; }
    .attachment-links button:hover { background: var(--red-soft); border-color: #fecaca; }

    .empty { border: 1px dashed #d4d4d8; background: #fafafa; border-radius: var(--radius); padding: 38px; text-align: center; color: var(--muted); }
    .empty strong { display: block; color: var(--text); margin-bottom: 6px; }
    .loading { opacity: 0.65; pointer-events: none; }
    .footer-tag { margin-top: 28px; display: flex; justify-content: center; color: #71717a; font-size: 12px; font-weight: 900; }
    .footer-tag span { border-radius: 999px; background: white; border: 1px solid var(--line); padding: 9px 14px; box-shadow: var(--shadow-soft); }
    .footer-tag strong { color: var(--red); }

    @media (max-width: 1260px) { .filter-grid { grid-template-columns: repeat(3, 1fr); } }
    @media (max-width: 1120px) { .login-grid, .grid-2, .grid-half, .new-grid, .expense-grid { grid-template-columns: 1fr; } .expense-summary-grid { grid-template-columns: repeat(2, 1fr); } .platform-grid { grid-template-columns: repeat(2, 1fr); } .platform-category-card { grid-column: span 1; } .landing-header { flex-direction: column; } .stats-grid { grid-template-columns: repeat(2, 1fr); } .request-main { grid-template-columns: 1fr; } .amount-box { text-align: left; } }
    @media (max-width: 820px) { .platform-grid { grid-auto-rows: auto; } .platform-card { height: auto; } .platform-category-card { grid-column: 1 / -1; min-height: auto; margin-bottom: 20px; align-self: start; } .platform-category-toggle { height: auto; min-height: 0; flex-direction: row; align-items: flex-start; padding-right: 64px; position: relative; } .platform-category-main { flex-direction: column; } .platform-category-chevron { position: absolute; top: 22px; right: 22px; } .platform-category-card.open { margin-bottom: 26px; } .platform-options { position: relative; left: auto; right: auto; top: auto; z-index: 1; margin: -18px 12px 0; padding: 30px 14px 14px; grid-template-columns: 1fr; border: 1px solid #fecaca; border-top: 0; border-radius: 0 0 22px 22px; transform: translateY(-6px); opacity: 0; box-shadow: 0 16px 34px rgba(193,18,31,0.10); } .platform-options[hidden] { padding-top: 0; padding-bottom: 0; margin-top: 0; border-width: 0 1px 1px; } .platform-category-card.open .platform-options { transform: translateY(0); opacity: 1; margin-top: -18px; } .platform-option { grid-template-columns: 38px 1fr; } .sidebar { position: static; width: auto; border-right: 0; } .module-sidebar-nav { margin-top: 18px; } .module-side-btn { justify-content: flex-start; } .logout-btn, .made-by-sidebar { position: static; margin-top: 18px; width: 100%; } .main { margin-left: 0; } .topbar-actions, .topbar-actions .btn { width: 100%; } .topbar-inner { align-items: flex-start; flex-direction: column; } .content, .expense-page { padding: 20px; } .expense-hero, .expense-form-header, .expense-modal-header { flex-direction: column; } .expense-actions, .expense-actions .btn, .expense-form-header .btn, .expense-modal-header .btn { width: 100%; } .feature-grid, .platform-grid, .workflow-grid, .stats-grid, .expense-summary-grid, .expense-management-grid, .expense-filter-grid, .expense-detail-grid, .expense-form-panel .form-grid, .form-grid, .request-fields, .filter-grid { grid-template-columns: 1fr; } .expense-form-panel .span-2, .expense-form-panel .span-3, .expense-form-panel .span-4, .expense-detail-field.full { grid-column: 1 / -1; } .expense-modal-backdrop { padding: 10px; align-items: stretch; } .expense-modal { max-height: 94vh; border-radius: 20px; } .expense-page { width: 100%; max-width: 100%; padding: 16px; overflow-x: hidden; } .expense-hero { padding: 20px; border-radius: 24px; } .expense-form-panel, #expenseListPanel, .expense-rule-panel { width: 100%; max-width: 100%; overflow: hidden; } .expense-form-header .btn[type="submit"] { display: none; } .expense-form-panel .form-grid { grid-template-columns: 1fr !important; gap: 14px; } .expense-form-panel .form-field, .expense-form-panel .input, .expense-form-panel .select, .expense-form-panel .textarea, .expense-filter-grid .input, .expense-filter-grid .select { min-width: 0; max-width: 100%; } .expense-rule-panel p { overflow-wrap: anywhere; } .expense-table-wrap { overflow-x: visible; border: 0; background: transparent; } .expense-table { min-width: 0; display: block; width: 100%; border-collapse: separate; } .expense-table thead { display: none; } .expense-table tbody { display: grid; gap: 12px; width: 100%; } .expense-table tr { display: grid; gap: 0; width: 100%; border: 1px solid var(--line); background: white; border-radius: 20px; padding: 12px 14px; box-shadow: var(--shadow-soft); } .expense-table td { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; overflow-wrap: anywhere; } .expense-table td:last-child { border-bottom: 0; } .expense-table td::before { content: attr(data-label); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 10px; font-weight: 950; } .expense-table .action-row { margin-top: 0; grid-template-columns: 1fr; } .expense-table .btn, .expense-table .expense-action-btn { width: 100%; } .expense-table tr.exp-edit-row { display: block; padding: 0; border: 0; background: transparent; box-shadow: none; border-radius: 0; } .exp-edit-row > td { display: block; padding: 0 !important; border: 0; } .exp-edit-row > td::before { display: none; content: ""; } .exp-inline-editor .form-grid { grid-template-columns: 1fr !important; } .exp-inline-editor-pad { padding: 16px; border-radius: 18px; border: 1px solid var(--line); border-left: 3px solid var(--red); background: white; } .login-screen { padding: 18px; } .login-grid { gap: 24px; } .request-header { align-items: stretch; flex-direction: column; } .request-header-actions { justify-content: stretch; } .request-header-actions .btn { flex: 1; } .content, .expense-page, .admin-page, .quality-page, .maintenance-page, .logistics-page { padding-bottom: 120px; } }
    @media (max-width: 560px) { .hero-title { font-size: 42px; } .hero-text { font-size: 16px; } .login-card { padding: 22px; border-radius: 26px; } .content { padding: 16px; } .topbar { padding: 14px 16px; } .topbar .btn { width: 100%; } .sidebar { padding: 16px; } .brand strong { font-size: 18px; } .nav { grid-template-columns: 1fr 1fr; } .nav-btn { justify-content: center; text-align: center; padding: 12px 10px; font-size: 12px; } .stat-card, .panel, .request-card { padding: 16px; border-radius: 18px; } .page-title { font-size: 22px; } .bar-row { grid-template-columns: 1fr; gap: 6px; } .bar-value { text-align: left; } .form-actions { flex-direction: column-reverse; } .form-actions .btn, .action-row .btn { width: 100%; } .action-row { grid-template-columns: 1fr; } }
    @media (max-width: 820px) {
      #loginScreen .login-grid { display: flex; flex-direction: column; align-items: stretch; }
      #loginScreen .login-grid > section:first-child { display: contents; }
      #loginScreen .login-grid > section:first-child .eyebrow { order: 1; }
      #loginScreen .login-grid > section:first-child .hero-title { order: 2; }
      #loginScreen .login-grid > section:first-child .hero-text { order: 3; }
      #loginScreen .login-grid > .login-card { order: 4; }
      #loginScreen .login-grid > section:first-child .feature-grid { order: 5; max-width: none; }
      #loginScreen .login-grid > section:first-child .made-by-login { order: 6; }
    }


    .quality-shell { min-height: 100vh; background: var(--bg); }
    .quality-page { max-width: 1380px; margin: 0 auto; padding: 28px 30px 48px; }
    .quality-hero { background: linear-gradient(135deg, var(--black), #27272a); color: white; border-radius: 32px; padding: 28px; box-shadow: var(--shadow); display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
    .quality-hero h1 { margin: 8px 0 0; font-size: clamp(34px, 4vw, 54px); line-height: 0.96; letter-spacing: -0.06em; }
    .quality-hero p { margin: 14px 0 0; max-width: 820px; color: #d4d4d8; line-height: 1.65; }
    .quality-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
    .quality-summary-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
    .quality-grid { margin-top: 22px; display: grid; grid-template-columns: 1fr; gap: 22px; align-items: start; }
    .quality-form-panel { scroll-margin-top: 110px; }
    .quality-form-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
    .quality-form-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
    .quality-form-grid .span-2 { grid-column: span 2; }
    .quality-form-grid .span-3 { grid-column: span 3; }
    .quality-form-grid .span-4 { grid-column: 1 / -1; }
    .certificate-form-stack { display: grid; gap: 18px; align-content: start; }
    .certificate-report-meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
    .quality-filter-grid { margin-top: 18px; display: grid; grid-template-columns: 1.4fr 0.8fr 0.8fr 0.8fr 0.8fr; gap: 10px; align-items: end; }
    .quality-table-wrap { margin-top: 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: 20px; background: white; max-width: 100%; }
    .quality-table { width: 100%; min-width: 1220px; border-collapse: collapse; }
    .quality-table th, .quality-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; vertical-align: top; }
    .quality-table th { background: #fafafa; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; font-weight: 950; }
    .quality-table tr:last-child td { border-bottom: 0; }
    .quality-table td strong { display: block; color: var(--black); }
    .quality-link { color: var(--red); font-weight: 950; text-decoration: none; overflow-wrap: anywhere; }
    .quality-link:hover { text-decoration: underline; }
    .quality-status-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 950; border: 1px solid #d4d4d8; background: #f4f4f5; color: #3f3f46; white-space: nowrap; }
    .quality-status-valid { background: #dcfce7; border-color: #bbf7d0; color: #166534; }
    .quality-status-expired { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
    .quality-status-nofile { background: #fef3c7; border-color: #fde68a; color: #92400e; }
    .quality-row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
    .quality-action-btn { border: 1px solid var(--line); background: white; color: var(--black); border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 950; }
    .quality-action-btn:hover { background: var(--red-soft); border-color: #fecaca; color: #991b1b; }
    .quality-note { margin-top: 14px; color: var(--muted); font-size: 13px; line-height: 1.6; }
    .quality-editor-note { margin-top: 18px; border: 1px solid #fecaca; border-left: 5px solid var(--red); background: #fff1f2; color: #7f1d1d; border-radius: 18px; padding: 16px 18px; font-weight: 850; line-height: 1.55; box-shadow: var(--shadow-soft); }
    .quality-page, .quality-grid, .quality-form-panel, #certificateListPanel, .quality-table-wrap { min-width: 0; }

    .maintenance-shell { min-height: 100vh; background: var(--bg); }

    .maintenance-main .topbar-inner { max-width: 1380px; }
    .maintenance-sidebar .brand strong { letter-spacing: -0.04em; }
    .maintenance-sidebar-nav { margin-top: 32px; display: grid; gap: 8px; }
    .maintenance-side-btn { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: 18px; padding: 13px 14px; background: transparent; color: #d4d4d8; font-size: 14px; font-weight: 900; text-align: left; transition: 0.16s ease; cursor: pointer; }
    .maintenance-side-btn:hover { background: #18181b; color: white; }
    .maintenance-side-btn.active { background: var(--red); color: white; box-shadow: 0 14px 24px rgba(193, 18, 31, 0.28); }
    .maintenance-side-btn.is-disabled, .maintenance-side-btn:disabled { opacity: 0.48; cursor: not-allowed; box-shadow: none; }
    .maintenance-side-btn.is-disabled:hover, .maintenance-side-btn:disabled:hover { background: transparent; color: #d4d4d8; }
    .maintenance-page { max-width: 1380px; margin: 0 auto; padding: 28px 30px 48px; }
    .maintenance-hero { background: linear-gradient(135deg, var(--black), #27272a); color: white; border-radius: 32px; padding: 28px; box-shadow: var(--shadow); display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
    .maintenance-hero h1 { margin: 8px 0 0; font-size: clamp(34px, 4vw, 54px); line-height: 0.96; letter-spacing: -0.06em; }
    .maintenance-hero p { margin: 14px 0 0; max-width: 860px; color: #d4d4d8; line-height: 1.65; }
    .maintenance-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
    .maintenance-summary-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
    .maintenance-tabbar { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; }
    .maintenance-tab-btn { border: 1px solid var(--line); background: white; color: var(--black); border-radius: 999px; padding: 10px 14px; font-size: 13px; font-weight: 950; box-shadow: var(--shadow-soft); }
    .maintenance-tab-btn.active { background: var(--red); color: white; border-color: var(--red); }
    .maintenance-grid { margin-top: 22px; display: grid; grid-template-columns: 1fr; gap: 22px; align-items: start; }
    .maintenance-filter-grid { margin-top: 18px; display: grid; grid-template-columns: 1.4fr 0.8fr 0.8fr 0.8fr 0.8fr; gap: 10px; align-items: end; }
    .maintenance-form-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
    .maintenance-form-grid .span-2 { grid-column: span 2; }
    .maintenance-form-grid .span-3 { grid-column: span 3; }
    .maintenance-form-grid .span-4 { grid-column: 1 / -1; }
    .maintenance-complete-form { margin-top: 12px; display: grid; gap: 18px; }
    .maintenance-complete-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px 28px; align-items: start; }
    .maintenance-complete-left { display: grid; gap: 18px; align-content: start; }
    .maintenance-complete-time-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
    .maintenance-complete-detected { display: flex; flex-direction: column; align-self: stretch; }
    .maintenance-complete-detected .textarea { flex: 1 1 auto; min-height: 0; height: auto; }
    .maintenance-table-wrap { margin-top: 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: 20px; background: white; max-width: 100%; }
    .maintenance-table { width: 100%; min-width: 1120px; border-collapse: collapse; }
    .maintenance-table th, .maintenance-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; vertical-align: top; }
    .maintenance-table th { background: #fafafa; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; font-weight: 950; }
    .maintenance-table tr:last-child td { border-bottom: 0; }
    .maintenance-table td strong { display: block; color: var(--black); }
    .maintenance-table td small { display: block; margin-top: 3px; color: var(--muted); line-height: 1.35; }
    .maintenance-row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
    .maintenance-action-btn { border: 1px solid var(--line); background: white; color: var(--black); border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 950; }
    .maintenance-action-btn:hover { background: var(--red-soft); border-color: #fecaca; color: #991b1b; }
    .maintenance-action-danger { border-color: #fecaca; color: #991b1b; }
    .maintenance-action-danger:hover { background: var(--red); border-color: var(--red); color: white; }
    .maintenance-note { margin-top: 14px; color: var(--muted); font-size: 13px; line-height: 1.6; }
    .maintenance-alert { margin-top: 18px; border: 1px solid #fecaca; border-left: 5px solid var(--red); background: #fff1f2; color: #7f1d1d; border-radius: 18px; padding: 16px 18px; font-weight: 850; line-height: 1.55; box-shadow: var(--shadow-soft); }
    .maintenance-status-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 950; border: 1px solid #d4d4d8; background: #f4f4f5; color: #3f3f46; white-space: nowrap; }
    .maintenance-status-planned { background: #fef3c7; border-color: #fde68a; color: #92400e; }
    .maintenance-status-done { background: #dcfce7; border-color: #bbf7d0; color: #166534; }
    .maintenance-status-warn { background: #fee2e2; border-color: #fecaca; color: #991b1b; }

    .maintenance-status-draft { background: #fef3c7; border-color: #fde68a; color: #92400e; }
    .maintenance-placeholder-row td strong { color: var(--black); }
    .maintenance-placeholder-row { background: #fffdf5; }
    .maintenance-edit-row > td { padding: 0 !important; background: #fafafa; border-bottom: 1px solid var(--line); }
    .maintenance-inline-editor { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.34s ease; }
    .maintenance-edit-row.open .maintenance-inline-editor { grid-template-rows: 1fr; }
    .maintenance-inline-editor-inner { overflow: hidden; min-height: 0; }
    .maintenance-inline-editor-pad { padding: 18px 20px 22px; border-left: 3px solid var(--red); opacity: 0; transition: opacity 0.28s ease 0.06s; }
    .maintenance-edit-row.open .maintenance-inline-editor-pad { opacity: 1; }
    .maintenance-inline-head { display: flex; justify-content: flex-end; margin-bottom: 4px; }
    .maintenance-inline-close { border: 1px solid var(--line); background: white; color: var(--black); border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 950; cursor: pointer; }
    .maintenance-inline-close:hover { background: var(--red-soft); border-color: #fecaca; color: #991b1b; }
    .maintenance-inline-editor .panel { border: 0; box-shadow: none; padding: 0; background: transparent; border-radius: 0; }
    .maintenance-inline-editor .maintenance-form-grid { margin-top: 12px; }
    .maintenance-action-btn.active { background: var(--red-soft); border-color: #fecaca; color: #991b1b; }
    .maintenance-mini-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
    .maintenance-collapsible-card { align-self: start; }
    .maintenance-card-dropdown { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.34s ease, margin-top 0.18s ease; margin-top: 0; pointer-events: none; }
    .maintenance-card-dropdown.open { grid-template-rows: 1fr; margin-top: 18px; pointer-events: auto; }
    .maintenance-card-dropdown-inner { overflow: hidden; min-height: 0; opacity: 0; transform: translateY(-4px); transition: opacity 0.28s ease 0.06s, transform 0.28s ease 0.06s; }
    .maintenance-card-dropdown.open .maintenance-card-dropdown-inner { opacity: 1; transform: translateY(0); }
    .maintenance-card-dropdown .form-grid { margin-top: 0; }
    .maintenance-part-form-grid,
    .maintenance-movement-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .maintenance-money-field { display: grid; grid-template-columns: minmax(0, 1fr) 128px; gap: 10px; align-items: start; }
    .maintenance-money-field .input,
    .maintenance-money-field .select,
    .maintenance-money-field .nexus-select,
    .maintenance-money-field .nexus-select-btn { min-width: 0; }
    .maintenance-tab-stack { display: grid; gap: 22px; }
    .maintenance-stock-history-panel { margin-top: 0; }
    .maintenance-page, .maintenance-grid, .maintenance-table-wrap { min-width: 0; }

    @media (max-width: 820px) {
      .maintenance-page { width: 100%; max-width: 100%; padding: 16px; overflow-x: hidden; }
      .maintenance-sidebar-nav { margin-top: 18px; }
      .maintenance-side-btn { justify-content: flex-start; }
      .maintenance-hero { flex-direction: column; padding: 20px; border-radius: 24px; }
      .maintenance-actions, .maintenance-actions .btn { width: 100%; }
      .maintenance-summary-grid, .maintenance-filter-grid, .maintenance-form-grid, .maintenance-mini-grid { grid-template-columns: 1fr !important; }
      .maintenance-form-grid .span-2, .maintenance-form-grid .span-3, .maintenance-form-grid .span-4 { grid-column: 1 / -1; }
      .maintenance-complete-layout,
      .maintenance-complete-time-row { grid-template-columns: 1fr !important; }
      .maintenance-table-wrap { overflow-x: visible; border: 0; background: transparent; }
      .maintenance-table { min-width: 0; display: block; width: 100%; border-collapse: separate; }
      .maintenance-table thead { display: none; }
      .maintenance-table tbody { display: grid; gap: 12px; width: 100%; }
      .maintenance-table tr { display: grid; gap: 0; width: 100%; border: 1px solid var(--line); background: white; border-radius: 20px; padding: 12px 14px; box-shadow: var(--shadow-soft); }
      .maintenance-table td { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; overflow-wrap: anywhere; }
      .maintenance-table td:last-child { border-bottom: 0; }
      .maintenance-table td::before { content: attr(data-label); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 10px; font-weight: 950; }
      .maintenance-row-actions { display: grid; grid-template-columns: 1fr; }
      .maintenance-action-btn { width: 100%; }

      .maintenance-table tr.maintenance-edit-row { display: block; padding: 0; border: 0; background: transparent; box-shadow: none; border-radius: 0; }
      .maintenance-edit-row > td { display: block; padding: 0 !important; border: 0; }
      .maintenance-edit-row > td::before { display: none; content: ""; }
      .maintenance-inline-editor .maintenance-form-grid { grid-template-columns: 1fr !important; }
      .maintenance-inline-editor-pad { padding: 16px; border-radius: 18px; border: 1px solid var(--line); border-left: 3px solid var(--red); background: white; }
      .maintenance-money-field { grid-template-columns: 1fr; }
    }
    .cert-placeholder-row { background: #fffdf5; }
    .cert-placeholder-row td strong { display: block; color: var(--black); }
    .quality-status-draft { background: #fef3c7; border-color: #fde68a; color: #92400e; }
    .cert-edit-row > td { padding: 0 !important; background: #fafafa; border-bottom: 1px solid var(--line); }
    .cert-inline-editor { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.34s ease; }
    .cert-edit-row.open .cert-inline-editor { grid-template-rows: 1fr; }
    .cert-inline-editor-inner { overflow: hidden; min-height: 0; }
    .cert-inline-editor-pad { padding: 18px 20px 22px; border-left: 3px solid var(--red); opacity: 0; transition: opacity 0.28s ease 0.06s; }
    .cert-edit-row.open .cert-inline-editor-pad { opacity: 1; }
    .cert-inline-head { display: flex; justify-content: flex-end; margin-bottom: 4px; }
    .cert-inline-close { border: 1px solid var(--line); background: white; color: var(--black); border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 950; cursor: pointer; }
    .cert-inline-close:hover { background: var(--red-soft); border-color: #fecaca; color: #991b1b; }
    .cert-inline-editor .quality-form-panel { border: 0; box-shadow: none; padding: 0; background: transparent; border-radius: 0; }
    .cert-inline-editor .quality-form-panel.hidden { display: block; }
    .quality-action-btn.active { background: var(--red-soft); border-color: #fecaca; color: #991b1b; }

    @media (max-width: 820px) {
      .quality-page { width: 100%; max-width: 100%; padding: 16px; overflow-x: hidden; }
      .quality-hero, .quality-form-header { flex-direction: column; padding: 20px; border-radius: 24px; }
      .quality-actions, .quality-actions .btn, .quality-form-header .btn { width: 100%; }
      .quality-summary-grid, .quality-filter-grid, .quality-form-grid { grid-template-columns: 1fr !important; }
      .quality-form-grid .span-2, .quality-form-grid .span-3, .quality-form-grid .span-4 { grid-column: 1 / -1; }
      .certificate-report-meta-grid { grid-template-columns: 1fr; }
      .quality-table-wrap { overflow-x: visible; border: 0; background: transparent; }
      .quality-table { min-width: 0; display: block; width: 100%; border-collapse: separate; }
      .quality-table thead { display: none; }
      .quality-table tbody { display: grid; gap: 12px; width: 100%; }
      .quality-table tr { display: grid; gap: 0; width: 100%; border: 1px solid var(--line); background: white; border-radius: 20px; padding: 12px 14px; box-shadow: var(--shadow-soft); }
      .quality-table td { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; overflow-wrap: anywhere; }
      .quality-table td:last-child { border-bottom: 0; }
      .quality-table td::before { content: attr(data-label); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 10px; font-weight: 950; }
      .quality-row-actions { display: grid; grid-template-columns: 1fr; }
      .quality-action-btn { width: 100%; }
      .quality-table tr.cert-edit-row { display: block; padding: 0; border: 0; background: transparent; box-shadow: none; border-radius: 0; }
      .cert-edit-row > td { display: block; padding: 0 !important; border: 0; }
      .cert-edit-row > td::before { display: none; content: ""; }
      .cert-inline-editor .quality-form-grid { grid-template-columns: 1fr !important; }
      .cert-inline-editor-pad { padding: 16px; border-radius: 18px; border: 1px solid var(--line); border-left: 3px solid var(--red); background: white; }
    }


    .admin-shell { min-height: 100vh; background: var(--bg); }
    .admin-page { max-width: 1380px; margin: 0 auto; padding: 28px 30px 48px; }
    .admin-hero { background: linear-gradient(135deg, var(--black), #27272a); color: white; border-radius: 32px; padding: 28px; box-shadow: var(--shadow); display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
    .admin-hero h1 { margin: 8px 0 0; font-size: clamp(34px, 4vw, 54px); line-height: 0.96; letter-spacing: -0.06em; }
    .admin-hero p { margin: 14px 0 0; max-width: 820px; color: #d4d4d8; line-height: 1.65; }
    .admin-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
    .admin-summary-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
    .admin-grid { margin-top: 22px; display: grid; grid-template-columns: 1fr; gap: 22px; align-items: start; }
    .admin-form-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
    .admin-form-grid .span-2 { grid-column: span 2; }
    .admin-form-grid .span-4 { grid-column: 1 / -1; }
    .admin-filter-grid { margin-top: 18px; display: grid; grid-template-columns: 1.3fr 0.9fr 0.8fr auto; gap: 10px; align-items: end; }
    .admin-table-wrap { margin-top: 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: 20px; background: white; max-width: 100%; }
    .admin-table { width: 100%; min-width: 980px; border-collapse: collapse; }
    .admin-table th, .admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; vertical-align: top; }
    .admin-table th { background: #fafafa; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; font-weight: 950; }
    .admin-table tr:last-child td { border-bottom: 0; }
    .admin-table td strong { display: block; color: var(--black); }
    .admin-row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
    .admin-action-btn { border: 1px solid var(--line); background: white; color: var(--black); border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 950; }
    .admin-action-btn:hover { background: var(--red-soft); border-color: #fecaca; color: #991b1b; }
    .admin-action-danger { border-color: #fecaca; color: #991b1b; }
    .admin-action-danger:hover { background: var(--red); border-color: var(--red); color: white; }
    .admin-status-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 950; border: 1px solid #d4d4d8; background: #f4f4f5; color: #3f3f46; white-space: nowrap; }
    .admin-status-active { background: #dcfce7; border-color: #bbf7d0; color: #166534; }
    .admin-status-inactive { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
    .admin-status-draft { background: #fef3c7; border-color: #fde68a; color: #92400e; }
    .admin-placeholder-row td strong { color: var(--black); }
    .admin-placeholder-row { background: #fffdf5; }
    .admin-edit-row > td { padding: 0 !important; background: #fafafa; border-bottom: 1px solid var(--line); }
    .admin-inline-editor { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.34s ease; }
    .admin-edit-row.open .admin-inline-editor { grid-template-rows: 1fr; }
    .admin-inline-editor-inner { overflow: hidden; min-height: 0; }
    .admin-inline-editor-pad { padding: 18px 20px 22px; border-left: 3px solid var(--red); opacity: 0; transition: opacity 0.28s ease 0.06s; }
    .admin-edit-row.open .admin-inline-editor-pad,
    .deviation-edit-row.open .deviation-inline-editor-pad { opacity: 1; }
    .admin-inline-head { display: flex; justify-content: flex-end; margin-bottom: 4px; }
    .admin-inline-close { border: 1px solid var(--line); background: white; color: var(--black); border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 950; cursor: pointer; }
    .admin-inline-close:hover { background: var(--red-soft); border-color: #fecaca; color: #991b1b; }
    .admin-inline-editor .panel { border: 0; box-shadow: none; padding: 0; background: transparent; border-radius: 0; }
    .admin-inline-editor .admin-form-grid { margin-top: 12px; }
    .admin-action-btn.active { background: var(--red-soft); border-color: #fecaca; color: #991b1b; }
    .module-access-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
    .module-access-card { position: relative; border: 1px solid var(--line); background: #fafafa; border-radius: 18px; padding: 14px 38px 14px 16px; display: block; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease; }
    .module-access-card input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
    .module-access-card strong { display: block; font-size: 13px; color: var(--black); }
    .module-access-card span { display: block; margin-top: 3px; color: var(--muted); line-height: 1.4; font-size: 12px; }
    .module-access-card::after { content: "✓"; position: absolute; top: 12px; right: 12px; width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; font-size: 12px; font-weight: 950; color: white; background: var(--red); opacity: 0; transform: scale(0.5); transition: opacity 0.15s ease, transform 0.15s ease; }
    .module-access-card:hover { border-color: #fecaca; }
    .module-access-card:has(input:checked) { border-color: var(--red); background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red); }
    .module-access-card:has(input:checked) strong { color: #991b1b; }
    .module-access-card:has(input:checked) span { color: #b91c1c; }
    .module-access-card:has(input:checked)::after { opacity: 1; transform: scale(1); }
    .module-access-card:has(input:focus-visible) { outline: 2px solid var(--red); outline-offset: 2px; }
    .admin-note { margin-top: 18px; border: 1px solid #fecaca; border-left: 5px solid var(--red); background: #fff1f2; color: #7f1d1d; border-radius: 18px; padding: 16px 18px; font-weight: 850; line-height: 1.55; box-shadow: var(--shadow-soft); }
    .admin-page, .admin-grid, .admin-table-wrap { min-width: 0; }

    @media (max-width: 820px) {
      .admin-page { width: 100%; max-width: 100%; padding: 16px; overflow-x: hidden; }
      .admin-hero { flex-direction: column; padding: 20px; border-radius: 24px; }
      .admin-actions, .admin-actions .btn { width: 100%; }
      .admin-summary-grid, .admin-filter-grid, .admin-form-grid { grid-template-columns: 1fr !important; }
      .admin-form-grid .span-2, .admin-form-grid .span-4 { grid-column: 1 / -1; }
      .admin-table-wrap { overflow-x: visible; border: 0; background: transparent; }
      .admin-table { min-width: 0; display: block; width: 100%; border-collapse: separate; }
      .admin-table thead { display: none; }
      .admin-table tbody { display: grid; gap: 12px; width: 100%; }
      .admin-table tr { display: grid; gap: 0; width: 100%; border: 1px solid var(--line); background: white; border-radius: 20px; padding: 12px 14px; box-shadow: var(--shadow-soft); }
      .admin-table td { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; overflow-wrap: anywhere; }
      .admin-table td:last-child { border-bottom: 0; }
      .admin-table td::before { content: attr(data-label); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 10px; font-weight: 950; }
      .admin-row-actions { display: grid; grid-template-columns: 1fr; }
      .admin-action-btn { width: 100%; }
      .admin-table tr.admin-edit-row { display: block; padding: 0; border: 0; background: transparent; box-shadow: none; border-radius: 0; }
      .admin-edit-row > td { display: block; padding: 0 !important; border: 0; }
      .admin-edit-row > td::before { display: none; content: ""; }
      .admin-inline-editor .admin-form-grid { grid-template-columns: 1fr !important; }
      .admin-inline-editor-pad { padding: 16px; border-radius: 18px; border: 1px solid var(--line); border-left: 3px solid var(--red); background: white; }
    }

    .logistics-shell { min-height: 100vh; background: var(--bg); }
    .logistics-page { max-width: 1380px; margin: 0 auto; padding: 28px 30px 48px; }
    .logistics-hero { background: linear-gradient(135deg, var(--black), #27272a); color: white; border-radius: 32px; padding: 28px; box-shadow: var(--shadow); display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
    .logistics-hero h1 { margin: 8px 0 0; font-size: clamp(34px, 4vw, 54px); line-height: 0.96; letter-spacing: -0.06em; }
    .logistics-hero p { margin: 14px 0 0; max-width: 820px; color: #d4d4d8; line-height: 1.65; }
    .logistics-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
    .logistics-shell .btn:disabled { opacity: 0.48; cursor: not-allowed; box-shadow: none; }

    .logistics-shell.loading { opacity: 1; pointer-events: auto; }
    #allocatedStockResultsPanel.loading { opacity: 0.65; pointer-events: none; }
    .logistics-summary-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
    .logistics-map-summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .logistics-map-summary-card {
      min-height: 0;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: start;
      gap: 15px;
    }
    .logistics-map-summary-main { min-width: 0; }
    .logistics-stat-nested {
      grid-column: 1 / -1;
      margin-top: 0;
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      align-items: center;
      gap: 8px;
      color: var(--black);
      font-size: 12px;
      font-weight: 950;
      width: 100%;
      max-width: 100%;
    }
    .logistics-stat-nested .logistics-level-stat-pill {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      min-width: 0;
      min-height: 28px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: #fafafa;
      color: var(--black);
      padding: 7px 8px;
      margin: 0;
      font-size: 12px;
      line-height: 1;
      font-weight: 950;
      white-space: nowrap;
    }
    .logistics-grid { margin-top: 22px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
    .logistics-filter-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(4, minmax(96px, 0.5fr)) minmax(170px, 1fr) minmax(132px, 0.72fr) minmax(210px, 1.2fr); gap: 14px; align-items: start; }
    .logistics-search-field, .logistics-sort-field, .logistics-second-choice-field { min-width: 0; }
    .logistics-filter-grid .form-field { display: grid; grid-template-rows: 16px 48px; gap: 9px; align-items: stretch; }
    .logistics-filter-grid .form-field > label:not(.logistics-filter-card) { display: flex; align-items: flex-end; height: 16px; min-height: 16px; margin: 0; color: var(--muted); font-size: 11px; font-weight: 950; text-transform: uppercase; letter-spacing: 0.08em; line-height: 1; }
    .logistics-filter-grid .select, .logistics-filter-grid .input { height: 48px; min-height: 48px; box-sizing: border-box; border-radius: 16px; padding-top: 0; padding-bottom: 0; }
    .logistics-native-select { display: none !important; }
    .logistics-select { position: relative; min-width: 0; height: 48px; min-height: 48px; z-index: 1; }
    .logistics-select.is-open { z-index: 60; }
    .logistics-select-btn { width: 100%; height: 48px; min-height: 48px; border: 1px solid var(--line); background: white; color: var(--text); border-radius: 16px; padding: 0 44px 0 16px; text-align: left; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; position: relative; transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease; }
    .logistics-select-btn::after { content: ""; position: absolute; right: 17px; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--black); border-bottom: 2px solid var(--black); transform: translateY(-65%) rotate(45deg); transition: transform 0.18s ease, border-color 0.15s ease; }
    .logistics-select-btn:hover { border-color: #fecaca; }
    .logistics-select-btn:focus-visible, .logistics-select.is-open .logistics-select-btn { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-soft); outline: none; }
    .logistics-select.is-open .logistics-select-btn::after { border-color: var(--red); transform: translateY(-35%) rotate(225deg); }
    .logistics-select-menu { position: absolute; left: 0; right: 0; top: calc(100% + 8px); max-height: 320px; overflow: hidden; border: 1px solid var(--line); background: white; border-radius: 18px; padding: 8px; box-shadow: var(--shadow); box-sizing: border-box; }
    .logistics-select-search-wrap { padding: 2px 2px 8px; }
    .logistics-select-search { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 14px; background: #fafafa; color: var(--text); outline: none; padding: 0 12px; font: inherit; font-size: 13px; font-weight: 800; box-sizing: border-box; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
    .logistics-select-search:focus { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-soft); background: white; }
    .logistics-select-options { max-height: 248px; overflow: auto; padding-right: 2px; }
    .logistics-select-empty { padding: 14px 12px; color: var(--muted); font-size: 13px; font-weight: 850; text-align: center; }
    .logistics-select-menu[hidden] { display: none; }
    .logistics-select-option { width: 100%; border: 0; background: transparent; color: var(--black); border-radius: 14px; padding: 11px 12px; text-align: left; font: inherit; font-size: 14px; font-weight: 850; cursor: pointer; transition: background 0.15s ease, color 0.15s ease; }
    .logistics-select-option:hover, .logistics-select-option:focus-visible { background: var(--red-soft); color: #991b1b; outline: none; }
    .logistics-select-option.is-selected { background: var(--red); color: white; }
    .logistics-select-option.is-selected:hover, .logistics-select-option.is-selected:focus-visible { background: var(--red-dark); color: white; }
    .logistics-filter-grid .logistics-filter-card { position: relative; height: 48px; min-height: 48px; margin: 0; box-sizing: border-box; border: 1px solid var(--line); background: #fafafa; border-radius: 16px; padding: 8px 42px 8px 16px; display: flex; align-items: center; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease; }
    .logistics-filter-card input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
    .logistics-filter-card strong { display: block; color: var(--black); font-size: 13px; font-weight: 950; line-height: 1.12; }
    .logistics-filter-card span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.12; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .logistics-filter-card::after { content: "✓"; position: absolute; top: 50%; right: 14px; width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; font-size: 12px; font-weight: 950; color: white; background: var(--red); opacity: 0; transform: translateY(-50%) scale(0.5); transition: opacity 0.15s ease, transform 0.15s ease; }
    .logistics-filter-card:hover { border-color: #fecaca; }
    .logistics-filter-card:has(input:checked) { border-color: var(--red); background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red); }
    .logistics-filter-card:has(input:checked) strong { color: #991b1b; }
    .logistics-filter-card:has(input:checked) span { color: #b91c1c; }
    .logistics-filter-card:has(input:checked)::after { opacity: 1; transform: translateY(-50%) scale(1); }
    .logistics-filter-card:has(input:focus-visible) { outline: 2px solid var(--red); outline-offset: 2px; }
    .logistics-location-note { margin-top: 16px; border: 1px solid var(--line); background: #fafafa; border-radius: 18px; padding: 13px 15px; color: var(--muted); font-size: 13px; font-weight: 850; line-height: 1.45; }
    .logistics-location-pill { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 7px 11px; background: var(--red-soft); color: #991b1b; border: 1px solid #fecaca; font-size: 12px; font-weight: 950; white-space: nowrap; }
    .logistics-results-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
    .logistics-results-actions .btn { white-space: nowrap; }
    .logistics-table-wrap { position: relative; margin-top: 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: 20px; background: white; max-width: 100%; }
    .logistics-loading-overlay { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; min-height: 220px; padding: 28px; background: rgba(255,255,255,0.88); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
    .logistics-loading-overlay[hidden] { display: none; }
    .logistics-loader-card { min-width: min(340px, 100%); border: 1px solid var(--line); background: white; border-radius: 22px; box-shadow: var(--shadow-soft); padding: 22px; display: grid; justify-items: center; gap: 8px; text-align: center; color: var(--muted); font-size: 13px; }
    .logistics-loader-card strong { color: var(--black); font-size: 16px; font-weight: 950; }
    .logistics-loader-spinner { width: 34px; height: 34px; border-radius: 999px; border: 4px solid var(--red-soft); border-top-color: var(--red); animation: logistics-spin 0.8s linear infinite; }
    @keyframes logistics-spin { to { transform: rotate(360deg); } }
    .logistics-table { width: 100%; min-width: 1120px; table-layout: fixed; border-collapse: collapse; }
    .logistics-table th, .logistics-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; vertical-align: top; overflow-wrap: anywhere; }
    .logistics-table th { background: #fafafa; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; font-weight: 950; }
    .logistics-table tr:last-child td { border-bottom: 0; }
    .logistics-table th:nth-child(1), .logistics-table td:nth-child(1) { width: 8%; }
    .logistics-table th:nth-child(2), .logistics-table td:nth-child(2) { width: 9%; }
    .logistics-table th:nth-child(3), .logistics-table td:nth-child(3) { width: 9%; }
    .logistics-table th:nth-child(4), .logistics-table td:nth-child(4) { width: 21%; }
    .logistics-table th:nth-child(5), .logistics-table td:nth-child(5) { width: 5%; }
    .logistics-table th:nth-child(6), .logistics-table td:nth-child(6) { width: 6%; }
    .logistics-table th:nth-child(7), .logistics-table td:nth-child(7) { width: 19%; }
    .logistics-table th:nth-child(8), .logistics-table td:nth-child(8) { width: 9%; }
    .logistics-table th:nth-child(9), .logistics-table td:nth-child(9) { width: 6%; }
    .logistics-table th:nth-child(10), .logistics-table td:nth-child(10) { width: 8%; }
    .logistics-cell-box { max-width: 260px; white-space: normal; }
    .logistics-cell-description { max-width: 280px; white-space: normal; }
    .logistics-table td strong { display: block; color: var(--black); }
    .logistics-table .muted-text { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
    .logistics-page, .logistics-grid, .logistics-grid > .panel, .logistics-table-wrap { min-width: 0; }

    .logistics-view[hidden] { display: none !important; }
    .logistics-map-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
    .logistics-warehouse-map-panel { margin-top: 22px; }
    .logistics-map-note { margin-top: 16px; border: 1px solid var(--line); border-left: 5px solid var(--red); background: #fff1f2; color: #7f1d1d; border-radius: 18px; padding: 14px 16px; font-size: 13px; font-weight: 850; line-height: 1.5; }
    .logistics-map-toolbar { margin-top: 16px; display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
    .logistics-map-legend { display: flex; align-items: center; align-self: flex-end; flex-wrap: wrap; gap: 10px; min-height: 46px; color: var(--muted); font-size: 12px; font-weight: 900; }
    .logistics-map-legend span { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: white; border-radius: 999px; padding: 7px 10px; }
    .logistics-map-legend-swatch { width: 14px; height: 14px; border-radius: 5px; display: inline-block; border: 1px solid var(--line); }
    .logistics-map-options { display: flex; align-items: flex-end; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-left: auto; }
    .logistics-map-search-field { width: 220px; margin: 0; }
    .logistics-map-search-field label { margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 950; text-transform: uppercase; letter-spacing: 0.08em; }
    .logistics-map-search-field .input { height: 46px; min-height: 46px; border-radius: 16px; padding-left: 14px; font-size: 13px; font-weight: 900; }
    .logistics-map-product-field { width: 220px; margin: 0; }
    .logistics-map-compact-field { display: grid; gap: 6px; min-width: 170px; }
    .logistics-map-control-label { color: var(--muted); font-size: 11px; font-weight: 950; text-transform: uppercase; letter-spacing: 0.08em; line-height: 1; }
    .logistics-map-product-field label { margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 950; text-transform: uppercase; letter-spacing: 0.08em; }
    .logistics-map-product-field .logistics-select { height: 46px; min-height: 46px; }
    .logistics-map-product-field .logistics-select-btn { height: 46px; min-height: 46px; border-radius: 16px; padding-left: 14px; font-size: 13px; font-weight: 900; }
    .logistics-map-product-field .logistics-select-menu { top: calc(100% + 7px); }
    .logistics-map-toggle-card { position: relative; height: 46px; min-height: 46px; border: 1px solid var(--line); background: #fafafa; border-radius: 18px; padding: 9px 42px 9px 14px; display: inline-flex; align-items: center; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease; }
    .logistics-map-toggle-card input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
    .logistics-map-toggle-card strong { display: block; color: var(--black); font-size: 13px; font-weight: 950; line-height: 1.12; }
    .logistics-map-toggle-card span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.12; }
    .logistics-map-toggle-card::after { content: "✓"; position: absolute; top: 50%; right: 13px; width: 21px; height: 21px; border-radius: 999px; display: grid; place-items: center; font-size: 12px; font-weight: 950; color: white; background: var(--red); opacity: 0; transform: translateY(-50%) scale(0.5); transition: opacity 0.15s ease, transform 0.15s ease; }
    .logistics-map-toggle-card:hover { border-color: #fecaca; }
    .logistics-map-toggle-card:has(input:checked) { border-color: var(--red); background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red); }
    .logistics-map-toggle-card:has(input:checked) strong { color: #991b1b; }
    .logistics-map-toggle-card:has(input:checked) span { color: #b91c1c; }
    .logistics-map-toggle-card:has(input:checked)::after { opacity: 1; transform: translateY(-50%) scale(1); }
    .logistics-map-toggle-card:has(input:focus-visible) { outline: 2px solid var(--red); outline-offset: 2px; }
    .logistics-map-legend-location { background: white; }
    .logistics-map-legend-empty { background: #dcfce7; border-color: #bbf7d0; }
    .logistics-map-legend-partial { background: #fef3c7; border-color: #fde68a; }
    .logistics-map-legend-allocated { background: #fee2e2; border-color: #fecaca; }
    .logistics-warehouse-map-shell { margin-top: 18px; border: 1px solid var(--line); border-radius: 20px; background: #fafafa; padding: 16px; max-width: 100%; overflow: hidden; }
    .logistics-warehouse-map-scroll { position: relative; width: 100%; max-width: 100%; height: 662px; max-height: 662px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--bg); padding: 16px; cursor: grab; touch-action: pan-y; }
    .logistics-warehouse-map-scroll.is-compressed { height: auto; max-height: none; }
    .logistics-warehouse-map-scroll.is-dragging { cursor: grabbing; user-select: none; }
    .logistics-warehouse-map-scroll.is-dragging * { user-select: none; }
    .logistics-warehouse-map-grid {
      --warehouse-map-columns: 85;
      --warehouse-map-rows: 65;
      --warehouse-map-cell-width: 42px;
      --warehouse-map-cell-height: 24px;
      display: grid;
      grid-template-columns: repeat(var(--warehouse-map-columns), var(--warehouse-map-cell-width));
      grid-template-rows: repeat(var(--warehouse-map-rows), var(--warehouse-map-cell-height));
      gap: 2px;
      min-width: calc((var(--warehouse-map-columns) * var(--warehouse-map-cell-width)) + ((var(--warehouse-map-columns) - 1) * 2px));
      min-height: calc((var(--warehouse-map-rows) * var(--warehouse-map-cell-height)) + ((var(--warehouse-map-rows) - 1) * 2px));
      background: var(--bg);
    }
    .logistics-warehouse-row-label {
      display: grid;
      place-items: center;
      min-width: 0;
      min-height: 0;
      border: 1px solid #27272a;
      border-radius: 9px;
      background: var(--black);
      color: white;
      font-size: 10px;
      font-weight: 950;
      line-height: 1;
      letter-spacing: -0.02em;
      writing-mode: vertical-rl;
      transform: rotate(180deg);
      box-shadow: var(--shadow-soft);
      overflow: hidden;
      position: sticky;
      left: 0;
      z-index: 8;
    }
    .logistics-warehouse-row-label.is-map-header {
      writing-mode: horizontal-tb;
      transform: none;
      font-size: 9px;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }
    .logistics-warehouse-row-label.is-aisle-number {
      writing-mode: horizontal-tb;
      transform: none;
      letter-spacing: 0.02em;
      font-size: 11px;
    }
    .logistics-warehouse-level-label {
      display: grid;
      place-items: center;
      min-width: 0;
      min-height: 0;
      border: 1px solid #27272a;
      border-radius: 9px;
      background: var(--black);
      color: white;
      font-size: 10px;
      font-weight: 950;
      line-height: 1;
      letter-spacing: 0.04em;
      box-shadow: var(--shadow-soft);
      overflow: hidden;
      position: sticky;
      left: calc(var(--warehouse-map-cell-width) + 2px);
      z-index: 7;
    }
    .logistics-warehouse-level-label.is-map-header {
      font-size: 8px;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }
    .logistics-warehouse-map-grid.is-compressed .logistics-warehouse-location { font-size: 9px; cursor: pointer; }
    .logistics-warehouse-location[data-allocated-stock-map-position] { cursor: pointer; }
    .logistics-warehouse-map-grid.is-compressed .logistics-warehouse-location:hover,
    .logistics-warehouse-map-grid.is-compressed .logistics-warehouse-location.active { border-color: var(--black); background: white; color: var(--black); box-shadow: inset 0 0 0 1px var(--black); }
    .logistics-warehouse-location {
      appearance: none;
      -webkit-appearance: none;
      width: 100%;
      height: 100%;
      min-width: 0;
      min-height: 0;
      border: 1px solid var(--line);
      border-radius: 7px;
      background: white;
      color: var(--black);
      padding: 0 2px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      font: inherit;
      font-size: 9px;
      font-weight: 850;
      line-height: 1;
      white-space: nowrap;
      cursor: default;
      position: relative;
      z-index: 2;
      transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
    }
    .logistics-warehouse-location.is-empty {
      border-color: #bbf7d0;
      background: #dcfce7;
      color: #166534;
    }
    .logistics-warehouse-location.is-partial {
      border-color: #fde68a;
      background: #fef3c7;
      color: #92400e;
    }
    .logistics-warehouse-location.is-allocated {
      border-color: #fecaca;
      background: #fee2e2;
      color: #991b1b;
    }
    .logistics-warehouse-map-grid .logistics-warehouse-location[data-allocated-stock-map-position] { cursor: pointer; }
    .logistics-warehouse-map-grid .logistics-warehouse-location:hover,
    .logistics-warehouse-map-grid .logistics-warehouse-location:focus-visible {
      border-color: var(--black);
      background: white;
      color: var(--black);
      box-shadow: inset 0 0 0 1px var(--black);
      outline: none;
      transform: translateY(-1px);
    }
    .logistics-warehouse-location.is-reference-match { box-shadow: inset 0 0 0 1px var(--black); }
    .logistics-warehouse-location.is-reference-dimmed { opacity: 0.24; filter: grayscale(0.75); }
    .logistics-warehouse-location.is-reference-dimmed span { filter: blur(0.25px); }
    .logistics-warehouse-location.is-reference-dimmed:hover,
    .logistics-warehouse-location.is-reference-dimmed:focus-visible { opacity: 0.52; }
    .logistics-warehouse-location span { overflow: hidden; text-overflow: ellipsis; }
    .logistics-warehouse-level-menu {
      position: fixed;
      z-index: 650;
      width: max-content;
      min-width: 94px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: white;
      box-shadow: var(--shadow-soft);
      padding: 8px;
    }
    .logistics-warehouse-level-menu-head {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 8px;
      border-bottom: 1px solid var(--line);
      padding-bottom: 7px;
      margin-bottom: 7px;
      min-width: 0;
    }
    .logistics-warehouse-level-menu-head strong { color: var(--black); font-size: 13px; font-weight: 950; }
    .logistics-warehouse-level-menu-head span { color: var(--muted); font-size: 10px; font-weight: 900; }
    .logistics-warehouse-level-menu-options {
      display: grid;
      grid-template-columns: 42px;
      justify-content: center;
      justify-items: center;
      gap: 4px;
      width: 100%;
    }
    .logistics-warehouse-level-menu .logistics-warehouse-level-option {
      width: 42px;
      height: 24px;
      min-width: 42px;
      min-height: 24px;
      border: 1px solid var(--line);
      border-radius: 7px;
      background: white;
      color: var(--black);
      padding: 0 2px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      font-size: 9px;
      font-weight: 850;
      line-height: 1;
      white-space: nowrap;
      cursor: pointer;
      z-index: 1;
    }
    .logistics-warehouse-level-menu .logistics-warehouse-level-option.is-empty,
    .logistics-warehouse-level-menu .logistics-warehouse-level-menu-position.is-empty {
      border-color: #bbf7d0;
      background: #dcfce7;
      color: #166534;
    }
    .logistics-warehouse-level-menu .logistics-warehouse-level-option.is-partial,
    .logistics-warehouse-level-menu .logistics-warehouse-level-menu-position.is-partial {
      border-color: #fde68a;
      background: #fef3c7;
      color: #92400e;
    }
    .logistics-warehouse-level-menu .logistics-warehouse-level-option.is-allocated,
    .logistics-warehouse-level-menu .logistics-warehouse-level-menu-position.is-allocated {
      border-color: #fecaca;
      background: #fee2e2;
      color: #991b1b;
    }
    .logistics-warehouse-level-menu-position {
      width: 42px;
      height: 24px;
      min-width: 42px;
      min-height: 24px;
      border: 1px solid var(--line);
      border-radius: 7px;
      display: inline-flex !important;
      align-items: center;
      justify-content: center;
      font-size: 9px !important;
      line-height: 1;
    }
    .logistics-warehouse-level-menu .logistics-warehouse-level-option:hover,
    .logistics-warehouse-level-menu .logistics-warehouse-level-option:focus-visible {
      border-color: var(--black);
      box-shadow: inset 0 0 0 1px var(--black);
      outline: none;
      transform: translateY(-1px);
    }
    .logistics-warehouse-level-menu .logistics-warehouse-level-option.is-empty,
    .logistics-warehouse-level-menu .logistics-warehouse-level-menu-position.is-empty {
      border-color: #bbf7d0;
      background: #dcfce7;
      color: #166534;
    }
    .logistics-warehouse-level-menu .logistics-warehouse-level-option.is-partial,
    .logistics-warehouse-level-menu .logistics-warehouse-level-menu-position.is-partial {
      border-color: #fde68a;
      background: #fef3c7;
      color: #92400e;
    }
    .logistics-warehouse-level-menu .logistics-warehouse-level-option.is-allocated,
    .logistics-warehouse-level-menu .logistics-warehouse-level-menu-position.is-allocated {
      border-color: #fecaca;
      background: #fee2e2;
      color: #991b1b;
    }
    .logistics-warehouse-map-empty { border: 1px dashed #d4d4d8; background: #fafafa; border-radius: 18px; padding: 24px; color: var(--muted); font-size: 13px; font-weight: 850; text-align: center; }
    .logistics-warehouse-occupancy { margin-top: 18px; border: 1px solid var(--line); border-radius: 20px; background: white; padding: 18px; box-shadow: var(--shadow-soft); }
    .logistics-warehouse-occupancy-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
    .logistics-warehouse-occupancy-head h3 { margin: 0; color: var(--black); font-size: 20px; font-weight: 950; letter-spacing: -0.03em; }
    .logistics-warehouse-occupancy-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
    .logistics-warehouse-occupancy-list { display: grid; gap: 9px; margin-top: 16px; }
    .logistics-warehouse-occupancy-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) 112px; align-items: center; gap: 14px; }
    .logistics-warehouse-occupancy-label { color: var(--black); font-size: 13px; font-weight: 950; }
    .logistics-warehouse-occupancy-bar { height: 18px; border: 1px solid var(--line); background: #f4f4f5; border-radius: 999px; overflow: hidden; }
    .logistics-warehouse-occupancy-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--red); transition: width 0.18s ease; }
    .logistics-warehouse-occupancy-value { display: flex; justify-content: flex-end; align-items: baseline; gap: 5px; white-space: nowrap; color: var(--muted); font-size: 12px; font-weight: 900; }
    .logistics-warehouse-occupancy-value strong { color: var(--black); font-size: 13px; font-weight: 950; }
    .logistics-warehouse-empty-card { margin-top: 18px; border: 1px solid var(--line); border-radius: 20px; background: white; padding: 18px; box-shadow: var(--shadow-soft); }
    .logistics-warehouse-empty-columns { margin-top: 16px; display: grid; grid-template-columns: repeat(18, minmax(118px, 1fr)); gap: 10px; overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 6px; max-width: 100%; }
    .logistics-warehouse-empty-column { min-width: 118px; border: 1px solid var(--line); border-radius: 18px; background: #fafafa; padding: 10px; }
    .logistics-warehouse-empty-column-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
    .logistics-warehouse-empty-column-head strong { color: var(--black); font-size: 12px; font-weight: 950; }
    .logistics-warehouse-empty-column-head span { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 7px; border: 1px solid #bbf7d0; background: #dcfce7; color: #166534; border-radius: 999px; font-size: 11px; font-weight: 950; }
    .logistics-warehouse-empty-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; align-content: start; }
    .logistics-warehouse-empty-chip { appearance: none; border: 1px solid #bbf7d0; background: #dcfce7; color: #166534; border-radius: 10px; min-height: 28px; padding: 4px 5px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-size: 11px; line-height: 1; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease; }
    .logistics-warehouse-empty-chip strong { font-size: 11px; font-weight: 950; }
    .logistics-warehouse-empty-chip span { font-size: 10px; font-weight: 950; opacity: 0.82; }
    .logistics-warehouse-empty-chip:hover,
    .logistics-warehouse-empty-chip:focus-visible { border-color: var(--black); background: white; color: var(--black); box-shadow: inset 0 0 0 1px var(--black); outline: none; transform: translateY(-1px); }
    .logistics-warehouse-empty-none { grid-column: 1 / -1; border: 1px dashed #d4d4d8; border-radius: 12px; padding: 10px 8px; color: var(--muted); font-size: 11px; font-weight: 900; text-align: center; }

    @media (max-width: 1180px) {
      .logistics-map-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }

    @media (max-width: 820px) {
      .logistics-page { width: 100%; max-width: 100%; padding: 16px; overflow-x: hidden; }
      .logistics-hero { flex-direction: column; padding: 20px; border-radius: 24px; }
      .logistics-actions, .logistics-actions .btn { width: 100%; }
      .logistics-results-actions, .logistics-results-actions .btn { width: 100%; }
      .logistics-summary-grid, .logistics-filter-grid { grid-template-columns: 1fr !important; }
      .logistics-table-wrap { overflow-x: visible; border: 0; background: transparent; }
      .logistics-loading-overlay { border-radius: 20px; padding: 18px; }
      .logistics-table { min-width: 0; display: block; width: 100%; border-collapse: separate; }
      .logistics-table thead { display: none; }
      .logistics-table tbody { display: grid; gap: 12px; width: 100%; }
      .logistics-table tr { display: grid; gap: 0; width: 100%; border: 1px solid var(--line); background: white; border-radius: 20px; padding: 12px 14px; box-shadow: var(--shadow-soft); }
      .logistics-table td { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 10px; align-items: start; width: auto !important; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; overflow-wrap: anywhere; }
      .logistics-cell-box, .logistics-cell-description { max-width: 100%; }
      .logistics-table td:last-child { border-bottom: 0; }
      .logistics-table td::before { content: attr(data-label); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 10px; font-weight: 950; }
      .logistics-table td[colspan] { display: block; }
      .logistics-table td[colspan]::before { display: none; content: ""; }
      .logistics-map-actions, .logistics-map-actions .logistics-location-pill { width: 100%; }
      .logistics-map-toolbar { align-items: stretch; }
      .logistics-map-legend, .logistics-map-options, .logistics-map-toggle-card, .logistics-map-product-field { width: 100%; }
      .logistics-warehouse-map-shell { padding: 12px; border-radius: 18px; }
      .logistics-warehouse-map-scroll { height: 520px; max-height: 520px; padding: 12px; border-radius: 16px; }
      .logistics-warehouse-map-scroll.is-compressed { height: auto; max-height: none; }
      .logistics-warehouse-map-grid { --warehouse-map-cell-width: 38px; --warehouse-map-cell-height: 24px; }
      .logistics-warehouse-location { font-size: 8px; }
      .logistics-warehouse-row-label, .logistics-warehouse-level-label { font-size: 9px; }
      .logistics-warehouse-level-label.is-map-header { font-size: 7px; }
      .logistics-warehouse-occupancy { padding: 14px; border-radius: 18px; }
      .logistics-warehouse-occupancy-head { flex-direction: column; }
      .logistics-warehouse-occupancy-row { grid-template-columns: 64px minmax(0, 1fr); gap: 10px; }
      .logistics-warehouse-occupancy-value { grid-column: 2; justify-content: flex-start; }
      .logistics-warehouse-empty-card { padding: 14px; border-radius: 18px; }
      .logistics-warehouse-empty-columns { grid-template-columns: repeat(18, minmax(112px, 112px)); }
    }


    /* Stock Alocado sidebar trial */
    .logistics-main .topbar-inner { max-width: 1380px; }
    .logistics-sidebar .brand strong { letter-spacing: -0.04em; }
    .logistics-sidebar-nav { margin-top: 32px; display: grid; gap: 8px; }
    .logistics-side-btn { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: 18px; padding: 13px 14px; background: transparent; color: #d4d4d8; font-size: 14px; font-weight: 900; text-align: left; transition: 0.16s ease; cursor: pointer; }
    .logistics-side-btn:hover { background: #18181b; color: white; }
    .logistics-side-btn.active { background: var(--red); color: white; box-shadow: 0 14px 24px rgba(193, 18, 31, 0.28); }
    .logistics-side-btn.is-disabled, .logistics-side-btn:disabled { opacity: 0.48; cursor: not-allowed; box-shadow: none; }
    .logistics-side-btn.is-disabled:hover, .logistics-side-btn:disabled:hover { background: transparent; color: #d4d4d8; }

    @media (max-width: 820px) {
      .logistics-sidebar-nav { margin-top: 18px; }
      .logistics-side-btn { justify-content: flex-start; }
    }


    /* Table polish: equal desktop row actions, centered status pills and consistent description badges */
    .status,
    .expense-status-pill,
    .quality-status-pill,
    .admin-status-pill,
    .maintenance-status-pill,
    .logistics-status-pill,
    .deviation-status-pill {
      justify-content: center;
      text-align: center;
      line-height: 1.25;
    }

    .expense-status {
      align-items: flex-start;
      justify-content: flex-start;
      max-width: 180px;
      white-space: normal;
      overflow-wrap: anywhere;
      line-height: 1.3;
      text-align: left;
      border-radius: 14px;
    }

    @media (min-width: 821px) {
      .action-row,
      .expense-doc-actions,
      .quality-row-actions,
      .admin-row-actions,
      .maintenance-row-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
        gap: 8px;
        align-items: center;
        justify-content: end;
        min-width: 112px;
      }

      .action-row .btn,
      .expense-action-btn,
      .quality-action-btn,
      .admin-action-btn,
      .maintenance-action-btn {
        width: 100%;
        min-width: 112px;
        text-align: center;
        justify-content: center;
      }

      .expense-doc-actions {
        margin-top: 0;
      }

      .maintenance-two-action-cell {
        width: 300px;
      }

      .maintenance-two-action-cell .maintenance-two-action-row {
        grid-template-columns: repeat(2, minmax(112px, 1fr));
        min-width: 236px;
      }

      .admin-table th:last-child,
      .admin-table td[data-label="Ação"] {
        width: 320px;
      }

      #adminUsersTableBody .admin-user-row-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      #adminDepartmentsTableBody .admin-row-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .admin-table td[data-label="Ação"] .admin-row-actions {
        gap: 6px;
        min-width: 0;
      }

      .admin-table td[data-label="Ação"] .admin-action-btn {
        min-width: 0;
        padding: 7px 8px;
        font-size: 11px;
        white-space: nowrap;
      }

    }

    /* Expense table desktop/mobile polish: fixed description pills and equal action buttons */
    :root { --expense-description-pill-width: 128px; }

    .expense-table .expense-status {
      width: var(--expense-description-pill-width);
      max-width: var(--expense-description-pill-width);
      min-height: 30px;
      box-sizing: border-box;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      white-space: normal;
      overflow-wrap: anywhere;
      line-height: 1.25;
    }

    .expense-table .expense-doc-actions .expense-action-btn,
    .expense-table .expense-doc-actions .approval-doc-btn {
      width: 100%;
      min-width: 118px;
      box-sizing: border-box;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      text-align: center;
    }

    @media (min-width: 821px) {
      .expense-table .expense-doc-actions {
        grid-template-columns: minmax(118px, 118px);
        justify-content: end;
        align-items: stretch;
      }
    }

    @media (max-width: 820px) {
      .expense-table td[data-label="Descrição"] .expense-status,
      .expense-table td[data-label="Estado"] .expense-status-pill {
        width: 100%;
        max-width: 100%;
        min-height: 34px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        box-sizing: border-box;
      }

      .expense-table td[data-label="Ação"] .expense-doc-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
      }

      .expense-table td[data-label="Ação"] .expense-action-btn,
      .expense-table td[data-label="Ação"] .approval-doc-btn {
        width: 100%;
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        box-sizing: border-box;
      }
    }

/* Nexus styled date picker */
.nexus-native-date {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip-path: inset(50%) !important;
}

.nexus-date {
  position: relative;
  width: 100%;
  min-width: 0;
}

.nexus-date-btn {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 16px;
  padding: 12px 44px 12px 13px;
  color: var(--text);
  outline: none;
  transition: 0.15s ease;
  font: inherit;
  text-align: left;
  cursor: pointer;
  position: relative;
}

.nexus-date-btn::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  border-radius: 6px;
  border: 1px solid var(--line);
  background:
    linear-gradient(var(--red), var(--red)) 50% 36% / 10px 2px no-repeat,
    linear-gradient(var(--red), var(--red)) 50% 64% / 10px 2px no-repeat,
    linear-gradient(var(--red), var(--red)) 35% 50% / 2px 10px no-repeat,
    linear-gradient(var(--red), var(--red)) 65% 50% / 2px 10px no-repeat,
    var(--red-soft);
}

.nexus-date-btn:hover,
.nexus-date.is-open .nexus-date-btn {
  border-color: #fecaca;
}

.nexus-date-btn:focus,
.nexus-date.is-open .nexus-date-btn {
  border-color: var(--red);
  box-shadow: 0 0 0 4px var(--red-soft);
}

.nexus-date:not(.has-value) .nexus-date-btn span {
  color: var(--muted);
}

.nexus-date.is-disabled .nexus-date-btn {
  cursor: not-allowed;
  color: var(--muted);
  background: #fafafa;
}

.nexus-date-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 200;
  width: min(320px, calc(100vw - 32px));
  border: 1px solid var(--line);
  background: white;
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 12px;
}

.nexus-date-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.nexus-date-head strong {
  color: var(--black);
  font-size: 13px;
  font-weight: 950;
  text-align: center;
  text-transform: capitalize;
}

.nexus-date-nav,
.nexus-date-link {
  border: 1px solid var(--line);
  background: white;
  color: var(--black);
  cursor: pointer;
  font-weight: 950;
  transition: 0.15s ease;
}

.nexus-date-nav {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  font-size: 18px;
  line-height: 1;
}

.nexus-date-nav:hover,
.nexus-date-link:hover {
  border-color: #fecaca;
  background: var(--red-soft);
  color: #991b1b;
}

.nexus-date-weekdays,
.nexus-date-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.nexus-date-weekdays {
  margin-bottom: 6px;
}

.nexus-date-weekdays span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nexus-date-day {
  height: 34px;
  border: 1px solid transparent;
  background: white;
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  transition: 0.15s ease;
}

.nexus-date-day:hover {
  border-color: #fecaca;
  background: var(--red-soft);
  color: #991b1b;
}

.nexus-date-day.is-muted {
  color: #a1a1aa;
}

.nexus-date-day.is-today {
  border-color: #fecaca;
}

.nexus-date-day.is-selected {
  background: var(--red);
  border-color: var(--red);
  color: white;
}

.nexus-date-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.nexus-date-link {
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
}

@media (max-width: 820px) {
  .nexus-date-menu {
    left: 0;
    right: auto;
    width: min(310px, calc(100vw - 52px));
  }

  .nexus-date-day {
    height: 36px;
  }
}

    /* Inline editor dropdown visibility: custom select menus must escape add/edit table expanders. */
    .expense-table-wrap:has(.exp-edit-row.open),
    .quality-table-wrap:has(.cert-edit-row.open),
    .maintenance-table-wrap:has(.maintenance-edit-row.open),
    .admin-table-wrap:has(.admin-edit-row.open),
    .deviation-table-wrap:has(.deviation-edit-row.open) {
      overflow: visible;
    }

    .exp-edit-row.open,
    .cert-edit-row.open,
    .maintenance-edit-row.open,
    .admin-edit-row.open,
    .deviation-edit-row.open {
      position: relative;
      z-index: 90;
      overflow: visible;
    }

    .exp-edit-row.open > td,
    .cert-edit-row.open > td,
    .maintenance-edit-row.open > td,
    .admin-edit-row.open > td,
    .deviation-edit-row.open > td,
    .exp-edit-row.open .exp-inline-editor,
    .cert-edit-row.open .cert-inline-editor,
    .maintenance-edit-row.open .maintenance-inline-editor,
    .admin-edit-row.open .admin-inline-editor,
    .deviation-edit-row.open .deviation-inline-editor,
    .exp-edit-row.open .exp-inline-editor-inner,
    .cert-edit-row.open .cert-inline-editor-inner,
    .maintenance-edit-row.open .maintenance-inline-editor-inner,
    .admin-edit-row.open .admin-inline-editor-inner,
    .deviation-edit-row.open .deviation-inline-editor-inner,
    .exp-edit-row.open .exp-inline-editor-pad,
    .cert-edit-row.open .cert-inline-editor-pad,
    .maintenance-edit-row.open .maintenance-inline-editor-pad,
    .admin-edit-row.open .admin-inline-editor-pad,
    .deviation-edit-row.open .deviation-inline-editor-pad {
      overflow: visible;
    }

    .nexus-select.is-open,
    .nexus-date.is-open,
    .logistics-select.is-open {
      z-index: 12001;
    }


    .nexus-back-to-top {
      position: fixed;
      right: 28px;
      bottom: 28px;
      z-index: 250;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 9px;
      min-width: 104px;
      height: 48px;
      border: 0;
      border-radius: 999px;
      background: var(--red);
      color: white;
      font-size: 13px;
      font-weight: 950;
      box-shadow: 0 18px 34px rgba(193,18,31,0.24);
      cursor: pointer;
      opacity: 0;
      pointer-events: none;
      transform: translateY(12px) scale(0.96);
      transition: opacity 0.2s ease, transform 0.2s ease, background 0.16s ease;
    }

    .nexus-back-to-top span {
      width: 24px;
      height: 24px;
      border-radius: 999px;
      display: grid;
      place-items: center;
      background: rgba(255,255,255,0.16);
      line-height: 1;
      font-size: 16px;
      font-weight: 950;
    }

    .nexus-back-to-top.show {
      opacity: 1;
      pointer-events: auto;
      transform: translateY(0) scale(1);
    }

    .nexus-back-to-top:hover {
      background: var(--red-dark);
      transform: translateY(-2px) scale(1);
    }

    .nexus-back-to-top:focus-visible {
      outline: none;
      box-shadow: 0 0 0 4px var(--red-soft), 0 18px 34px rgba(193,18,31,0.24);
    }

    @media (max-width: 820px) {
      .nexus-back-to-top {
        right: 18px;
        bottom: 18px;
        min-width: 96px;
        height: 46px;
      }
    }

    @media (max-width: 560px) {
      .nexus-back-to-top {
        right: 14px;
        bottom: 14px;
        min-width: 46px;
        width: 46px;
        padding: 0;
        gap: 0;
      }

      .nexus-back-to-top strong {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
      }

      .nexus-back-to-top span {
        background: transparent;
      }
    }

    /* === Mobile bottom-crop + safe-area fixes (final overrides) === */
    @media (max-width: 820px) {
      .content,
      .expense-page,
      .admin-page,
      .quality-page,
      .maintenance-page,
      .logistics-page,
      .deviation-page {
        padding-bottom: calc(132px + env(safe-area-inset-bottom, 0px)) !important;
      }
      .nexus-back-to-top {
        bottom: calc(18px + env(safe-area-inset-bottom, 0px));
        z-index: 400;
      }
    }

    /* === Mobile off-canvas sidebar (hamburger drawer) === */
    .mobile-menu-btn { display: none; }
    .sidebar-backdrop { display: none; }
    @media (max-width: 820px) {
      /* Hamburger button in the topbar */
      .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 46px;
        height: 46px;
        flex: 0 0 auto;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: white;
        color: var(--black);
        cursor: pointer;
        margin-bottom: 14px;
      }
      .mobile-menu-btn svg { width: 22px; height: 22px; }
      .mobile-menu-btn:hover { background: var(--bg); }

      /* Topbar back to a row so the hamburger sits at the left */
      .topbar-inner { flex-direction: row !important; align-items: center !important; gap: 12px; }
      .topbar-inner > div:not(.topbar-actions) { flex: 1 1 auto; min-width: 0; }
      .topbar-actions { width: auto !important; flex: 0 0 auto; }
      .topbar-actions .btn { width: auto !important; }

      /* Sidebar becomes an off-canvas drawer (hidden by default) */
      .sidebar {
        position: fixed !important;
        inset: 0 auto 0 0 !important;
        width: 86% !important;
        max-width: 320px;
        height: 100% !important;
        border-right: 1px solid #27272a !important;
        border-radius: 0 !important;
        padding: 22px !important;
        margin: 0 !important;
        z-index: 320 !important;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        box-shadow: var(--shadow);
      }
      body.sidebar-open .sidebar { transform: translateX(0); }

      /* Restore the drawer's internal layout (override the stacked-mobile rules) */
      .sidebar {
        display: flex !important;
        flex-direction: column !important;
        min-height: 100dvh;
        height: 100dvh !important;
      }
      .module-sidebar-nav,
      .maintenance-sidebar-nav,
      .logistics-sidebar-nav,
      .nav {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        margin-top: 18px !important;
        flex: 0 0 auto;
      }
      .module-side-btn,
      .maintenance-side-btn,
      .logistics-side-btn,
      .nav-btn {
        width: 100% !important;
        justify-content: flex-start !important;
        text-align: left !important;
        min-height: 54px;
      }
      .logout-btn {
        position: static !important;
        width: 100% !important;
        margin-top: auto !important;
        flex: 0 0 auto;
      }
      .made-by-sidebar {
        position: static !important;
        width: 100% !important;
        margin-top: 18px !important;
        margin-bottom: 0 !important;
        flex: 0 0 auto;
      }

      /* Backdrop */
      .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 310;
        background: rgba(8,8,8,0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
      }
      body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
      body.sidebar-open { overflow: hidden; }
    }

/* === Logistics mobile drawer refinements === */
@media (max-width: 820px) {
  .logistics-page {
    padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .logistics-sidebar.sidebar {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100dvh;
    height: 100dvh !important;
  }

  .logistics-sidebar .logistics-sidebar-nav,
  .logistics-sidebar.nav,
  .logistics-sidebar .nav {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    flex: 0 0 auto;
  }

  .logistics-sidebar .logistics-side-btn,
  .logistics-sidebar .nav-btn {
    width: 100% !important;
    justify-content: flex-start !important;
    text-align: left !important;
    min-height: 54px;
  }

  .logistics-sidebar .logout-btn {
    position: static !important;
    width: 100% !important;
    margin-top: auto !important;
    flex: 0 0 auto;
  }

  .logistics-sidebar .made-by-sidebar {
    position: static !important;
    width: 100% !important;
    margin-top: 18px !important;
    margin-bottom: 0 !important;
    flex: 0 0 auto;
  }
}

@supports not (height: 100dvh) {
  @media (max-width: 820px) {
    .sidebar {
      min-height: 100vh;
      height: 100vh !important;
    }
  }
}


/* === Deviation Requests module === */
.deviation-shell { min-height: 100vh; background: var(--bg); }
.deviation-page { max-width: 1380px; margin: 0 auto; padding: 28px 30px 48px; }
.deviation-hero { background: linear-gradient(135deg, var(--black), #27272a); color: white; border-radius: 32px; padding: 28px; box-shadow: var(--shadow); display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.deviation-hero h1 { margin: 8px 0 0; font-size: clamp(34px, 4vw, 54px); line-height: 0.96; letter-spacing: -0.06em; }
.deviation-hero p { margin: 14px 0 0; max-width: 760px; color: #d4d4d8; line-height: 1.65; }
.deviation-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.deviation-summary-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.deviation-grid { margin-top: 22px; display: grid; grid-template-columns: 1fr; gap: 22px; align-items: start; }
.deviation-page, .deviation-grid, .deviation-table-wrap { min-width: 0; }
.deviation-filter-grid { margin-top: 18px; display: grid; grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.deviation-table-wrap { margin-top: 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: 20px; background: white; max-width: 100%; }
.deviation-table { width: 100%; border-collapse: collapse; min-width: 1080px; }
.deviation-table th, .deviation-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; vertical-align: top; }
.deviation-table th { background: #fafafa; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; font-weight: 950; }
.deviation-table tr:last-child td { border-bottom: 0; }
.deviation-table td strong { display: block; color: var(--black); }
.deviation-muted-line { display: block; color: var(--muted); margin-top: 3px; font-size: 12px; line-height: 1.4; }
.deviation-row-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.deviation-action-btn { border: 1px solid var(--line); background: white; color: var(--black); border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 950; transition: 0.16s ease; }
.deviation-action-btn:hover, .deviation-action-btn.active { background: var(--red-soft); border-color: #fecaca; color: #991b1b; }
.deviation-action-btn.danger { color: var(--red); }
.deviation-action-btn.green { color: var(--green); }
.deviation-status-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 950; border: 1px solid #d4d4d8; background: #f4f4f5; color: #3f3f46; white-space: nowrap; }
.deviation-status-waiting, .deviation-status-draft { background: #fef3c7; border-color: #fde68a; color: #92400e; }
.deviation-status-approved { background: #dcfce7; border-color: #bbf7d0; color: #166534; }
.deviation-status-rejected, .deviation-status-cancelled { background: var(--red-soft); border-color: #fecaca; color: #991b1b; }
.deviation-form { display: grid; gap: 18px; }
.deviation-form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.deviation-form-grid .span-2 { grid-column: span 2; }
.deviation-form-grid .span-3 { grid-column: span 3; }
.deviation-form-grid .span-4 { grid-column: 1 / -1; }
.deviation-option-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.deviation-option-card { position: relative; border: 1px solid var(--line); background: #fafafa; border-radius: 18px; padding: 14px 38px 14px 16px; cursor: pointer; transition: 0.15s ease; min-height: 54px; display: flex; align-items: center; }
.deviation-option-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.deviation-option-card::after { content: "✓"; position: absolute; top: 50%; right: 12px; width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; line-height: 1; color: white; background: var(--red); opacity: 0; transform: translateY(-50%) scale(0.5); transition: 0.15s ease; font-size: 12px; font-weight: 950; }
.deviation-option-card:hover { border-color: #fecaca; }
.deviation-option-card:has(input:checked) { border-color: var(--red); background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red); }
.deviation-option-card:has(input:checked)::after { opacity: 1; transform: translateY(-50%) scale(1); }
.deviation-option-card strong { color: var(--black); font-size: 13px; font-weight: 950; }
.deviation-mini-table-wrap { width: 100%; overflow-x: auto; }
.deviation-mini-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.deviation-mini-table th, .deviation-mini-table td { border-bottom: 1px solid var(--line); padding: 10px; vertical-align: top; text-align: left; }
.deviation-mini-table th { background: #fafafa; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 950; }
.deviation-placeholder-row td { background: #fffdf5; }
.deviation-edit-row > td { padding: 0 !important; background: #fafafa; border-bottom: 1px solid var(--line); }
.deviation-inline-editor { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.34s ease; }
.deviation-edit-row.open .deviation-inline-editor { grid-template-rows: 1fr; }
.deviation-inline-editor-inner { overflow: hidden; min-height: 0; }
.deviation-inline-editor-pad { padding: 18px 20px 22px; border-left: 3px solid var(--red); opacity: 0; transition: opacity 0.28s ease 0.06s; }
.deviation-edit-row.open .deviation-inline-editor-pad { opacity: 1; }
.deviation-inline-head { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.deviation-inline-close { border: 1px solid var(--line); background: white; color: var(--black); border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 950; cursor: pointer; }
.deviation-inline-close:hover { background: var(--red-soft); border-color: #fecaca; color: #991b1b; }
.deviation-document-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; margin-top: 16px; }
.deviation-doc-card { background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-soft); overflow: hidden; }
.deviation-doc-titlebar { background: linear-gradient(135deg, var(--black), #27272a); color: white; padding: 20px 22px; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.deviation-doc-titlebar h2 { margin: 0; font-size: 22px; font-weight: 950; letter-spacing: -0.04em; }
.deviation-doc-titlebar > div > span { color: #d4d4d8; font-size: 13px; }
.deviation-doc-body { padding: 22px; display: grid; gap: 18px; }
.deviation-doc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.deviation-doc-field, .deviation-notice-card { border: 1px solid var(--line); border-radius: 18px; padding: 13px; background: #fafafa; }
.deviation-doc-field span, .deviation-doc-text span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 950; margin-bottom: 5px; }
.deviation-doc-field strong { display: block; color: var(--black); font-weight: 950; line-height: 1.35; overflow-wrap: anywhere; }
.deviation-doc-text { border: 1px solid var(--line); border-radius: 18px; padding: 15px; background: white; }
.deviation-doc-text p { margin: 0; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.deviation-side-panel { display: grid; gap: 14px; }
.deviation-notice-card { background: white; box-shadow: var(--shadow-soft); }
.deviation-notice-card h3 { margin: 0 0 7px; font-size: 16px; letter-spacing: -0.03em; font-weight: 950; }
.deviation-notice-card p { margin: 0; color: var(--muted); line-height: 1.45; font-size: 13px; }
.deviation-notice-actions { margin-top: 14px; }
.deviation-notice-card p.deviation-notice-note { margin-top: 10px; }
@media (max-width: 1120px) {
  .deviation-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deviation-document-layout { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .deviation-page { padding: 16px 16px 40px; }
  .deviation-hero { flex-direction: column; padding: 20px; border-radius: 24px; }
  .deviation-actions, .deviation-actions .btn { width: 100%; }
  .deviation-filter-grid { grid-template-columns: 1fr; }
  .deviation-table-wrap { overflow-x: visible; border: 0; background: transparent; }
  .deviation-table { min-width: 0; display: block; width: 100%; border-collapse: separate; }
  .deviation-table thead { display: none; }
  .deviation-table tbody { display: grid; gap: 12px; width: 100%; }
  .deviation-table tr { display: grid; width: 100%; border: 1px solid var(--line); background: white; border-radius: 20px; padding: 12px 14px; box-shadow: var(--shadow-soft); }
  .deviation-table td { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; overflow-wrap: anywhere; }
  .deviation-table td:last-child { border-bottom: 0; }
  .deviation-table td::before { content: attr(data-label); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 10px; font-weight: 950; }
  .deviation-table tr.deviation-edit-row { display: block; padding: 0; border: 0; background: transparent; box-shadow: none; border-radius: 0; }
  .deviation-edit-row > td { display: block; padding: 0 !important; border: 0; }
  .deviation-edit-row > td::before { display: none; content: ""; }
  .deviation-inline-editor-pad { padding: 16px; border-radius: 18px; border: 1px solid var(--line); border-left: 3px solid var(--red); background: white; }
  .deviation-form-grid, .deviation-option-grid, .deviation-doc-grid { grid-template-columns: 1fr !important; }
  .deviation-form-grid .span-2, .deviation-form-grid .span-3, .deviation-form-grid .span-4 { grid-column: auto; }
  .deviation-mini-table { display: block; min-width: 0; }
  .deviation-mini-table thead { display: none; }
  .deviation-mini-table tbody { display: grid; gap: 10px; }
  .deviation-mini-table tr { display: grid; border: 1px solid var(--line); border-radius: 18px; padding: 10px 12px; background: white; }
  .deviation-mini-table td { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
  .deviation-mini-table td:last-child { border-bottom: 0; }
  .deviation-mini-table td::before { content: attr(data-label); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 10px; font-weight: 950; }
  .deviation-row-actions, .form-actions { display: grid; grid-template-columns: 1fr; }
  .deviation-row-actions .deviation-action-btn, .form-actions .btn { width: 100%; }
}
@media (max-width: 560px) {
  .deviation-table td { grid-template-columns: 100px minmax(0, 1fr); }
  .deviation-doc-titlebar { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 820px) {
  .deviation-page { padding-bottom: calc(132px + env(safe-area-inset-bottom, 0px)) !important; }
}
.deviation-form .form-section { border: 1px solid var(--line); border-radius: var(--radius); background: white; overflow: visible; position: relative; }
.deviation-form .form-section:has(.nexus-select.is-open), .deviation-form .form-section:has(.nexus-date.is-open) { z-index: 12002; }
.deviation-form .form-section-head { padding: 13px 16px; border-bottom: 1px solid var(--line); background: #fafafa; border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.deviation-form .form-section-head strong { color: var(--black); font-weight: 950; letter-spacing: -0.02em; }
.deviation-form .form-section-head span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.deviation-form .form-section-body { padding: 16px; border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px); background: white; }
.deviation-form .field-hint { color: var(--muted); font-size: 12px; line-height: 1.4; }

.deviation-visually-hidden-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.deviation-mini-table td[data-label="Ações"] { vertical-align: middle; text-align: center; }
.deviation-mini-table td[data-label="Ações"] .deviation-action-btn { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; }
.deviation-approval-card { min-height: auto; padding: 10px 38px 10px 12px; }

/* Deviation request refinement overrides */
.deviation-form .input,
.deviation-form .select,
.deviation-form .nexus-select-btn,
.deviation-form .nexus-date-btn {
  height: 48px;
  min-height: 48px;
  box-sizing: border-box;
}
.deviation-form .input,
.deviation-form .select {
  padding-top: 0;
  padding-bottom: 0;
}
.deviation-form .nexus-select-btn,
.deviation-form .nexus-date-btn {
  display: flex;
  align-items: center;
}
.deviation-form .nexus-date-btn {
  padding-top: 0;
  padding-bottom: 0;
}


/* Requisitions list header refinements */
@media (max-width: 820px) {
  .request-header-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .request-header-actions .btn {
    width: 100% !important;
    min-width: 0;
    justify-content: center;
  }
  .request-header-actions .request-create-btn {
    order: -1;
    grid-column: 1 / -1;
  }
}

/* Deviation action button alignment */
.deviation-form .form-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Final mobile drawer consistency overrides */
@media (max-width: 820px) {
  .sidebar .nav-btn,
  .sidebar .module-side-btn,
  .sidebar .maintenance-side-btn,
  .sidebar .logistics-side-btn {
    font-size: 14px !important;
    font-weight: 900 !important;
    line-height: 1.25 !important;
  }
  .sidebar .side-icon {
    width: 18px !important;
    height: 18px !important;
  }
}

/* Deviation user suggestions and corrective-action refinements */
.deviation-user-suggestion-menu {
  position: fixed;
  z-index: 13000;
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  background: white;
  border-radius: 18px;
  padding: 8px;
  box-shadow: var(--shadow);
  box-sizing: border-box;
}
.deviation-user-suggestion-menu[hidden] { display: none; }
.deviation-user-suggestion-option {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--black);
  border-radius: 14px;
  padding: 11px 12px;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.deviation-user-suggestion-option:hover,
.deviation-user-suggestion-option:focus-visible {
  background: var(--red-soft);
  color: #991b1b;
  outline: none;
}
.deviation-user-suggestion-option strong {
  display: block;
  font-size: 13px;
  font-weight: 950;
}
.deviation-user-suggestion-option span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  overflow-wrap: anywhere;
}
.deviation-user-suggestion-option:hover span,
.deviation-user-suggestion-option:focus-visible span {
  color: #991b1b;
}
.deviation-form .form-section-head .deviation-action-btn,
.deviation-mini-table td[data-label="Ações"] .deviation-action-btn {
  min-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.deviation-mini-table td[data-label="Ações"] .deviation-action-btn {
  width: 100%;
}

    .sidebar-edge-swipe-zone { display: none; }

    @media (max-width: 820px) {
      .sidebar-edge-swipe-zone {
        display: block;
        position: fixed;
        inset: 0 auto 0 0;
        width: 28px;
        height: 100dvh;
        z-index: 309;
        background: transparent;
        touch-action: pan-y;
      }
      body.sidebar-open .sidebar-edge-swipe-zone { pointer-events: none; }
    }

/* 20260609 admin department module defaults + alignment refinements */
.platform-category-main,
.platform-card-flat .platform-category-main {
  align-self: stretch;
}
.platform-category-copy {
  min-height: 100%;
}
.platform-category-copy p {
  margin-bottom: 28px;
}
.platform-category-copy .platform-badge {
  margin-top: auto;
}
.admin-field-hint {
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.admin-table td[data-label="Estado"],
.admin-table td[data-label="Ação"] {
  vertical-align: middle;
}
.admin-table td[data-label="Estado"] {
  white-space: nowrap;
}
@media (max-width: 820px) {
  .admin-table td[data-label="Estado"],
  .admin-table td[data-label="Ação"] {
    align-items: center;
  }
}

/* Nexus datetime picker extension */
.nexus-date.has-time .nexus-date-menu {
  width: min(360px, calc(100vw - 32px));
}

.nexus-date-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.nexus-date-time-row label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nexus-date-time-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--black);
  font-size: 14px;
  font-weight: 950;
}

.nexus-date-time-picker {
  position: relative;
  min-width: 76px;
}

.nexus-date-time-btn {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  border-radius: 14px;
  padding: 9px 32px 9px 12px;
  color: var(--text);
  outline: none;
  font: inherit;
  font-weight: 950;
  text-align: left;
  transition: 0.15s ease;
  position: relative;
}

.nexus-date-time-btn::after {
  content: "⌄";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-54%);
  color: var(--black);
  font-size: 14px;
  line-height: 1;
}

.nexus-date-time-btn:focus,
.nexus-date-time-picker.is-open .nexus-date-time-btn {
  border-color: var(--red);
  box-shadow: 0 0 0 4px var(--red-soft);
}

.nexus-date-time-menu {
  position: absolute;
  z-index: 12002;
  top: calc(100% + 8px);
  right: 0;
  width: 116px;
  max-height: 184px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.nexus-date-time-menu[hidden] {
  display: none;
}

.nexus-date-time-option {
  border: 0;
  border-radius: 10px;
  background: #fafafa;
  color: var(--text);
  padding: 8px 0;
  font-size: 13px;
  font-weight: 950;
  text-align: center;
  transition: 0.15s ease;
}

.nexus-date-time-option:hover,
.nexus-date-time-option:focus {
  background: var(--red-soft);
  color: #991b1b;
  outline: none;
}

.nexus-date-time-option.is-selected {
  background: var(--red);
  color: white;
}

.nexus-date-apply {
  background: var(--red);
  border-color: var(--red);
  color: white;
}

.nexus-date-apply:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  color: white;
}

@media (max-width: 820px) {
  .nexus-date.has-time .nexus-date-menu {
    width: min(330px, calc(100vw - 52px));
  }

  .nexus-date-time-row {
    align-items: stretch;
    flex-direction: column;
  }

  .nexus-date-time-controls,
  .nexus-date-time-picker {
    width: 100%;
  }

  .nexus-date-time-menu {
    left: 0;
    right: auto;
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
