:root {
  font-family: Lato, Arial, sans-serif;
  color: #f4f4f4;
  background: #030603;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #000; color: #f4f4f4; }
button, input, select { font: inherit; }
button, a { transition: .18s ease; }
a { color: inherit; text-decoration: none; }

body { overflow-x: hidden; }

html.lenis,
html.lenis body { height: auto; }

.lenis.lenis-smooth { scroll-behavior: auto !important; }

.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }

.lenis.lenis-stopped { overflow: hidden; }

.lenis.lenis-scrolling iframe { pointer-events: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #082c00; border: 2px solid #000; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #32cd32; }
html { scrollbar-width: thin; scrollbar-color: #082c00 #000; }

.glass-card {
  background: rgba(8, 44, 0, .85);
  border: 1px solid rgba(50, 205, 50, .1);
  backdrop-filter: blur(16px);
}

.muted { color: #b8c2b8; font-size: 13px; line-height: 1.6; }
.eyebrow { margin: 0 0 8px; color: #32cd32; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.danger-text { color: #ff7b7b; }
.auth-page { display: grid; place-items: center; padding: 20px; }
.login-shell { width: min(420px, 100%); }
.login-panel { padding: 34px; background: #071407; border: 1px solid #1b351b; border-radius: 8px; box-shadow: 0 30px 80px rgba(0,0,0,.55); }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 24px; color: #000; background: #32cd32; border-radius: 6px; font-weight: 900; }
.login-panel h1, .admin-heading h1, .modal-panel h2 { margin: 0; font-size: 28px; letter-spacing: 0; }
.login-panel form, .modal-panel form { display: grid; gap: 16px; margin-top: 26px; }
label { display: grid; gap: 7px; color: #b8c2b8; font-size: 11px; font-weight: 700; }
input, select { min-height: 44px; padding: 0 12px; color: #fff; background: #020402; border: 1px solid #1b351b; border-radius: 6px; outline: none; }
input:focus, select:focus { border-color: #32cd32; }
.login-panel button, .primary-button { min-height: 42px; padding: 0 15px; color: #000; background: #32cd32; border: 0; border-radius: 6px; font-weight: 800; cursor: pointer; }
.login-panel button:disabled, .primary-button:disabled { opacity: .5; }
.form-error { min-height: 18px; margin: 0; color: #ef4444; font-size: 11px; }
.form-success { min-height: 18px; margin: 12px 0 0; color: #32cd32; font-size: 11px; }

.site-header { position: fixed; top: 0; left: 0; width: 100%; z-index: 100; background: rgba(0,0,0,.95); border-bottom: 1px solid #082c00; backdrop-filter: blur(14px); }
.site-nav { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: min(1280px, calc(100% - 32px)); min-height: 72px; margin: 0 auto; }
.site-brand { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 900; letter-spacing: 0; }
.site-brand img { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; }
.site-brand > span > span { color: #32cd32; }
.site-links, .site-user { display: flex; align-items: center; }
.site-links { gap: 18px; }
.site-links a { color: #b8c2b8; font-size: 13px; font-weight: 700; }
.site-links a:hover, .site-links .is-active { color: #32cd32; }
.site-user { gap: 12px; }
.site-user div { display: grid; gap: 3px; text-align: right; }
.site-user strong { font-size: 12px; }
.site-user small { color: #32cd32; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.site-user > span, .site-mobile-user span { display: grid; place-items: center; width: 40px; height: 40px; color: #020402; background: #32cd32; border-radius: 50%; font-weight: 900; }
.site-user button, .site-mobile-menu button, .site-menu-button { color: #d8e4d8; background: transparent; border: 0; cursor: pointer; }
.site-menu-button { display: none; font-size: 24px; }
.site-mobile-menu { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px; background: #000; }
.site-mobile-menu[hidden] { display: none; }
.site-mobile-menu > a { font-size: 26px; font-weight: 900; }
.site-mobile-menu > a.is-active { color: #32cd32; }
.site-mobile-close { position: absolute; top: 24px; right: 24px; font-size: 34px; }
.site-mobile-user { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.site-mobile-user strong { font-size: 18px; }
.site-mobile-user small { color: #32cd32; font-size: 12px; font-weight: 900; text-transform: uppercase; }
.site-mobile-menu button:not(.site-mobile-close) { padding: 10px 14px; border: 1px solid #1b351b; border-radius: 6px; }

.admin-shell { width: min(1280px, calc(100% - 32px)); margin: 0 auto; padding: 128px 0 80px; }
.admin-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.admin-heading h1 { margin: 0; color: #fff; font-size: clamp(32px, 5vw, 46px); font-weight: 900; letter-spacing: 0; }
.admin-heading .muted { margin: 8px 0 0; color: #b8c2b8; font-size: 15px; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.hero-action { min-height: 42px; padding: 0 18px; box-shadow: 0 0 18px rgba(50,205,50,.28); }
.admin-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.admin-overview article { display: flex; align-items: center; gap: 14px; min-height: 94px; padding: 20px; background: rgba(8,44,0,.85); border: 1px solid rgba(50,205,50,.12); border-radius: 8px; backdrop-filter: blur(16px); }
.admin-overview span { display: grid; place-items: center; width: 42px; height: 42px; color: #32cd32; background: rgba(50,205,50,.14); border-radius: 8px; }
.admin-overview div { display: grid; gap: 4px; }
.admin-overview small { color: #b8c2b8; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.admin-overview strong { color: #fff; font-size: 26px; font-weight: 900; }
.client-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.client-card { display: grid; gap: 20px; padding: 22px; background: rgba(8,44,0,.85); border: 1px solid rgba(50,205,50,.16); border-radius: 8px; backdrop-filter: blur(16px); }
.client-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.client-card__identity { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.client-card__identity > span { display: grid; flex: 0 0 auto; place-items: center; width: 40px; height: 40px; color: #32cd32; background: rgba(50,205,50,.15); border-radius: 8px; }
.client-card h2 { margin: 0; color: #fff; overflow-wrap: anywhere; font-size: 18px; font-weight: 900; }
.client-card p { margin: 5px 0 0; color: #b8c2b8; font-size: 12px; }
.client-card__actions { display: flex; flex-shrink: 0; align-items: center; gap: 8px; }
.preview-icon-button { display: grid; place-items: center; width: 36px; height: 36px; color: #32cd32; background: #020402; border: 1px solid rgba(50,205,50,.32); border-radius: 6px; cursor: pointer; }
.preview-icon-button:hover { background: rgba(50,205,50,.12); border-color: #32cd32; }
.source-tags { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; }
.source-tags span { padding: 6px 8px; color: #f4f4f4; background: #020402; border: 1px solid rgba(50,205,50,.26); border-radius: 5px; font-size: 10px; font-weight: 900; }
.source-tags .is-empty { color: #b8c2b8; background: transparent; }
.client-card__footer { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.manage-button, .provider-button, .secondary-button, .danger-button, .icon-button, .remove-client-button, .danger-submit { color: #d8e4d8; background: #020402; border: 1px solid #1b351b; border-radius: 6px; cursor: pointer; }
.manage-button { min-height: 40px; font-size: 11px; font-weight: 900; }
.remove-client-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 98px; min-height: 38px; color: #ff7b7b; border-color: rgba(239,68,68,.28); font-size: 11px; font-weight: 900; }
.remove-client-button:hover, .danger-submit:hover { background: rgba(239,68,68,.12); border-color: #ef4444; }

.admin-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; }
.admin-modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.8); backdrop-filter: blur(8px); }
.modal-panel { position: relative; width: min(650px, 100%); max-height: calc(100vh - 36px); padding: 26px; overflow: auto; background: #071407; border: 1px solid rgba(50,205,50,.35); border-radius: 8px; box-shadow: 0 24px 80px rgba(0,0,0,.55); overscroll-behavior: contain; }
.modal-panel.compact { width: min(430px, 100%); }
.close-button { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; }
.modal-panel > label { margin-top: 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.secondary-button, .primary-button, .danger-submit { min-height: 38px; padding: 0 13px; font-size: 11px; font-weight: 900; }
.danger-submit { color: #fff; background: #b91c1c; border-color: #ef4444; }
.danger-submit:disabled { opacity: .55; }

.connection-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 22px 0; }
.provider-button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; font-size: 11px; font-weight: 800; }
.provider-button:hover, .manage-button:hover { border-color: #32cd32; }
.account-controls { margin: 18px 0 10px; }
.account-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid #1b351b; }
.account-tabs button { min-height: 40px; color: #b8c2b8; background: transparent; border: 0; border-bottom: 2px solid transparent; font-size: 10px; font-weight: 800; }
.account-tabs button.is-active { color: #fff; border-color: #32cd32; }
.account-tabs small { margin-left: 6px; }
.account-controls > input { width: 100%; margin-top: 10px; }
.account-list { display: grid; gap: 7px; max-height: 340px; overflow: auto; overscroll-behavior: contain; }
.account-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px; background: #020402; border: 1px solid #1b351b; border-radius: 6px; }
.account-row label { display: flex; flex: 1; grid-template: none; align-items: center; gap: 10px; min-width: 0; }
.account-row input { width: 16px; height: 16px; min-height: auto; accent-color: #32cd32; }
.account-row label span { display: grid; gap: 3px; min-width: 0; }
.account-row strong { color: #f4f4f4; overflow-wrap: anywhere; font-size: 11px; }
.account-row small { color: #b8c2b8; font-size: 9px; }
.danger-button { padding: 7px 9px; color: #ef4444; border-color: rgba(239,68,68,.3); font-size: 9px; font-weight: 800; }
.admin-toast { position: fixed; right: 18px; bottom: 18px; z-index: 220; max-width: min(360px, calc(100vw - 36px)); padding: 12px 14px; color: #031003; background: #32cd32; border-radius: 6px; box-shadow: 0 18px 50px rgba(0,0,0,.45); font-size: 12px; font-weight: 900; }
.empty-state { grid-column: 1 / -1; padding: 48px; text-align: center; background: rgba(8,44,0,.85); border: 1px dashed rgba(50,205,50,.28); border-radius: 8px; }
.empty-state.small { padding: 25px; }
.loader { width: 28px; height: 28px; margin: 30px auto; border: 3px solid #1b351b; border-top-color: #32cd32; border-radius: 50%; animation: spin .8s linear infinite; }
.modal-open { overflow: hidden; overscroll-behavior: none; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .site-links, .site-user { display: none; }
  .site-menu-button { display: block; }
  .site-nav { min-height: 72px; }
  .admin-shell { padding: 112px 0 60px; }
  .admin-heading { align-items: stretch; flex-direction: column; }
  .admin-heading h1 { font-size: 34px; }
  .admin-overview { grid-template-columns: 1fr; }
  .connection-actions { grid-template-columns: 1fr; }
  .account-row { align-items: flex-start; flex-direction: column; }
  .danger-button { width: 100%; }
  .client-card__footer { grid-template-columns: 1fr; }
  .remove-client-button { width: 100%; }
}

@media (max-width: 420px) {
  .site-brand { font-size: 21px; }
  .site-brand img { width: 40px; height: 40px; }
  .client-card__top { align-items: stretch; flex-direction: column; }
  .client-card__actions { justify-content: flex-end; }
  .client-grid { grid-template-columns: 1fr; }
}

body.theme-light {
  background: #f4f7f2 !important;
  color: #101510 !important;
}

body.theme-light header,
body.theme-light [data-mobile-menu],
body.theme-light footer {
  background: rgba(244, 247, 242, 0.96) !important;
  border-color: rgba(17, 81, 0, 0.18) !important;
}

body.theme-light .glass-card,
body.theme-light .modal-panel,
body.theme-light .login-panel,
body.theme-light .empty-state {
  background: #ffffff !important;
  color: #101510 !important;
}

body.theme-light .text-white,
body.theme-light .text-brand-light,
body.theme-light .account-row strong {
  color: #101510 !important;
}

body.theme-light .text-brand-gray,
body.theme-light .muted,
body.theme-light .account-row small {
  color: #5d665d !important;
}

/* Form controls must override the later Tailwind reset. */
.login-panel form input, .login-panel form select, .modal-panel form input, .modal-panel form select, .account-controls > input { padding: 12px 14px; min-height: 46px; font-size: 14px; line-height: 1.4; width: 100%; }
.modal-panel form label, .login-panel form label { gap: 9px; font-size: 12px; }
.account-row > span { display: grid; gap: 6px; min-width: 0; }
.account-row > span strong { line-height: 1.5; }
.account-row > span small { display: block; line-height: 1.5; overflow-wrap: anywhere; font-size: 12px; }
.account-row { padding: 14px; gap: 14px; }
[data-client-goals-list], [data-client-users-list] { display: grid; gap: 12px; margin-top: 22px; }
.modal-panel form { gap: 20px; }

.keyword-chips { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.keyword-chip { padding:10px 12px; border:1px solid #1b351b; border-radius:8px; background:#020402; color:#f4f4f4; font-size:12px; text-align:left; }
.keyword-chip:hover { border-color:#32cd32; }
.keyword-chip.is-selected { border-color:rgba(50,205,50,.4); background:rgba(50,205,50,.12); color:#32cd32; }
.keyword-add-row { display:flex; gap:8px; }
.keyword-add-row input { min-width:0; flex:1; }
.keyword-add-row button { flex-shrink:0; }

body:not(.theme-light) input::placeholder, body:not(.theme-light) textarea::placeholder { color:#aebaae; opacity:1; }
