:root{
  --bg1:#0b1220;
  --bg2:#0f1b33;
  --card: rgba(255,255,255,.06);
  --card2: rgba(255,255,255,.08);
  --border: rgba(255,255,255,.12);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.65);
  --shadow: 0 18px 50px rgba(0,0,0,.45);
  --radius: 18px;

  --primary: #4aa3ff;
  --danger: #ff4d6d;
  --warn: #ffcc66;
  --info: #5dd6ff;
  --purple: #b58cff;
  --success: #4ce6a1;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  color:var(--text);
}

.bg{
  background:
    radial-gradient(1100px 600px at 20% -10%, rgba(74,163,255,.35), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(255,77,109,.25), transparent 55%),
    radial-gradient(900px 600px at 50% 110%, rgba(181,140,255,.20), transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  min-height:100%;
}

.container{
  max-width: 1120px;
  margin: 22px auto;
  padding: 0 14px 40px;
}

.glass{
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.card{
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.h2{ margin: 0 0 12px; font-size: 18px; }

.muted{ color: var(--muted); }
.small{ font-size: 12px; }

.row{ display:flex; align-items:center; }
.row.gap{ gap:10px; }
.row.between{ justify-content: space-between; }
.grow{ flex: 1; }

.topbar{
  position: sticky;
  top:0;
  z-index: 20;
  background: rgba(11,18,32,.6);
  border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(12px);
}
.topbar-inner{
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 14px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap:10px;
}
.topbar-left, .topbar-right{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }

.appname{
  display:flex; align-items:center; gap:10px;
  text-decoration:none; color:var(--text);
  font-weight: 700;
}
.logo-sm{
  width: 34px; height:34px; display:grid; place-items:center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(74,163,255,.35), rgba(255,77,109,.25));
  border: 1px solid rgba(255,255,255,.12);
}

.pill{
  display:inline-flex; align-items:center; justify-content:center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  font-size: 12px;
  white-space: nowrap;
}
.pill-soft{ background: rgba(255,255,255,.05); }
.pill-warn{ background: rgba(255,204,102,.16); border-color: rgba(255,204,102,.22); }
.pill-info{ background: rgba(93,214,255,.16); border-color: rgba(93,214,255,.22); }
.pill-purple{ background: rgba(181,140,255,.16); border-color: rgba(181,140,255,.22); }
.pill-success{ background: rgba(76,230,161,.16); border-color: rgba(76,230,161,.22); }

.btn{
  appearance:none; border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 14px;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex; align-items:center; justify-content:center;
  gap:8px;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.btn:hover{ transform: translateY(-1px); background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.18); }
.btn:active{ transform: translateY(0); }
.btn.disabled{ opacity:.45; pointer-events:none; }

.btn-sm{ padding: 8px 10px; border-radius: 12px; font-size: 13px; }
.btn-lg{ padding: 14px 16px; border-radius: 16px; font-size: 16px; }
.btn-ghost{ background: rgba(255,255,255,.04); }
.btn-primary{
  background: rgba(74,163,255,.18);
  border-color: rgba(74,163,255,.32);
}
.btn-primary:hover{ background: rgba(74,163,255,.24); border-color: rgba(74,163,255,.45); }
.btn-danger{
  background: rgba(255,77,109,.16);
  border-color: rgba(255,77,109,.34);
}
.btn-danger:hover{ background: rgba(255,77,109,.22); border-color: rgba(255,77,109,.48); }
.w-100{ width:100%; }

.input{
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.20);
  color: var(--text);
  outline: none;
}
.input:focus{ border-color: rgba(74,163,255,.6); box-shadow: 0 0 0 4px rgba(74,163,255,.12); }
textarea.input{ resize: vertical; }

.label{
  display:block;
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 6px;
}

.alert{
  padding: 12px;
  border-radius: 14px;
  margin: 12px 0;
  border: 1px solid rgba(255,255,255,.12);
}
.alert-danger{
  background: rgba(255,77,109,.14);
  border-color: rgba(255,77,109,.28);
}
.list-ul{ margin: 0; padding-left: 18px; }

.list{ display:grid; gap: 14px; margin-top: 14px; }

.task-card{ padding: 16px; }
.task-head{ display:flex; justify-content: space-between; align-items:flex-start; gap:12px; }
.task-id{ font-size: 20px; font-weight: 800; }
.badges{ display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.task-body{ margin-top: 12px; }
.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.task-actions{
  display:flex; gap:10px; flex-wrap:wrap;
  margin-top: 14px;
}
.meta-row{
  margin-top: 12px;
  display:flex; justify-content: space-between; gap:10px;
  flex-wrap: wrap;
}

.empty{
  text-align:center;
  padding: 26px;
  margin-top: 14px;
}
.empty h2{ margin: 0 0 8px; }
.empty p{ margin: 0 0 14px; color: var(--muted); }

.empty-sm{
  padding: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  color: var(--muted);
}

.table-wrap{ overflow:auto; margin-top: 12px; }
.table{
  width:100%;
  border-collapse: collapse;
  min-width: 760px;
}
.table th, .table td{
  text-align:left;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.table th{ color: var(--muted); font-weight: 700; }

.pagination{ display:flex; justify-content:flex-end; gap:10px; margin-top: 12px; }

.grid{ display:grid; gap:14px; }
.filters{ grid-template-columns: repeat(4, 1fr); }
.col2{ grid-column: span 2; }
.col4{ grid-column: span 4; }

.form-grid{ grid-template-columns: repeat(4, 1fr); }
.task-page{ grid-template-columns: 1.3fr .7fr; }
.logs{ grid-column: span 2; }

.hint{
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.auth-wrap{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding: 18px;
}
.auth-card{
  width: min(430px, 100%);
  padding: 18px;
}
.brand{
  display:flex; align-items:center; gap:12px;
  margin-bottom: 14px;
}
.logo{
  width: 46px; height:46px; border-radius: 16px;
  display:grid; place-items:center;
  font-weight: 900;
  background: linear-gradient(135deg, rgba(74,163,255,.35), rgba(255,77,109,.25));
  border: 1px solid rgba(255,255,255,.14);
}
.title{ font-weight: 900; font-size: 18px; }
.sub{ color: var(--muted); font-size: 12px; margin-top: 2px; }

.pdf-box{
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  margin-bottom: 12px;
}
.pdf-name{ margin: 6px 0 10px; }

.timeline{ margin-top: 10px; }
.log-item{
  display:grid;
  grid-template-columns: 14px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.log-dot{
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(74,163,255,.85);
  margin-top: 6px;
  box-shadow: 0 0 0 4px rgba(74,163,255,.14);
}
.log-details{
  margin: 10px 0 0;
  padding: 10px;
  border-radius: 14px;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.10);
  overflow:auto;
  max-height: 240px;
  font-size: 12px;
  color: rgba(255,255,255,.82);
  white-space: pre-wrap;
}

.toast{
  position: fixed;
  right: 14px;
  top: 72px;
  z-index: 40;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.toast-success{ border-color: rgba(76,230,161,.35); }
.toast-danger{ border-color: rgba(255,77,109,.45); }

@media (max-width: 980px){
  .task-page{ grid-template-columns: 1fr; }
  .logs{ grid-column: auto; }
}

@media (max-width: 760px){
  .filters{ grid-template-columns: repeat(2, 1fr); }
  .col2{ grid-column: span 2; }
  .col4{ grid-column: span 2; }
  .form-grid{ grid-template-columns: repeat(2, 1fr); }

  .grid2{ grid-template-columns: 1fr; }
  .task-actions .btn{ width: 100%; }
  .topbar-right .btn{ width: 100%; }
}
