/* URLHOST Social Agent – premium theme (light + dark). Loaded after app.v12.css. */
:root {
  --brand: #16A34A;
  --brand-hover: #15803D;
  --accent: #22C55E;
  --grad: linear-gradient(135deg, #22C55E 0%, #16A34A 45%, #0E7A3A 100%);
  --grad-soft: linear-gradient(135deg, rgba(34, 197, 94, .14), rgba(22, 163, 74, .06));
  --ground: #F4F8F5;
  --card: #FFFFFF;
  --card-2: #F8FBF9;
  --line: #E1ECE5;
  --line-soft: #EEF4F0;
  --text: #0B2A1D;
  --muted: #5B7066;
  --mint: #E7F6EC;
  --input: #FFFFFF;
  --input-line: #D3E3D9;
  --shadow-sm: 0 1px 2px rgba(11, 42, 29, .05), 0 2px 8px -4px rgba(11, 42, 29, .08);
  --shadow: 0 1px 2px rgba(11, 42, 29, .04), 0 12px 32px -18px rgba(11, 42, 29, .28);
  --shadow-lg: 0 30px 60px -30px rgba(11, 42, 29, .35);
  --glow: 0 10px 30px -10px rgba(34, 197, 94, .55);
  --side-bg: rgba(255, 255, 255, .78);
  --side-text: #24433A;
  --side-muted: #6E857B;
  --side-hover: rgba(22, 163, 74, .08);
  --radius-lg: 22px;
  --radius: 14px;
  --radius-sm: 10px;
  --display: 'Sora', 'Segoe UI', system-ui, sans-serif;
  --body: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
}
html[data-theme="dark"] {
  --brand: #22C55E;
  --brand-hover: #4ADE80;
  --accent: #4ADE80;
  --grad-soft: linear-gradient(135deg, rgba(34, 197, 94, .16), rgba(34, 197, 94, .04));
  --ground: #06110C;
  --card: rgba(255, 255, 255, .045);
  --card-2: rgba(255, 255, 255, .03);
  --line: rgba(255, 255, 255, .09);
  --line-soft: rgba(255, 255, 255, .06);
  --text: #E7F5EC;
  --muted: #94AFA2;
  --mint: rgba(34, 197, 94, .12);
  --deep: #E7F5EC;
  --input: rgba(255, 255, 255, .05);
  --input-line: rgba(255, 255, 255, .12);
  --success-bg: rgba(34, 197, 94, .14);
  --error-bg: rgba(239, 68, 68, .14);
  --error: #FCA5A5;
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, .04) inset;
  --shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 18px 40px -24px rgba(0, 0, 0, .8);
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, .9);
  --glow: 0 10px 34px -8px rgba(34, 197, 94, .55);
  --side-bg: rgba(8, 22, 15, .82);
  --side-text: #D5EBDD;
  --side-muted: #7F9A8C;
  --side-hover: rgba(255, 255, 255, .05);
  color-scheme: dark;
}

/* Page */
body {
  background:
    radial-gradient(900px 600px at 105% -10%, rgba(34, 197, 94, .14), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(22, 163, 74, .10), transparent 60%),
    var(--ground);
  background-attachment: fixed;
  color: var(--text);
  letter-spacing: -.005em;
}
html[data-theme="dark"] body {
  background:
    radial-gradient(900px 600px at 105% -10%, rgba(34, 197, 94, .18), transparent 60%),
    radial-gradient(800px 600px at -10% 110%, rgba(16, 185, 129, .10), transparent 60%),
    var(--ground);
  background-attachment: fixed;
}
a { color: var(--brand); }
a:hover { color: var(--brand-hover); }
h1 { font-size: 30px; letter-spacing: -.02em; }
h1, h2, h3 { color: var(--text); }
.muted, .hint { color: var(--muted); }
::selection { background: rgba(34, 197, 94, .3); }

/* Sidebar */
.sidebar {
  background: var(--side-bg);
  color: var(--side-text);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  gap: 26px;
  padding: 24px 16px;
}
.brand-mark { background: var(--grad); box-shadow: var(--glow); border-radius: 13px; }
.brand-name { color: var(--text); font-family: var(--display); letter-spacing: -.01em; }
.brand-sub { color: var(--side-muted); }
.nav { gap: 3px; }
.nav-link { color: var(--side-text); border-radius: 12px; padding: 10px 12px; font-weight: 600; transition: background .15s, color .15s, transform .15s; }
.nav-link .icon { opacity: .75; }
.nav-link:hover { background: var(--side-hover); color: var(--text); }
.nav-link.is-active { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.nav-link.is-active .icon { opacity: 1; }
.nav-badge { background: var(--accent); color: #05301A; }
.nav-link.is-active .nav-badge { background: rgba(255, 255, 255, .25); color: #fff; }
.nav-badge-soft { background: var(--mint); color: var(--brand); }
.nav-link.is-active .nav-badge-soft { background: rgba(255, 255, 255, .25); color: #fff; }
.agent-card { background: var(--card-2); border: 1px solid var(--line); color: var(--side-muted); border-radius: 16px; box-shadow: var(--shadow-sm); }
.agent-row, a.agent-row { color: var(--text); }
.logout { color: var(--side-muted); }
.logout:hover { color: var(--text); }
.credit-warn { color: #D97706; }
html[data-theme="dark"] .credit-warn { color: #FCD34D; }

/* Theme switch */
.theme-switch { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--line-soft); border: 1px solid var(--line); }
.theme-switch button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: transparent; color: var(--side-muted); font: 700 12px var(--body); padding: 7px 8px; border-radius: 999px; cursor: pointer; transition: background .15s, color .15s; }
.theme-switch button .icon { width: 15px; height: 15px; }
.theme-switch button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: var(--shadow-sm); }
html[data-theme="dark"] .theme-switch button[aria-pressed="true"] { background: rgba(255, 255, 255, .1); }

/* Main */
.main { padding: 34px 44px 64px; gap: 22px; }
.page-head h1 { background: linear-gradient(90deg, var(--text), color-mix(in srgb, var(--text) 70%, var(--brand))); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Panels & cards */
.panel, .stat, .h-card, .idea-card, .save-bar, .story-card, .provider-card, .login-card {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.panel { border-radius: var(--radius-lg); padding: 26px; }
html[data-theme="dark"] .panel, html[data-theme="dark"] .stat, html[data-theme="dark"] .idea-card, html[data-theme="dark"] .h-card, html[data-theme="dark"] .story-card { backdrop-filter: blur(10px); }
.panel-title { font-size: 17px; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.panel-title .icon { width: 30px; height: 30px; padding: 6px; border-radius: 10px; background: var(--grad-soft); color: var(--brand); margin: 0; }
.stat { border-radius: 18px; }
.stat-value { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.idea-card { border-radius: 16px; transition: border-color .15s, transform .15s, box-shadow .15s; }
.idea-card:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); transform: translateY(-1px); }
.idea-edit, .caption-box { background: var(--card-2); border: 1px solid var(--line-soft); }
.h-card:hover { box-shadow: var(--shadow-lg); }
.version-history li.is-current { background: var(--mint); }
.post-row.is-selected { background: var(--mint); }
.post-row { color: var(--text); }

/* Buttons */
.btn { border-radius: 12px; transition: transform .12s, box-shadow .15s, background .15s, color .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--glow); border-color: transparent; }
.btn-primary:hover { background: var(--grad); filter: brightness(1.06); color: #fff; box-shadow: 0 14px 34px -10px rgba(34, 197, 94, .7); }
.btn-outline { background: var(--card); color: var(--text); border-color: var(--input-line); }
.btn-outline:hover { background: var(--mint); color: var(--text); border-color: var(--brand); }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { background: var(--line-soft); color: var(--text); }
.link-btn { color: var(--brand); }
.link-btn:hover { color: var(--brand-hover); }

/* Forms */
.field input, .field textarea, .field select, .history-search input, .history-tools select {
  background: var(--input); color: var(--text); border: 1px solid var(--input-line); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(34, 197, 94, .18); outline: none; }
.field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
html[data-theme="dark"] .field select option { background: #0B1C14; color: var(--text); }
.field input[type="file"] { background: var(--card-2); }
.color-field input[type="color"] { background: var(--input); border-color: var(--input-line); }
.switch-ui { background: color-mix(in srgb, var(--muted) 45%, transparent); }

/* Chips, pills, tabs */
.chip { background: var(--mint); color: var(--text); border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent); }
.chip-date, .chip-layout { background: var(--line-soft); }
.pill { letter-spacing: .02em; }
.pill-posted { background: var(--grad); color: #fff; }
html[data-theme="dark"] .pill-pending { background: rgba(255, 255, 255, .08); color: #CFE0D6; }
html[data-theme="dark"] .pill-generating, html[data-theme="dark"] .pill-revising, html[data-theme="dark"] .pill-posting { background: rgba(96, 165, 250, .16); color: #BFDBFE; }
html[data-theme="dark"] .pill-review { background: rgba(251, 191, 36, .16); color: #FDE68A; }
html[data-theme="dark"] .pill-approved { background: rgba(34, 197, 94, .18); color: #BBF7D0; }
html[data-theme="dark"] .pill-failed { background: rgba(239, 68, 68, .16); color: #FCA5A5; }
.tabs { gap: 4px; padding: 4px; border-radius: 999px; background: var(--line-soft); border: 1px solid var(--line); }
.tab { background: transparent; border: 0; color: var(--muted); font-weight: 700; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.is-active { background: var(--card); color: var(--text); box-shadow: var(--shadow-sm); border: 0; }
html[data-theme="dark"] .tab.is-active { background: rgba(255, 255, 255, .1); }
.view-tabs { background: var(--line-soft); border-color: var(--line); }
.view-tab.is-active { background: var(--card); color: var(--text); }

/* Tables */
.table th { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; border-bottom-color: var(--line); }
.table td { border-bottom-color: var(--line-soft); }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--brand) 4%, transparent); }

/* Flash */
.flash { border-radius: 14px; border: 1px solid transparent; box-shadow: var(--shadow-sm); }
.flash-success { border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
html[data-theme="dark"] .flash-success { color: #BBF7D0; }
html[data-theme="dark"] .flash-warn { background: rgba(251, 191, 36, .12); color: #FDE68A; }
html[data-theme="dark"] .flash-info { color: #BBF7D0; }
.idea-working { background: var(--grad-soft); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }

/* Calendar & misc (dark fixes) */
html[data-theme="dark"] .day-empty { background: transparent; border-color: var(--line); }
html[data-theme="dark"] .day-item { background: rgba(255, 255, 255, .06); color: var(--text); }
html[data-theme="dark"] .day-review { background: rgba(251, 191, 36, .14); color: #FDE68A; }
html[data-theme="dark"] .day-posted { background: rgba(34, 197, 94, .22); color: #fff; }
html[data-theme="dark"] .meter { background: rgba(255, 255, 255, .06); border-color: var(--line); }
html[data-theme="dark"] .lp-card, html[data-theme="dark"] .lp-arrow, html[data-theme="dark"] .provider-card { background: var(--card); }
html[data-theme="dark"] .credit-box.credit-low { background: rgba(251, 191, 36, .1); }
html[data-theme="dark"] .status-warn { background: rgba(251, 191, 36, .14); color: #FDE68A; }
html[data-theme="dark"] .state-ok { color: #BBF7D0; }
html[data-theme="dark"] .login-page { background: transparent; }
html[data-theme="dark"] .btn-outline { background: transparent; }
html[data-theme="dark"] .preview, html[data-theme="dark"] .carousel-track { background: rgba(255, 255, 255, .04); }

/* Motion */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.main > * { animation: rise .35s ease both; }
.main > *:nth-child(2) { animation-delay: .04s; }
.main > *:nth-child(3) { animation-delay: .08s; }
.main > *:nth-child(4) { animation-delay: .12s; }
@media (prefers-reduced-motion: reduce) { .main > * { animation: none; } }

@media (max-width: 900px) {
  .main { padding: 22px 16px 48px; }
  .sidebar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--card); }
  html[data-theme="dark"] .sidebar { background: #0A1A13; }
}

/* Login page */
.login-page { background: none !important; }

/* Sidebar logo */
.brand-logo { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 0 4px; text-decoration: none; }
.brand-logo:hover { text-decoration: none; }
.logo-plate { display: inline-flex; align-items: center; padding: 10px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.logo-plate img { display: block; height: 30px; width: auto; max-width: 180px; }
.logo-text { display: none; font: 800 18px var(--display); color: #0B2A1D; letter-spacing: .02em; }
.logo-plate.logo-missing img { display: none; }
.logo-plate.logo-missing .logo-text { display: inline; }
.brand-logo .brand-sub { padding-left: 4px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--side-muted); }
html[data-theme="dark"] .logo-plate { border-color: rgba(255, 255, 255, .15); box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .8); }
@media (max-width: 900px) { .brand-logo { flex-direction: row; align-items: center; } .logo-plate { padding: 7px 10px; } .logo-plate img { height: 24px; } }
