:root {
  --green: #009b58;
  --green-dark: #00844c;
  --green-soft: #e9f8ef;
  --ink: #101828;
  --muted: #667085;
  --line: #e5ebe7;
  --bg: #f8faf9;
  --shadow: 0 3px 14px rgba(16, 40, 27, .035);
}

html, body { max-width: 100%; overflow-x: clip; }
body { background: var(--bg); color: var(--ink); font-family: Inter, Arial, sans-serif; font-size: 14px; }
h1, h2, .brand, .visual-brand, .boot, .mobile-brand { font-family: Inter, Arial, sans-serif; }
.eyebrow { color: var(--green); }
.logo-icon { background: var(--green); }
.button.primary { background: var(--green); box-shadow: 0 5px 13px rgba(0, 155, 88, .12); }
.button.primary:hover:not(:disabled) { background: var(--green-dark); }
.button.secondary { background: var(--green-soft); color: var(--green-dark); }
.panel { border-color: var(--line); border-radius: 16px; box-shadow: var(--shadow); }

.app-header { height: 72px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: none; }
.header-inner { width: 100%; max-width: 1360px; height: 100%; margin: 0 auto; padding: 0 30px; gap: 24px; }
.brand { gap: 11px; color: var(--ink); font-size: 22px; line-height: 1; letter-spacing: -.04em; }
.brand .logo-icon { width: 43px; height: 43px; border-radius: 12px; box-shadow: none; }
.brand .logo-icon svg { width: 24px; height: 24px; }
.brand-name { display: block; }
.brand strong { color: var(--green); }
.brand small { margin-top: 5px; color: #98a5a0; font: 800 9px Inter, Arial, sans-serif; letter-spacing: .16em; }
.header-actions { gap: 5px; }
.header-actions .button { min-height: 39px; padding: 0 15px; border-radius: 999px; color: #475467; font-size: 13px; font-weight: 700; }
.header-actions .button svg { width: 17px; height: 17px; }
.header-actions .button:hover { background: #f3f8f5; color: var(--green-dark); }
.header-actions .button[aria-current="page"] { background: var(--green-soft); color: var(--green-dark); }
.header-actions #logout { margin-left: 7px; padding-left: 17px; border-left: 1px solid var(--line); border-radius: 0 999px 999px 0; }
.header-actions .button:focus-visible, .brand:focus-visible, .view-switch button:focus-visible, .website-detail-button:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

.app-main { width: 100%; max-width: 1360px; margin: 0 auto; padding: 28px 30px 64px; }
#website-list-page { min-width: 0; }
.workspace-heading { margin-bottom: 22px; }
.workspace-heading .eyebrow { margin-bottom: 8px; font-size: 11px; }
.workspace-heading h1 { margin: 0 0 7px; color: var(--ink); font-size: clamp(30px, 2.5vw, 32px); line-height: 1.2; font-weight: 800; letter-spacing: -.045em; }
.workspace-heading p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.workspace-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.workspace-stat { min-width: 0; min-height: 110px; display: flex; align-items: center; gap: 15px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.workspace-stat .stat-icon { width: 58px; height: 58px; flex: none; display: grid; place-items: center; border-radius: 14px; }
.workspace-stat .stat-icon svg { width: 26px; height: 26px; stroke-width: 1.8; }
.workspace-stat > div { min-width: 0; }
.workspace-stat div > span { display: block; margin-bottom: 7px; color: #667085; font-size: 13px; font-weight: 600; }
.workspace-stat strong { display: block; color: var(--ink); font-size: clamp(25px, 2vw, 29px); line-height: 1.15; font-weight: 800; letter-spacing: -.045em; overflow-wrap: anywhere; }
.stat-total .stat-icon { color: var(--green); background: #e9f8ef; }
.stat-active .stat-icon { color: #078e58; background: #e8f7ef; }
.stat-inactive .stat-icon { color: #cb8327; background: #fff2e2; }
.stat-today .stat-icon { color: #3579c9; background: #eaf3ff; }

.website-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 22px 0 16px; }
.website-search { width: min(500px, 100%); height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid #dce6df; border-radius: 11px; background: #fff; color: #98a5a0; }
.website-search:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(0, 155, 88, .09); }
.website-search svg { width: 18px; height: 18px; }
.website-search input { width: 100%; height: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.website-search input::placeholder { color: #98a5a0; }
.toolbar-actions { display: flex; align-items: center; gap: 10px; }
.view-switch { height: 46px; display: flex; align-items: center; gap: 2px; padding: 4px; border: 1px solid #dce6df; border-radius: 11px; background: #fff; }
.view-switch button { width: 37px; height: 37px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: #98a5a0; }
.view-switch button[aria-pressed="true"] { background: var(--green-soft); color: var(--green); }
.view-switch svg { width: 18px; height: 18px; }
.toolbar-actions #add-website { min-height: 46px; padding: 0 17px; border-radius: 11px; font-size: 13px; }
.toolbar-actions #add-website svg { width: 18px; height: 18px; }
.create-panel { margin-bottom: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.website-grid.view-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.website-card { min-width: 0; min-height: 126px; display: grid; grid-template-columns: minmax(245px, 1.1fr) minmax(440px, 1.6fr) minmax(155px, auto); align-items: center; gap: 22px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); transition: border-color .18s, box-shadow .18s; }
.website-card:hover { border-color: #c7ded0; box-shadow: 0 6px 19px rgba(16, 40, 27, .06); }
.website-identity { min-width: 0; display: flex; align-items: center; gap: 14px; }
.web-avatar { width: 58px; height: 58px; flex: none; display: grid; place-items: center; border-radius: 14px; background: #eaf8ef; color: var(--green); font: 800 21px Inter, Arial, sans-serif; }
.website-identity-copy { min-width: 0; }
.website-card h2 { margin: 0 0 10px; color: var(--ink); font-size: 18px; line-height: 1.25; font-weight: 800; letter-spacing: -.025em; overflow-wrap: anywhere; }
.website-badges { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.website-card .website-badges code { padding: 6px 9px; border-radius: 7px; background: #f2f5f3; color: #526457; font: 800 12px Inter, Arial, sans-serif; letter-spacing: .03em; }
.website-badges .status-pill { padding: 6px 9px; font-size: 11px; }
.website-card-metrics { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; }
.website-card-metric { min-width: 0; padding: 0 17px; border-left: 1px solid var(--line); }
.website-card-metric > span { display: block; margin-bottom: 8px; color: #7a8780; font-size: 12px; font-weight: 600; }
.website-card-metric strong { display: block; color: var(--ink); font-size: 15px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.website-card-actions { display: flex; align-items: center; justify-content: flex-end; gap: 13px; }
.website-state { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.website-state::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.website-state.active { color: var(--green); background: #eaf8ef; }
.website-state.inactive { color: #8a6f4f; background: #fff4e6; }
.website-detail-button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; border: 1px solid #b6dcc6; border-radius: 9px; background: #fff; color: var(--green-dark); font-size: 13px; font-weight: 700; white-space: nowrap; }
.website-detail-button:hover { background: var(--green-soft); }
.website-detail-button svg { width: 15px; height: 15px; }
.empty-state { grid-column: 1 / -1; padding: 38px 22px; }

.website-grid.view-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 410px), 1fr)); gap: 16px; }
.view-grid .website-card { min-height: 245px; grid-template-columns: 1fr; gap: 17px; padding: 22px; }
.view-grid .website-card-metrics { padding-top: 15px; border-top: 1px solid var(--line); }
.view-grid .website-card-metric:first-child { padding-left: 0; border-left: 0; }
.view-grid .website-card-metric { padding: 0 10px; }
.view-grid .website-card-metric strong { font-size: 15px; }
.view-grid .website-card-actions { justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--line); }

@media (max-width: 1180px) {
  .website-card { grid-template-columns: minmax(0, 1fr) auto; gap: 16px; }
  .website-card-metrics { grid-column: 1 / -1; grid-row: 2; padding-top: 14px; border-top: 1px solid var(--line); }
  .website-card-metric:first-child { padding-left: 0; border-left: 0; }
  .website-card-actions { grid-column: 2; grid-row: 1; }
  .view-grid .website-card { grid-template-columns: 1fr; }
  .view-grid .website-card-metrics, .view-grid .website-card-actions { grid-column: 1; grid-row: auto; }
}

@media (max-width: 1024px) {
  .workspace-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-inner { padding-left: 24px; padding-right: 24px; }
  .app-main { padding-left: 24px; padding-right: 24px; }
}

@media (max-width: 760px) {
  .app-header { height: auto; }
  .header-inner { min-height: 72px; flex-wrap: wrap; padding: 12px 24px; }
  .header-actions { width: 100%; justify-content: space-between; }
  .header-actions .button { flex: 1; padding: 0 8px; font-size: 12px; }
  .header-actions #logout { margin-left: 0; padding-left: 8px; border-left: 0; border-radius: 999px; }
  #nav-settings span { display: inline; }
  .app-main { padding: 24px 24px 56px; }
  .website-toolbar { flex-wrap: wrap; }
  .website-search { width: 100%; }
  .toolbar-actions { width: 100%; justify-content: space-between; }
}

@media (max-width: 640px) {
  .header-inner { gap: 8px; padding: 10px 16px; }
  .brand { font-size: 20px; }
  .brand .logo-icon { width: 42px; height: 42px; }
  .header-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding-top: 7px; border-top: 1px solid var(--line); }
  .header-actions .button { min-width: 0; min-height: 38px; justify-content: center; }
  .app-main { padding: 21px 16px 48px; }
  .workspace-heading { margin-bottom: 19px; }
  .workspace-heading h1 { font-size: 30px; }
  .workspace-heading p { font-size: 13px; }
  .workspace-stats { gap: 10px; }
  .workspace-stat { min-height: 106px; display: block; padding: 12px; }
  .workspace-stat .stat-icon { width: 36px; height: 36px; margin-bottom: 7px; border-radius: 10px; }
  .workspace-stat .stat-icon svg { width: 19px; height: 19px; }
  .workspace-stat div > span { margin-bottom: 4px; font-size: 12px; }
  .workspace-stat strong { font-size: 23px; }
  .website-toolbar { gap: 10px; margin-top: 19px; }
  .toolbar-actions #add-website { padding: 0 12px; }
  .website-card, .view-grid .website-card { min-height: 0; grid-template-columns: 1fr; gap: 16px; padding: 18px; }
  .website-card-metrics, .view-grid .website-card-metrics { grid-column: 1; grid-row: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 0; padding-top: 15px; }
  .website-card-metric { padding: 0 10px; }
  .website-card-metric:first-child { padding-left: 0; border-left: 0; }
  .website-card-metric:last-child { grid-column: 1 / -1; padding: 11px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .website-card-actions, .view-grid .website-card-actions { grid-column: 1; grid-row: auto; justify-content: space-between; padding-top: 13px; border-top: 1px solid var(--line); }
  .web-avatar { width: 52px; height: 52px; }
  .website-card h2 { font-size: 17px; }
}
