* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f4;
  color: #14181A;
}
a { color: inherit; }

/* Auth pages (signup/login) */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid #e5e5e5; border-radius: 12px; padding: 32px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.auth-card h1 { font-size: 20px; margin: 0 0 4px; }
.auth-card p.subtitle { font-size: 13px; color: #737373; margin: 0 0 24px; }
.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.auth-field input { width: 100%; box-sizing: border-box; border: 2px solid #d4d4d4; border-radius: 6px; padding: 10px 14px; font-size: 14px; }
.auth-field input:focus { border-color: #006B50; outline: none; box-shadow: 0 0 0 3px rgba(0, 107, 80, 0.2); }
.auth-submit { width: 100%; background: #006B50; color: #ffffff; border: 2px solid #006B50; border-radius: 6px; padding: 12px; font-weight: 700; font-size: 14px; cursor: pointer; }
.auth-submit:hover { background: #00513C; border-color: #00513C; }
.auth-submit:disabled { opacity: 0.6; cursor: wait; }
.auth-error { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; font-size: 13px; padding: 10px 12px; border-radius: 6px; margin-bottom: 16px; }
.auth-footer { margin-top: 20px; font-size: 13px; color: #737373; text-align: center; }
.auth-footer a { font-weight: 600; text-decoration: underline; }

/* Top nav (settings/orders/billing) */
.cabinet-topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 40px; border-bottom: 1px solid #e5e5e5; background: #fff; }
.cabinet-topbar-left { display: flex; align-items: center; gap: 28px; }
.cabinet-topbar-tabs { display: flex; gap: 4px; }
.cabinet-topbar-tab { padding: 18px 4px; margin: 0 12px; font-size: 14px; font-weight: 600; color: #737373; text-decoration: none; border-bottom: 3px solid transparent; display: inline-block; }
.cabinet-topbar-tab:hover { color: #14181A; }
.cabinet-topbar-tab.active { color: #14181A; border-bottom-color: #006B50; }
.cabinet-topbar-shop { font-size: 13px; color: #737373; }
.trial-badge { display: none; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #D9EBE3; color: #00513C; white-space: nowrap; }
.trial-badge:not(:empty) { display: inline-block; }
.trial-badge.expired { background: #fee2e2; color: #991b1b; }
.trial-badge.active { background: #D9EBE3; color: #00513C; }
.cabinet-topbar-right { display: flex; align-items: center; gap: 16px; }
.cabinet-logout-btn { background: none; border: none; font-size: 13px; color: #737373; cursor: pointer; text-decoration: underline; padding: 0; }

/* Connect page */
.connect-main { max-width: 720px; margin: 0 auto; padding: 48px 24px; }
.connect-card { background: #fff; border: 1px solid #e5e5e5; border-radius: 12px; padding: 32px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.connect-steps { margin: 16px 0 24px; padding-left: 20px; font-size: 14px; line-height: 1.8; color: #262626; }
.connect-scopes { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 24px; }
.connect-scope { font-family: 'SF Mono', monospace; font-size: 12px; background: #f5f5f4; border: 1px solid #e5e5e5; border-radius: 4px; padding: 3px 8px; }
.connect-field { margin-bottom: 16px; }
.connect-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.connect-field input { width: 100%; box-sizing: border-box; border: 2px solid #d4d4d4; border-radius: 6px; padding: 10px 14px; font-size: 14px; font-family: inherit; }
.connect-field input:focus { border-color: #006B50; outline: none; box-shadow: 0 0 0 3px rgba(0, 107, 80, 0.2); }
.connect-submit { background: #006B50; color: #ffffff; border: 2px solid #006B50; border-radius: 6px; padding: 12px 24px; font-weight: 700; font-size: 14px; cursor: pointer; }
.connect-submit:hover { background: #00513C; border-color: #00513C; }
.connect-submit:disabled { opacity: 0.6; cursor: wait; }
.connect-error { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; font-size: 13px; padding: 10px 12px; border-radius: 6px; margin-bottom: 16px; }

/* Settings page */
.settings-layout { display: flex; width: 100%; max-width: 100%; min-height: 65vh; box-sizing: border-box; }
.settings-side { width: 280px; flex-shrink: 0; display: flex; flex-direction: column; background: #14181A; color: #e5e5e5; font-family: 'JetBrains Mono', 'SF Mono', monospace; padding: 24px 0; border-right: 4px solid #006B50; }
.settings-side-title { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: #737373; padding: 0 20px 16px; border-bottom: 1px solid #262626; margin-bottom: 16px; }
.settings-nav-item { display: block; width: 100%; padding: 14px 20px; text-align: left; border: none; background: none; color: #a3a3a3; font-family: inherit; font-size: 13px; cursor: pointer; border-left: 3px solid transparent; }
.settings-nav-item:hover { color: #4DAB8D; background: #1F2521; }
.settings-nav-item.active { color: #4DAB8D; background: #1F2521; border-left-color: #4DAB8D; }
.settings-nav-item .nav-num { opacity: 0.5; margin-right: 10px; }
.settings-side-footer { padding: 20px 20px 0; border-top: 1px solid #262626; margin-top: auto; }
.settings-main { flex: 1; min-width: 0; background: #f5f5f4; padding: 32px 40px 40px; overflow: auto; }
.settings-block { background: #fff; padding: 0 32px 28px; margin-bottom: 28px; border: 1px solid #e5e5e5; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); overflow: hidden; }
.settings-block::before { content: ''; display: block; height: 4px; background: #006B50; margin: 0 -32px 24px -32px; }
.settings-block-title { font-size: 18px; font-weight: 800; color: #14181A; margin: 0 0 20px 0; padding-left: 14px; border-left: 4px solid #006B50; }
.cabinet-field-heading { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #525252; margin: 20px 0 4px; }
.field-group { margin-bottom: 16px; }
.field-group--nested { padding: 16px 16px 16px 20px; border-left: 3px solid #D9EBE3; background: #EBF4F0; border-radius: 0 8px 8px 0; margin-bottom: 16px; }
.cabinet-label { display: block; font-weight: 600; color: #14181A; font-size: 13px; margin-bottom: 6px; }
.field-group input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), .field-group textarea, .field-group select { width: 100%; box-sizing: border-box; border: 2px solid #d4d4d4; border-radius: 6px; padding: 10px 14px; font-size: 14px; font-family: inherit; }
.field-group input:focus, .field-group textarea:focus, .field-group select:focus { border-color: #006B50; outline: none; box-shadow: 0 0 0 3px rgba(0, 107, 80, 0.2); }
.cabinet-help-text { font-size: 12px; color: #737373; margin-top: 4px; }
.cabinet-checkbox-row, .cabinet-radio-row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #14181A; margin-bottom: 8px; cursor: pointer; }
.cabinet-color-row { display: flex; align-items: center; gap: 8px; }
.cabinet-color-row input[type="color"] { width: 44px; height: 36px; padding: 2px; border: 2px solid #d4d4d4; border-radius: 6px; cursor: pointer; }
.cabinet-color-row input[type="text"] { max-width: 120px; }
.cabinet-btn { padding: 10px 18px; border-radius: 6px; border: 2px solid #d4d4d4; background: #fff; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.settings-save-btn { background: #006B50; color: #ffffff; border: 2px solid #006B50; padding: 14px 32px; width: 100%; font-weight: 700; border-radius: 6px; cursor: pointer; }
.settings-save-btn:hover { background: #00513C; border-color: #00513C; }
.settings-save-btn:disabled { opacity: 0.6; cursor: wait; }
.design-subtitle { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: #737373; margin: 4px 0 12px; }
.color-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.preset-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.preset-btn { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff; border: 2px solid #e5e5e5; border-radius: 8px; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 600; color: #14181A; }
.preset-btn:hover { border-color: #006B50; }
.preset-swatch { display: inline-flex; border-radius: 4px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08); }
.preset-swatch span { width: 14px; height: 18px; display: block; }
.logo-preview-frame { border: 2px dashed #d4d4d4; border-radius: 8px; padding: 20px; display: flex; align-items: center; justify-content: center; min-height: 120px; }
.logo-preview-empty { color: #a3a3a3; font-size: 13px; }
.field-preview-frame { border: 2px dashed #d4d4d4; border-radius: 8px; padding: 24px; display: flex; align-items: center; justify-content: center; }
.field-preview-input { width: 100%; max-width: 360px; padding: 12px 14px; border: 2px solid #d4d4d4; background: #fff; font-size: 14px; }
.hidden { display: none !important; }

/* Orders page */
.orders-main { padding: 32px 40px 40px; max-width: 1100px; margin: 0 auto; }
.period-tabs { display: flex; gap: 8px; margin-bottom: 24px; }
.period-tab { padding: 6px 14px; border-radius: 999px; border: 1px solid #d4d4d4; background: #fff; font-size: 13px; font-weight: 600; color: #404040; text-decoration: none; cursor: pointer; }
.period-tab.active { background: #006B50; color: #ffffff; border-color: #006B50; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-tile { background: #fff; border: 1px solid #e5e5e5; border-radius: 10px; padding: 18px 20px; }
.stat-tile-label { font-size: 12px; color: #737373; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.stat-tile-value { font-size: 24px; font-weight: 800; }
.orders-section { background: #fff; border: 1px solid #e5e5e5; border-radius: 10px; padding: 24px; margin-bottom: 24px; }
.orders-section h2 { font-size: 15px; margin: 0 0 16px; }
.breakdown-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f5f5f4; font-size: 13px; }
.breakdown-row:last-child { border-bottom: none; }
table.orders-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.orders-table th { text-align: left; color: #737373; font-weight: 600; padding: 8px 12px; border-bottom: 1px solid #e5e5e5; }
table.orders-table td { padding: 10px 12px; border-bottom: 1px solid #f5f5f4; }
.status-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #f5f5f4; color: #404040; }
.status-pill.CONFIRMED { background: #dcfce7; color: #166534; }
.status-pill.ABANDONED { background: #fee2e2; color: #991b1b; }
.empty-state { color: #737373; font-size: 13px; padding: 24px 0; text-align: center; }

/* Billing page */
.billing-main { padding: 32px 40px 48px; max-width: 900px; margin: 0 auto; }
.billing-title { font-size: 24px; margin: 0 0 4px; }
.billing-subtitle { font-size: 14px; color: #737373; margin: 0 0 20px; }
.billing-notice { background: #fffbeb; border: 1px solid #fde047; color: #713f12; font-size: 13px; padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.plan-card { background: #fff; border: 2px solid #e5e5e5; border-radius: 12px; padding: 24px; display: flex; flex-direction: column; position: relative; max-width: 380px; }
.plan-card.current { border-color: #006B50; box-shadow: 0 0 0 3px rgba(0, 107, 80, 0.15); }
.plan-card h2 { margin: 0 0 4px; font-size: 18px; }
.plan-price { font-size: 28px; font-weight: 800; margin: 8px 0 16px; }
.plan-price small { font-size: 13px; font-weight: 500; color: #737373; }
.plan-features { list-style: none; padding: 0; margin: 0 0 20px; font-size: 13px; color: #262626; flex: 1; }
.plan-features li { padding: 4px 0; }
.plan-features li::before { content: "✓ "; color: #006B50; font-weight: 700; }
.plan-submit { display: block; box-sizing: border-box; background: #006B50; color: #ffffff; border: 2px solid #006B50; border-radius: 6px; padding: 10px; font-weight: 700; font-size: 13px; cursor: pointer; width: 100%; text-align: center; text-decoration: none; }
.plan-submit:hover { background: #00513C; border-color: #00513C; }
.plan-submit:disabled { opacity: 0.6; cursor: default; }
.plan-badge { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; color: #00513C; background: #D9EBE3; padding: 2px 8px; border-radius: 999px; margin-bottom: 8px; align-self: flex-start; }

/* Toast */
.cabinet-toast { position: fixed; bottom: 24px; right: 24px; background: #14181A; color: #fff; padding: 12px 18px; border-radius: 8px; font-size: 13px; z-index: 50; }
.cabinet-toast.error { background: #991b1b; }
