:root {
  --aurora-navy: #062551;
  --aurora-navy-2: #083b72;
  --aurora-blue: #0a6ee8;
  --aurora-teal: #0aa29a;
  --aurora-green: #16a35a;
  --aurora-amber: #f59e0b;
  --aurora-red: #ef4444;
  --aurora-violet: #7c3aed;
  --aurora-ink: #0b1f3a;
  --aurora-muted: #60708a;
  --aurora-line: #dbe6f2;
  --aurora-bg: #f4f8fc;
  --aurora-card: #fff;
  --aurora-shadow: 0 18px 45px rgba(15, 40, 75, .10);
  --aurora-shadow-strong: 0 24px 60px rgba(5, 24, 52, .22);
  --aurora-radius: 18px;
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  color: var(--aurora-ink);
}

* { box-sizing: border-box; }

body.aurora-shell {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #eef6fd 0, #f7fafc 360px, #f5f8fb 100%);
  color: var(--aurora-ink);
}

.aurora-topbar {
  height: 76px;
  background: linear-gradient(90deg, var(--aurora-navy), var(--aurora-navy-2));
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 28px;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 12px 30px rgba(5, 24, 52, .24);
}

.aurora-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 180px;
}

.aurora-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0b84e5, #13b981);
  display: grid;
  place-items: center;
  font-weight: 950;
  font-size: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28);
}

.aurora-brand strong { display: block; font-size: 18px; line-height: 1; }
.aurora-brand span { display: block; margin-top: 4px; color: #bcd0e6; font-size: 12px; font-weight: 700; }

.aurora-nav {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
}

.aurora-nav a,
.aurora-nav-button {
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border-radius: 10px;
  color: #e8f2ff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 850;
  border: 1px solid transparent;
  white-space: nowrap;
}

.aurora-nav a.active,
.aurora-nav a:hover,
.aurora-module:hover .aurora-nav-button {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .18);
  color: #fff;
}

.aurora-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: #38bdf8;
}

.aurora-module { position: relative; }
.aurora-module.green .aurora-dot { background: #22c55e; }
.aurora-module.amber .aurora-dot { background: #f59e0b; }
.aurora-module.red .aurora-dot { background: #fb7185; }
.aurora-module.violet .aurora-dot { background: #a78bfa; }
.aurora-module.indigo .aurora-dot { background: #60a5fa; }
.aurora-module.teal .aurora-dot { background: #2dd4bf; }

.aurora-dropdown {
  display: none;
  position: absolute;
  top: 48px;
  left: 0;
  width: 360px;
  padding: 10px;
  background: #fff;
  border: 1px solid #c8d8ea;
  border-radius: 14px;
  box-shadow: var(--aurora-shadow-strong);
  z-index: 80;
}

.aurora-module:hover .aurora-dropdown { display: grid; gap: 8px; }

.aurora-dropdown a {
  display: grid;
  height: auto;
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 11px;
  background: #f8fbff;
  color: #10233f;
  border: 1px solid #e0e8f1;
}

.aurora-dropdown a:hover { background: #eef7ff; border-color: #b8d5ef; }
.aurora-dropdown strong { font-size: 13px; }
.aurora-dropdown span { margin-top: 3px; color: #64748b; font-size: 11.5px; line-height: 1.35; }

.aurora-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.aurora-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0ea5e9, #10b981);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 950;
}

.aurora-logout {
  height: 36px;
  border: 1px solid rgba(255, 255, 255, .20);
  border-radius: 10px;
  color: #e8f2ff;
  text-decoration: none;
  display: flex;
  align-items: center;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 850;
  background: rgba(255, 255, 255, .08);
}

.aurora-page {
  padding: 20px 24px 34px;
  max-width: 1920px;
  margin: 0 auto;
}

.aurora-card {
  background: var(--aurora-card);
  border: 1px solid #e2eaf3;
  border-radius: var(--aurora-radius);
  box-shadow: var(--aurora-shadow);
  overflow: hidden;
}

.aurora-button {
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--aurora-blue);
  color: #fff;
  font-weight: 950;
  padding: 0 16px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.aurora-button.secondary {
  background: #fff;
  color: #334155;
  border: 1px solid #cbd8e7;
}

.aurora-field {
  height: 42px;
  border: 1px solid #cbd8e7;
  border-radius: 12px;
  background: #fff;
  color: var(--aurora-ink);
  padding: 0 14px;
  font-size: 13px;
}

.aurora-pill {
  height: 25px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 950;
  background: #eef2f7;
  color: #475569;
}

.aurora-pill.ok { background: #dff8e8; color: #08733f; }
.aurora-pill.warn { background: #fff1d6; color: #99600b; }
.aurora-pill.danger { background: #ffe8e8; color: #c02121; }
.aurora-pill.blue { background: #e7f1ff; color: var(--aurora-blue); }

.aurora-table-wrap { overflow: auto; max-height: 460px; }
.aurora-table { width: 100%; border-collapse: collapse; min-width: 1140px; }
.aurora-table th,
.aurora-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  font-size: 12.5px;
  white-space: nowrap;
}
.aurora-table th {
  position: sticky;
  top: 0;
  background: #eaf5ff;
  color: #064b7c;
  text-transform: uppercase;
  font-size: 11px;
  z-index: 1;
}
.aurora-table tbody tr:hover td { background: #f6fbff; }

@media (max-width: 900px) {
  .aurora-topbar { height: auto; align-items: flex-start; flex-direction: column; padding: 14px 18px; }
  .aurora-nav { overflow: auto; width: 100%; }
}


/* Operational module shell - Phase 2 */
.aurora-context-bar {
  display: grid;
  grid-template-columns: 56px minmax(280px, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  padding: 18px 20px;
  border-top: 4px solid var(--aurora-green);
}

.aurora-context-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--aurora-blue), var(--aurora-teal));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 950;
  font-size: 24px;
}

.aurora-context-title span {
  display: block;
  color: var(--aurora-blue);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.aurora-context-title strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: .01em;
}

.aurora-context-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 9px;
  color: var(--aurora-muted);
  font-size: 12px;
  font-weight: 800;
}

.aurora-context-meta b { color: var(--aurora-ink); }

.aurora-context-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.aurora-module-hero {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding: 22px 24px;
  margin-bottom: 16px;
  border-top: 4px solid var(--aurora-blue);
}

.aurora-module-eyebrow {
  color: var(--aurora-blue);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.aurora-module-title {
  margin: 6px 0 0;
  font-size: 32px;
  line-height: 1.08;
  letter-spacing: -.01em;
}

.aurora-module-desc {
  margin-top: 8px;
  color: var(--aurora-muted);
  font-size: 13px;
  line-height: 1.5;
}

.aurora-quick-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.aurora-productivity-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, .6fr);
  gap: 16px;
  align-items: start;
}

.aurora-section-card {
  padding: 18px;
}

.aurora-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.aurora-section-head h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -.01em;
}

.aurora-submodule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.aurora-submodule-card {
  min-height: 86px;
  padding: 14px 15px;
  border: 1px solid #dce7f2;
  border-left: 4px solid var(--aurora-blue);
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff, #f5faff);
  color: var(--aurora-ink);
  text-decoration: none;
  box-shadow: 0 10px 25px rgba(15, 40, 75, .06);
  display: grid;
  align-content: start;
  gap: 6px;
}

.aurora-submodule-card.active {
  border-left-color: var(--aurora-green);
  background: linear-gradient(135deg, #ecfdf5, #ffffff);
}

.aurora-submodule-card strong { font-size: 14px; }
.aurora-submodule-card span { color: var(--aurora-muted); font-size: 12px; line-height: 1.35; }

.aurora-status-list {
  display: grid;
  gap: 10px;
}

.aurora-status-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 13px;
  border: 1px solid #e0e8f1;
  border-radius: 13px;
  background: #f8fbff;
  font-size: 13px;
}

.aurora-status-row strong { color: var(--aurora-muted); }
.aurora-missing-state { padding: 28px; }

@media (max-width: 1120px) {
  .aurora-context-bar,
  .aurora-module-hero,
  .aurora-productivity-grid { grid-template-columns: 1fr; }
  .aurora-context-actions,
  .aurora-quick-actions { justify-content: flex-start; }
  .aurora-context-icon { display: none; }
}

/* Visual base final polish - Dashboard/global only. */
:root {
  --aurora-soft-blue: #f6f9fd;
  --aurora-soft-line: #e7eef6;
  --aurora-clean-shadow: 0 12px 34px rgba(15, 40, 75, .075);
  --aurora-clean-shadow-hover: 0 18px 46px rgba(15, 40, 75, .12);
}

.erp-security-logout { display: none !important; }
.erp-idle-warning { right: 24px !important; bottom: 24px !important; }

body:not(.login-body) .topbar,
body.aurora-shell .aurora-topbar {
  min-height: 74px;
  box-shadow: 0 10px 30px rgba(5, 24, 52, .18);
}

body:not(.login-body) .nav a,
body:not(.login-body) .nav-button,
.aurora-nav a,
.aurora-nav-button {
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

body:not(.login-body) .nav a:hover,
body:not(.login-body) .nav-button:hover,
.aurora-nav a:hover,
.aurora-nav-button:hover {
  transform: translateY(-1px);
}

body:not(.login-body) main {
  max-width: 1920px;
}

.company-context {
  border-radius: 20px !important;
  border: 1px solid var(--aurora-soft-line) !important;
  border-top: 0 !important;
  background: linear-gradient(115deg, rgba(255,255,255,.98), rgba(241,248,255,.96)) !important;
  box-shadow: var(--aurora-clean-shadow) !important;
  min-height: 112px;
}

.company-title {
  letter-spacing: 0 !important;
  font-size: clamp(24px, 1.7vw, 34px) !important;
  text-transform: none !important;
}

.context-icon {
  background: #edf6ff !important;
  color: #0a6ee8 !important;
  box-shadow: inset 0 0 0 1px #d9e9f8;
}

.context-actions .action-btn,
.action-btn,
.button,
.aurora-button {
  border-radius: 12px !important;
  box-shadow: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.context-actions .action-btn:hover,
.action-btn:hover,
.button:hover,
.aurora-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(10,110,232,.14);
}

.kpi-grid {
  gap: 14px !important;
}

.kpi {
  border-radius: 18px !important;
  border-color: var(--aurora-soft-line) !important;
  box-shadow: var(--aurora-clean-shadow) !important;
  min-height: 116px !important;
  background: rgba(255,255,255,.96) !important;
}

.kpi:hover,
.card:hover,
.table-card:hover {
  box-shadow: var(--aurora-clean-shadow-hover) !important;
}

.kpi:after {
  opacity: .075 !important;
}

.kpi-icon {
  width: 44px !important;
  height: 44px !important;
  border-radius: 14px !important;
  font-size: 20px !important;
}

.kpi span {
  color: #52637a !important;
  font-weight: 850 !important;
}

.kpi strong {
  font-size: 25px !important;
  font-weight: 900 !important;
}

.module-grid {
  gap: 12px !important;
  grid-template-columns: repeat(5, minmax(150px, 1fr)) !important;
}

.module-card {
  min-height: 78px !important;
  border-radius: 16px !important;
  background: linear-gradient(135deg, #ffffff, #f7fbff) !important;
  color: #10233f !important;
  border: 1px solid #dfe9f4 !important;
  box-shadow: var(--aurora-clean-shadow) !important;
  position: relative;
}

.module-card:before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, #0a6ee8, #0aa29a);
}

.module-card:nth-child(2n):before { background: linear-gradient(180deg, #0aa29a, #16a35a); }
.module-card:nth-child(3n):before { background: linear-gradient(180deg, #7c3aed, #0a6ee8); }
.module-card:nth-child(4n):before { background: linear-gradient(180deg, #f59e0b, #0a6ee8); }

.module-card strong {
  font-size: 15px !important;
  color: #10233f !important;
}

.module-card span {
  color: #60708a !important;
  font-size: 11.5px !important;
}

.module-card:hover {
  filter: none !important;
  transform: translateY(-2px) !important;
}

.card,
.table-card,
.aurora-card {
  border-radius: 20px !important;
  border-color: var(--aurora-soft-line) !important;
  box-shadow: var(--aurora-clean-shadow) !important;
}

.card-head {
  background: #fff !important;
  border-bottom-color: var(--aurora-soft-line) !important;
}

.table-toolbar {
  background: #fbfdff !important;
  align-items: center;
}

.searchbar input,
.aurora-field,
select.action-btn {
  border-radius: 12px !important;
  border-color: #d6e3f1 !important;
}

.filter {
  height: 34px !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #40546d !important;
  border-color: #d6e3f1 !important;
}

.filter.active {
  background: #0a6ee8 !important;
  color: #fff !important;
  border-color: #0a6ee8 !important;
}

.table-wrap,
.aurora-table-wrap {
  max-height: min(58vh, 560px) !important;
}

table th,
.aurora-table th {
  background: #f1f7fd !important;
  color: #33516f !important;
  letter-spacing: .025em;
  border-bottom: 1px solid #dce8f4 !important;
}

table td,
.aurora-table td {
  border-bottom-color: #eef3f8 !important;
  color: #1f344d;
}

.pill,
.badge,
.aurora-pill {
  min-height: 24px;
  border-radius: 999px !important;
  font-weight: 800 !important;
}

@media (max-width: 1380px) {
  .module-grid { grid-template-columns: repeat(4, minmax(150px, 1fr)) !important; }
}

@media (max-width: 900px) {
  .company-context { grid-template-columns: 1fr !important; }
  .module-grid { grid-template-columns: 1fr 1fr !important; }
  .kpi-grid { grid-template-columns: 1fr 1fr !important; }
}


/* Final UX/UI polish - shared authenticated topbar for generic modules. */
.aurora-topbar{gap:18px!important;align-items:center!important}.aurora-nav{flex:1;min-width:0}.user-menu{position:relative;margin-left:auto;display:flex;align-items:center}.user-trigger{height:46px;min-height:46px;border:1px solid rgba(255,255,255,.18);border-radius:16px;background:rgba(255,255,255,.10);color:#fff;display:flex;align-items:center;gap:10px;padding:0 12px;box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 12px 24px rgba(5,24,52,.12);cursor:pointer}.user-avatar{width:34px;height:34px;border-radius:999px;background:linear-gradient(135deg,#0ea5e9,#10b981);display:grid;place-items:center;color:#fff;font-weight:950;font-size:12px;letter-spacing:.02em}.user-meta{display:grid;text-align:left;line-height:1.1}.user-meta strong{font-size:13px;color:#fff;font-weight:950;max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-meta em{font-style:normal;color:#c7daec;font-size:11px;font-weight:800}.user-caret{font-size:10px;color:#dbeafe}.user-dropdown{display:none;position:absolute;right:0;top:52px;min-width:210px;padding:8px;background:#fff;border:1px solid #d9e6f2;border-radius:14px;box-shadow:0 24px 60px rgba(5,24,52,.22);z-index:120}.user-menu:hover .user-dropdown,.user-menu:focus-within .user-dropdown{display:grid;gap:6px}.user-dropdown a{height:38px;color:#10233f!important;background:#fff!important;border:0!important;border-radius:10px;text-decoration:none;display:flex;align-items:center;padding:0 10px;font-size:12px;font-weight:900}.user-dropdown a:hover{background:#eef7ff!important;color:#0a6ee8!important}.aurora-user-chip{display:none!important}@media(max-width:980px){.user-menu{width:100%;margin-left:0}.user-trigger{width:100%;justify-content:flex-start}.user-dropdown{left:0;right:auto}.aurora-nav{width:100%}}


/* Final correction: clean user menu, neutral tabs, modern action groups. */
.erp-user-menu{position:relative;margin-left:auto;display:flex;align-items:center;justify-content:flex-end;min-width:210px;z-index:300}.erp-user-trigger{appearance:none;height:48px!important;min-height:48px!important;border:1px solid rgba(255,255,255,.18)!important;border-radius:18px!important;background:rgba(255,255,255,.10)!important;color:#fff!important;display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:10px!important;padding:0 12px!important;line-height:1!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.13),0 14px 30px rgba(5,24,52,.16)!important;white-space:nowrap!important}.erp-user-avatar{flex:0 0 34px;width:34px;height:34px;border-radius:999px;background:linear-gradient(135deg,#0ea5e9,#10b981);display:grid;place-items:center;color:#fff;font-size:12px;font-weight:950;letter-spacing:.02em}.erp-user-copy{display:grid!important;gap:3px;text-align:left;line-height:1.05!important;min-width:0}.erp-user-copy strong{display:block;color:#fff;font-size:13px;font-weight:950;max-width:148px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.erp-user-copy em{display:block;font-style:normal;color:#c7daec;font-size:11px;font-weight:800}.erp-user-caret{display:block;color:#dbeafe;font-size:10px;line-height:1;margin-left:2px}.erp-user-dropdown{display:none;position:absolute;right:0;top:54px;min-width:220px;padding:8px;background:#fff;border:1px solid #d9e6f2;border-radius:15px;box-shadow:0 24px 60px rgba(5,24,52,.22);z-index:500}.erp-user-menu:hover .erp-user-dropdown,.erp-user-menu:focus-within .erp-user-dropdown{display:grid;gap:6px}.erp-user-dropdown a{height:39px!important;display:flex!important;align-items:center!important;padding:0 11px!important;border:0!important;border-radius:11px!important;background:#fff!important;color:#10233f!important;text-decoration:none!important;font-size:12px!important;font-weight:900!important}.erp-user-dropdown a:hover{background:#eef7ff!important;color:#0a6ee8!important}.user-menu,.aurora-user-chip{display:none!important}.topnav .erp-user-menu,.aurora-topbar .erp-user-menu,.top .erp-user-menu{margin-left:auto!important}.topnav,.aurora-topbar,.top{align-items:center!important}
.tabs,.view-tabs,.stage-tabs,.detail-filters,.desktop-stage{gap:9px!important}.tab,.view-tab,.stage-tab,.detail-tab,.detail-filter,.chip{height:34px!important;border-radius:999px!important;background:#fff!important;color:#173b61!important;border:1px solid #cfe0ef!important;box-shadow:0 6px 16px rgba(15,40,75,.05)!important;padding:0 13px!important;transition:background .16s ease,border-color .16s ease,color .16s ease,transform .16s ease,box-shadow .16s ease!important}.tab:hover,.view-tab:hover,.stage-tab:hover,.detail-tab:hover,.detail-filter:hover,.chip:hover{background:#eef7ff!important;border-color:#9cc7ef!important;transform:translateY(-1px)}.tab.active,.view-tab.active,.stage-tab.active,.detail-tab.active,.detail-filter.active,.chip.active{background:linear-gradient(135deg,#0a6ee8,#0b79b7)!important;color:#fff!important;border-color:#0a6ee8!important;box-shadow:0 12px 24px rgba(10,110,232,.16)!important}.tab.active::before{background:rgba(255,255,255,.2)!important;color:#fff!important}.desktop-stage .tab{border-left:1px solid #cfe0ef!important}.desktop-stage .tab::before{display:none!important}
.erp-actions{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;padding:10px!important;border:1px solid #d9e6f2!important;border-radius:16px!important;background:linear-gradient(180deg,#fff,#f7fbff)!important;box-shadow:0 12px 30px rgba(15,40,75,.06)!important}.erp-action-main{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.erp-actions button,.erp-actions .button,.erp-actions .action-link{height:40px!important;border-radius:12px!important;padding:0 13px!important;font-weight:900!important;text-decoration:none!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:7px!important;box-shadow:0 8px 18px rgba(15,40,75,.07)!important}.erp-actions .action-primary,.erp-actions button:not(.secondary):not(.danger){background:linear-gradient(135deg,#0a6ee8,#0b79b7)!important;border-color:#0a6ee8!important;color:#fff!important}.erp-actions .secondary,.erp-actions .button.secondary,.erp-actions .action-link{background:#fff!important;color:#173b61!important;border:1px solid #cfe0ef!important}.erp-actions .danger{margin-left:auto;background:linear-gradient(135deg,#dc2626,#991b1b)!important;border-color:#b91c1c!important;color:#fff!important}.btn-icon{font-size:15px;line-height:1;font-weight:950}.more-actions{position:relative}.more-actions summary{list-style:none;height:40px;border:1px solid #cfe0ef;border-radius:12px;background:#fff;color:#173b61;display:flex;align-items:center;gap:8px;padding:0 13px;font-size:13px;font-weight:950;cursor:pointer;box-shadow:0 8px 18px rgba(15,40,75,.07)}.more-actions summary::-webkit-details-marker{display:none}.more-actions summary::after{content:'v';font-size:10px;color:#60738b}.more-actions-menu{position:absolute;right:0;top:46px;min-width:270px;padding:8px;display:grid;gap:6px;background:#fff;border:1px solid #d9e6f2;border-radius:16px;box-shadow:0 24px 60px rgba(5,24,52,.20);z-index:250}.more-actions:not([open]) .more-actions-menu{display:none}.more-actions-menu button,.more-actions-menu a{width:100%!important;justify-content:flex-start!important;box-shadow:none!important}
.kpi{border-radius:18px!important;border:1px solid #d9e6f2!important;box-shadow:0 18px 42px rgba(15,40,75,.09)!important}.kpi::before{content:'';display:block;width:38px;height:38px;border-radius:14px;background:linear-gradient(135deg,#eef7ff,#e9fbf5);box-shadow:inset 0 0 0 1px #d9e6f2;margin-bottom:8px}.card{border-radius:18px!important;border-color:#d9e6f2!important;box-shadow:0 18px 45px rgba(15,40,75,.08)!important}.toolbar{border-radius:18px 18px 0 0!important}.table-wrap table th{background:#f0f7ff!important;color:#0b3a66!important;border-bottom:1px solid #cfe0ef!important}.table-wrap table td{border-color:#e6eef7!important}.table-wrap tbody tr:hover td{background:#f3f9ff!important}@media(max-width:1100px){.erp-actions{align-items:stretch!important;flex-direction:column!important}.erp-actions .danger{margin-left:0}.more-actions-menu{left:0;right:auto}.erp-user-menu{width:100%;justify-content:flex-start;margin-left:0}.erp-user-trigger{width:100%}}


/* Final UI guard: neutral inactive tabs and clearer operational spacing. */
.tab:not(.active),
.view-tab:not(.active),
.detail-filter:not(.active),
.filter-chip:not(.active),
.chip:not(.active),
.segmented button:not(.active),
.tabs button:not(.active),
.stage-tab:not(.active),
.provider-stage:not(.active),
.detraction-stage:not(.active),
.tab-btn:not(.active){
  background:#fff!important;
  color:#173b61!important;
  border:1px solid #cfe0ef!important;
  box-shadow:0 6px 14px rgba(15,40,75,.04)!important;
}
.tab.active,
.view-tab.active,
.detail-filter.active,
.filter-chip.active,
.chip.active,
.segmented button.active,
.tabs button.active,
.stage-tab.active,
.provider-stage.active,
.detraction-stage.active,
.tab-btn.active{
  background:linear-gradient(135deg,#0a6ee8,#0b79b7)!important;
  color:#fff!important;
  border-color:#0a6ee8!important;
  box-shadow:0 10px 24px rgba(10,110,232,.18)!important;
}
.tab:hover:not(.active),
.view-tab:hover:not(.active),
.detail-filter:hover:not(.active),
.filter-chip:hover:not(.active),
.chip:hover:not(.active),
.segmented button:hover:not(.active),
.tabs button:hover:not(.active),
.stage-tab:hover:not(.active),
.provider-stage:hover:not(.active),
.detraction-stage:hover:not(.active),
.tab-btn:hover:not(.active){
  background:#eef7ff!important;
  border-color:#a9cff2!important;
  color:#0b3a66!important;
}
.tab,.view-tab,.detail-filter,.filter-chip,.chip,.segmented button,.tabs button,.stage-tab,.provider-stage,.detraction-stage,.tab-btn{
  border-radius:12px!important;
  margin-right:6px!important;
  transition:background .16s ease,border-color .16s ease,box-shadow .16s ease,transform .16s ease!important;
}
.tab:hover,.view-tab:hover,.detail-filter:hover,.filter-chip:hover,.chip:hover,.segmented button:hover,.tabs button:hover,.stage-tab:hover,.provider-stage:hover,.detraction-stage:hover,.tab-btn:hover{transform:translateY(-1px)}
.erp-user-menu *{box-sizing:border-box}.erp-user-menu a{white-space:nowrap}.erp-user-trigger{font-family:inherit!important;text-transform:none!important}.erp-user-trigger::after{display:none!important}.erp-user-copy strong,.erp-user-copy em{letter-spacing:0!important;text-transform:none!important}.erp-user-dropdown{font-family:inherit!important}.erp-user-dropdown a::before{content:'';width:6px;height:6px;border-radius:99px;background:#0a6ee8;margin-right:8px;opacity:.75}.erp-user-dropdown a:last-child::before{background:#dc2626}.topnav>a[href='/logout/'],.top>a[href='/logout/'],.aurora-topbar>a[href='/logout/']{display:none!important}
.purchases-page .hero,.sales-page .hero,.ops-hero,.active-company-strip{box-shadow:0 18px 44px rgba(15,40,75,.08)!important;border-radius:18px!important}.purchases-page .card,.sales-page .card,.liquidation-page .card{margin-top:14px!important}.erp-actions + .tabs,.erp-actions + .view-tabs{margin-top:10px!important}.kpis .kpi,.metric-card{position:relative;overflow:hidden}.kpis .kpi::after,.metric-card::after{content:'';position:absolute;right:-24px;top:-28px;width:92px;height:92px;border-radius:999px;background:radial-gradient(circle,rgba(10,110,232,.10),rgba(10,110,232,0) 68%);pointer-events:none}.table-wrap{border-radius:0 0 16px 16px}.table-wrap table{font-feature-settings:'tnum' 1}.table-wrap tbody tr{transition:background .14s ease}.table-wrap th{letter-spacing:.01em}.pill{border-radius:999px!important;padding:5px 10px!important;font-weight:850!important}.toolbar label{font-weight:850!important;color:#516780!important}.toolbar input,.toolbar select{border-radius:11px!important;border-color:#cfe0ef!important;background:#fff!important}.toolbar input:focus,.toolbar select:focus{outline:2px solid rgba(10,110,232,.18)!important;border-color:#74ace8!important}

/* aurora global branding containment */
.brand-logo,.aurora-brand-mark.brand-logo{overflow:hidden!important;background:#fff!important}
.brand-logo-img{width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;display:block!important}






/* Header/logo hardening for all modules */
.aurora-brand-mark.brand-logo,.brand-mark.brand-logo,.logo.brand-logo{width:44px!important;height:44px!important;min-width:44px!important;max-width:44px!important;min-height:44px!important;max-height:44px!important;flex:0 0 44px!important;overflow:hidden!important;display:grid!important;place-items:center!important;position:relative!important}.aurora-brand-mark.brand-logo .brand-logo-img,.brand-mark.brand-logo .brand-logo-img,.logo.brand-logo .brand-logo-img{width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;display:block!important;position:static!important;transform:none!important;margin:0!important}.erp-user-menu{min-width:238px!important}.erp-user-copy strong{max-width:160px!important}.erp-user-trigger{overflow:hidden!important}.erp-user-dropdown{overflow:visible!important}
/* SUNAT compact module polish */ .sunat-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:10px!important;margin-bottom:12px!important}.sunat-card{min-height:116px!important;padding:15px 16px!important;display:grid!important;grid-template-columns:46px minmax(0,1fr) 86px!important;grid-template-rows:auto 1fr auto!important;column-gap:12px!important;row-gap:5px!important;align-items:start!important;border-radius:18px!important;background:linear-gradient(135deg,#fff 0%,#f8fbff 100%)!important;box-shadow:0 14px 30px rgba(13,45,86,.07)!important;transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease!important}.sunat-card:hover{transform:translateY(-2px)!important;box-shadow:0 20px 42px rgba(13,45,86,.11)!important;border-color:#bdd7ef!important}.sunat-card:before{width:48px!important;height:48px!important;right:-16px!important;top:-16px!important;opacity:.72!important}.sunat-card-head{grid-column:1!important;grid-row:1 / span 3!important;display:block!important}.sunat-code{width:40px!important;height:40px!important;border-radius:13px!important;font-size:14px!important}.sunat-status{position:absolute!important;top:11px!important;right:12px!important;max-width:76px!important;height:24px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;padding:0 8px!important;border-radius:999px!important;font-size:10px!important;line-height:1!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;background:#eef7ff!important;color:#075aaf!important;z-index:2!important}.sunat-card h3{grid-column:2!important;grid-row:1!important;margin:0!important;padding-right:8px!important;font-size:15px!important;line-height:1.22!important;letter-spacing:-.01em!important;color:#071b36!important;max-width:100%!important}.sunat-card p{grid-column:2 / span 2!important;grid-row:2!important;margin:0!important;padding-right:76px!important;min-height:0!important;max-width:none!important;font-size:12px!important;line-height:1.38!important;color:#51677f!important;display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;overflow:hidden!important}.sunat-chips{display:none!important}.sunat-card-footer{grid-column:2 / span 2!important;grid-row:3!important;display:flex!important;justify-content:flex-end!important;align-items:center!important;border-top:1px solid #edf2f7!important;padding-top:8px!important;margin-top:2px!important}.sunat-card-footer .sunat-muted{display:none!important}.sunat-link{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-width:86px!important;height:30px!important;border:1px solid #c9dcf0!important;border-radius:11px!important;background:#fff!important;color:#0a4f93!important;font-size:12px!important;font-weight:950!important;text-decoration:none!important;box-shadow:0 8px 18px rgba(13,45,86,.06)!important}.sunat-kpi{min-height:72px!important;padding:12px 15px!important;border-radius:18px!important}.sunat-kpi strong{font-size:20px!important}.sunat-actions{margin-top:4px!important;padding:10px 12px!important;border-radius:16px!important}@media(max-width:1200px){.sunat-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.sunat-card{grid-template-columns:46px minmax(0,1fr) 72px!important}.sunat-link{min-width:72px!important}}@media(max-width:760px){.sunat-grid{grid-template-columns:1fr!important}.sunat-card{grid-template-columns:44px minmax(0,1fr)!important}.sunat-card p,.sunat-card-footer{grid-column:2!important}.sunat-card p{padding-right:0!important}.sunat-status{display:none!important}}

/* Aurora Premium Design System - visual layer only. */
:root {
  --ap-font: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --ap-navy-950: #041a3a;
  --ap-navy-900: #062551;
  --ap-navy-800: #083b72;
  --ap-blue-600: #0a6ee8;
  --ap-blue-700: #0758ba;
  --ap-teal-600: #0a8f8a;
  --ap-green-600: #168a5b;
  --ap-amber-600: #b7791f;
  --ap-red-600: #b42318;
  --ap-violet-600: #6656d9;
  --ap-indigo-600: #4656c8;
  --ap-ink: #0b1f3a;
  --ap-text: #20324a;
  --ap-muted: #60708a;
  --ap-bg: #f5f8fb;
  --ap-surface: #fff;
  --ap-surface-soft: #f9fbfe;
  --ap-line: #d9e6f2;
  --ap-line-soft: #e9f0f7;
  --ap-shadow-sm: 0 8px 22px rgba(11,31,58,.06);
  --ap-shadow-md: 0 16px 38px rgba(11,31,58,.09);
  --ap-shadow-lg: 0 26px 70px rgba(5,24,52,.16);
  --ap-radius-sm: 10px;
  --ap-radius-md: 14px;
  --ap-radius-lg: 18px;
  --ap-radius-xl: 22px;
}

html { font-family: var(--ap-font) !important; font-feature-settings: "tnum" 1, "cv02" 1, "cv03" 1; }
body, body.aurora-shell { font-family: var(--ap-font) !important; background: linear-gradient(180deg,#edf4fb 0,#f7fafc 280px,var(--ap-bg) 100%) !important; color: var(--ap-text) !important; letter-spacing: 0 !important; }

.topbar, .topnav, .aurora-topbar, .top {
  min-height: 72px !important;
  padding: 0 24px !important;
  background: linear-gradient(90deg,var(--ap-navy-950),var(--ap-navy-900) 46%,var(--ap-navy-800)) !important;
  border-bottom: 1px solid rgba(255,255,255,.12) !important;
  box-shadow: 0 14px 34px rgba(5,24,52,.18) !important;
}
.brand strong, .aurora-brand strong { font-size: 17px !important; font-weight: 850 !important; letter-spacing: 0 !important; }
.brand span, .aurora-brand span { color: #c8d8ea !important; font-size: 11.5px !important; font-weight: 700 !important; }
.nav a, .menu a, .aurora-nav a, .aurora-nav-button {
  height: 38px !important;
  border-radius: var(--ap-radius-sm) !important;
  font-size: 12.5px !important;
  font-weight: 760 !important;
  color: #e8f1fb !important;
  transition: background .16s ease, border-color .16s ease, transform .16s ease !important;
}
.nav a:hover, .menu a:hover, .aurora-nav a:hover, .aurora-nav-button:hover, .nav a.active, .menu a.active, .aurora-nav a.active, .aurora-nav-button.active {
  background: rgba(255,255,255,.13) !important;
  border-color: rgba(255,255,255,.18) !important;
  transform: translateY(-1px);
}

main, .aurora-page, .alerts-page { max-width: 1920px !important; margin-left: auto !important; margin-right: auto !important; padding: 20px 24px 32px !important; }
.hero, .company-context, .aurora-context-bar, .aurora-module-hero, .active-company-strip, .alerts-hero {
  border: 1px solid var(--ap-line) !important;
  border-top: 0 !important;
  border-radius: var(--ap-radius-xl) !important;
  background: linear-gradient(135deg,rgba(255,255,255,.98),#f7fbff 72%,#f2fbf8) !important;
  box-shadow: var(--ap-shadow-md) !important;
  min-height: 108px !important;
}
.hero::before, .company-context::before, .aurora-context-bar::before, .active-company-strip::before { background: none !important; }
h1, .aurora-module-title, .company-title, .alerts-title {
  color: var(--ap-ink) !important;
  font-size: clamp(24px,1.55vw,32px) !important;
  font-weight: 820 !important;
  letter-spacing: 0 !important;
  line-height: 1.12 !important;
  text-transform: none !important;
}
.eyebrow, .context-eyebrow, .aurora-module-eyebrow, .alerts-eyebrow, .active-company-label { color: var(--ap-blue-600) !important; font-size: 11px !important; font-weight: 820 !important; letter-spacing: .075em !important; }
.hint, .aurora-module-desc, .alerts-desc { color: var(--ap-muted) !important; line-height: 1.48 !important; }

.card, .table-card, .panel, .aurora-card, .alerts-panel, .modal-card, .report-dialog {
  border: 1px solid var(--ap-line) !important;
  border-radius: var(--ap-radius-lg) !important;
  background: var(--ap-surface) !important;
  box-shadow: var(--ap-shadow-sm) !important;
}
.card:hover, .table-card:hover, .aurora-card:hover, .alerts-panel:hover { box-shadow: var(--ap-shadow-md) !important; }
.toolbar, .table-toolbar, .table-head, .toolrow, .card-head, .view-header, .filters-panel, .alerts-toolbar { background: linear-gradient(180deg,#fff,var(--ap-surface-soft)) !important; border-bottom-color: var(--ap-line-soft) !important; }

.kpis, .kpi-grid, .metrics, .alerts-kpis { gap: 14px !important; }
.kpi, .metric, .alerts-kpi, .sunat-kpi {
  min-height: 108px !important;
  border: 1px solid var(--ap-line) !important;
  border-left: 4px solid var(--module-accent,var(--ap-blue-600)) !important;
  border-radius: var(--ap-radius-lg) !important;
  background: linear-gradient(145deg,#fff,#fbfdff) !important;
  box-shadow: var(--ap-shadow-sm) !important;
  padding: 16px !important;
  overflow: hidden !important;
}
.kpi::after, .metric::after, .alerts-kpi::after { opacity: .045 !important; }
.kpi span, .metric span, .alerts-kpi small { color: var(--ap-muted) !important; font-size: 10.5px !important; font-weight: 800 !important; letter-spacing: .055em !important; }
.kpi strong, .metric strong, .alerts-kpi strong { color: var(--ap-ink) !important; font-size: clamp(23px,1.5vw,31px) !important; font-weight: 820 !important; }

button, .button, .aurora-button, .action-btn, .alerts-button, .sunat-btn, .sunat-link, .actions a.action-link {
  min-height: 38px !important;
  border-radius: var(--ap-radius-sm) !important;
  font-family: var(--ap-font) !important;
  font-size: 12.5px !important;
  font-weight: 760 !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, border-color .14s ease !important;
}
button:not(.secondary):not(.danger):not(.report-secondary):not(.report-soft), .button:not(.secondary):not(.danger), .aurora-button:not(.secondary), .action-btn.primary, .alerts-button {
  background: linear-gradient(135deg,var(--ap-blue-600),var(--ap-blue-700)) !important;
  border-color: var(--ap-blue-600) !important;
  color: #fff !important;
}
button:hover, .button:hover, .aurora-button:hover, .action-btn:hover, .alerts-button:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(10,110,232,.12) !important; }
.secondary, .button.secondary, .aurora-button.secondary, .action-btn:not(.primary), .report-secondary, .report-soft, .actions a.action-link { background: #fff !important; color: #173b61 !important; border: 1px solid #cfe0ef !important; }
.danger, button.danger, .button.danger { background: linear-gradient(135deg,#dc2626,#991b1b) !important; border-color: #b91c1c !important; color: #fff !important; }

input, select, textarea, .aurora-field, .alerts-field input, .alerts-field select {
  border: 1px solid #ccdbea !important;
  border-radius: var(--ap-radius-sm) !important;
  background: #fff !important;
  color: var(--ap-text) !important;
  font-family: var(--ap-font) !important;
  font-size: 12.5px !important;
  box-shadow: none !important;
}
input:focus, select:focus, textarea:focus, .aurora-field:focus { outline: 3px solid rgba(10,110,232,.14) !important; border-color: #78afe8 !important; }
label, .alerts-field label, .toolbar label { color: var(--ap-muted) !important; font-size: 11.5px !important; font-weight: 760 !important; letter-spacing: .02em !important; }

.tab, .view-tab, .stage-tab, .detail-filter, .filter, .chip, .provider-stage, .detraction-stage, .tab-btn {
  height: 34px !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #24415f !important;
  border: 1px solid #cfdfef !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 760 !important;
}
.tab.active, .view-tab.active, .stage-tab.active, .detail-filter.active, .filter.active, .chip.active, .provider-stage.active, .detraction-stage.active, .tab-btn.active {
  background: linear-gradient(135deg,var(--module-accent,var(--ap-blue-600)),var(--module-accent-2,var(--ap-blue-700))) !important;
  border-color: var(--module-accent,var(--ap-blue-600)) !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(10,110,232,.14) !important;
}

.table-wrap, .aurora-table-wrap, .alerts-table-wrap { border-top: 1px solid var(--ap-line-soft) !important; background: #fff !important; }
table, .aurora-table, .alerts-table { font-feature-settings: "tnum" 1 !important; }
th, .aurora-table th, .alerts-table th { background: #f4f8fc !important; color: #33516f !important; border-bottom: 1px solid #d9e6f2 !important; font-size: 10.5px !important; font-weight: 820 !important; letter-spacing: .04em !important; }
td, .aurora-table td, .alerts-table td { color: #21364f !important; border-color: #edf2f7 !important; font-size: 12.25px !important; line-height: 1.36 !important; }
tbody tr:hover td, .aurora-table tbody tr:hover td, .alerts-table tr:hover td { background: #f4f9ff !important; }
tbody tr.selected td { background: #e6f3ff !important; box-shadow: inset 0 1px 0 #b4d8f4, inset 0 -1px 0 #b4d8f4 !important; }
.pill, .badge, .aurora-pill, .alerts-badge, .status-cell { min-height: 24px !important; border-radius: 999px !important; padding: 4px 9px !important; font-size: 10.75px !important; font-weight: 760 !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,.42) !important; }

.module-grid { gap: 12px !important; }
.module-card, .aurora-submodule-card, .sunat-card { border: 1px solid var(--ap-line) !important; border-radius: var(--ap-radius-lg) !important; background: linear-gradient(145deg,#fff,#fbfdff) !important; box-shadow: var(--ap-shadow-sm) !important; }
.module-card:hover, .aurora-submodule-card:hover, .sunat-card:hover { transform: translateY(-2px) !important; box-shadow: var(--ap-shadow-md) !important; }

.dashboard-page { --module-accent: var(--ap-blue-600); --module-accent-2: var(--ap-teal-600); }
.companies-page { --module-accent: var(--ap-green-600); --module-accent-2: #0f766e; }
.purchases-page { --module-accent: #1f6fb2; --module-accent-2: #0b79b7; }
.sales-page { --module-accent: var(--ap-teal-600); --module-accent-2: #0f766e; }
.liquidation-page { --module-accent: var(--ap-violet-600); --module-accent-2: #4f46e5; }
.purchases-page .hero, .sales-page .hero, .liquidation-page .hero, .companies-page .hero { border-left: 5px solid var(--module-accent) !important; }
.purchases-page .kpi, .sales-page .kpi, .liquidation-page .kpi, .companies-page .metric { border-left-color: var(--module-accent) !important; }

@media (max-width: 1180px) {
  main, .aurora-page, .alerts-page { padding: 16px !important; }
  .kpi-grid, .kpis, .metrics, .alerts-kpis { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
}
@media (max-width: 760px) {
  .topbar, .topnav, .aurora-topbar, .top { padding: 14px 16px !important; }
  .kpi-grid, .kpis, .metrics, .alerts-kpis { grid-template-columns: 1fr !important; }
}

/* Aurora Premium Phase 2 - operational workspaces and dense data UI. */
.aurora-premium {
  --ap-shell-height: 74px;
  --ap-focus: 0 0 0 3px rgba(10, 110, 232, .16);
}

.aurora-premium main {
  max-width: 1920px;
  margin: 0 auto;
}

.aurora-premium .hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(180, 199, 219, .82) !important;
  border-top: 0 !important;
  border-left: 6px solid var(--ap-accent, #0a6ee8) !important;
  background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(246,250,255,.94) 58%, rgba(238,248,246,.92)) !important;
  box-shadow: 0 18px 42px rgba(15, 40, 75, .10) !important;
}

.aurora-premium .hero::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--ap-accent, #0a6ee8), var(--ap-accent-2, #16a37b), transparent 78%);
  pointer-events: none;
}

.aurora-premium .hero > *,
.aurora-premium .aurora-module-hero > *,
.aurora-premium .alerts-hero > * {
  position: relative;
  z-index: 1;
}

.aurora-premium .company-badge,
.aurora-premium .active-company-strip,
.aurora-premium .aurora-context-bar {
  border: 1px solid rgba(22, 163, 123, .24) !important;
  background: linear-gradient(135deg, #f4fff9, #eaf7ff) !important;
  color: #0e5f49 !important;
  box-shadow: 0 10px 24px rgba(15, 40, 75, .07) !important;
}

.aurora-premium .kpis { align-items: stretch; }

.aurora-premium .kpi {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid rgba(205, 220, 237, .92) !important;
  border-left: 0 !important;
  border-radius: 8px !important;
  background: linear-gradient(180deg, #fff, #f8fbff) !important;
  box-shadow: 0 12px 28px rgba(15, 40, 75, .07) !important;
  position: relative;
  overflow: hidden;
}

.aurora-premium .kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--ap-accent, #0a6ee8);
}

.aurora-premium .kpi.green::before { background: #16a37b; }
.aurora-premium .kpi.amber::before { background: #d08a18; }
.aurora-premium .kpi.violet::before { background: #6d5bd0; }

.aurora-premium .kpi span {
  color: #5e728a !important;
  letter-spacing: .045em !important;
}

.aurora-premium .kpi strong {
  color: #10233f !important;
  font-size: clamp(20px, 1.45vw, 26px) !important;
  line-height: 1.1 !important;
}

.aurora-premium .card,
.aurora-premium .table-card,
.aurora-premium .panel,
.aurora-premium .coef-panel {
  border-color: rgba(205, 220, 237, .96) !important;
  box-shadow: 0 14px 34px rgba(15, 40, 75, .08) !important;
}

.aurora-premium .toolbar,
.aurora-premium .period-base-strip,
.aurora-premium .desktop-stage,
.aurora-premium .view-header,
.aurora-premium .detail-filters,
.aurora-premium .detraction-search,
.aurora-premium .detraction-stage-row,
.aurora-premium .export-actions {
  background: linear-gradient(180deg, #fbfdff, #f2f7fc) !important;
  border-bottom: 1px solid #dbe7f3 !important;
}

.aurora-premium .filters,
.aurora-premium .actions,
.aurora-premium .erp-actions,
.aurora-premium .report-actions {
  gap: 10px !important;
}

.aurora-premium label {
  color: #54677f !important;
  font-weight: 850 !important;
}

.aurora-premium input,
.aurora-premium select,
.aurora-premium textarea,
.aurora-premium .cell-select,
.aurora-premium .liq-input {
  border-color: #c7d6e6 !important;
  border-radius: 8px !important;
  background: linear-gradient(180deg, #fff, #fbfdff) !important;
  color: #10233f !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75) !important;
}

.aurora-premium input:focus,
.aurora-premium select:focus,
.aurora-premium textarea:focus,
.aurora-premium button:focus-visible,
.aurora-premium a:focus-visible {
  outline: none !important;
  box-shadow: var(--ap-focus) !important;
  border-color: var(--ap-accent, #0a6ee8) !important;
}

.aurora-premium button,
.aurora-premium .button,
.aurora-premium .action-link {
  border-radius: 8px !important;
  font-weight: 850 !important;
  letter-spacing: 0 !important;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease !important;
}

.aurora-premium button:hover,
.aurora-premium .button:hover,
.aurora-premium .action-link:hover { transform: translateY(-1px); }
.aurora-premium button:active,
.aurora-premium .button:active,
.aurora-premium .action-link:active { transform: translateY(0); }

.aurora-premium .secondary,
.aurora-premium button.secondary,
.aurora-premium .report-secondary,
.aurora-premium .report-soft {
  background: #fff !important;
  color: #173b61 !important;
  border-color: #c8d8e8 !important;
}

.aurora-premium .danger,
.aurora-premium button.danger {
  background: linear-gradient(135deg, #dc2626, #9f1d1d) !important;
  border-color: #b91c1c !important;
  color: #fff !important;
}

.aurora-premium .tabs,
.aurora-premium .stage-tabs,
.aurora-premium .view-tabs,
.aurora-premium .purchase-tabs { scrollbar-width: thin; }

.aurora-premium .tab,
.aurora-premium .stage-tab,
.aurora-premium .view-tab,
.aurora-premium .detail-filter,
.aurora-premium .provider-stage,
.aurora-premium .detraction-stage,
.aurora-premium .tab-btn {
  min-height: 34px;
  border-radius: 8px !important;
  white-space: nowrap;
}

.aurora-premium .tab.active,
.aurora-premium .stage-tab.active,
.aurora-premium .view-tab.active,
.aurora-premium .detail-filter.active,
.aurora-premium .provider-stage.active,
.aurora-premium .detraction-stage.active,
.aurora-premium .tab-btn.active {
  background: linear-gradient(135deg, var(--ap-accent, #0a6ee8), var(--ap-accent-2, #0b79b7)) !important;
}

.aurora-premium .summary-line,
.aurora-premium .help,
.aurora-premium .tab-help {
  color: #3e536b !important;
  background: #fbfdff !important;
}

.aurora-premium .summary-pill,
.aurora-premium .pill,
.aurora-premium .status-cell,
.aurora-premium .coef-summary span,
.aurora-premium .igv-report-footer span {
  border-radius: 999px !important;
  border: 1px solid #cfdeed !important;
  background: #fff !important;
  color: #23415f !important;
}

.aurora-premium .pill.ok,
.aurora-premium .status-cell.ok { background: #e6f8ef !important; color: #087344 !important; border-color: #bcebd2 !important; }
.aurora-premium .pill.warn,
.aurora-premium .status-cell.warn { background: #fff5d8 !important; color: #8a5a00 !important; border-color: #f1d792 !important; }
.aurora-premium .pill.danger,
.aurora-premium .pill.bad,
.aurora-premium .status-cell.danger { background: #ffe5e1 !important; color: #a3261e !important; border-color: #f5bbb4 !important; }

.aurora-premium .table-wrap {
  border-top: 1px solid #dce8f4 !important;
  background: #fff !important;
  scrollbar-width: thin;
  scrollbar-color: #9fb6cc #eef4fa;
}

.aurora-premium .table-wrap::-webkit-scrollbar,
.aurora-premium .bottom-scroll::-webkit-scrollbar { height: 12px; width: 12px; }
.aurora-premium .table-wrap::-webkit-scrollbar-thumb,
.aurora-premium .bottom-scroll::-webkit-scrollbar-thumb { background: #9fb6cc; border-radius: 999px; border: 3px solid #eef4fa; }
.aurora-premium .table-wrap::-webkit-scrollbar-track,
.aurora-premium .bottom-scroll::-webkit-scrollbar-track { background: #eef4fa; }

.aurora-premium table { font-variant-numeric: tabular-nums; }
.aurora-premium th,
.aurora-premium td { border-color: #e1eaf3 !important; }

.aurora-premium th {
  background: linear-gradient(180deg, #edf6ff, #dfeefa) !important;
  color: #113f66 !important;
  font-size: 11px !important;
  letter-spacing: .035em !important;
}

.aurora-premium tbody tr:nth-child(even) td { background: #fbfdff !important; }
.aurora-premium tbody tr:hover td { background: #eef7ff !important; }
.aurora-premium tbody tr.selected td,
.aurora-premium tbody tr.selected { background: #dff1ff !important; outline-color: #0ea5e9 !important; }

.aurora-premium td.money,
.aurora-premium td.total,
.aurora-premium .td-money,
.aurora-premium .td-total,
.aurora-premium .money-cell {
  text-align: right !important;
  color: #123d63 !important;
  font-weight: 850 !important;
}

.aurora-premium .pager,
.aurora-premium .bottom-scroll {
  background: #f8fbff !important;
  border-color: #dce8f4 !important;
}

.aurora-premium .modal {
  backdrop-filter: blur(4px);
  background: rgba(8, 24, 42, .56) !important;
}

.aurora-premium .modal-card,
.aurora-premium .report-dialog {
  border-radius: 8px !important;
  border-color: rgba(190, 210, 230, .92) !important;
  box-shadow: 0 28px 90px rgba(8, 24, 42, .30) !important;
}

.aurora-premium .modal-head,
.aurora-premium .detraction-head {
  background: linear-gradient(135deg, #10233f, #174a78) !important;
  color: #fff !important;
  border-bottom: 0 !important;
}

.aurora-premium .modal-head h2,
.aurora-premium .detraction-head h2 { color: #fff !important; }
.aurora-premium .close-icon,
.aurora-premium .report-close { border-radius: 8px !important; }

.aurora-premium .coef-grid,
.aurora-premium .igv-report-cards { gap: 12px !important; }

.aurora-premium .coef-card,
.aurora-premium .igv-report-card {
  border-radius: 8px !important;
  border-color: #d8e5f2 !important;
  background: linear-gradient(180deg, #fff, #f8fbff) !important;
}

.aurora-premium .opening-line {
  border-color: #f1d792 !important;
  background: linear-gradient(135deg, #fffaf0, #fffdf7) !important;
}

.dashboard-page .module-card,
.dashboard-page .stat-card,
.dashboard-page .action-card,
.companies-page .company-card,
.companies-page .result-card {
  border-radius: 8px !important;
  border-color: #d8e5f2 !important;
  box-shadow: 0 12px 28px rgba(15, 40, 75, .07) !important;
}

.dashboard-page .module-card:hover,
.dashboard-page .action-card:hover,
.companies-page .company-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(15, 40, 75, .11) !important;
}

.purchases-page { --ap-accent: #0a6ee8; --ap-accent-2: #16a37b; }
.sales-page { --ap-accent: #0b79b7; --ap-accent-2: #16a37b; }
.liquidation-page { --ap-accent: #6d5bd0; --ap-accent-2: #d08a18; }
.companies-page { --ap-accent: #16a37b; --ap-accent-2: #0a6ee8; }
.dashboard-page { --ap-accent: #0a6ee8; --ap-accent-2: #6d5bd0; }

@media (max-width: 1180px) {
  .aurora-premium main { padding-inline: 18px !important; }
  .aurora-premium .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .aurora-premium .toolbar,
  .aurora-premium .filters,
  .aurora-premium .actions,
  .aurora-premium .period-base-strip,
  .aurora-premium .view-header { align-items: stretch !important; }
}

@media (max-width: 760px) {
  .aurora-premium main { padding-inline: 14px !important; }
  .aurora-premium .hero { padding: 16px !important; }
  .aurora-premium .kpis { grid-template-columns: 1fr !important; }
  .aurora-premium .filters input,
  .aurora-premium .filters select,
  .aurora-premium label input,
  .aurora-premium label select { width: 100% !important; }
  .aurora-premium .modal { padding: 12px !important; }
}

/* Aurora Premium Phase 3 - shell, support and admin screens. */
.aurora-premium.aurora-shell,
.aurora-premium.support-page,
.aurora-premium.users-page,
.aurora-premium.identity-page,
.aurora-premium.sunat-page-shell {
  --ap-accent: #0a6ee8;
  --ap-accent-2: #16a37b;
  background: linear-gradient(180deg, #eaf3fb 0, #f6f9fc 320px) !important;
}

.aurora-premium .aurora-topbar,
.aurora-premium .top,
.aurora-premium .topnav {
  min-height: 74px !important;
  border-bottom: 1px solid rgba(255,255,255,.12) !important;
  background: linear-gradient(90deg, #062551, #0a3a73 58%, #0f7775) !important;
  box-shadow: 0 14px 32px rgba(5, 24, 52, .22) !important;
}

.aurora-premium .aurora-brand,
.aurora-premium .brand {
  min-width: 220px;
}

.aurora-premium .aurora-brand-mark,
.aurora-premium .logo,
.aurora-premium .mark {
  border-radius: 10px !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.45), 0 10px 22px rgba(5,24,52,.14) !important;
}

.aurora-premium .aurora-nav,
.aurora-premium .menu,
.aurora-premium .nav {
  scrollbar-width: thin;
}

.aurora-premium .aurora-nav a,
.aurora-premium .aurora-nav-button,
.aurora-premium .menu a,
.aurora-premium .nav a {
  border-radius: 8px !important;
  letter-spacing: 0 !important;
}

.aurora-premium .aurora-dropdown {
  border-radius: 8px !important;
  border: 1px solid #d8e5f2 !important;
  box-shadow: 0 24px 60px rgba(5,24,52,.20) !important;
}

.aurora-premium .aurora-page,
.aurora-premium .alerts-page,
.aurora-premium .notifications-page,
.aurora-premium main.sunat-page,
.aurora-premium main {
  background: transparent !important;
}

.aurora-premium .aurora-card,
.aurora-premium .alerts-hero,
.aurora-premium .alerts-panel,
.aurora-premium .alerts-kpi,
.aurora-premium .notify-hero,
.aurora-premium .notify-card,
.aurora-premium .notify-panel,
.aurora-premium .notify-kpi,
.aurora-premium .sunat-company,
.aurora-premium .sunat-hero,
.aurora-premium .sunat-card,
.aurora-premium .sunat-panel,
.aurora-premium .sunat-kpi,
.aurora-premium .panel,
.aurora-premium .card {
  border-radius: 8px !important;
  border-color: #d8e5f2 !important;
  background: linear-gradient(180deg, #fff, #f9fcff) !important;
  box-shadow: 0 14px 34px rgba(15, 40, 75, .08) !important;
}

.aurora-premium .aurora-module-hero,
.aurora-premium .alerts-hero,
.aurora-premium .notify-hero,
.aurora-premium .sunat-company,
.aurora-premium .sunat-hero,
.aurora-premium .hero {
  border-left: 6px solid var(--ap-accent, #0a6ee8) !important;
}

.aurora-premium .aurora-module-title,
.aurora-premium .alerts-title,
.aurora-premium .notify-title,
.aurora-premium .hero h1,
.aurora-premium h1 {
  color: #10233f !important;
  letter-spacing: 0 !important;
}

.aurora-premium .aurora-module-eyebrow,
.aurora-premium .alerts-eyebrow,
.aurora-premium .notify-eyebrow,
.aurora-premium .sunat-eyebrow,
.aurora-premium .eyebrow {
  color: var(--ap-accent, #0a6ee8) !important;
  letter-spacing: .06em !important;
}

.aurora-premium .aurora-module-desc,
.aurora-premium .alerts-desc,
.aurora-premium .notify-desc,
.aurora-premium .hint,
.aurora-premium .meta,
.aurora-premium .sunat-muted,
.aurora-premium .sunat-note,
.aurora-premium .notify-card p {
  color: #5c7088 !important;
}

.aurora-premium .alerts-kpi,
.aurora-premium .notify-kpi,
.aurora-premium .sunat-kpi {
  min-height: 94px;
  border-left-width: 0 !important;
  position: relative;
  overflow: hidden;
}

.aurora-premium .alerts-kpi::before,
.aurora-premium .notify-kpi::before,
.aurora-premium .sunat-kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--ap-accent, #0a6ee8);
}

.aurora-premium .alerts-kpi.danger::before,
.aurora-premium .notify-kpi.red::before { background: #dc2626; }
.aurora-premium .alerts-kpi.warn::before,
.aurora-premium .notify-kpi.amber::before,
.aurora-premium .sunat-kpi.amber::before { background: #d08a18; }
.aurora-premium .alerts-kpi.next::before,
.aurora-premium .notify-kpi.green::before,
.aurora-premium .sunat-kpi.green::before { background: #16a37b; }

.aurora-premium .notify-card,
.aurora-premium .sunat-card,
.aurora-premium .aurora-submodule-card {
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease !important;
}

.aurora-premium .notify-card:hover,
.aurora-premium .sunat-card:hover,
.aurora-premium .aurora-submodule-card:hover {
  transform: translateY(-2px) !important;
  border-color: #b9d2e9 !important;
  box-shadow: 0 18px 42px rgba(15, 40, 75, .12) !important;
}

.aurora-premium .alerts-toolbar,
.aurora-premium .notify-panel-head,
.aurora-premium .sunat-download-box,
.aurora-premium .sunat-actions,
.aurora-premium .panel h2,
.aurora-premium .card h2 {
  background: linear-gradient(180deg, #fbfdff, #f2f7fc) !important;
  border-color: #dbe7f3 !important;
}

.aurora-premium .alerts-field input,
.aurora-premium .alerts-field select,
.aurora-premium .sunat-field input,
.aurora-premium .sunat-field textarea,
.aurora-premium .sunat-field select,
.aurora-premium .sunat-download-form input,
.aurora-premium .sunat-download-form select,
.aurora-premium .field input,
.aurora-premium input,
.aurora-premium select,
.aurora-premium textarea {
  border-radius: 8px !important;
  border-color: #c7d6e6 !important;
  background: linear-gradient(180deg, #fff, #fbfdff) !important;
}

.aurora-premium .alerts-button,
.aurora-premium .notify-button,
.aurora-premium .sunat-btn.primary,
.aurora-premium .btn.primary,
.aurora-premium button:not(.secondary):not(.danger) {
  border-radius: 8px !important;
  background: linear-gradient(135deg, var(--ap-accent, #0a6ee8), var(--ap-accent-2, #0f9f8f)) !important;
  color: #fff !important;
}

.aurora-premium .sunat-btn,
.aurora-premium .btn.secondary,
.aurora-premium .secondary {
  border-radius: 8px !important;
  background: #fff !important;
  color: #173b61 !important;
  border-color: #c8d8e8 !important;
}

.aurora-premium .alerts-table th,
.aurora-premium .notify-table th,
.aurora-premium .sunat-table th,
.aurora-premium table th {
  background: linear-gradient(180deg, #edf6ff, #dfeefa) !important;
  color: #113f66 !important;
}

.aurora-premium .alerts-table td,
.aurora-premium .notify-table td,
.aurora-premium .sunat-table td,
.aurora-premium table td {
  border-color: #e1eaf3 !important;
}

.aurora-premium .alerts-table tr:hover td,
.aurora-premium .notify-table tr:hover td,
.aurora-premium .sunat-table tr:hover td,
.aurora-premium tr:hover td {
  background: #eef7ff !important;
}

.aurora-premium .alerts-badge,
.aurora-premium .notify-badge,
.aurora-premium .sunat-status,
.aurora-premium .sunat-chip,
.aurora-premium .sunat-status-pill,
.aurora-premium .pill,
.aurora-premium .aurora-pill {
  border-radius: 999px !important;
  border: 1px solid #cfdeed !important;
}

.aurora-premium .preview-box,
.aurora-premium .favicon-preview,
.aurora-premium .rule,
.aurora-premium .sunat-note,
.aurora-premium .sunat-check,
.aurora-premium .sunat-document-fields {
  border-radius: 8px !important;
  border-color: #d8e5f2 !important;
}

.aurora-premium.identity-page { --ap-accent: #0f7775; --ap-accent-2: #0a6ee8; }
.aurora-premium.users-page { --ap-accent: #6d5bd0; --ap-accent-2: #0a6ee8; }
.aurora-premium.notifications-page-shell { --ap-accent: #0a6ee8; --ap-accent-2: #16a37b; }
.aurora-premium.alerts-page-shell { --ap-accent: #d08a18; --ap-accent-2: #0a6ee8; }
.aurora-premium.sunat-page-shell { --ap-accent: #0a6ee8; --ap-accent-2: #0f7775; }
.aurora-premium.module-page-shell { --ap-accent: #0a6ee8; --ap-accent-2: #6d5bd0; }

@media (max-width: 1100px) {
  .aurora-premium .aurora-topbar,
  .aurora-premium .top,
  .aurora-premium .topnav {
    height: auto !important;
    align-items: flex-start !important;
  }
  .aurora-premium .aurora-nav,
  .aurora-premium .menu,
  .aurora-premium .nav {
    width: 100%;
    overflow-x: auto;
  }
  .aurora-premium .alerts-kpis,
  .aurora-premium .notify-kpis,
  .aurora-premium .notify-grid,
  .aurora-premium .sunat-kpis,
  .aurora-premium .sunat-grid,
  .aurora-premium .grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 760px) {
  .aurora-premium .alerts-kpis,
  .aurora-premium .notify-kpis,
  .aurora-premium .notify-grid,
  .aurora-premium .sunat-kpis,
  .aurora-premium .sunat-grid,
  .aurora-premium .grid {
    grid-template-columns: 1fr !important;
  }
  .aurora-premium .alerts-page,
  .aurora-premium .notifications-page,
  .aurora-premium main.sunat-page,
  .aurora-premium main {
    padding-inline: 14px !important;
  }
}

/* Aurora Premium Phase 4 - login and final visual alignment. */
.aurora-premium.login-page {
  --ap-accent: #0a6ee8;
  --ap-accent-2: #16a37b;
  min-height: 100vh;
  background: radial-gradient(circle at 82% 76%, rgba(22,163,123,.13), transparent 28%), radial-gradient(circle at 14% 18%, rgba(10,110,232,.16), transparent 30%), linear-gradient(135deg, #f7fbff 0, #eef6fc 100%) !important;
}

.aurora-premium.login-page::before {
  background: linear-gradient(145deg, #061f46, #0a3a73 58%, #0f7775) !important;
}

.aurora-premium.login-page .shell {
  border-radius: 8px !important;
  border: 1px solid rgba(216,229,242,.92) !important;
  box-shadow: 0 30px 90px rgba(8, 30, 56, .22) !important;
}

.aurora-premium.login-page .brand {
  background: radial-gradient(circle at 30% 24%, rgba(10,110,232,.20), transparent 30%), linear-gradient(150deg, #06234d 0, #07345f 56%, #0f7775 100%) !important;
}

.aurora-premium.login-page .logo-stage img {
  filter: drop-shadow(0 22px 32px rgba(0,10,28,.32)) !important;
}

.aurora-premium.login-page .brand-icons b {
  border-radius: 8px !important;
  background: rgba(255,255,255,.10) !important;
}

.aurora-premium.login-page .panel {
  background: linear-gradient(180deg, #fff, #fbfdff) !important;
}

.aurora-premium.login-page .panel h1 {
  color: #10233f !important;
  letter-spacing: 0 !important;
}

.aurora-premium.login-page .subtitle,
.aurora-premium.login-page .footer {
  color: #61758c !important;
}

.aurora-premium.login-page label {
  color: #27384f !important;
  letter-spacing: 0 !important;
}

.aurora-premium.login-page input[type="text"],
.aurora-premium.login-page input[type="password"] {
  height: 44px !important;
  border-radius: 8px !important;
  border-color: #c7d6e6 !important;
  background: linear-gradient(180deg, #fff, #fbfdff) !important;
}

.aurora-premium.login-page input:focus {
  border-color: var(--ap-accent, #0a6ee8) !important;
  box-shadow: 0 0 0 3px rgba(10,110,232,.16) !important;
}

.aurora-premium.login-page button[type="submit"] {
  border-radius: 8px !important;
  background: linear-gradient(135deg, var(--ap-accent, #0a6ee8), var(--ap-accent-2, #16a37b)) !important;
  box-shadow: 0 16px 30px rgba(10,110,232,.22) !important;
}

.aurora-premium.login-page .secure-box,
.aurora-premium.login-page .error {
  border-radius: 8px !important;
}

.aurora-premium.login-page .forgot {
  color: var(--ap-accent, #0a6ee8) !important;
}

@media (max-width: 900px) {
  .aurora-premium.login-page .shell { width: min(100%, 560px) !important; }
  .aurora-premium.login-page .brand { min-height: 360px !important; }
}

/* Aurora Premium Phase 5 - accessibility, responsive polish and print. */
.aurora-premium {
  color-scheme: light;
  accent-color: var(--ap-accent, #0a6ee8);
}

.aurora-premium *,
.aurora-premium *::before,
.aurora-premium *::after {
  text-rendering: geometricPrecision;
}

.aurora-premium :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid rgba(10, 110, 232, .24) !important;
  outline-offset: 2px !important;
}

.aurora-premium :where(button, .button, .aurora-button, .action-link, .sunat-btn, .btn, .alerts-button, .notify-button) {
  min-width: max-content;
}

.aurora-premium :where(button, .button, .aurora-button, .action-link, .sunat-btn, .btn, .alerts-button, .notify-button)[disabled],
.aurora-premium :where(input, select, textarea):disabled {
  cursor: not-allowed !important;
  opacity: .62 !important;
  filter: grayscale(.15);
}

.aurora-premium :where(input, select, textarea)::placeholder {
  color: #8a9bae !important;
}

.aurora-premium :where(input[type="checkbox"], input[type="radio"]) {
  min-width: 16px;
  width: 16px !important;
  height: 16px !important;
  padding: 0 !important;
}

.aurora-premium :where(.topnav, .topbar, .aurora-topbar, .top) {
  isolation: isolate;
}

.aurora-premium :where(.menu, .nav, .aurora-nav, .submenu, .tax-subnav-inner, .sunat-subnav, .tabs, .stage-tabs, .view-tabs, .purchase-tabs, .detail-filters) {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scroll-padding-inline: 12px;
}

.aurora-premium :where(.menu, .nav, .aurora-nav, .submenu, .tax-subnav-inner, .sunat-subnav) a {
  flex: 0 0 auto;
}

.aurora-premium :where(.hero, .aurora-module-hero, .alerts-hero, .notify-hero, .sunat-hero, .sunat-company) {
  overflow-wrap: anywhere;
}

.aurora-premium :where(.hero h1, .aurora-module-title, .alerts-title, .notify-title, .sunat-company h1, .sunat-hero h2) {
  max-width: 100%;
}

.aurora-premium :where(.hint, .aurora-module-desc, .alerts-desc, .notify-desc, .sunat-hero p, .meta) {
  line-height: 1.55 !important;
}

.aurora-premium :where(.kpi, .alerts-kpi, .notify-kpi, .sunat-kpi) strong {
  overflow-wrap: anywhere;
}

.aurora-premium :where(.toolbar, .filters, .actions, .erp-actions, .period-base-strip, .view-header, .alerts-toolbar, .detraction-search, .export-actions, .sunat-actions, .sunat-form-actions) {
  min-width: 0;
}

.aurora-premium :where(.filters label, .toolbar label, .period-base-strip label, .alerts-field, .sunat-field, .field) {
  min-width: min(220px, 100%);
}

.aurora-premium :where(.filters input, .filters select, .toolbar input, .toolbar select, .alerts-field input, .alerts-field select, .sunat-field input, .sunat-field select, .sunat-field textarea, .field input) {
  min-width: 0;
}

.aurora-premium :where(.table-wrap, .alerts-table-wrap, .notify-table-wrap, .sunat-table-wrap) {
  overscroll-behavior: contain;
}

.aurora-premium :where(table) caption {
  caption-side: top;
  padding: 10px 12px;
  color: #53677f;
  font-size: 12px;
  font-weight: 850;
  text-align: left;
}

.aurora-premium :where(th, td) {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aurora-premium :where(td strong, th strong) {
  color: inherit;
}

.aurora-premium :where(td.money, td.total, .td-money, .td-total, .money-cell) {
  font-variant-numeric: tabular-nums lining-nums;
}

.aurora-premium :where(.empty-company, .empty-alerts, .aurora-missing-state, .note:empty)::before {
  color: #72849a;
}

.aurora-premium :where(.empty-company, .empty-alerts, .aurora-missing-state) {
  border-radius: 8px !important;
  border: 1px dashed #bcd0e3 !important;
  background: linear-gradient(180deg, #fff, #f8fbff) !important;
}

.aurora-premium :where(.error, .notice.err, .sunat-alert.bad) {
  background: #fff1f2 !important;
  color: #9f1239 !important;
  border-color: #fecdd3 !important;
}

.aurora-premium :where(.notice.ok, .sunat-alert.ok) {
  background: #e8fff3 !important;
  color: #087246 !important;
  border-color: #a8ebca !important;
}

.aurora-premium :where(.modal.open, .report-modal) {
  animation: aurora-modal-fade .14s ease-out both;
}

.aurora-premium :where(.modal-card, .report-dialog) {
  animation: aurora-modal-rise .16s ease-out both;
}

@keyframes aurora-modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes aurora-modal-rise {
  from { opacity: .82; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .aurora-premium *,
  .aurora-premium *::before,
  .aurora-premium *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}

@media (max-width: 1280px) {
  .aurora-premium :where(.topnav, .topbar, .aurora-topbar, .top) {
    align-items: flex-start !important;
    flex-wrap: wrap !important;
  }

  .aurora-premium :where(.menu, .nav, .aurora-nav) {
    order: 3;
    width: 100%;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    padding-bottom: 4px;
  }

  .aurora-premium .erp-user-menu {
    margin-left: auto !important;
  }
}

@media (max-width: 900px) {
  .aurora-premium :where(main, .alerts-page, .notifications-page, .sunat-page, .aurora-page) {
    padding: 14px !important;
  }

  .aurora-premium :where(.hero, .aurora-module-hero, .alerts-hero, .notify-hero, .sunat-hero, .sunat-company) {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .aurora-premium :where(.filters, .actions, .erp-actions, .alerts-filters, .detraction-search, .sunat-form-actions, .report-actions) {
    display: grid !important;
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
  }

  .aurora-premium :where(button, .button, .aurora-button, .action-link, .sunat-btn, .btn, .alerts-button, .notify-button) {
    width: 100%;
    justify-content: center !important;
  }

  .aurora-premium :where(.table-wrap, .alerts-table-wrap, .notify-table-wrap, .sunat-table-wrap) {
    max-height: 68vh !important;
  }
}

@media print {
  body.aurora-premium {
    background: #fff !important;
    color: #111827 !important;
  }

  .aurora-premium :where(.topnav, .topbar, .aurora-topbar, .top, .menu, .nav, .aurora-nav, .erp-user-menu, .actions, .erp-actions, .toolbar, .filters, .tabs, .stage-tabs, .view-tabs, .bottom-scroll, .pager, .modal, .report-close, button, .button, .aurora-button, .sunat-actions) {
    display: none !important;
  }

  .aurora-premium :where(main, .alerts-page, .notifications-page, .sunat-page, .aurora-page) {
    padding: 0 !important;
    max-width: none !important;
  }

  .aurora-premium :where(.card, .panel, .aurora-card, .alerts-panel, .notify-panel, .sunat-panel, .hero, .aurora-module-hero, .alerts-hero, .notify-hero, .sunat-hero, .sunat-company) {
    border: 1px solid #d1d5db !important;
    box-shadow: none !important;
    break-inside: avoid;
  }

  .aurora-premium :where(.table-wrap, .alerts-table-wrap, .notify-table-wrap, .sunat-table-wrap) {
    overflow: visible !important;
    max-height: none !important;
  }

  .aurora-premium :where(table) {
    width: 100% !important;
    min-width: 0 !important;
  }

  .aurora-premium :where(th, td) {
    white-space: normal !important;
    max-width: none !important;
    font-size: 10px !important;
  }
}

/* Aurora Premium Phase 6 - module identity, hierarchy and production polish. */
.aurora-premium {
  --ap-page-gutter: clamp(16px, 2vw, 30px);
  --ap-card-radius: 8px;
  --ap-dense-shadow: 0 10px 26px rgba(15, 40, 75, .075);
  --ap-dense-shadow-hover: 0 16px 36px rgba(15, 40, 75, .12);
}

.aurora-premium :where(main, .aurora-page, .alerts-page, .notifications-page, .sunat-page) {
  padding-left: var(--ap-page-gutter) !important;
  padding-right: var(--ap-page-gutter) !important;
}

.aurora-premium :where(.topnav, .aurora-topbar, .top) {
  backdrop-filter: saturate(1.08) blur(10px);
}

.aurora-premium :where(.brand strong, .aurora-brand strong) {
  letter-spacing: 0 !important;
}

.aurora-premium :where(.submenu, .subnav, .tax-subnav, .sunat-subnav-header) {
  border-radius: 8px !important;
}

.aurora-premium :where(.submenu, .subnav) {
  padding: 5px !important;
  background: rgba(255,255,255,.08) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
}

.aurora-premium :where(.tax-subnav-inner, .sunat-subnav-header) {
  background: rgba(255,255,255,.92) !important;
  border-color: #d8e5f2 !important;
  box-shadow: var(--ap-dense-shadow) !important;
}

.aurora-premium :where(.hero, .company-context, .aurora-context-bar, .active-company-strip, .sunat-company, .notify-hero, .alerts-hero) {
  min-height: unset !important;
  border-radius: var(--ap-card-radius) !important;
  box-shadow: var(--ap-dense-shadow) !important;
}

.aurora-premium :where(.hero, .aurora-module-hero, .sunat-hero, .notify-hero, .alerts-hero) h1,
.aurora-premium :where(.sunat-hero) h2 {
  font-size: clamp(24px, 2vw, 34px) !important;
  line-height: 1.08 !important;
}

.aurora-premium :where(.company-badge, .alerts-company, .notify-context, .sunat-note) {
  border-radius: 8px !important;
}

.aurora-premium :where(.kpis, .kpi-grid, .alerts-kpis, .notify-kpis, .sunat-kpis) {
  gap: 12px !important;
}

.aurora-premium :where(.kpi, .stat-card, .alerts-kpi, .notify-kpi, .sunat-kpi) {
  border-radius: var(--ap-card-radius) !important;
  box-shadow: var(--ap-dense-shadow) !important;
}

.aurora-premium :where(.kpi, .stat-card, .alerts-kpi, .notify-kpi, .sunat-kpi):hover {
  transform: translateY(-1px);
  box-shadow: var(--ap-dense-shadow-hover) !important;
}

.dashboard-page .module-grid,
.dashboard-page .action-grid,
.dashboard-page .quick-grid {
  gap: 12px !important;
}

.dashboard-page :where(.module-card, .action-card, .company-card) {
  min-height: 84px !important;
  align-content: center !important;
  border-radius: var(--ap-card-radius) !important;
}

.dashboard-page .module-card strong,
.dashboard-page .action-card strong {
  font-size: 14px !important;
}

.dashboard-page .module-card span,
.dashboard-page .action-card span {
  line-height: 1.35 !important;
}

.companies-page :where(.panel, .card, .company-card, .result-card) {
  border-radius: var(--ap-card-radius) !important;
}

.companies-page :where(.company-card, .result-card):hover {
  border-color: #b7d0e8 !important;
}

.purchases-page :where(.toolbar, .period-base-strip, .desktop-stage),
.sales-page :where(.toolbar, .period-base-strip, .desktop-stage),
.liquidation-page :where(.toolbar, .view-header, .coef-panel) {
  position: relative;
}

.purchases-page :where(.toolbar, .period-base-strip)::before,
.sales-page :where(.toolbar, .period-base-strip)::before,
.liquidation-page :where(.toolbar, .view-header)::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--ap-accent), var(--ap-accent-2));
}

.aurora-premium :where(.toolbar, .period-base-strip, .desktop-stage, .view-header, .alerts-toolbar, .detraction-search, .sunat-actions) {
  border-radius: 0 !important;
}

.aurora-premium :where(.actions, .erp-actions) {
  border-radius: var(--ap-card-radius) !important;
  background: #fff !important;
}

.aurora-premium :where(.more-actions summary) {
  border-radius: var(--ap-card-radius) !important;
}

.aurora-premium :where(.more-actions-menu, .erp-user-dropdown) {
  border-radius: var(--ap-card-radius) !important;
}

.aurora-premium :where(.tab, .stage-tab, .view-tab, .detail-filter, .provider-stage, .detraction-stage, .chip) {
  min-width: fit-content;
  box-shadow: none !important;
}

.aurora-premium :where(.tab.active, .stage-tab.active, .view-tab.active, .detail-filter.active, .provider-stage.active, .detraction-stage.active, .chip.active) {
  box-shadow: 0 8px 18px rgba(10, 110, 232, .16) !important;
}

.aurora-premium :where(.table-wrap, .alerts-table-wrap, .notify-table-wrap, .sunat-table-wrap) {
  background: linear-gradient(180deg, #fff, #fbfdff) !important;
}

.aurora-premium :where(table) {
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.aurora-premium :where(th) {
  height: 38px !important;
  vertical-align: middle !important;
}

.aurora-premium :where(td) {
  height: 39px !important;
  vertical-align: middle !important;
}

.aurora-premium :where(tbody tr:first-child td) {
  border-top: 0 !important;
}

.aurora-premium :where(tbody tr.selected td) {
  box-shadow: inset 4px 0 0 var(--ap-accent, #0a6ee8) !important;
}

.liquidation-page :where(.coef-card, .igv-report-card, .igv-report-result, .opening-line) {
  border-radius: var(--ap-card-radius) !important;
}

.liquidation-page .igv-report-result {
  background: linear-gradient(135deg, #10233f, var(--ap-accent), var(--ap-accent-2)) !important;
}

.sunat-page-shell :where(.sunat-card, .sunat-panel, .sunat-company, .sunat-hero) {
  border-radius: var(--ap-card-radius) !important;
}

.sunat-page-shell .sunat-card {
  min-height: 150px !important;
}

.notifications-page-shell :where(.notify-card, .notify-panel, .notify-kpi),
.alerts-page-shell :where(.alerts-panel, .alerts-kpi) {
  border-radius: var(--ap-card-radius) !important;
}

.login-page .shell {
  width: min(1040px, calc(100vw - 36px)) !important;
}

.login-page .brand-icons {
  gap: 10px !important;
}

.login-page .brand-icons b {
  width: 32px !important;
  height: 32px !important;
}

.login-page .panel h1::after {
  content: "";
  display: block;
  width: 46px;
  height: 4px;
  margin-top: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ap-accent), var(--ap-accent-2));
}

@media (min-width: 1440px) {
  .aurora-premium :where(.table-wrap) {
    max-height: calc(100vh - 380px) !important;
  }
}

@media (max-width: 700px) {
  .login-page .brand-icons {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .aurora-premium :where(.erp-user-trigger) {
    max-width: 100% !important;
  }

  .aurora-premium :where(.erp-user-copy strong) {
    max-width: 190px !important;
  }
}

/* Aurora Premium Phase 7 - interaction states, readability and responsive polish. */
.aurora-premium {
  --ap-focus-ring: 0 0 0 3px rgba(20, 118, 184, .18);
  --ap-row-hover: #edf7ff;
  --ap-row-selected: #dff0ff;
  --ap-soft-border: #dbe7f2;
  --ap-ink-strong: #10243e;
}

.aurora-premium .aurora-topbar,
.aurora-premium .top,
.aurora-premium .topnav {
  border-bottom: 1px solid rgba(255, 255, 255, .14) !important;
}

.aurora-premium .aurora-nav a.active,
.aurora-premium .menu a.active,
.aurora-premium .nav a.active,
.aurora-premium .tax-subnav a.active {
  box-shadow: inset 0 -2px 0 rgba(255,255,255,.82), 0 8px 18px rgba(9, 35, 64, .12) !important;
}

.aurora-premium .erp-user-trigger {
  min-height: 42px !important;
  border: 1px solid rgba(255,255,255,.24) !important;
  background: rgba(255,255,255,.12) !important;
  backdrop-filter: blur(10px);
}

.aurora-premium .erp-user-trigger:hover,
.aurora-premium .erp-user-menu:hover .erp-user-trigger {
  background: rgba(255,255,255,.2) !important;
  transform: translateY(-1px);
}

.aurora-premium .erp-user-dropdown {
  border: 1px solid var(--ap-soft-border) !important;
  border-radius: 8px !important;
  box-shadow: 0 22px 46px rgba(15, 39, 71, .18) !important;
  overflow: hidden;
}

.aurora-premium .erp-user-dropdown a {
  min-height: 38px;
  display: flex !important;
  align-items: center;
}

.aurora-premium .erp-user-dropdown a:hover {
  background: #eef7ff !important;
  color: #0b5f95 !important;
}

.aurora-premium .hero,
.aurora-premium .aurora-module-hero,
.aurora-premium .sunat-hero,
.aurora-premium .notify-hero,
.aurora-premium .alerts-hero {
  min-height: 126px;
}

.aurora-premium .hero h1,
.aurora-premium .aurora-module-title,
.aurora-premium .sunat-hero h1,
.aurora-premium .notify-title,
.aurora-premium .alerts-title {
  text-wrap: balance;
}

.aurora-premium .hint,
.aurora-premium .aurora-module-desc,
.aurora-premium .sunat-note,
.aurora-premium .notify-desc,
.aurora-premium .alerts-desc {
  max-width: 78ch;
  line-height: 1.55 !important;
}

.aurora-premium .kpi:hover,
.aurora-premium .alerts-kpi:hover,
.aurora-premium .notify-kpi:hover,
.aurora-premium .sunat-kpi:hover {
  border-color: #b8d4ec !important;
  box-shadow: 0 18px 36px rgba(24, 52, 82, .13) !important;
}

.aurora-premium .toolbar,
.aurora-premium .filters,
.aurora-premium .actions,
.aurora-premium .view-header,
.aurora-premium .period-base-strip,
.aurora-premium .detail-filters,
.aurora-premium .detraction-search,
.aurora-premium .export-actions {
  row-gap: 10px !important;
}

.aurora-premium input::placeholder,
.aurora-premium textarea::placeholder {
  color: #8aa0b7 !important;
}

.aurora-premium input:hover,
.aurora-premium select:hover,
.aurora-premium textarea:hover,
.aurora-premium .liq-input:hover {
  border-color: #9ec2df !important;
}

.aurora-premium input:focus,
.aurora-premium select:focus,
.aurora-premium textarea:focus,
.aurora-premium .liq-input:focus {
  box-shadow: var(--ap-focus-ring) !important;
}

.aurora-premium button,
.aurora-premium .button,
.aurora-premium .action-link,
.aurora-premium .btn,
.aurora-premium .sunat-btn,
.aurora-premium .alerts-button,
.aurora-premium .notify-button {
  min-height: 38px;
  justify-content: center;
  gap: 7px;
}

.aurora-premium button:disabled,
.aurora-premium .button[aria-disabled="true"],
.aurora-premium input:disabled,
.aurora-premium select:disabled {
  opacity: .62 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

.aurora-premium .tab:hover,
.aurora-premium .stage-tab:hover,
.aurora-premium .view-tab:hover,
.aurora-premium .detail-filter:hover,
.aurora-premium .provider-stage:hover,
.aurora-premium .detraction-stage:hover,
.aurora-premium .tab-btn:hover {
  border-color: #9ec2df !important;
  background: #f5fbff !important;
}

.aurora-premium .tab.active:hover,
.aurora-premium .stage-tab.active:hover,
.aurora-premium .view-tab.active:hover,
.aurora-premium .detail-filter.active:hover,
.aurora-premium .provider-stage.active:hover,
.aurora-premium .detraction-stage.active:hover,
.aurora-premium .tab-btn.active:hover {
  background: linear-gradient(135deg, #0d74b7, #128b83) !important;
  color: #fff !important;
}

.aurora-premium .table-wrap,
.aurora-premium .panel .body,
.aurora-premium .card {
  scrollbar-color: #9fb6cc #eef4fa;
}

.aurora-premium table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.aurora-premium thead th:first-child { border-top-left-radius: 6px; }
.aurora-premium thead th:last-child { border-top-right-radius: 6px; }

.aurora-premium th {
  letter-spacing: .02em !important;
}

.aurora-premium td,
.aurora-premium th {
  vertical-align: middle !important;
}

.aurora-premium tbody tr:hover td,
.aurora-premium tbody tr:hover th {
  background: var(--ap-row-hover) !important;
}

.aurora-premium tbody tr:focus-within td {
  background: var(--ap-row-selected) !important;
}

.aurora-premium td:first-child,
.aurora-premium th:first-child {
  border-left: 1px solid #e1eaf3 !important;
}

.aurora-premium .pill,
.aurora-premium .summary-pill,
.aurora-premium .status-cell,
.aurora-premium .notify-badge,
.aurora-premium .alerts-badge,
.aurora-premium .sunat-badge {
  min-height: 24px;
  align-items: center;
  gap: 5px;
  line-height: 1.2 !important;
}

.aurora-premium .modal,
.aurora-premium .report-modal {
  backdrop-filter: blur(6px);
}

.aurora-premium .modal-card,
.aurora-premium .report-dialog,
.aurora-premium .detraction-panel {
  border-radius: 8px !important;
  border-color: #c9d9e8 !important;
}

.aurora-premium .modal-head,
.aurora-premium .detraction-head {
  min-height: 58px;
}

.aurora-premium .login-panel,
.aurora-premium .login-card,
.aurora-premium .login-box {
  border-radius: 8px !important;
  box-shadow: 0 26px 70px rgba(12, 35, 64, .18) !important;
}

.aurora-premium.login-page input,
.aurora-premium.login-page button {
  min-height: 44px;
}

.aurora-premium .empty,
.aurora-premium .empty-state,
.aurora-premium td[colspan] {
  color: #687b91 !important;
}

.aurora-premium .note,
.aurora-premium .help,
.aurora-premium .tab-help,
.aurora-premium .summary-line {
  line-height: 1.5 !important;
}

@media (max-width: 1180px) {
  .aurora-premium .aurora-topbar,
  .aurora-premium .top,
  .aurora-premium .topnav {
    align-items: stretch !important;
  }
  .aurora-premium .aurora-nav,
  .aurora-premium .menu,
  .aurora-premium .nav {
    overflow-x: auto;
    padding-bottom: 4px;
  }
}

@media (max-width: 760px) {
  .aurora-premium .hero,
  .aurora-premium .aurora-module-hero,
  .aurora-premium .sunat-hero,
  .aurora-premium .notify-hero,
  .aurora-premium .alerts-hero {
    min-height: 0;
  }
  .aurora-premium .toolbar > *,
  .aurora-premium .filters > *,
  .aurora-premium .actions > *,
  .aurora-premium .report-actions > * {
    width: 100%;
  }
  .aurora-premium button,
  .aurora-premium .button,
  .aurora-premium .btn,
  .aurora-premium .sunat-btn {
    width: 100%;
  }
  .aurora-premium .erp-user-menu,
  .aurora-premium .erp-user-trigger {
    width: 100%;
  }
  .aurora-premium .erp-user-dropdown {
    width: 100%;
    right: 0 !important;
  }
}
