:root{
  --g-ink:#102033;
  --g-ink-2:#53657a;
  --g-ink-3:#7b8da3;
  --g-bg:#f4f7fb;
  --g-bg-2:#eaf0f7;
  --g-surface:#ffffff;
  --g-surface-2:#f8fbff;
  --g-border:#dbe5f0;
  --g-border-strong:#c4d2e3;
  --g-primary:#123a5f;
  --g-primary-2:#1f6f9f;
  --g-primary-soft:#e5f2fb;
  --g-accent:#c7923e;
  --g-ok:#16834f;
  --g-warn:#b66a08;
  --g-err:#b42318;
  --g-radius:14px;
  --g-radius-lg:22px;
  --g-shadow:0 18px 48px rgba(16,32,51,.10);
  --g-shadow-soft:0 10px 28px rgba(16,32,51,.07);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  min-height:100vh;
  background:
    radial-gradient(circle at 12% 0%,rgba(31,111,159,.16),transparent 34%),
    radial-gradient(circle at 88% 8%,rgba(199,146,62,.14),transparent 30%),
    linear-gradient(180deg,#f8fbff 0%,var(--g-bg) 44%,#eef4fa 100%);
  color:var(--g-ink);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  font-size:14px;
  line-height:1.5;
  letter-spacing:-.01em;
}

body>header.panel-header{
  position:sticky;
  top:0;
  z-index:20;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin:0;
  padding:16px 28px;
  border:0;
  border-bottom:1px solid rgba(196,210,227,.72);
  background:rgba(255,255,255,.84);
  backdrop-filter:blur(18px);
  box-shadow:0 12px 34px rgba(16,32,51,.08);
}

body>header.panel-header h1{
  margin:0;
  min-width:max-content;
  font-size:19px;
  font-weight:850;
  letter-spacing:-.04em;
  color:var(--g-primary);
}

body>header.panel-header h1:before{
  content:"";
  display:inline-block;
  width:10px;
  height:10px;
  margin-right:10px;
  border-radius:999px;
  background:linear-gradient(135deg,var(--g-accent),#f0c76d);
  box-shadow:0 0 0 5px rgba(199,146,62,.15);
}

main.page-section,#app{
  width:min(1180px,calc(100% - 40px));
  margin:26px auto 56px;
}

a{color:inherit;text-decoration:none}
button,input,select,textarea{font:inherit}

.g-card,.hero-card,.card,.panel,.section-card,.page-card{
  position:relative;
  overflow:hidden;
  background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(248,251,255,.96));
  border:1px solid rgba(219,229,240,.95);
  border-radius:var(--g-radius-lg);
  padding:22px;
  box-shadow:var(--g-shadow-soft);
}

.hero-card{
  padding:28px;
  margin-bottom:20px;
  border-color:rgba(196,210,227,.86);
  box-shadow:var(--g-shadow);
}

.hero-card:after{
  content:"";
  position:absolute;
  inset:0 0 auto auto;
  width:220px;
  height:220px;
  transform:translate(38%,-46%);
  border-radius:999px;
  background:radial-gradient(circle,rgba(31,111,159,.15),transparent 68%);
  pointer-events:none;
}

.hero-card h2,.g-card h2,.g-card h3,.panel-header h2,.panel-header h3,.card h2,.card h3,.panel h2,.panel h3{
  margin:0;
  color:var(--g-ink);
  letter-spacing:-.035em;
}

.hero-card h2{font-size:28px;font-weight:850;margin-bottom:8px;color:var(--g-primary)}
.g-card h3,.card h3,.panel h3{font-size:17px;font-weight:800;margin-bottom:14px}

.panel-header,.page-header,.section-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  flex-wrap:wrap;
  margin-bottom:16px;
  padding-bottom:14px;
  border-bottom:1px solid var(--g-border);
}

.panel-header h2,.panel-header h3,.page-header h2,.page-header h3,.section-header h2,.section-header h3{font-size:18px;font-weight:820}

.toolbar,.actions,.filters{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin-bottom:16px;
}

body>header .toolbar{
  flex:1;
  justify-content:flex-end;
  margin:0;
  max-height:46px;
  overflow:auto hidden;
  scrollbar-width:thin;
}

.g-btn,button,.btn,.button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:39px;
  padding:9px 15px;
  border-radius:999px;
  border:1px solid var(--g-border-strong);
  background:rgba(255,255,255,.9);
  color:var(--g-ink);
  font-size:13px;
  font-weight:750;
  cursor:pointer;
  transition:transform .16s ease,box-shadow .16s ease,background .16s ease,border-color .16s ease,color .16s ease;
}

.g-btn:hover,button:hover:not(:disabled),.btn:hover,.button:hover{
  transform:translateY(-1px);
  background:#fff;
  border-color:#b6c8da;
  box-shadow:0 10px 22px rgba(16,32,51,.10);
}

.g-btn.primary,.g-btn.button-primary,.button-primary,.btn-primary,.primary{
  background:linear-gradient(135deg,var(--g-primary),var(--g-primary-2));
  color:#fff;
  border-color:rgba(18,58,95,.75);
  box-shadow:0 12px 24px rgba(18,58,95,.22);
}

.button-danger,.btn-danger,.danger{background:linear-gradient(135deg,#a51f16,#d33a2c);color:#fff;border-color:#a51f16}
button:disabled,.btn:disabled{opacity:.45;cursor:not-allowed;transform:none;box-shadow:none}

.g-grid,.grid{display:grid;gap:14px}
.g-row,.row{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.two-columns,.columns-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.three-columns,.columns-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.page-section,.page-shell,.module-page{margin-bottom:28px}
.page-section>h2,.page-shell>h2,.module-page>h2{font-size:22px;font-weight:850;margin:0 0 14px;color:var(--g-primary)}

.metric-grid,.metrics-grid,.kpi-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  gap:14px;
  margin-bottom:18px;
}

.metric,.kpi,.stat-card{
  position:relative;
  min-height:118px;
  background:linear-gradient(180deg,#fff,var(--g-surface-2));
  border:1px solid var(--g-border);
  border-radius:20px;
  padding:18px;
  box-shadow:var(--g-shadow-soft);
}

.metric:before,.kpi:before,.stat-card:before{
  content:"";
  position:absolute;
  left:18px;
  top:16px;
  width:36px;
  height:4px;
  border-radius:999px;
  background:linear-gradient(90deg,var(--g-accent),rgba(199,146,62,.25));
}

.metric h3,.metric span,.kpi h3,.kpi span,.stat-card h3,.stat-card span{
  display:block;
  margin:10px 0 8px;
  font-size:11px;
  font-weight:850;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--g-ink-2);
}

.metric b,.metric p,.kpi b,.kpi p,.stat-card b,.stat-card p{
  display:block;
  margin:0;
  font-size:25px;
  font-weight:880;
  line-height:1.12;
  color:var(--g-primary);
  letter-spacing:-.045em;
}

.metric p .g-badge{font-size:12px;letter-spacing:0;text-transform:none}

.g-table,.data-table,table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border:1px solid var(--g-border);
  border-radius:16px;
  background:#fff;
}

.g-table th,.data-table th,table th{
  text-align:left;
  padding:12px 14px;
  font-size:11px;
  font-weight:850;
  text-transform:uppercase;
  letter-spacing:.09em;
  color:var(--g-ink-2);
  background:linear-gradient(180deg,#f8fbff,#eff5fb);
  border-bottom:1px solid var(--g-border);
}

.g-table td,.data-table td,table td{
  padding:13px 14px;
  border-bottom:1px solid #eef3f8;
  color:var(--g-ink);
  vertical-align:top;
}

.g-table tr:last-child td,.data-table tr:last-child td,table tr:last-child td{border-bottom:none}
.g-table tbody tr:hover,.data-table tbody tr:hover,table tbody tr:hover{background:#f9fcff}

.g-badge,.badge,.pill,.tag{
  display:inline-flex;
  align-items:center;
  width:max-content;
  max-width:100%;
  padding:5px 10px;
  border-radius:999px;
  font-size:11px;
  line-height:1.1;
  font-weight:850;
  letter-spacing:.02em;
  border:1px solid var(--g-border);
  background:var(--g-primary-soft);
  color:var(--g-primary);
}
.badge-ok,.ok,.success{background:#dcfce7;color:#166534;border:1px solid #b7efcb}
.badge-warn,.warn,.warning{background:#fff3d6;color:#9a5b05;border:1px solid #f4d18a}
.badge-err,.error,.danger-badge{background:#fee2e2;color:#991b1b;border:1px solid #fecaca}

.ui-state,.empty-state,.loading-state{
  margin:0;
  padding:18px;
  text-align:center;
  color:var(--g-ink-2);
  font-size:14px;
  border-radius:16px;
  background:rgba(248,251,255,.74);
}
.ui-state.error,.empty-state.error{color:var(--g-err);background:#fff1f1}

.field,.form-field,.input-group{display:flex;flex-direction:column;gap:6px;margin-bottom:12px}
.field label,.form-field label,.input-group label{font-size:12px;font-weight:800;color:var(--g-ink-2)}
.field input,.field select,.field textarea,input.g-input,select.g-input,textarea.g-input,.form-field input,.form-field select,.form-field textarea,.input-group input,.input-group select,.input-group textarea{
  width:100%;
  min-height:40px;
  padding:10px 12px;
  border:1px solid var(--g-border-strong);
  border-radius:13px;
  background:#fff;
  color:var(--g-ink);
  outline:none;
  transition:border-color .16s ease,box-shadow .16s ease,background .16s ease;
}
.field textarea,textarea.g-input,.form-field textarea,.input-group textarea{min-height:110px;resize:vertical}
.field input:focus,.field select:focus,.field textarea:focus,input.g-input:focus,select.g-input:focus,textarea.g-input:focus,.form-field input:focus,.form-field select:focus,.form-field textarea:focus,.input-group input:focus,.input-group select:focus,.input-group textarea:focus{
  border-color:var(--g-primary-2);
  box-shadow:0 0 0 4px rgba(31,111,159,.13);
}

.list,.timeline{display:grid;gap:10px;margin:0;padding:0;list-style:none}
.list-item,.timeline-item{
  padding:14px;
  border:1px solid var(--g-border);
  border-radius:16px;
  background:rgba(255,255,255,.74);
}

section+section{margin-top:16px}
small,.muted,.hint,.subtitle{color:var(--g-ink-3)}
hr{border:0;border-top:1px solid var(--g-border);margin:18px 0}

@media(max-width:920px){
  body>header.panel-header{align-items:flex-start;padding:14px 18px}
  body>header .toolbar{justify-content:flex-start;max-height:none}
  main.page-section,#app{width:min(100% - 24px,1180px);margin-top:18px}
  .two-columns,.columns-2,.three-columns,.columns-3{grid-template-columns:1fr}
  .hero-card{padding:22px}
  .hero-card h2{font-size:24px}
}

@media(max-width:620px){
  body{font-size:13px}
  body>header.panel-header{position:relative}
  .g-card,.hero-card,.card,.panel,.section-card,.page-card{border-radius:18px;padding:18px}
  .metric-grid,.metrics-grid,.kpi-grid{grid-template-columns:1fr}
  .g-table,.data-table,table{display:block;overflow-x:auto;white-space:nowrap}
  .g-btn,button,.btn,.button{width:100%}
  .toolbar,.actions,.filters{align-items:stretch}
}

@media print{
  body{background:#fff;color:#111827}
  body>header.panel-header{position:static;box-shadow:none;background:#fff}
  .g-card,.hero-card,.metric,.card,.panel,.kpi,.stat-card{box-shadow:none;break-inside:avoid}
  .g-btn,button,.toolbar,.actions,.filters{display:none!important}
  main.page-section,#app{width:100%;margin:0}
}
