:root{
  --bg:#0b0f19;
  --panel:#0f172a;
  --panel2:#111c36;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --line:rgba(255,255,255,.08);
  --good:#22c55e;
  --warn:#f59e0b;
  --bad:#ef4444;
  --accent:#60a5fa;
  --accent2:#a78bfa;
  --chip:rgba(96,165,250,.18);
  --shadow: 0 12px 40px rgba(0,0,0,.45);
  --r: 18px;
  --r2: 22px;
  --font: ui-sans-serif, system-ui, -apple-system, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}
*{box-sizing:border-box}
body{
  margin:0; font-family:var(--font); color:var(--text);
  background: radial-gradient(1200px 800px at 10% 0%, rgba(96,165,250,.20), transparent 60%),
              radial-gradient(900px 600px at 90% 10%, rgba(167,139,250,.18), transparent 55%),
              linear-gradient(180deg, #070a12, #0b0f19 45%, #070a12);
  min-height:100vh;
}
a{color:inherit}
button, input, select, textarea{font-family:inherit}
.app{
  display:flex; min-height:100vh;
}
.sidebar{
  width:280px; padding:18px;
  border-right:1px solid var(--line);
  background: rgba(15,23,42,.52);
  backdrop-filter: blur(10px);
  position:sticky; top:0; height:100vh;
}
.brand{
  display:flex; align-items:center; gap:12px; padding:12px; border-radius:var(--r2);
  background: linear-gradient(135deg, rgba(96,165,250,.18), rgba(167,139,250,.14));
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: var(--shadow);
}
.logo{
  width:40px;height:40px;border-radius:14px;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.35), transparent 40%),
              linear-gradient(135deg, rgba(96,165,250,.9), rgba(167,139,250,.9));
  display:grid; place-items:center;
  border:1px solid rgba(255,255,255,.18);
}
.logo span{
  font-weight:900; letter-spacing:-.04em;
  color:#0b0f19;
}
.brand h1{font-size:14px; margin:0}
.brand p{margin:2px 0 0; color:var(--muted); font-size:12px}
.nav{margin-top:16px; display:flex; flex-direction:column; gap:8px}
.nav button{
  width:100%; text-align:left; border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  color:var(--text); padding:12px 12px;
  border-radius:14px; cursor:pointer;
  display:flex; align-items:center; justify-content:space-between;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
.nav button:hover{transform: translateY(-1px); background: rgba(255,255,255,.05); border-color: rgba(96,165,250,.35)}
.nav button.active{
  background: linear-gradient(135deg, rgba(96,165,250,.16), rgba(167,139,250,.12));
  border-color: rgba(96,165,250,.55);
}
.pill{
  font-size:11px; color:var(--muted);
  padding:4px 8px; border-radius:999px;
  background: rgba(255,255,255,.04);
  border:1px solid var(--line);
}
.sidebar-footer{
  position:absolute; left:18px; right:18px; bottom:18px;
  padding:12px; border-radius:16px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
}
.sidebar-footer .row{display:flex; justify-content:space-between; align-items:center; gap:10px}
.small{font-size:12px; color:var(--muted)}
.content{flex:1; padding:22px; max-width:1200px; margin:0 auto}
.topbar{
  display:flex; justify-content:space-between; align-items:center; gap:12px;
  margin-bottom:16px;
}
.title{display:flex; flex-direction:column; gap:4px}
.title h2{margin:0; font-size:18px}
.title .sub{color:var(--muted); font-size:12px}
.actions{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.btn{
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  color:var(--text);
  padding:10px 12px;
  border-radius:14px;
  cursor:pointer;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
  display:inline-flex; align-items:center; gap:8px;
}
.btn:hover{transform: translateY(-1px); border-color: rgba(96,165,250,.35); background: rgba(255,255,255,.06)}
.btn.primary{
  border-color: rgba(96,165,250,.55);
  background: linear-gradient(135deg, rgba(96,165,250,.22), rgba(167,139,250,.16));
}
.btn.danger{border-color: rgba(239,68,68,.5); background: rgba(239,68,68,.10)}
.btn.good{border-color: rgba(34,197,94,.5); background: rgba(34,197,94,.10)}
.grid{
  display:grid; gap:14px;
  grid-template-columns: repeat(12, 1fr);
}
.card{
  grid-column: span 12;
  border:1px solid var(--line);
  background: rgba(15,23,42,.55);
  border-radius: var(--r2);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.card .hd{
  padding:14px 14px 10px;
  border-bottom:1px solid var(--line);
  display:flex; justify-content:space-between; align-items:center; gap:10px;
  background: rgba(255,255,255,.02);
}
.card .hd h3{margin:0; font-size:14px}
.card .hd .meta{color:var(--muted); font-size:12px}
.card .bd{padding:14px}
.kpis{display:grid; gap:12px; grid-template-columns: repeat(12, 1fr);}
.kpi{
  grid-column: span 3;
  border:1px solid var(--line);
  border-radius: 18px;
  padding:12px;
  background: rgba(255,255,255,.03);
}
.kpi .label{font-size:12px; color:var(--muted)}
.kpi .val{font-size:20px; font-weight:800; margin-top:6px}
.kpi .hint{font-size:11px; color:var(--muted); margin-top:6px}
.chip{
  display:inline-flex; align-items:center; gap:6px;
  padding:6px 10px; border-radius:999px;
  border:1px solid rgba(96,165,250,.35);
  background: var(--chip);
  font-size:12px;
}
.row{display:flex; gap:12px; flex-wrap:wrap}
.field{display:flex; flex-direction:column; gap:8px; min-width: 220px; flex:1; margin-bottom:16px}
label{font-size:12px; color:var(--muted)}
input, select, textarea{
  width:100%;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.2);
  color: var(--text);
  outline: none;
}
textarea{min-height:120px; resize:vertical}
.table{
  width:100%;
  border-collapse: collapse;
  overflow:hidden;
  border-radius: 16px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.02);
}
.table th, .table td{
  padding:10px 10px;
  border-bottom:1px solid var(--line);
  font-size:12px;
  text-align:left;
  vertical-align: top;
}
.table th{color:var(--muted); font-weight:600; background: rgba(255,255,255,.03)}
.right{text-align:right}
.status{
  font-size:12px; padding:6px 10px; border-radius:999px; display:inline-flex; gap:6px; align-items:center;
  border:1px solid var(--line); background: rgba(255,255,255,.03);
}
.dot{width:8px;height:8px;border-radius:99px;background: var(--muted)}
.s-draft .dot{background: var(--muted)}
.s-scheduled .dot{background: var(--accent)}
.s-sending .dot{background: var(--warn)}
.s-done .dot{background: var(--good)}
.s-failed .dot{background: var(--bad)}
.split{
  display:grid; grid-template-columns: 1fr 1fr; gap:14px;
}
.muted{color:var(--muted)}
.hr{height:1px; background: var(--line); margin:12px 0}
.toast{
  position: fixed; right: 16px; bottom: 16px;
  background: rgba(15,23,42,.9);
  border:1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  max-width: 360px;
  display:none;
}
.toast.show{display:block}
.toast .t{font-weight:700; font-size:13px}
.toast .m{font-size:12px; color:var(--muted); margin-top:6px; line-height:1.4}
.modal{
  position: fixed; inset:0; display:none; place-items:center;
  background: rgba(0,0,0,.55);
  padding:16px;
}
.modal.show{display:grid}
.modal-card{
  width:min(720px, 100%);
  max-height:90vh;
  border-radius: 22px;
  border:1px solid var(--line);
  background: rgba(15,23,42,.92);
  box-shadow: var(--shadow);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.modal-card .hd{padding:14px; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; align-items:center; gap:10px; flex-shrink:0}
.modal-card .bd{padding:14px; overflow-y:auto; flex:1}
.mono{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size:12px}
.progress{
  height:10px; border-radius:999px; background: rgba(255,255,255,.06);
  border:1px solid var(--line); overflow:hidden;
}
.bar{
  height:100%; width:0%;
  background: linear-gradient(90deg, rgba(96,165,250,.9), rgba(167,139,250,.9));
  border-radius:999px;
}
.login-wrap{
  min-height:100vh; display:grid; place-items:center; padding:20px;
}
.login{
  width:min(440px, 100%);
  border-radius: 22px;
  border:1px solid var(--line);
  background: rgba(15,23,42,.72);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.login .hd{padding:16px; border-bottom:1px solid var(--line)}
.login .bd{padding:16px}
.hintbox{
  padding:12px; border-radius:16px;
  border:1px solid rgba(96,165,250,.35);
  background: rgba(96,165,250,.12);
  color: #dbeafe;
  font-size:12px; line-height:1.45;
}
.mobile-header{
  display:none;
  padding:14px 18px;
  background: rgba(15,23,42,.92);
  border-bottom:1px solid var(--line);
  position:sticky;
  top:0;
  z-index:100;
  align-items:center;
  justify-content:space-between;
  backdrop-filter: blur(10px);
}
.mobile-header .brand-mobile{
  display:flex;
  align-items:center;
  gap:10px;
}
.hamburger{
  width:40px;
  height:40px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  border-radius:12px;
  cursor:pointer;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:5px;
  padding:10px;
}
.hamburger span{
  width:20px;
  height:2px;
  background:var(--text);
  border-radius:2px;
  transition: all .3s ease;
}
.sidebar-overlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.6);
  z-index:199;
}
.sidebar-overlay.show{
  display:block;
}
.section-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  min-height:44px;
}
.section-header > div:first-child{
  flex:1;
}

@media (max-width: 980px){
  .mobile-header{display:flex}
  .sidebar{
    position:fixed;
    top:0;
    left:-280px;
    height:100vh;
    z-index:200;
    transition: left .3s ease;
  }
  .sidebar.open{
    left:0;
  }
  .content{padding:16px}
  .kpi{grid-column: span 6}
  .split{grid-template-columns: 1fr}
  .topbar{margin-top:0}
}
@media (max-width: 520px){
  .kpi{grid-column: span 12}
  .btn{width:100%; justify-content:center}
  .actions{width:100%}
}
