:root{
  --bg:#f5f6f8;
  --card:#ffffff;
  --border:#e6e8ee;
  --text:#1b1f2a;
  --muted:#667085;
  --primary:#2563eb;
  --shadow: 0 8px 18px rgba(16,24,40,.08);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background:var(--bg);
}

a{ color:var(--primary); text-decoration:none; }
a:hover{ text-decoration:underline; }

.topbar{
  position:sticky; top:0; z-index:10;
  background:#fff;
  border-bottom:1px solid var(--border);
  height:52px;
  display:flex; align-items:center;
  padding:0 18px;
}
.brand{ font-weight:700; margin-right:18px; }
.nav a{
  margin-right:14px;
  color:#344054;
  padding:6px 10px;
  border-radius:10px;
}
.nav a.active{ background:#eef2ff; color:#1e40af; }

.container{
  max-width: 1120px;
  margin: 18px auto 42px;
  padding: 0 14px;
}

.page-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 10px 2px 14px;
}
.page-title h1{
  margin:0;
  font-size: 34px;
  letter-spacing:.2px;
}
.actions{ display:flex; gap:10px; }

.btn{
  border:1px solid var(--border);
  background:#fff;
  padding:8px 12px;
  border-radius:10px;
  cursor:pointer;
  font-weight:600;
}
.btn:hover{ box-shadow: var(--shadow); }
.btn.primary{
  background: var(--primary);
  border-color: var(--primary);
  color:#fff;
}

.grid{
  display:grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  align-items:start;
}

.card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius:12px;
  box-shadow: 0 1px 0 rgba(16,24,40,.04);
}

.left{ padding:14px; }
.avatar-wrap{ display:flex; justify-content:center; }
.avatar{
  width: 280px;
  height: 170px;
  object-fit:cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background:#111827;
}

.profile h2{
  margin: 12px 0 4px;
  font-size: 22px;
  text-transform: lowercase;
}
.kv{ font-size: 13px; }
.kv div{ padding:3px 0; }
.kv span{ color: var(--muted); margin-right:6px; }
.profile hr{
  border:0;
  border-top:1px solid var(--border);
  margin: 12px 0;
}

.profile h3{
  margin: 0 0 6px;
  font-size: 13px;
  color:#101828;
}
.muted{ color: var(--muted); }

.right{ display:flex; flex-direction:column; gap:14px; }

.section .section-hd{
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  font-weight:800;
  color:#111827;
  background:#fafafa;
  border-top-left-radius:12px;
  border-top-right-radius:12px;
}
.section .section-bd{ padding:12px; }
.section h4{
  margin: 6px 0 8px;
  font-size: 13px;
}
.two-col{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px 18px;
}
.row{ font-size: 13px; color:#111827; }
.row span{ color: var(--muted); margin-left:6px; }

.table-wrap{
  overflow:auto;
  border:1px solid var(--border);
  border-radius:10px;
}
table{
  width:100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
th, td{
  border-bottom:1px solid var(--border);
  padding:8px 10px;
  vertical-align: top;
  white-space: nowrap;
}
th{
  background:#f8fafc;
  text-align:left;
  font-weight:800;
}
tbody tr:last-child td{ border-bottom:0; }

.footer{
  border-top:1px solid var(--border);
  background:#fff;
  padding: 18px;
  color: #667085;
  text-align:center;
}

/* Modal */
.modal.hidden{ display:none; }
.modal{ position:fixed; inset:0; z-index:50; }
.modal-backdrop{
  position:absolute; inset:0;
  background: rgba(0,0,0,.35);
}
.modal-card{
  position:relative;
  max-width: 920px;
  margin: 42px auto;
  background:#fff;
  border-radius: 14px;
  border:1px solid var(--border);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modal-hd{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 12px 14px;
  border-bottom:1px solid var(--border);
  background:#fafafa;
}
.icon-btn{
  border:1px solid var(--border);
  background:#fff;
  border-radius:10px;
  width: 36px;
  height: 32px;
  cursor:pointer;
}
.modal-bd{ padding: 12px 14px; }
.form-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
label{ font-size: 12px; color:#111827; font-weight:700; }
input, textarea{
  width:100%;
  margin-top:6px;
  padding: 9px 10px;
  border:1px solid var(--border);
  border-radius:10px;
  font: inherit;
}
textarea{ resize: vertical; }
.modal-ft{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  padding: 12px 14px;
  border-top:1px solid var(--border);
  background:#fafafa;
}

@media (max-width: 980px){
  .grid{ grid-template-columns: 1fr; }
  .avatar{ width:100%; height:220px; }
  .form-grid{ grid-template-columns: 1fr; }
}