:root{
  --bg:#f5f6f8;
  --panel:#ffffff;
  --panel-soft:#fafafa;
  --text:#1d1d1f;
  --muted:#6e6e73;
  --line:#e5e5ea;
  --line-strong:#d2d2d7;
  --blue:#0071e3;
  --blue-soft:#edf5ff;
  --green:#34c759;
  --red:#ff3b30;
  --sidebar:#111827;
  --sidebar-2:#1f2937;
  --sidebar-text:#f9fafb;
  --sidebar-muted:#9ca3af;
  --radius:12px;
  --shadow:0 12px 30px rgba(29,29,31,.07);
}

*{box-sizing:border-box}
html{background:var(--bg)}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Inter,Arial,sans-serif;
  font-size:14px;
}
a{color:inherit;text-decoration:none}
h1,h2,h3,p{margin-top:0}
h1{font-size:32px;line-height:1.12;margin-bottom:8px;letter-spacing:-.02em}
h2{font-size:18px;line-height:1.25;margin-bottom:6px}
h3{font-size:13px;margin:0 0 8px}

input,select{
  width:100%;
  border:1px solid var(--line-strong);
  border-radius:10px;
  background:#fff;
  color:var(--text);
  padding:11px 12px;
  outline:none;
  min-height:42px;
}
input:focus,select:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(0,113,227,.14)}
label span{display:block;color:var(--muted);font-size:12px;font-weight:700;margin-bottom:7px}

.fm-shell{display:grid;grid-template-columns:304px minmax(0,1fr);min-height:100vh}
.fm-sidebar{
  position:sticky;
  top:0;
  height:100vh;
  overflow:auto;
  background:linear-gradient(180deg,var(--sidebar),#0b1220);
  color:var(--sidebar-text);
  padding:18px 14px;
}
.fm-brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding:8px 10px 18px;
  margin-bottom:10px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.fm-brand strong{display:block;font-size:17px;line-height:1.1}
.fm-brand small{display:block;color:var(--sidebar-muted);font-size:12px;margin-top:3px}
.fm-brand-mark{
  display:grid;
  place-items:center;
  width:38px;
  height:38px;
  border-radius:11px;
  background:var(--blue);
  color:#fff;
  font-size:13px;
  font-weight:900;
}

.fm-nav{padding-bottom:22px}
.fm-nav-group{margin-top:16px}
.fm-nav-heading{
  padding:0 10px 7px;
  color:var(--sidebar-muted);
  font-size:11px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.fm-nav-link{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:38px;
  padding:9px 10px;
  border-radius:10px;
  color:#d1d5db;
  font-size:13px;
  font-weight:650;
  margin:2px 0;
}
.fm-nav-link:hover{background:rgba(255,255,255,.07);color:#fff}
.fm-nav-link.is-active{
  background:#fff;
  color:var(--text);
  box-shadow:0 10px 24px rgba(0,0,0,.22);
}
.fm-icon{
  width:17px;
  height:17px;
  fill:currentColor;
  flex:0 0 auto;
}
.fm-icon path{fill:currentColor}
.fm-nav-link .fm-icon{color:inherit;opacity:.9}

.fm-main{min-width:0;padding:28px 32px 46px}
.fm-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:22px;
  padding:13px 16px;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:0 4px 14px rgba(29,29,31,.04);
}
.fm-top strong{font-size:15px}
.fm-eyebrow{
  display:block;
  color:var(--blue);
  font-size:11px;
  font-weight:900;
  letter-spacing:.09em;
  text-transform:uppercase;
  margin-bottom:6px;
}
.fm-page-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px;
  margin-bottom:20px;
}
.fm-page-head p{max-width:760px;margin-bottom:0}
.fm-muted{color:var(--muted)}

.fm-card{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:18px;
  margin-bottom:18px;
  box-shadow:var(--shadow);
}
a.fm-card{display:block;transition:transform .14s,border-color .14s,box-shadow .14s}
a.fm-card:hover{transform:translateY(-1px);border-color:rgba(0,113,227,.28);box-shadow:0 16px 36px rgba(0,113,227,.11)}
.fm-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px}
.fm-summary-grid{margin-bottom:18px}
.fm-stat{min-height:142px}
.fm-stat h2{font-size:34px;letter-spacing:-.025em;margin:12px 0 4px}
.fm-stat p{color:var(--muted);font-size:13px;line-height:1.42;margin:0}
.fm-stat-icon{
  float:right;
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  border-radius:10px;
  color:var(--blue);
  background:var(--blue-soft);
}
.fm-stat-icon .fm-icon{width:17px;height:17px}

.fm-section-title{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:16px;
}
.fm-section-title p{margin-bottom:0}
.fm-form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(235px,1fr));gap:14px;align-items:end}
.fm-span-2{grid-column:span 2}

.btn{
  border:0;
  border-radius:10px;
  padding:10px 15px;
  cursor:pointer;
  font-weight:800;
  font-family:inherit;
  min-height:40px;
}
.btn-primary{background:var(--blue);color:#fff}
.btn-primary:hover{background:#0066cc}
.btn-danger{background:var(--red);color:#fff}
.btn-ghost{background:#fff;color:var(--text);border:1px solid var(--line-strong)}
.btn-gold{background:#ffcc00;color:#1d1d1f}

.pill{
  display:inline-flex;
  align-items:center;
  border-radius:999px;
  padding:6px 10px;
  background:#f2f2f7;
  color:#515154;
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}
.fm-notice{background:rgba(52,199,89,.12);border:1px solid rgba(52,199,89,.32);border-radius:12px;padding:12px;margin-bottom:14px;color:#1b7f39}
.fm-error{background:rgba(255,59,48,.1);border:1px solid rgba(255,59,48,.28);border-radius:12px;padding:10px;color:#b42318}

.fm-table-wrap{overflow:auto;border-radius:12px;border:1px solid var(--line)}
table{width:100%;border-collapse:collapse;min-width:920px;background:#fff}
th{
  background:#f7f7f9;
  color:#555;
  text-align:left;
  font-size:12px;
  font-weight:900;
  padding:12px;
  border-bottom:1px solid var(--line);
  white-space:nowrap;
}
td{
  background:#fff;
  border-bottom:1px solid var(--line);
  padding:12px;
  font-size:13px;
  vertical-align:top;
}
tr:hover td{background:#fbfbfd}
td:last-child{white-space:nowrap}

.fm-area-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:14px}
.fm-area{
  background:var(--panel-soft);
  border:1px solid var(--line);
  border-radius:14px;
  padding:15px;
}
.fm-area h3{
  font-size:14px;
  font-weight:900;
  color:var(--text);
  margin-bottom:5px;
}
.fm-area-desc{
  color:var(--muted);
  font-size:12px;
  line-height:1.35;
  margin:0 0 12px;
}
.fm-area-link{
  display:flex;
  gap:10px;
  padding:10px;
  border-radius:10px;
  color:var(--text);
}
.fm-area-link:hover{background:#fff;box-shadow:0 6px 18px rgba(29,29,31,.06)}
.fm-area-link .fm-icon{width:16px;height:16px;color:var(--blue);margin-top:1px}
.fm-area-link strong{display:block;font-size:13px}
.fm-area-link small{display:block;color:var(--muted);font-size:12px;line-height:1.35;margin-top:2px}

.fm-user-hero{
  background:linear-gradient(135deg,#0071e3,#5ac8fa);
  color:#fff;
  border:0;
}
.fm-user-hero p{color:rgba(255,255,255,.86);max-width:820px;margin-bottom:0}
.fm-login-body{min-height:100vh;display:grid;place-items:center;padding:20px}
.fm-login-card{
  width:min(430px,100%);
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
  padding:26px;
  display:grid;
  gap:14px;
  box-shadow:var(--shadow);
}
.fm-login-card h1{font-size:28px}
.fm-check{display:flex;align-items:center;gap:8px;color:var(--muted)}
.fm-check input{width:auto;min-height:0}
.danger-zone{border-color:rgba(255,59,48,.35);background:rgba(255,59,48,.06)}

@media(max-width:900px){
  .fm-shell{grid-template-columns:1fr}
  .fm-sidebar{position:static;height:auto}
  .fm-main{padding:18px}
  .fm-page-head,.fm-section-title,.fm-top{align-items:flex-start;flex-direction:column}
  .fm-span-2{grid-column:span 1}
}
