@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg: #F0F2F0;
  --surface: #ffffff;
  --surface-2: #F7F9F7;
  --ink: #040C10;
  --muted: #5a6b62;
  --line: #DDE4DE;
  --brand: #01EA72;
  --brand2: #22CC98;
  --brand-dark: #039950;
  --brand-soft: #eafaf2;
  --gray: #373D3D;
  --warn: #c0392b;
  --radius: 12px;
  --shadow-sm: 0 1px 4px rgba(4,12,16,.06), 0 4px 16px rgba(4,12,16,.05);
  --shadow: 0 2px 8px rgba(4,12,16,.06), 0 8px 32px rgba(4,12,16,.08);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: 'Work Sans', system-ui, sans-serif; -webkit-font-smoothing: antialiased; line-height: 1.5; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { text-decoration: none; }

.shell { width: min(1140px, calc(100% - 40px)); margin: 0 auto; }

/* TOPBAR */
.topbar { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.94); backdrop-filter: blur(20px); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 900; letter-spacing: .06em; }
.brand-mark { display: flex; align-items: flex-end; gap: 3px; height: 30px; }
.brand-mark span { display: block; width: 7px; border-radius: 2px; background: var(--brand); }
.brand-mark span:nth-child(1) { height: 30px; }
.brand-mark span:nth-child(2) { height: 21px; background: var(--brand2); }
.brand-mark span:nth-child(3) { height: 13px; background: var(--gray); }
.brand small { display: block; margin-top: 1px; color: var(--brand-dark); font-size: 9px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; gap: 8px; }

/* BUTTONS */
.primary-button { display: inline-flex; align-items: center; gap: 6px; background: var(--brand); color: var(--ink); border: none; border-radius: 8px; padding: 10px 20px; font-size: 13px; font-weight: 800; letter-spacing: .04em; transition: all .15s; cursor: pointer; }
.primary-button:hover { background: var(--brand2); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(1,234,114,.3); }
.ghost-button, .link-button { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 9px 16px; font-size: 13px; font-weight: 700; letter-spacing: .03em; transition: all .15s; }
.ghost-button:hover, .link-button:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.btn-add { display: inline-flex; align-items: center; gap: 5px; background: var(--brand-soft); color: var(--brand-dark); border: 1px solid var(--brand); border-radius: 6px; padding: 5px 12px; font-size: 11px; font-weight: 700; transition: all .15s; }
.btn-add:hover { background: var(--brand); color: var(--ink); }
.btn-remove { background: #fff0f0; color: #c0392b; border: 1px solid #fcc; border-radius: 6px; padding: 4px 8px; font-size: 11px; }
.btn-remove:hover { background: #fcc; }

/* HERO */
.hero { padding: 48px 0 20px; }
.hero h1 { font-size: clamp(26px,4vw,44px); font-weight: 900; line-height: 1.05; letter-spacing: -.02em; margin-bottom: 8px; }
.hero p { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* MONTH TABS */
.month-strip { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 28px; scrollbar-width: none; }
.month-strip::-webkit-scrollbar { display: none; }
.month-tab { flex: 0 0 auto; padding: 8px 16px; border-radius: 100px; border: 1.5px solid var(--line); background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; transition: all .15s; display: inline-flex; align-items: center; gap: 5px; }
.month-tab:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.month-tab.active { background: var(--brand); border-color: var(--brand); color: var(--ink); box-shadow: 0 2px 8px rgba(1,234,114,.35); }
.month-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-dark); display: inline-block; flex-shrink: 0; }
.month-tab.active .month-dot { background: rgba(4,12,16,.4); }

/* SECTIONS */
.section { margin: 0 0 32px; }
.section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); }
.section-title::before { content: ''; display: block; width: 3px; height: 18px; border-radius: 2px; background: var(--brand); flex-shrink: 0; }
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.section-subtitle { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }

/* CARDS */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }

/* GRID */
.grid { display: grid; gap: 12px; }
.grid-4 { grid-template-columns: repeat(4,1fr); }
.grid-2 { grid-template-columns: repeat(2,1fr); }

/* METRICS */
.metric { padding: 20px 22px; position: relative; overflow: hidden; }
.metric::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--metric-color, var(--brand)); }
.metric-label { font-size: 9px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.metric-value { font-size: 28px; font-weight: 900; line-height: 1; color: var(--metric-color, var(--brand)); letter-spacing: -.01em; }
.metric-sub { margin-top: 8px; font-size: 11px; color: var(--muted); font-weight: 500; }
.metric.insta::before { background: #E1306C; }
.metric.insta .metric-value { color: var(--ink); font-size: 24px; }

/* TABLES */
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13px; }
thead tr { border-bottom: 1px solid var(--line); background: var(--surface-2); }
th { padding: 11px 16px; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); text-align: left; }
td { padding: 13px 16px; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 500; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
td.numeric, th.numeric { text-align: right; font-variant-numeric: tabular-nums; }

/* ROI GRID */
.roi-grid { display: grid; grid-template-columns: repeat(3,1fr); margin-top: 12px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.roi-cell { padding: 16px 20px; background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.roi-cell:nth-child(3n) { border-right: none; }
.roi-cell:nth-last-child(-n+3) { border-bottom: none; }
.roi-label { font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.roi-value { font-size: 18px; font-weight: 900; color: var(--ink); }
.roi-value.green { color: var(--brand-dark); }

/* ANALYSIS */
.analysis { padding: 24px 28px; line-height: 1.85; white-space: pre-line; font-size: 14px; border-left: 4px solid var(--brand); background: linear-gradient(to right, var(--brand-soft) 0%, var(--surface) 60%); }

/* EMPTY */
.empty { padding: 64px 24px; text-align: center; color: var(--muted); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.empty-icon { font-size: 40px; margin-bottom: 14px; opacity: .6; display: block; }
.empty p { font-size: 15px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.empty small { font-size: 13px; }

/* LOGIN */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 60% 30%, rgba(1,234,114,.1) 0%, transparent 60%), var(--bg); }
.login-card { width: min(420px,100%); padding: 40px; border-radius: 20px; box-shadow: var(--shadow); }
.login-card .brand { justify-content: center; margin-bottom: 28px; font-size: 20px; }
.login-card h1 { font-size: 26px; font-weight: 900; margin-bottom: 6px; text-align: center; }
.login-card > p { color: var(--muted); font-size: 13px; margin-bottom: 28px; text-align: center; }

/* FORMS */
.form-grid { display: grid; gap: 14px; }
label { display: grid; gap: 7px; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
input, textarea, select { width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 13px; transition: border-color .15s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(1,234,114,.12); }
textarea { min-height: 100px; resize: vertical; }

/* ALERTS */
.error { padding: 12px 16px; border-radius: 8px; background: #fef2f2; border: 1px solid #fecaca; color: var(--warn); font-size: 13px; font-weight: 600; }
.notice { padding: 12px 16px; border-radius: 8px; background: var(--brand-soft); border: 1px solid var(--brand); color: var(--brand-dark); font-size: 13px; font-weight: 700; }
.divider { border: none; border-top: 1px solid var(--line); margin: 24px 0; }

/* ADMIN */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; gap: 16px; padding-bottom: 60px; align-items: start; }
.admin-panel { padding: 22px; }
.admin-panel h2 { font-size: 16px; font-weight: 800; margin-bottom: 18px; color: var(--ink); }
.admin-fields { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.fieldset-title { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); padding: 16px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }

/* REPEATER TABLES */
.table-rep-wrap { overflow-x: auto; margin-bottom: 8px; }
.rep-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 400px; }
.rep-table th { background: var(--surface-2); color: var(--muted); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; font-weight: 700; }
.rep-table td { padding: 6px 6px; border-bottom: 1px solid var(--line); }
.rep-table input, .rep-table select { padding: 6px 8px; font-size: 12px; width: 100%; border-radius: 6px; }
.rep-table td:last-child { width: 40px; text-align: center; }

/* RESPONSIVE */
@media (max-width: 920px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .grid-2, .admin-layout, .roi-grid { grid-template-columns: 1fr; }
  .admin-fields { grid-template-columns: 1fr 1fr; }
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 12px 0; }
  .metric-value { font-size: 22px; }
}
@media (max-width: 560px) {
  .shell { width: calc(100% - 24px); }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .admin-fields { grid-template-columns: 1fr; }
}
