/* Growora dashboard - tema claro premium estilo SaaS */
:root {
  --bg: #f4f5fa;
  --surface: #ffffff;
  --surface-2: #fbfbfe;
  --border: #ececf3;
  --border-strong: #e2e2ec;
  --text: #14151a;
  --text-2: #5b5d6b;
  --text-3: #9698a6;
  --primary: #7c5cff;
  --primary-600: #6a45ff;
  --primary-soft: #f1ecff;
  --green: #18a957;
  --green-soft: #e6f7ee;
  --amber: #e0941a;
  --red: #e0483d;
  --blue: #2f6bff;
  --pink: #e1306c;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(20,21,26,.04), 0 8px 24px rgba(20,21,26,.05);
  --shadow-sm: 0 1px 2px rgba(20,21,26,.05);
  --sidebar-w: 256px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.ic { width: 20px; height: 20px; flex: none; }
.ic-sm { width: 16px; height: 16px; flex: none; }
.ic-brand { width: 20px; height: 20px; color: #fff; }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none; background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 20px 14px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #8a6bff, #6a45ff);
  box-shadow: 0 6px 16px rgba(124,92,255,.4);
}
.brand-text strong { display: block; font-size: 15px; font-weight: 800; letter-spacing: -.2px; }
.brand-text span { font-size: 11.5px; color: var(--text-3); }

/* ---------- nav ---------- */
.nav { padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-item, .nav-sub-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px;
  border-radius: 10px; color: var(--text-2); font-weight: 500; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.nav-item span, .nav-sub-item span { white-space: nowrap; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-600); font-weight: 600; }
.nav-item.active svg { color: var(--primary); }
.nav-group .nav-sub { display: none; flex-direction: column; gap: 2px; margin: 2px 0 2px 18px;
  padding-left: 10px; border-left: 1.5px solid var(--border); }
.nav-group.open .nav-sub { display: flex; }
.nav-sub-item { padding: 8px 10px; font-size: 13px; }
.nav-sub-item:hover { background: var(--surface-2); color: var(--text); }
.nav-sub-item svg { width: 17px; height: 17px; color: var(--text-3); }

/* ---------- sidebar footer ---------- */
.sidebar-footer { margin-top: auto; padding: 12px; border-top: 1px solid var(--border); }
.badge-dry {
  font-size: 11px; font-weight: 600; color: var(--amber); background: #fdf3e2;
  border: 1px solid #f6e3c2; padding: 6px 10px; border-radius: 8px; text-align: center; margin-bottom: 10px;
}
.user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.user:hover { background: var(--surface-2); }
.avatar { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg,#8a6bff,#6a45ff);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.user-text { flex: 1; min-width: 0; }
.user-text strong { display: block; font-size: 13px; }
.user-text span { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.user-logout { color: var(--text-3); display: grid; place-items: center; }
.user-logout:hover { color: var(--red); }

/* ---------- topbar ---------- */
.topbar {
  height: 64px; flex: none; display: flex; align-items: center; gap: 16px;
  padding: 0 28px; background: var(--bg); position: sticky; top: 0; z-index: 5;
}
.search {
  flex: 1; max-width: 520px; display: flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
  padding: 9px 14px; color: var(--text-3);
}
.search input { border: none; outline: none; background: transparent; flex: 1; font-size: 13.5px; color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.btn-ghost { display: inline-flex; align-items: center; gap: 7px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 13px; font-size: 13px;
  font-weight: 500; color: var(--text-2); cursor: pointer; }
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); }
.btn-icon { width: 38px; height: 38px; display: grid; place-items: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; color: var(--text-2); cursor: pointer; }
.btn-icon:hover { color: var(--text); }

/* ---------- content ---------- */
.content { padding: 8px 28px 40px; }
.page-head { margin: 6px 0 22px; }
.page-head h1 { font-size: 23px; font-weight: 800; letter-spacing: -.4px; margin: 0; }
.page-head p { color: var(--text-2); margin: 4px 0 0; font-size: 13.5px; }
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: none; cursor: pointer;
  border-radius: 10px; padding: 10px 16px; font-size: 13.5px; font-weight: 600; font-family: inherit; }
.btn-primary { background: linear-gradient(135deg,#8a6bff,#6a45ff); color: #fff;
  box-shadow: 0 6px 16px rgba(124,92,255,.32); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-light { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-light:hover { border-color: var(--border-strong); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }
.btn-danger { background: #fdeceb; color: var(--red); border: 1px solid #f7d4d1; }
.btn-danger:hover { background: #fbdedb; }

/* ---------- cards & grid ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px 20px; }
.card-title { font-size: 15px; font-weight: 700; margin: 0; letter-spacing: -.2px; }
.card-sub { color: var(--text-3); font-size: 12.5px; margin: 2px 0 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px;
  border-bottom: 1px solid var(--border); }

.grid { display: grid; gap: 18px; }
.kpis { grid-template-columns: repeat(4, 1fr); }
.cols-3 { grid-template-columns: 1.15fr .9fr .95fr; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-31 { grid-template-columns: 2fr 1fr; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2,1fr); } .cols-3, .cols-2, .cols-31 { grid-template-columns: 1fr; } }

/* ---------- KPI ---------- */
.kpi { padding: 18px 20px; }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi .kpi-label { color: var(--text-2); font-size: 13px; font-weight: 500; }
.kpi .kpi-val { font-size: 27px; font-weight: 800; letter-spacing: -.6px; margin-top: 6px; }
.kpi .kpi-sub { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.trend { font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 7px; }
.trend.up { color: var(--green); background: var(--green-soft); }
.kpi-hero { background: linear-gradient(135deg, #7d5cff 0%, #6a45ff 60%, #5b34f0 100%); color: #fff; border: none; }
.kpi-hero .kpi-label, .kpi-hero .kpi-sub { color: rgba(255,255,255,.8); }
.kpi-hero .pill { background: rgba(255,255,255,.22); color: #fff; }
.kpi-hero-stats { display: flex; gap: 22px; margin-top: 14px; }
.kpi-hero-stats div strong { font-size: 19px; font-weight: 800; display: block; }
.kpi-hero-stats div span { font-size: 11.5px; color: rgba(255,255,255,.8); }

.spark { margin-top: 14px; height: 44px; width: 100%; }

/* ---------- pills / badges ---------- */
.pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; display: inline-flex; align-items: center; gap: 5px; }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-grey { background: #eff0f5; color: var(--text-2); }
.pill-amber { background: #fdf3e2; color: var(--amber); }
.pill-red { background: #fdeceb; color: var(--red); }
.pill-purple { background: var(--primary-soft); color: var(--primary-600); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--green); }

/* ---------- list rows ---------- */
.row-list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 13px; padding: 13px 20px; border-top: 1px solid var(--border); }
.row:first-child { border-top: none; }
.row-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-600); flex: none; }
.row-ico.fb { background: #e9f0ff; color: var(--blue); }
.row-ico.ig { background: #fdecf3; color: var(--pink); }
.row-main { flex: 1; min-width: 0; }
.row-main strong { font-size: 13.5px; font-weight: 600; display: block; }
.row-main span { font-size: 12px; color: var(--text-3); }
.row-meta { color: var(--text-3); font-size: 12px; text-align: right; white-space: nowrap; }

/* ---------- activity ---------- */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); }
.feed-item:first-child { border-top: none; }
.feed-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2);
  border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-2); flex: none; }
.feed-item .feed-body strong { font-size: 13px; font-weight: 500; color: var(--text); display: block; }
.feed-item .feed-body span { font-size: 11.5px; color: var(--text-3); }

/* ---------- table ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-3); padding: 12px 20px; border-bottom: 1px solid var(--border); }
.table td { padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table .t-name { font-weight: 600; }

/* ---------- modules / toggles ---------- */
.module { display: flex; align-items: center; gap: 13px; padding: 13px 20px; border-top: 1px solid var(--border); }
.module:first-child { border-top: none; }
.module .row-main strong { font-size: 13.5px; }
.switch { position: relative; width: 40px; height: 23px; flex: none; }
.switch input { display: none; }
.switch .track { position: absolute; inset: 0; background: #d8d9e3; border-radius: 20px; transition: background .18s; cursor: pointer; }
.switch .track::after { content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .18s; }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(17px); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; flex-wrap: wrap; }
.tab { padding: 11px 14px; font-size: 13.5px; font-weight: 600; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.tab.active { color: var(--primary-600); border-color: var(--primary); }

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px;
  font-family: inherit; font-size: 13.5px; background: var(--surface); color: var(--text); outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field .hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.field-row { display: flex; gap: 12px; }
.field-row > * { flex: 1; }
textarea { resize: vertical; min-height: 80px; }
.checks { display: flex; gap: 16px; flex-wrap: wrap; }
.checks label { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text); font-weight: 500; }

/* ---------- progress ---------- */
.progress { height: 7px; background: #ececf3; border-radius: 6px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg,#8a6bff,#6a45ff); border-radius: 6px; }

/* ---------- misc ---------- */
.muted { color: var(--text-3); }
.empty { text-align: center; padding: 40px 20px; color: var(--text-3); }
.empty svg { width: 36px; height: 36px; margin-bottom: 10px; color: var(--border-strong); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline { display: inline; }
.tag { font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  padding: 3px 9px; border-radius: 7px; }
.taglist { display: flex; flex-wrap: wrap; gap: 6px; }
.kv { display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13px; }
.kv:first-child { border-top: none; }
.kv span { color: var(--text-3); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background:
  radial-gradient(900px 500px at 50% -10%, #efeaff, transparent), var(--bg); }
.login-card { width: 380px; max-width: 92vw; background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; box-shadow: var(--shadow); padding: 34px 30px; }
.login-card .brand { padding: 0 0 18px; justify-content: center; }
.login-card h1 { font-size: 19px; margin: 0 0 4px; text-align: center; }
.login-card p.sub { text-align: center; color: var(--text-3); margin: 0 0 22px; font-size: 13px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 6px; }
.alert { background: #fdeceb; border: 1px solid #f7d4d1; color: var(--red); padding: 10px 13px;
  border-radius: 10px; font-size: 13px; margin-bottom: 14px; }

/* modal-ish details */
details.box { border: 1px solid var(--border); border-radius: 12px; margin-top: 10px; background: var(--surface-2); }
details.box > summary { cursor: pointer; padding: 11px 14px; font-weight: 600; font-size: 13px; list-style: none; }
details.box > summary::-webkit-details-marker { display: none; }
details.box .box-body { padding: 4px 14px 14px; }
