:root{
  --bg: #f7f9fc;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-2: #7c3aed;
  --success: #10b981;
  --border: #e5e7eb;
  --ring: rgba(37,99,235,.35);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial;
  background: radial-gradient(1000px 700px at 10% -10%, #eef2ff 0%, #f7f9fc 60%);
  color:var(--text);
}

.topbar{
  position: sticky; top:0; z-index:50;
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 16px; background:rgba(255,255,255,.8); backdrop-filter:saturate(1.2) blur(8px);
  border-bottom:1px solid var(--border);
}
.brand{display:flex;align-items:center;gap:10px;font-weight:600}
.actions-row{display:flex; gap:8px; align-items:center; flex-wrap:wrap}
.container{max-width:1100px;margin:24px auto;padding:0 16px}

.card{background:var(--card); border:1px solid var(--border); border-radius:16px; padding:16px; margin:12px 0; box-shadow:0 10px 30px rgba(2,8,20,.06)}
.card-header{display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin-bottom:12px}
.card-title{margin:0 0 6px; font-size:20px; font-weight:600}
.grid{display:grid; gap:16px}
.grid.two{grid-template-columns: repeat(2, minmax(0, 1fr))}
.gap{gap:12px}

label{display:block; color:var(--muted); font-size:14px; margin:8px 0}
input, select, textarea{
  width:100%; padding:12px 12px; border-radius:12px; border:1px solid var(--border);
  background:#fff; color:var(--text); outline:none; transition: box-shadow .15s ease, border-color .15s ease;
}
input:focus, select:focus, textarea:focus{ box-shadow:0 0 0 4px var(--ring); border-color:var(--accent) }
.input-with-prefix{display:flex; align-items:center; border:1px solid var(--border); border-radius:12px; overflow:hidden}
.input-with-prefix > span{padding:12px; background:#f3f4f6; color:#374151; border-right:1px solid var(--border)}
.input-with-prefix > input{border:0; border-radius:0}

.hint{color:var(--muted); font-size:12px; margin-top:6px}
.muted{color:var(--muted)}

.actions-row .btn{min-width:110px}

.btn{
  padding:10px 14px; border:1px solid var(--border); background:#fff; color:var(--text);
  border-radius:12px; cursor:pointer; transition: transform .06s ease, box-shadow .15s ease;
  box-shadow: 0 2px 6px rgba(2,8,20,.06);
}
.btn:hover{ transform: translateY(-1px); box-shadow: 0 6px 16px rgba(2,8,20,.08) }
.btn:active{ transform: translateY(0) }
.btn.primary{ background: var(--accent); border-color: var(--accent); color:#fff }
.btn.success{ background: var(--success); border-color: var(--success); color:#fff }
.btn.ghost{ background: transparent }

.spinner{ width:14px; height:14px; border:2px solid #fff; border-right-color:transparent; border-radius:999px; display:inline-block; margin-right:8px; transform: translateY(2px); opacity:0 }
.btn.loading .spinner{ animation: spin .8s linear infinite; opacity:1 }
@keyframes spin{ to { transform: translateY(2px) rotate(360deg) } }

.status-row{display:flex; align-items:center; gap:12px; margin-top:10px}
.status{ color:#374151; font-size:14px }
.progress-wrap{ background:#f3f4f6; border:1px solid var(--border); border-radius:999px; height:10px; flex:1; overflow:hidden }
.progress{ background: linear-gradient(90deg, var(--accent), var(--accent-2)); height:100%; width:0; transition: width .2s ease }

.table-wrap{ overflow:auto; border:1px solid var(--border); border-radius:12px }
.table-modern{ width:100%; border-collapse: separate; border-spacing:0 }
.table-modern thead th{ position: sticky; top:0; background:#fafafa; z-index:1; border-bottom:1px solid var(--border); font-weight:600; text-align:left; padding:12px }
.table-modern tbody td{ padding:12px; border-bottom:1px solid var(--border) }
.table-modern tbody tr:hover{ background:#fafafa }
.table-modern td a{ color: var(--accent); text-decoration:none }
.chip{ padding:6px 10px; border-radius:999px; border:1px solid var(--border); background:#fafafa; color:#111827 }

.toast{
  position: fixed; left:50%; bottom:24px; transform:translateX(-50%);
  background:#111827; color:#fff; padding:10px 14px; border-radius:12px; box-shadow:0 10px 30px rgba(2,8,20,.18);
  opacity:0; pointer-events:none; transition: opacity .2s ease, transform .2s ease;
}
.toast.show{ opacity:1; transform:translateX(-50%) translateY(-4px) }

.footer{ padding:16px 0 40px; color:var(--muted) }
.footer .container{ display:flex; justify-content:center }

@media (max-width: 820px){
  .grid.two{ grid-template-columns: 1fr }
  .actions-row{ justify-content:flex-end }
}
