:root {
  color-scheme: light;
  --navy: #10233f;
  --navy-2: #183453;
  --ink: #172338;
  --muted: #718096;
  --line: #e7edf3;
  --surface: #ffffff;
  --canvas: #f4f7fa;
  --teal: #25b99d;
  --teal-dark: #168d79;
  --teal-soft: #e7f8f4;
  --blue-soft: #edf4ff;
  --amber-soft: #fff6e5;
  --red-soft: #fff0ef;
  --shadow: 0 12px 34px rgba(20, 42, 69, .07);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
.boot-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; color: var(--muted); gap: 12px; }
.brand-mark { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; color: white; background: var(--navy); font-size: 21px; font-weight: 800; box-shadow: 0 8px 22px #10233f30; }
/* Login */
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); background: #fff; }
.login-side { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(32px, 6vw, 76px); color: #fff; background: radial-gradient(circle at 85% 22%, #24516c 0, transparent 28%), linear-gradient(145deg, #10233f 0%, #142d4d 58%, #0d594f 130%); }
.login-side:after { content: ""; position: absolute; width: 520px; height: 520px; right: -230px; bottom: -270px; border: 1px solid #ffffff1c; border-radius: 50%; box-shadow: 0 0 0 44px #ffffff08, 0 0 0 90px #ffffff06; }
.brand-lockup { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.brand-lockup .brand-mark { color: var(--navy); background: #fff; box-shadow: none; }
.brand-name { font-weight: 760; letter-spacing: .02em; font-size: 14px; }
.brand-sub { color: #b8c9d9; font-size: 11px; margin-top: 1px; letter-spacing: .11em; text-transform: uppercase; }
.login-message { max-width: 520px; position: relative; z-index: 1; padding: 50px 0; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .16em; font-weight: 750; color: var(--teal-dark); }
.login-message .eyebrow { color: #7ce3d0; }
.login-message h1 { font-size: clamp(38px, 5vw, 62px); line-height: 1.06; letter-spacing: -.045em; margin: 17px 0 20px; font-weight: 760; }
.login-message p { max-width: 440px; color: #c3d1de; font-size: 15px; line-height: 1.8; }
.login-feature-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.login-feature { border: 1px solid #ffffff25; border-radius: 999px; padding: 8px 12px; color: #dce8f2; font-size: 12px; background: #ffffff08; }
.login-footer { color: #93a9bd; font-size: 12px; position: relative; z-index: 1; }
.login-main { display: grid; place-items: center; padding: 36px 24px; }
.login-card { width: min(100%, 400px); }
.login-card h2 { font-size: 27px; letter-spacing: -.03em; margin: 0 0 8px; }
.login-card > p { color: var(--muted); margin: 0 0 30px; }
.form-field { display: grid; gap: 7px; margin: 17px 0; }
.form-field label { color: #3c4a5e; font-size: 12px; font-weight: 700; }
.form-field input, .form-field select { height: 46px; padding: 0 13px; width: 100%; color: var(--ink); background: #fff; border: 1px solid #dce4ed; border-radius: 10px; outline: none; transition: border .18s, box-shadow .18s; }
.form-field input:focus, .form-field select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px #25b99d20; }
.form-hint { color: var(--muted); font-size: 11px; margin-top: 4px; }
.btn { border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: 10px; padding: 11px 15px; font-weight: 700; transition: transform .15s, background .15s, box-shadow .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { color: #fff; background: var(--teal-dark); box-shadow: 0 5px 13px #168d7928; }
.btn-primary:hover { background: #107864; }
.btn-dark { color: #fff; background: var(--navy); }
.btn-light { color: #34455b; border: 1px solid var(--line); background: #fff; }
.btn-danger { color: #b6433d; background: var(--red-soft); }
.btn-block { width: 100%; min-height: 47px; margin-top: 12px; }
.btn:disabled { cursor: not-allowed; opacity: .58; }
.error-box { padding: 11px 13px; margin: 14px 0; border-radius: 9px; color: #a63f39; background: var(--red-soft); font-size: 12px; }
/* App layout */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 254px minmax(0, 1fr); }
.sidebar { min-height: 100vh; position: sticky; top: 0; height: 100vh; padding: 22px 15px 17px; display: flex; flex-direction: column; color: #dbe7f1; background: var(--navy); }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 3px 9px 26px; }
.sidebar-brand .brand-mark { width: 38px; height: 38px; border-radius: 12px; font-size: 18px; color: var(--navy); background: #fff; }
.sidebar-brand .brand-name { color: #fff; }
.sidebar-brand .brand-sub { font-size: 9px; }
.side-label { color: #8197ad; font-size: 10px; text-transform: uppercase; letter-spacing: .13em; font-weight: 800; padding: 15px 11px 8px; }
.nav-list { display: grid; gap: 4px; }
.nav-link { min-height: 42px; border-radius: 9px; padding: 0 11px; display: flex; align-items: center; gap: 12px; color: #b6c7d6; font-size: 12px; font-weight: 600; transition: .15s; }
.nav-link:hover { color: #fff; background: #ffffff0d; }
.nav-link.active { color: #fff; background: #ffffff16; box-shadow: inset 3px 0 var(--teal); }
.nav-icon { display: grid; place-items: center; width: 19px; height: 19px; opacity: .95; }
.nav-icon svg, .icon svg { display: block; width: 18px; height: 18px; }
.sidebar-bottom { margin-top: auto; }
.sidebar-note { margin: 12px 4px; padding: 13px; border: 1px solid #ffffff18; border-radius: 11px; background: #ffffff08; }
.sidebar-note strong { display: block; font-size: 11px; color: #eaf3f9; margin-bottom: 4px; }
.sidebar-note span { display: block; color: #9eb2c5; font-size: 10px; line-height: 1.55; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 14px 7px 0; border-top: 1px solid #ffffff19; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: var(--navy); background: #b9f0e5; font-weight: 800; font-size: 12px; }
.sidebar-user-text { min-width: 0; flex: 1; }
.sidebar-user-text strong { display: block; color: #fff; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-text span { color: #94a9bd; font-size: 10px; }
.logout-icon { border: 0; color: #9eb2c5; background: transparent; padding: 7px; border-radius: 8px; }
.logout-icon:hover { color: #fff; background: #ffffff13; }
.main-area { min-width: 0; }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 clamp(20px, 4vw, 48px); border-bottom: 1px solid var(--line); background: #ffffffd9; }
.topbar-left { display: flex; align-items: center; gap: 13px; }
.mobile-menu { display: none; }
.breadcrumb { color: #8b98a9; font-size: 11px; }
.topbar-title { font-weight: 750; color: #26364b; font-size: 13px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.secure-label { display: flex; align-items: center; gap: 7px; color: #648073; font-size: 11px; }
.secure-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px #25b99d1c; }
.content { width: min(100%, 1450px); margin: 0 auto; padding: 34px clamp(20px, 4vw, 48px) 50px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 25px; }
.page-heading h1 { margin: 5px 0 7px; font-size: clamp(24px, 3vw, 31px); line-height: 1.15; letter-spacing: -.04em; }
.page-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.overview-banner { position: relative; overflow: hidden; padding: 26px 28px; display: flex; align-items: center; justify-content: space-between; gap: 22px; color: white; border-radius: 16px; background: linear-gradient(112deg, #122a49, #1d5260); box-shadow: var(--shadow); }
.overview-banner:after { content: ""; position: absolute; width: 250px; height: 250px; border: 1px solid #ffffff21; border-radius: 50%; right: 9%; top: -170px; box-shadow: 0 0 0 35px #ffffff08, 0 0 0 75px #ffffff06; }
.overview-banner h2 { position: relative; z-index: 1; font-size: 22px; margin: 0 0 6px; letter-spacing: -.025em; }
.overview-banner p { position: relative; z-index: 1; color: #c5d8e4; margin: 0; font-size: 12px; }
.banner-tag { position: relative; z-index: 1; padding: 9px 12px; white-space: nowrap; border: 1px solid #ffffff35; background: #ffffff12; border-radius: 9px; color: #dcf5ef; font-size: 11px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 18px 0 27px; }
.stat-card, .panel, .module-card { border: 1px solid var(--line); background: var(--surface); border-radius: 13px; box-shadow: 0 4px 16px #162c4606; }
.stat-card { padding: 17px 18px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 650; }
.stat-icon { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 10px; color: var(--teal-dark); background: var(--teal-soft); }
.stat-value { margin-top: 12px; font-size: 26px; letter-spacing: -.04em; font-weight: 780; color: #1b2b40; }
.stat-foot { margin-top: 2px; color: #8b98a9; font-size: 10px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 26px 0 13px; }
.section-head h2 { margin: 0; font-size: 15px; letter-spacing: -.02em; }
.section-head span { color: var(--muted); font-size: 11px; }
.module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.module-card { padding: 17px; min-height: 174px; display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s, border .18s; }
.module-card:hover { transform: translateY(-2px); border-color: #cce8e1; box-shadow: var(--shadow); }
.module-card-top { display: flex; align-items: center; justify-content: space-between; }
.module-icon { width: 39px; height: 39px; display: grid; place-items: center; color: #168d79; background: var(--teal-soft); border-radius: 11px; }
.module-icon svg { width: 19px; height: 19px; }
.status-pill { border-radius: 999px; padding: 5px 8px; color: #936319; background: var(--amber-soft); font-size: 9px; font-weight: 750; }
.module-card h3 { font-size: 13px; margin: 13px 0 5px; }
.module-card p { font-size: 11px; color: var(--muted); margin: 0; line-height: 1.6; }
.module-card-bottom { margin-top: auto; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; color: #168d79; font-size: 11px; font-weight: 750; }
.module-card-bottom span:last-child { font-size: 17px; }
.columns-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: 15px; margin-top: 17px; }
.panel { padding: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; }
.panel-head h3 { margin: 0; font-size: 13px; }
.panel-head span { color: var(--muted); font-size: 10px; }
.activity-list { display: grid; }
.activity-row { display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; border-top: 1px solid #eff2f6; }
.activity-row:first-child { border-top: 0; }
.activity-dot { width: 8px; height: 8px; flex: 0 0 auto; margin-top: 5px; border-radius: 50%; background: #38bca3; box-shadow: 0 0 0 4px #e5f7f3; }
.activity-body { flex: 1; min-width: 0; }
.activity-body strong { display: block; font-size: 11px; color: #35465a; }
.activity-body span { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.activity-time { color: #9aa5b2; font-size: 9px; white-space: nowrap; }
.info-box { display: flex; align-items: flex-start; gap: 11px; padding: 13px; border-radius: 10px; color: #526477; background: #f4f8fb; font-size: 11px; line-height: 1.65; }
.info-box .icon { color: #47799b; }
.info-box strong { color: #293c52; }
/* Tables & module pages */
.panel-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; }
.panel-toolbar p { margin: 0; color: var(--muted); font-size: 11px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th { color: #8693a3; background: #f8fafc; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; font-weight: 750; }
th, td { padding: 12px 11px; border-bottom: 1px solid #edf1f5; }
td { color: #405166; font-size: 11px; }
td strong { color: #25364b; font-size: 11px; }
.role-badge { display: inline-flex; padding: 5px 8px; border-radius: 6px; color: #3e6887; background: var(--blue-soft); font-size: 9px; font-weight: 750; }
.state-active { color: #16816e; background: var(--teal-soft); }
.state-off { color: #a84d45; background: var(--red-soft); }
.table-action { border: 1px solid var(--line); color: #526277; background: white; padding: 6px 9px; border-radius: 7px; font-size: 10px; font-weight: 700; }
.table-action:hover { border-color: #c7d6e3; }
.empty-state { padding: 28px 14px; text-align: center; color: var(--muted); font-size: 12px; }
.empty-state .empty-icon { margin: 0 auto 11px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: #218e7c; background: var(--teal-soft); }
.module-hero { display: flex; align-items: flex-start; gap: 16px; padding: 22px; border: 1px solid var(--line); background: white; border-radius: 14px; box-shadow: 0 4px 16px #162c4606; }
.module-hero .module-icon { width: 48px; height: 48px; flex: 0 0 auto; }
.module-hero h2 { margin: 0 0 5px; font-size: 17px; }
.module-hero p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.integration-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.integration-step { padding: 16px; border: 1px solid var(--line); background: #fff; border-radius: 12px; }
.integration-step .step-number { color: #1c9a84; background: var(--teal-soft); width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; font-size: 11px; font-weight: 800; }
.integration-step h3 { font-size: 12px; margin: 11px 0 5px; }
.integration-step p { font-size: 10px; color: var(--muted); margin: 0; line-height: 1.6; }
/* Modal and toast */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: #0c1a2d88; }
.modal { width: min(100%, 460px); padding: 22px; border-radius: 15px; background: #fff; box-shadow: 0 25px 70px #06152a40; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 7px; }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-close { border: 0; background: #f2f5f8; border-radius: 8px; padding: 6px 9px; color: #647386; }
.modal-description { color: var(--muted); font-size: 11px; margin: 0 0 15px; }
.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: min(380px, calc(100vw - 44px)); padding: 12px 16px; color: white; background: #183d4a; border-radius: 10px; box-shadow: 0 12px 30px #10233f30; font-size: 12px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #963f3a; }
.app-footer { padding: 20px 0 0; color: #9aa6b3; font-size: 10px; text-align: center; }
@media (max-width: 1120px) {
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; left: -270px; width: 254px; transition: left .2s; box-shadow: 15px 0 30px #0c1d3030; }
  .sidebar.open { left: 0; }
  .mobile-menu { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 8px; width: 36px; height: 36px; }
  .columns-2 { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; }
  .login-side { min-height: 310px; padding: 27px; }
  .login-message { padding: 34px 0 20px; }
  .login-message h1 { font-size: 38px; }
  .login-footer { display: none; }
  .login-main { padding: 38px 23px 54px; }
}
@media (max-width: 560px) {
  .content { padding-top: 24px; }
  .topbar { min-height: 62px; padding: 0 17px; }
  .secure-label { display: none; }
  .module-grid { grid-template-columns: 1fr; }
  .stats-grid { gap: 9px; }
  .stat-card { padding: 13px; }
  .stat-value { font-size: 22px; }
  .overview-banner { align-items: flex-start; flex-direction: column; padding: 21px; }
  .page-heading { flex-direction: column; }
  .integration-steps { grid-template-columns: 1fr; }
  .activity-time { display: none; }
}
