* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #555555;
  --primary-dark: #434343;
  --green: #7f7f7f;
  --yellow: #848484;
  --red: #4d4d4d;
  --blue: #7c7c7c;
  --bg: #f4f4f4;
  --card: #ffffff;
  --border: #e4e4e4;
  --text: #181818;
  --muted: #727272;
}
body { font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--blue); }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 12px; }
.error-text { color: var(--red); font-size: 13px; margin-top: 8px; min-height: 16px; }

.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #555555, #535353); }
.login-card { background: #fff; padding: 40px 32px; border-radius: 16px; width: 360px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-card .logo { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.login-sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; line-height: 1.5; }
.login-card input { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px; margin-bottom: 12px; }

.app { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: #181818; color: #fff; padding: 20px 14px; display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; }
.sidebar .logo { font-size: 20px; font-weight: 800; padding: 0 8px 20px; }
.sidebar nav { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a { display: block; padding: 11px 12px; border-radius: 10px; cursor: pointer; font-size: 14px; color: #d4d4d4; }
.sidebar nav a:hover { background: #272727; }
.sidebar nav a.active { background: var(--primary); color: #fff; font-weight: 600; }
.sidebar-bottom { padding-top: 12px; }

.main { flex: 1; margin-left: 240px; padding: 20px 28px 60px; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 6px 0 18px; position: relative; }
.topbar-title { font-size: 22px; font-weight: 700; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn { position: relative; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; cursor: pointer; font-size: 16px; }
.badge { position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff; font-size: 11px; border-radius: 10px; padding: 1px 6px; font-weight: 700; }

.notif-panel { position: absolute; right: 28px; top: 56px; width: 380px; max-height: 70vh; overflow-y: auto; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.15); z-index: 50; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: 0; }
.notif-item .t { font-weight: 600; font-size: 14px; }
.notif-item .m { font-size: 13px; color: var(--muted); margin: 3px 0; }
.notif-item .d { font-size: 11px; color: #a2a2a2; }
.notif-item.unread { background: #f7f7f7; }

.tab { display: none; }
.tab.active { display: block; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin-bottom: 18px; }
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.stat .v { font-size: 28px; font-weight: 800; }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 4px; }
.stat.accent .v { color: var(--primary); }
.stat.green .v { color: var(--green); }
.stat.blue .v { color: var(--blue); }
.stat.orange .v { color: var(--yellow); }

.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters select, .filters input, .filters textarea, .field input, .field select { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; background: #fff; }
.filters textarea { flex: 1 1 100%; min-width: 260px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field input, .field select { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; }
.field input[type=checkbox] { width: 22px; height: 22px; }

.btn { background: #fff; border: 1px solid var(--border); color: var(--text); padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn:hover { background: #fafafa; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-red { background: #fff; border-color: #d5d5d5; color: var(--red); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; border-color: #404040; color: #d4d4d4; }
.btn-ghost:hover { background: #272727; }

.posts-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.post-card { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: #fff; }
.post-card .img { aspect-ratio: 4/5; background: #eee center/cover no-repeat; position: relative; cursor: pointer; }
.post-card .img video { width: 100%; height: 100%; object-fit: cover; }
.post-card .body { padding: 12px 14px; }
.post-card .cap { font-size: 13px; color: #404040; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 8px; }
.post-card .meta { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.post-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status.pending { background: #f2f2f2; color: #4e4e4e; }
.status.approved { background: #f4f4f4; color: #515151; }
.status.changes_requested { background: #f2f2f2; color: #4e4e4e; }
.status.rejected { background: #e8e8e8; color: #363636; }

.clients-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.client-card { border: 1px solid var(--border); border-radius: 14px; padding: 18px; background: #fff; }
.client-card .head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.client-avatar { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, #555555, #535353); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; }
.client-card .name { font-weight: 700; }
.client-card .ig { font-size: 13px; color: var(--blue); }
.client-card .info { font-size: 13px; color: var(--muted); margin: 3px 0; }
.client-card .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.progress { height: 8px; background: #e4e4e4; border-radius: 99px; overflow: hidden; margin: 8px 0; }
.progress .fill { height: 100%; background: var(--green); border-radius: 99px; }
.progress .fill.warn { background: var(--yellow); }
.progress .fill.danger { background: var(--red); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--border); color: var(--muted); font-size: 12px; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table tr:hover td { background: #fafafa; }

.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal { background: #fff; border-radius: 16px; padding: 24px; width: 560px; max-width: 100%; max-height: 90vh; overflow-y: auto; }
.modal h3 { margin-bottom: 16px; }
.modal .form-grid { margin-bottom: 8px; }
.modal .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.upload-zone { border: 2px dashed var(--border); border-radius: 12px; padding: 28px; text-align: center; cursor: pointer; color: var(--muted); font-size: 14px; }
.upload-zone img { max-width: 100%; max-height: 220px; border-radius: 10px; margin-top: 10px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #181818; color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 14px; z-index: 200; box-shadow: 0 8px 30px rgba(0,0,0,.3); max-width: 90vw; }
.toast a { color: #b6b6b6; }

.kw-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); font-size: 14px; padding: 20px; text-align: center; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid #ccc; border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 860px) {
  .sidebar { position: static; width: 100%; flex-direction: row; align-items: center; padding: 10px; overflow-x: auto; }
  .sidebar nav { flex-direction: row; }
  .sidebar .logo { padding: 0 12px 0 0; font-size: 16px; }
  .sidebar-bottom { padding: 0; }
  .app { flex-direction: column; }
  .main { margin-left: 0; padding: 14px; }
  .notif-panel { right: 14px; left: 14px; width: auto; }
}
:root { --primary:#646464; --primary-dark:#535353; --bg:#f7f7f7; --border:#e6e6e6; --text:#252525; --muted:#6f6f6f; }
body,input,button,select,textarea { font-family:-apple-system,sans-serif; }
:focus-visible { outline:3px solid #979797; outline-offset:3px; }
.sidebar { background:#fff; border-right:1px solid var(--border); color:var(--text); width:236px; padding:30px 18px; }
.logo { display:flex; align-items:center; gap:10px; letter-spacing:-.5px; }
.logo-mark { display:inline-grid; place-items:center; width:32px; height:32px; background:var(--primary); color:#fff; border-radius:10px; font-size:24px; font-weight:700; }
.sidebar .logo { font-size:18px; padding:0 8px 42px; }
.sidebar nav { gap:7px; }
.sidebar nav a { font-size:13px; padding:12px 16px; color:var(--muted); font-weight:500; }
.sidebar nav a::before { display:inline-block; width:24px; font-size:16px; color:#969696; }
.sidebar nav a[data-tab=dashboard]::before { content:'◫'; }
.sidebar nav a[data-tab=posts]::before { content:'▧'; }
.sidebar nav a[data-tab=clients]::before { content:'♧'; }
.sidebar nav a[data-tab=report]::before { content:'≡'; }
.sidebar nav a[data-tab=config]::before { content:'⚙'; }
.sidebar nav a:hover { background:#f7f7f7; }
.sidebar nav a.active { background:#ededed; color:var(--primary); }
.sidebar nav a.active::before { color:var(--primary); }
.btn-ghost { color:var(--muted); border-color:var(--border); }
.btn-ghost:hover { background:#f4f4f4; }
.main { margin-left:236px; padding:22px 36px 60px; max-width:1600px; }
.topbar { padding-bottom:20px; margin-bottom:28px; border-bottom:1px solid var(--border); }
.topbar-title { font-size:14px; font-weight:600; }
.welcome { margin-bottom:28px; }
.eyebrow { font-size:10px; letter-spacing:.14em; color:var(--primary); font-weight:700; }
.welcome h1 { font-size:28px; font-weight:600; letter-spacing:-1px; margin:10px 0; }
.welcome p { font-size:13px; color:var(--muted); line-height:1.7; }
.stats-grid { gap:12px; grid-template-columns:repeat(5,minmax(0,1fr)); margin-bottom:24px; }
.stat { padding:20px; border-radius:12px; }
.stat .v { font-size:28px; font-weight:600; letter-spacing:-1px; }
.stat .l { font-size:11px; margin-top:8px; }
.stat.green .v { color:#676767; } .stat.orange .v { color:#737373; }
.card { border-radius:14px; padding:22px; box-shadow:0 2px 4px #25252502; }
.card-title { font-size:14px; font-weight:600; }
.btn { font-size:12px; font-weight:600; padding:10px 14px; border-radius:8px; transition:background .15s; }
.btn-sm { font-size:11px; padding:7px 10px; }
.btn-red { color:#6d6d6d; border-color:#e2e2e2; }
.posts-list { gap:20px; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); }
.post-card { border-radius:12px; }
.post-card .body { padding:16px; }
.post-card .cap { font-size:13px; line-height:1.6; font-weight:500; }
.post-card .meta { line-height:1.9; font-size:11px; }
.status { font-size:10px; font-weight:600; }
.status.changes_requested { background:#ebebeb; color:#5e5e5e; }
.status.approved { background:#efefef; color:#5a5a5a; }
.post-actions { padding-top:12px; border-top:1px solid var(--border); }
.post-actions .btn:nth-child(2) { background:#eeeeee; color:var(--primary); border-color:#eeeeee; }
.client-avatar { background:#ebebeb; color:var(--primary); border-radius:14px; font-size:18px; }
.client-card .name { font-size:14px; }
.client-card .info,.client-card .ig { font-size:12px; line-height:1.7; }
.client-card .actions { margin-top:20px; }
.login-wrap { background:radial-gradient(ellipse at 50% 10%,#ebebeb,transparent 65%),#f7f7f7; padding:20px; }
.login-card { border:1px solid var(--border); border-radius:20px; width:400px; padding:38px; box-shadow:0 16px 50px #25252508; text-align:left; }
.login-card .logo { font-size:23px; margin-bottom:18px; }
.login-sub { margin-bottom:28px; }
.modal { border-radius:18px; padding:28px; box-shadow:0 24px 80px #25252520; }
.modal-back { background:#25252566; backdrop-filter:blur(4px); }
.field label { line-height:1.6; }
.upload-zone { background:#f9f9f9; padding:24px; line-height:1.7; }
.notif-panel { border-radius:12px; box-shadow:0 15px 40px #25252515; }
@media(max-width:1100px) { .stats-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } .main { padding:22px; } }
@media(max-width:860px) {
 .sidebar { width:100%; padding:14px; display:block; border-right:0; border-bottom:1px solid var(--border); overflow:visible; }
 .sidebar .logo { padding:0 0 16px; } .sidebar nav { display:flex; overflow-x:auto; flex-direction:row; gap:4px; padding-bottom:2px; } .sidebar nav a { flex-shrink:0; padding:10px; font-size:12px; }
 .sidebar-bottom { position:absolute; right:16px; top:17px; } .sidebar-bottom .btn { padding:7px 12px; }
 .main { margin-left:0; padding:20px 16px 40px; } .topbar { margin-bottom:22px; } .welcome h1 { font-size:25px; }
 .stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .stat:last-child { grid-column:1/-1; }
 .card { padding:16px; } .filters select { flex:1; min-width:140px; } .clients-grid { grid-template-columns:1fr; } .modal { padding:22px; }
 .posts-list { grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); }
}
@media(prefers-reduced-motion:reduce) { * { transition:none!important; animation:none!important; } }
.sidebar nav a { display:flex; align-items:center; gap:12px; }
.sidebar nav a::before { display:none; }
.sidebar nav svg,.icon-btn svg { width:18px; height:18px; flex-shrink:0; vertical-align:middle; }

.logo-mark { width:38px; height:32px; font-size:13px; font-weight:700; letter-spacing:-.6px; flex-shrink:0; }

.post-history { margin-top:24px; padding-top:20px; border-top:1px solid var(--border); }
.post-history h3 { font-size:13px; margin-bottom:16px; font-weight:600; }
.post-history ol { list-style:none; padding:0 0 0 9px; margin:0; }
.post-history li { position:relative; border-left:1px solid var(--border); padding:0 0 20px 18px; font-size:12px; }
.post-history li::before { content:''; width:7px; height:7px; border-radius:50%; background:#646464; position:absolute; left:-4px; top:4px; }
.history-meta,.history-transition { color:var(--muted); font-size:11px; margin-top:5px; line-height:1.6; }
.post-history p { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.6; margin-top:8px; }
.history-empty,.decision-hint { font-size:12px; color:var(--muted); line-height:1.7; }
.client-card a.btn,.client-detail-head a.btn { text-decoration:none; display:inline-flex; align-items:center; }
.client-detail-head { display:flex; justify-content:space-between; align-items:center; gap:20px; flex-wrap:wrap; margin:24px 0; }
.client-detail-head h1 { font-size:28px; letter-spacing:-.7px; font-weight:600; }
.client-detail-head p { color:var(--muted); font-size:13px; margin-top:6px; overflow-wrap:anywhere; }
.approval-meter { height:6px; background:#eee; border-radius:8px; margin:18px 0 12px; overflow:hidden; }
.approval-meter span { display:block; height:100%; background:#111; }
.client-detail-columns { display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:24px; align-items:start; }
.detail-filters { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:18px; }
.client-activity h2 { font-size:16px; font-weight:600; }
.client-activity ol { list-style:none; margin:22px 0; padding:0; }
.client-activity li { padding:0 0 22px 15px; margin-left:3px; border-left:1px solid #ddd; overflow-wrap:anywhere; }
.client-activity strong { display:block; font-size:12px; margin:8px 0; }
.client-activity li p { font-size:12px; white-space:pre-wrap; line-height:1.6; margin-top:8px; }
.activity-post { background:none; border:0; padding:0; font:inherit; font-size:12px; text-align:left; cursor:pointer; text-decoration:underline; text-underline-offset:3px; }
@media(max-width:1100px) { .client-detail-columns { grid-template-columns:1fr; } }
.sidebar-bottom { display:flex; flex-direction:column; gap:8px; }
#tab-team h1 { font-size:28px; letter-spacing:-.7px; }
#tab-team .clients-grid { margin-top:24px; }
@media(max-width:860px) { .sidebar-bottom { flex-direction:row; gap:6px; } .sidebar-bottom .btn { white-space:nowrap; font-size:11px; } }
