:root {
  --navy: #12233f;
  --navy-2: #0b1830;
  --blue: #1769e0;
  --blue-soft: #eaf2ff;
  --green: #16875b;
  --green-soft: #e9f8f1;
  --red: #c73e45;
  --red-soft: #fff0f1;
  --amber: #9a6800;
  --amber-soft: #fff7dc;
  --ink: #172236;
  --muted: #657188;
  --line: #e3e8f0;
  --surface: #ffffff;
  --background: #f5f7fb;
  --shadow: 0 8px 30px rgba(19, 37, 66, .07);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--background); color: var(--ink); }
body { font-size: 15px; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar { background: var(--navy-2); color: #dfe9f8; padding: 26px 18px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 0 10px 28px; color: white; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: inline-grid; place-items: center; background: linear-gradient(135deg, #20b986, #1682e6); color: white; font-size: 20px; font-weight: 800; box-shadow: 0 8px 20px rgba(32,185,134,.22); }
.brand strong { display: block; font-size: 18px; letter-spacing: -.3px; }
.brand small { display: block; color: #91a2bc; font-size: 11px; margin-top: 2px; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a { text-decoration: none; padding: 11px 12px; border-radius: 9px; color: #aebbd0; transition: .15s ease; display: flex; align-items: center; justify-content: space-between; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: white; }
.sidebar nav a.active { background: #1d3458; color: white; font-weight: 650; }
.nav-badge { font-size: 9px; text-transform: uppercase; padding: 3px 5px; border-radius: 5px; background: rgba(255,255,255,.1); color: #a9b8ce; }
.sidebar-footer { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid rgba(255,255,255,.09); font-size: 12px; color: #8fa0b9; display: grid; gap: 8px; overflow-wrap: anywhere; }
.link-button { border: 0; padding: 0; background: transparent; color: var(--blue); cursor: pointer; font-weight: 650; }
.sidebar .link-button { color: #d7e2f2; }

.main-content { padding: 46px clamp(24px, 4vw, 62px) 80px; min-width: 0; }
.auth-content { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 75% 20%, #e6f2ff 0, transparent 34%), var(--background); }
.page-header { margin-bottom: 28px; }
.page-header.split { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.page-header h1 { margin: 3px 0 7px; font-size: clamp(27px, 3vw, 38px); letter-spacing: -1.2px; line-height: 1.1; }
.page-header p { margin: 0; color: var(--muted); }
.eyebrow { font-size: 11px !important; font-weight: 800; color: var(--blue) !important; letter-spacing: 1.5px; }
.header-actions { display: flex; gap: 10px; align-items: center; }

.button { border: 1px solid transparent; border-radius: 9px; padding: 10px 15px; text-decoration: none; display: inline-flex; justify-content: center; align-items: center; gap: 7px; font-weight: 700; cursor: pointer; transition: .15s ease; white-space: nowrap; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.primary { color: white; background: var(--blue); box-shadow: 0 6px 14px rgba(23,105,224,.17); }
.button.primary:hover { background: #0f5ecf; }
.button.secondary { background: white; color: var(--ink); border-color: var(--line); }
.button.google { background: white; color: #30415d; border-color: var(--line); box-shadow: var(--shadow); }
.button.danger-outline { background: white; color: var(--red); border-color: #efcbd0; }
.button.small { font-size: 12px; padding: 7px 10px; }
.button.full { width: 100%; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 24px; }
.stats-grid.compact { margin-top: -2px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 19px 20px; box-shadow: 0 5px 18px rgba(19,37,66,.035); }
.stat-card span { color: var(--muted); display: block; font-size: 12px; font-weight: 650; }
.stat-card strong { display: block; margin-top: 5px; font-size: 27px; letter-spacing: -.8px; }
.stat-card.success { border-top: 3px solid var(--green); }
.stat-card.danger { border-top: 3px solid var(--red); }
.success-text { color: var(--green); }
.danger-text { color: var(--red); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 22px; overflow: hidden; }
.panel-header { padding: 20px 22px; border-bottom: 1px solid var(--line); }
.panel-header.split-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.panel-header h2, .form-panel h2 { margin: 0 0 4px; font-size: 17px; }
.panel-header p { margin: 0; color: var(--muted); font-size: 13px; }
.form-panel { padding: 24px; overflow: visible; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 12px 18px; font-size: 10px; text-transform: uppercase; letter-spacing: .7px; color: #7b879a; background: #f9fafc; border-bottom: 1px solid var(--line); }
td { padding: 15px 18px; border-bottom: 1px solid #edf0f5; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td strong, td small { display: block; }
td small { color: var(--muted); margin-top: 4px; font-size: 11px; }
.table-link { color: var(--blue); text-decoration: none; font-weight: 700; white-space: nowrap; }
.count { font-size: 16px; font-weight: 750; }
.url-cell { min-width: 330px; max-width: 520px; word-break: break-word; }
.url-cell > a { color: #263854; text-decoration: none; font-weight: 650; }
.url-cell > a:hover { color: var(--blue); text-decoration: underline; }
.empty-table { padding: 48px 22px; text-align: center; color: var(--muted); }
.empty-table h2 { color: var(--ink); font-size: 18px; }

.status, .result { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.status-completed, .status-submitted, .result-indexed { background: var(--green-soft); color: var(--green); }
.status-running, .result-processing { background: var(--blue-soft); color: var(--blue); }
.status-queued, .status-created, .status-waiting_quota, .result-pending { background: var(--amber-soft); color: var(--amber); }
.status-cancelled, .status-error, .result-error, .result-not_indexed { background: var(--red-soft); color: var(--red); }
.result-unknown, .result-no_property { background: #eef1f5; color: #596579; }

.notice { border-radius: 11px; padding: 14px 16px; display: flex; gap: 10px; align-items: baseline; margin: 0 0 20px; }
.notice strong { white-space: nowrap; }
.notice.info { background: var(--blue-soft); color: #245692; }
.notice.warning { background: var(--amber-soft); color: #745100; }
.empty-state { background: var(--surface); border: 1px dashed #cdd6e3; border-radius: 14px; padding: 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.empty-state h2 { margin: 0 0 5px; font-size: 18px; }
.empty-state p { margin: 0; color: var(--muted); max-width: 720px; }
.empty-state.accent { border-style: solid; border-left: 4px solid var(--blue); }
.empty-state.vertical { min-height: 330px; flex-direction: column; justify-content: center; text-align: center; }
.feature-icon { font-size: 34px; color: var(--blue); }

.stack-form { display: grid; gap: 18px; }
label { display: grid; gap: 7px; font-weight: 700; color: #34425a; }
input[type=text], input[type=email], input[type=password], textarea, select { width: 100%; border: 1px solid #ccd5e2; border-radius: 9px; background: white; padding: 11px 12px; color: var(--ink); outline: none; transition: .15s; }
textarea { resize: vertical; min-height: 170px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.6; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,105,224,.1); }
.optional, .helper { color: var(--muted); font-size: 11px; font-weight: 500; }
label > .helper { margin-top: -2px; }
.file-drop { border: 1.5px dashed #bdc9d9; padding: 24px; border-radius: 11px; text-align: center; cursor: pointer; background: #fafbfd; }
.file-drop:hover { border-color: var(--blue); background: #f5f9ff; }
.file-drop input { position: absolute; opacity: 0; pointer-events: none; }
.file-drop strong, .file-drop span { display: block; }
.file-drop span { color: var(--muted); font-weight: 500; font-size: 12px; margin-top: 4px; }
.or { display: flex; align-items: center; color: #8a95a7; font-size: 11px; text-transform: uppercase; }
.or::before, .or::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.or span { padding: 0 10px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 5px; }

.account-grid { display: grid; padding: 18px; gap: 12px; }
.account-card { border: 1px solid var(--line); border-radius: 11px; padding: 16px; display: flex; align-items: center; gap: 14px; }
.account-icon { width: 39px; height: 39px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; color: #4285f4; font-weight: 800; }
.account-body { flex: 1; min-width: 0; }
.account-body h3 { margin: 0 0 3px; font-size: 14px; }
.account-body p { margin: 0; color: var(--muted); font-size: 12px; }
.account-body span { display: inline-block; margin-top: 6px; color: var(--blue); font-size: 11px; font-weight: 750; }
.account-body .scope-warning { display: block; margin-top: 7px; color: var(--amber); font-size: 11px; }
.account-actions { display: flex; gap: 8px; }

.compact-notice { margin: 0; }
.sitemap-url { padding: 17px 22px; color: #30415d; background: #fafbfd; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }
.status-title { font-size: 19px !important; letter-spacing: -.2px !important; }
.date-title { font-size: 15px !important; letter-spacing: 0 !important; line-height: 1.35; }

.progress-panel { background: var(--navy); color: white; border-radius: 13px; padding: 18px 20px; margin-bottom: 16px; }
.progress-copy { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 11px; font-size: 13px; }
.progress-copy span { color: #b9c9df; }
.progress-track { height: 7px; background: rgba(255,255,255,.13); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, #19b984, #29a8ef); border-radius: inherit; transition: width .35s ease; }
.pagination { padding: 15px 18px; border-top: 1px solid var(--line); display: flex; justify-content: center; align-items: center; gap: 20px; font-size: 12px; }
.pagination a { color: var(--blue); text-decoration: none; font-weight: 700; }

.two-columns { display: grid; grid-template-columns: minmax(260px, .7fr) minmax(440px, 1.3fr); gap: 20px; align-items: start; }
.login-card { width: min(410px, 100%); background: white; border: 1px solid var(--line); box-shadow: 0 18px 60px rgba(19,37,66,.1); padding: 35px; border-radius: 17px; }
.login-brand { display: flex; justify-content: center; }
.login-card h1 { text-align: center; margin: 15px 0 6px; letter-spacing: -.8px; }
.login-card > p { text-align: center; color: var(--muted); margin: 0 0 25px; }
.flash-stack { display: grid; gap: 8px; margin-bottom: 18px; }
.flash { border-radius: 9px; padding: 11px 14px; font-size: 13px; border: 1px solid transparent; }
.flash-success { color: var(--green); background: var(--green-soft); border-color: #ccebdd; }
.flash-danger { color: var(--red); background: var(--red-soft); border-color: #f2d0d3; }
.flash-warning { color: var(--amber); background: var(--amber-soft); border-color: #f0dfab; }

@media (max-width: 1000px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .two-columns { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; padding: 15px; }
  .brand { padding-bottom: 14px; }
  .sidebar nav { grid-template-columns: repeat(2, 1fr); }
  .sidebar-footer { display: none; }
  .main-content { padding: 28px 16px 60px; }
  .page-header.split { align-items: stretch; flex-direction: column; }
  .panel-header.split-row { align-items: flex-start; flex-direction: column; }
  .header-actions { flex-wrap: wrap; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .empty-state { align-items: stretch; flex-direction: column; }
  .notice { align-items: flex-start; flex-direction: column; }
  .account-card { align-items: flex-start; flex-wrap: wrap; }
  .account-actions { width: 100%; }
  .progress-copy { flex-direction: column; gap: 4px; }
}
