:root {
  --bg: #eef1fb; --card: #fff; --line: #e4e8f3; --text: #1b2236; --muted: #6b7489;
  --primary: #5b5bf6; --primary2: #8b5cf6; --ok: #16a34a; --err: #e5383b; --warn: #d98a00; --radius: 18px;
  --grad: linear-gradient(135deg, #5b5bf6 0%, #8b5cf6 55%, #c056f0 100%);
}
* { box-sizing: border-box; }
body {
  margin: 0; color: var(--text); font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(139, 92, 246, .18), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(56, 189, 248, .16), transparent 60%),
    var(--bg);
}
header { background: var(--grad); color: #fff; padding: 22px 24px 70px; box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .15); }
.brand { max-width: 1500px; margin: 0 auto; font-weight: 800; font-size: 22px; letter-spacing: .2px; }
.brand span { display: block; font-weight: 400; font-size: 14px; opacity: .85; margin-top: 2px; }
main { max-width: 1500px; margin: -52px auto 0; padding: 0 16px 60px; display: grid; gap: 20px; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid rgba(255, 255, 255, .7); border-radius: var(--radius); padding: 22px; min-width: 0; box-shadow: 0 10px 30px rgba(40, 50, 110, .08); }
h2 { margin: 0 0 16px; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.head h2 { margin: 0; }
.head input { width: 280px; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 14px; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px;
  background: #f7f8fd; transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(91, 91, 246, .14); }
input[type=file] { padding: 8px; background: #fff; border-style: dashed; cursor: pointer; }
input[type=file]::file-selector-button {
  border: 0; border-radius: 8px; padding: 7px 12px; margin-right: 10px; background: #eef0ff; color: var(--primary); font: inherit; font-weight: 700; cursor: pointer;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }
details { margin: -4px 0 14px; }
summary { cursor: pointer; color: var(--primary); font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--text);
  border-radius: 12px; padding: 10px 18px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .12s, box-shadow .15s, border-color .15s, filter .15s;
}
.btn:hover { border-color: #c5cbe0; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(40, 50, 110, .10); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(108, 92, 246, .35); }
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 8px 22px rgba(108, 92, 246, .45); }
form > .btn.primary { width: 100%; padding: 13px; font-size: 16px; }
.btn.danger { color: var(--err); }
.btn.danger:hover { background: #fff3f3; border-color: #f5c2c3; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .55; cursor: wait; transform: none; }
.hint { font-size: 13px; margin: -4px 0 14px; padding: 10px 12px; background: linear-gradient(135deg, #f1f0ff, #f5f9ff); border: 1px solid #e3e1ff; border-radius: 11px; }
.hint:empty { display: none; }
.meta { font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); font-weight: 400; }
.err { color: var(--err); font-size: 13px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #eef0ff; color: var(--primary); vertical-align: 2px; }
.tag.warn { background: #fff4e0; color: var(--warn); }
.tag.ok { background: #e7f8ee; color: var(--ok); }
.hidden { display: none !important; }
.bar { height: 10px; background: #edf0f8; border-radius: 99px; overflow: hidden; margin-top: 16px; }
#barIn { height: 100%; width: 0; background: var(--grad); border-radius: 99px; transition: width .4s; }
#progText { margin-top: 6px; }
pre#log { background: #12162b; color: #c7d0e6; font-size: 12px; padding: 12px 14px; border-radius: 12px; max-height: 220px; overflow: auto; white-space: pre-wrap; word-break: break-all; margin: 10px 0 0; }
pre#log:empty { display: none; }
.box { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; margin-top: 14px; }
.box.ok { background: linear-gradient(135deg, #ecfbf2, #f3fff8); border: 1px solid #bfeccf; }
.box.err { background: #fff0f0; border: 1px solid #f6c6c7; }
.box > div { flex: 1; min-width: 0; }
.copyrow { display: flex; gap: 6px; margin-top: 8px; align-items: center; }
.copyrow input { padding: 6px 10px; font-size: 13px; background: #fff; border-radius: 10px; }
.list { display: grid; gap: 10px; margin-top: 18px; }
.applist { display: grid; gap: 12px; }
@media (min-width: 1100px) { .applist { grid-template-columns: repeat(auto-fill, minmax(560px, 1fr)); } .applist > .empty { grid-column: 1 / -1; } }
.item { display: flex; gap: 14px; align-items: flex-start; border: 1px solid var(--line); border-radius: 15px; padding: 14px; min-width: 0; background: #fff; transition: box-shadow .15s, border-color .15s; }
.item:hover { border-color: #d6dbee; box-shadow: 0 6px 18px rgba(40, 50, 110, .08); }
.item .main { flex: 1; min-width: 0; }
.item .title { font-weight: 700; font-size: 16px; }
.acts { display: flex; flex-direction: column; gap: 6px; }
.appic { width: 60px; height: 60px; border-radius: 15px; object-fit: cover; flex: none; box-shadow: 0 3px 10px rgba(0, 0, 0, .15); }
.appic.none { display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 800; font-size: 24px; }
.empty { color: var(--muted); text-align: center; padding: 26px; border: 2px dashed var(--line); border-radius: 15px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: #eef0f8; border-radius: 13px; margin-bottom: 14px; }
.seg button { border: 0; background: transparent; padding: 9px; border-radius: 10px; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.seg button.on { background: #fff; color: var(--primary); box-shadow: 0 2px 8px rgba(40, 50, 110, .12); }
label .sub { font-weight: 400; font-size: 12px; color: var(--muted); }
header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
header .brand { margin: 0; flex: 1; }
.logout { border: 1px solid rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .15); color: #fff; border-radius: 10px; padding: 7px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.logout:hover { background: rgba(255, 255, 255, .25); }
.login-wrap { display: flex; justify-content: center; margin: -52px 16px 60px; }
.login { width: 100%; max-width: 380px; }
.login .btn { width: 100%; padding: 12px; }
.login .err { margin-top: 10px; min-height: 18px; text-align: center; }
