:root {
  --bg: #080c12;
  --surface: #0f151f;
  --surface-2: #141c28;
  --surface-3: #192331;
  --line: #253044;
  --line-soft: #1c2635;
  --text: #f5f8fb;
  --muted: #91a0b3;
  --green: #39f0a0;
  --green-2: #22c982;
  --red: #ff6677;
  --yellow: #f6c454;
  --blue: #5ca9ff;
  --sidebar: 246px;
  --radius: 18px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 5%, rgba(57,240,160,.07), transparent 26%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.025em; }
.muted { color: var(--muted); }
.eyebrow { color: var(--green); font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.brand { color: #fff; font-size: 25px; font-weight: 950; letter-spacing: -.06em; }
.brand span { color: var(--green); }
.brand.large { font-size: 34px; }
.subtitle, .tagline { color: #65748a; font-size: 9px; font-weight: 900; letter-spacing: .16em; margin-top: 4px; }
.tagline { color: var(--green); margin-top: 15px; }

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 10% 20%, #103329 0, transparent 31%),
    radial-gradient(circle at 90% 80%, #182e45 0, transparent 33%),
    #090d14;
}
.login-shell {
  width: min(940px, 100%);
  min-height: 555px;
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: 0 35px 100px rgba(0,0,0,.45);
}
.login-hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 50px;
  background:
    linear-gradient(145deg, rgba(11,17,25,.88), rgba(16,37,31,.94)),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(255,255,255,.02) 40px);
}
.login-hero h1 { max-width: 520px; margin: 44px 0 18px; font-size: clamp(39px, 5vw, 58px); line-height: 1.01; }
.login-hero p { max-width: 520px; color: #a4b1c2; font-size: 16px; line-height: 1.7; }
.platforms { display: flex; gap: 9px; flex-wrap: wrap; }
.platforms span { padding: 8px 11px; border: 1px solid #294239; border-radius: 999px; color: #a9b7c8; font-size: 11px; font-weight: 800; }
.login-panel { display: flex; flex-direction: column; justify-content: center; padding: 45px; }
.login-panel h2 { margin: 10px 0 8px; font-size: 29px; }
.stack-form { display: grid; gap: 17px; margin-top: 27px; }
label { display: grid; gap: 8px; color: #b7c2d0; font-size: 12px; font-weight: 700; }
input, select, textarea {
  width: 100%;
  min-height: 47px;
  padding: 0 14px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  background: #0a1018;
  transition: border .2s, box-shadow .2s;
}
textarea { min-height: 105px; padding-top: 13px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(57,240,160,.10); }
.secure-note { margin-top: 22px; color: #748296; font-size: 11px; text-align: center; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }

.button {
  min-height: 43px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 850;
  font-size: 12px;
  transition: transform .15s, border-color .15s, background .15s;
}
.button:hover { transform: translateY(-1px); }
.button.primary { color: #07110d; background: var(--green); box-shadow: 0 9px 24px rgba(57,240,160,.15); }
.button.primary:hover { background: #54f5b1; }
.button.ghost { color: #c5cfda; border-color: var(--line); background: var(--surface-2); }
.form-error { padding: 11px 13px; color: #ff9aa5; border: 1px solid rgba(255,102,119,.25); border-radius: 10px; background: rgba(255,102,119,.08); font-size: 12px; line-height: 1.4; }

.app-view { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 26px 18px 20px;
  border-right: 1px solid var(--line-soft);
  background: rgba(11,16,24,.96);
  backdrop-filter: blur(18px);
}
.sidebar-top { padding: 0 10px 29px; border-bottom: 1px solid var(--line-soft); }
.nav { display: grid; gap: 7px; margin-top: 24px; }
.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 13px;
  color: #8e9caf;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 750;
}
.nav-item b { width: 22px; color: #6f7d90; font-size: 16px; text-align: center; }
.nav-item:hover { color: #d9e1e9; background: #121a25; }
.nav-item.active { color: #fff; border-color: #244338; background: linear-gradient(90deg, rgba(57,240,160,.13), rgba(57,240,160,.03)); }
.nav-item.active b { color: var(--green); }
.sidebar-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.user-card { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 9px; }
.user-card > div:last-child { min-width: 0; }
.user-card strong { display: block; overflow: hidden; color: #e6ebf1; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.user-card span { display: block; margin-top: 4px; color: var(--green); font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.avatar { width: 34px; height: 34px; display: grid; flex: 0 0 auto; place-items: center; color: #07110d; border-radius: 10px; background: var(--green); font-weight: 950; }
.logout-button { width: 100%; margin-top: 6px; padding: 9px; color: #78879a; border: 0; background: transparent; font-size: 11px; }
.logout-button:hover { color: #ff9aa5; }

.main-wrap { min-height: 100vh; margin-left: var(--sidebar); }
.topbar {
  height: 94px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(8,12,18,.75);
  backdrop-filter: blur(14px);
}
.topbar h1 { margin: 5px 0 0; font-size: 24px; }
.live { margin-left: auto; padding: 8px 11px; color: #a3b2c4; border: 1px solid var(--line); border-radius: 999px; font-size: 9px; font-weight: 900; letter-spacing: .1em; }
.live span { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px var(--green); }
.menu-button { display: none; color: var(--text); border: 0; background: transparent; font-size: 21px; }
.content { max-width: 1500px; margin: 0 auto; padding: 32px 34px 60px; }
.welcome-row, .toolbar, .section-title, .modal-head, .modal-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.welcome-row { margin-bottom: 23px; }
.welcome-row h2, .toolbar h2 { margin: 0 0 7px; font-size: 24px; }
.welcome-row p, .toolbar p { margin: 0; font-size: 12px; }
.toolbar { margin-bottom: 22px; }
.select-label { min-width: 190px; }
.select-label select { margin-top: 2px; }
.filter-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr)) minmax(220px, 1.6fr) auto;
  align-items: end;
  gap: 11px;
  margin-bottom: 14px;
  padding: 15px;
  border: 1px solid var(--line-soft);
  border-radius: 15px;
  background: rgba(15,21,31,.88);
}
.filter-bar input, .filter-bar select { min-height: 40px; }
.filter-bar .button { min-height: 40px; }
.check-label.compact { min-height: 40px; align-self: end; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: #0a1018; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 14px; }
.metric-card {
  position: relative;
  min-height: 148px;
  overflow: hidden;
  padding: 21px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--surface-2), var(--surface));
}
.metric-card::after { content: ""; position: absolute; width: 100px; height: 100px; right: -45px; bottom: -55px; border-radius: 50%; background: var(--accent, var(--green)); filter: blur(35px); opacity: .13; }
.metric-label { color: #8290a3; font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.metric-value { margin-top: 20px; font-size: clamp(25px, 3vw, 36px); font-weight: 900; letter-spacing: -.045em; }
.metric-foot { margin-top: 7px; color: #65748a; font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; }
.card { padding: 21px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: linear-gradient(145deg, rgba(20,28,40,.94), rgba(14,20,30,.98)); box-shadow: 0 18px 45px rgba(0,0,0,.10); }
.card.span-two { min-height: 410px; }
.section-title { align-items: flex-start; padding-bottom: 17px; border-bottom: 1px solid var(--line-soft); }
.section-title h3 { margin: 6px 0 0; font-size: 17px; }
.text-button { color: var(--green); border: 0; background: transparent; font-size: 11px; font-weight: 800; }
.pill { padding: 6px 9px; color: var(--green); border: 1px solid #265040; border-radius: 999px; background: rgba(57,240,160,.05); font-size: 8px; font-weight: 900; text-transform: uppercase; }

.video-list { display: grid; }
.video-row { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 16px 2px; border-bottom: 1px solid var(--line-soft); }
.video-row:last-child { border-bottom: 0; }
.rank { width: 29px; height: 29px; display: grid; place-items: center; color: var(--green); border: 1px solid #284137; border-radius: 9px; background: rgba(57,240,160,.05); font-size: 11px; font-weight: 900; }
.video-copy { min-width: 0; }
.video-copy strong { display: block; overflow: hidden; color: #e8edf3; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.video-copy span { display: block; margin-top: 5px; color: #718095; font-size: 9px; text-transform: uppercase; }
.video-stat { text-align: right; }
.video-stat strong { display: block; font-size: 13px; }
.video-stat span { color: #68778b; font-size: 9px; }
.platform-summary { display: grid; gap: 11px; padding-top: 18px; }
.platform-row { padding: 14px; border: 1px solid var(--line-soft); border-radius: 13px; background: #101721; }
.platform-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 11px; font-weight: 850; }
.platform-head span:last-child { color: #aab6c5; }
.progress { height: 5px; overflow: hidden; border-radius: 999px; background: #202b39; }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.brief-box { padding-top: 18px; }
.brief-box strong { display: block; margin-bottom: 9px; font-size: 14px; }
.brief-box p { margin: 0; color: #8e9caf; font-size: 12px; line-height: 1.65; }

.account-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.account-card { position: relative; padding: 21px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); }
.account-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.platform-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: #172231; font-weight: 950; text-transform: uppercase; }
.platform-icon.youtube { color: #ff6677; }
.platform-icon.instagram { color: #d78cff; }
.platform-icon.tiktok { color: #6de9f2; }
.platform-icon.facebook { color: #65a6ff; }
.account-card h3 { margin: 18px 0 5px; font-size: 16px; }
.account-card .handle { color: #738297; font-size: 11px; }
.account-number { margin-top: 23px; font-size: 27px; font-weight: 900; }
.account-number span { display: block; margin-top: 5px; color: #65748a; font-size: 9px; font-weight: 750; letter-spacing: .09em; }
.badge { padding: 6px 8px; color: #8290a3; border: 1px solid var(--line); border-radius: 999px; font-size: 8px; font-weight: 850; }
.badge.own { color: var(--green); border-color: #265040; }
.sync-actions { display: flex; align-items: center; gap: 12px; }
.sync-actions .muted { max-width: 260px; font-size: 10px; text-align: right; }
.sync-line { display: flex; align-items: center; gap: 7px; min-height: 34px; margin-top: 17px; padding-top: 13px; overflow: hidden; color: #76859a; border-top: 1px solid var(--line-soft); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.sync-line i { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #65748a; }
.sync-line.ok i { background: var(--green); box-shadow: 0 0 8px rgba(57,240,160,.6); }
.sync-line.error { color: #ff9aa5; }
.sync-line.error i { background: var(--red); }
.sync-badge { display: inline-block; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: #8b99aa; font-size: 8px; font-weight: 850; }
.sync-badge.ok { color: var(--green); border-color: #265040; }
.sync-badge.error { color: #ff9aa5; border-color: rgba(255,102,119,.3); }
.form-hint { margin: -8px 0 18px; color: #718095; font-size: 10px; line-height: 1.5; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 13px; border-bottom: 1px solid var(--line-soft); text-align: left; white-space: nowrap; }
th { color: #69788c; font-size: 9px; letter-spacing: .09em; text-transform: uppercase; }
td { color: #bec8d4; font-size: 11px; }
td strong { color: #edf2f7; }
tr:last-child td { border-bottom: 0; }
.table-title { max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.platform-chip { display: inline-block; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: #aeb9c7; font-size: 8px; font-weight: 850; text-transform: uppercase; }
.external-link { color: var(--green); text-decoration: none; }

.comments-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.comment-card { padding: 20px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: linear-gradient(145deg, rgba(20,28,40,.94), rgba(14,20,30,.98)); }
.comment-meta, .comment-foot { display: flex; align-items: center; gap: 9px; }
.comment-meta strong { margin-left: auto; color: #ff8b9a; font-size: 12px; }
.comment-card blockquote { margin: 20px 0; color: #e8edf3; font-size: 15px; font-weight: 650; line-height: 1.55; }
.comment-foot { justify-content: space-between; }
.comment-foot > div { min-width: 0; }
.comment-foot strong, .comment-foot span { display: block; }
.comment-foot strong { font-size: 11px; }
.comment-foot span { margin-top: 4px; color: #718095; font-size: 9px; }
.comment-video { margin-top: 15px; padding-top: 13px; overflow: hidden; color: #76859a; border-top: 1px solid var(--line-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.empty-state { padding: 42px 15px; color: #718095; text-align: center; font-size: 12px; }
.empty-state b { display: block; margin-bottom: 7px; color: #b9c4d0; font-size: 14px; }
.skeleton { height: 14px; margin: 13px 0; overflow: hidden; border-radius: 7px; background: #182230; }
.skeleton::after { content: ""; display: block; width: 45%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { transform: translateX(-120%); } to { transform: translateX(260%); } }

.modal { width: min(560px, calc(100% - 30px)); padding: 0; color: var(--text); border: 1px solid var(--line); border-radius: 20px; background: #0e151f; box-shadow: 0 30px 100px rgba(0,0,0,.6); }
.modal::backdrop { background: rgba(3,6,10,.75); backdrop-filter: blur(7px); }
.modal form { padding: 24px; }
.modal-head h2 { margin: 6px 0 0; }
.icon-button { width: 35px; height: 35px; color: #9eabba; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); font-size: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin: 23px 0; }
.form-grid .wide { grid-column: 1 / -1; }
.check-label { display: flex; align-items: center; gap: 9px; }
.check-label input { width: 16px; min-height: 16px; accent-color: var(--green); }
.modal-actions { justify-content: flex-end; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.toast { position: fixed; z-index: 80; right: 20px; bottom: 20px; max-width: 340px; padding: 13px 15px; color: #07110d; border-radius: 11px; background: var(--green); box-shadow: 0 15px 45px rgba(0,0,0,.3); font-size: 12px; font-weight: 800; opacity: 0; transform: translateY(14px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { color: white; background: #d84d60; }
.mobile-overlay { display: none; }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .account-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-bar { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-hero { min-height: 350px; padding: 34px; }
  .login-hero h1 { margin-top: 30px; }
  .login-panel { padding: 34px; }
  .sidebar { transform: translateX(-102%); transition: transform .22s; }
  .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-left: 0; }
  .menu-button { display: block; }
  .mobile-overlay { position: fixed; z-index: 15; inset: 0; background: rgba(0,0,0,.55); }
  .mobile-overlay.show { display: block; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .comments-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 20px; }
  .content { padding: 24px 20px 50px; }
}
@media (max-width: 590px) {
  .login-view { padding: 0; }
  .login-shell { min-height: 100vh; border: 0; border-radius: 0; }
  .login-hero { min-height: 300px; padding: 28px; }
  .login-hero h1 { font-size: 36px; }
  .login-panel { padding: 28px; }
  .metric-grid, .account-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 130px; }
  .welcome-row, .toolbar { align-items: flex-start; flex-direction: column; }
  .sync-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .sync-actions .muted { max-width: none; text-align: left; }
  .toolbar .button, .select-label { width: 100%; }
  .live { padding: 7px 8px; font-size: 0; }
  .live span { margin: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .filter-bar { grid-template-columns: 1fr; }
}
