:root {
  --bg: #f0f0f0;
  --fg: #000000;
  --muted: #666666;
  --border: #000000;
  --hover: #e0e0e0;
  --empty: #d8d8d8;
  --panel: #fafafa;
  --font: 'IBM Plex Mono', 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  height: 100%;
  margin: 0;
}

html,
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

body.app {
  overflow: hidden;
}

#root {
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
  font-size: inherit;
}

/* ---------- shell ---------- */

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.chrome {
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.chrome-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  max-width: 72rem;
  margin: 0 auto;
  width: 100%;
}

.brand {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.brand-sub {
  color: var(--muted);
  font-size: 11px;
  margin-left: 0.5rem;
}

.chrome-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 11px;
  color: var(--muted);
}

.scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.scroll-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem;
}

/* ---------- tabs ---------- */

.tabs {
  display: flex;
  border: 1px solid var(--border);
  overflow: hidden;
}

.tab {
  flex: 1;
  padding: 0.5rem 0.75rem;
  text-align: center;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.04em;
  background: var(--bg);
  cursor: pointer;
  border: none;
  border-right: 1px solid var(--border);
}

.tab:last-child {
  border-right: none;
}

.tab:hover {
  background: var(--hover);
}

.tab.active {
  background: var(--fg);
  color: var(--bg);
  font-weight: 700;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  padding: 0.5rem 1rem;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.03em;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover:not(:disabled) {
  background: var(--fg);
  color: var(--bg);
}

.btn:disabled {
  color: var(--muted);
  border-color: var(--muted);
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
  padding: 0.9rem 1rem;
  font-size: 13px;
}

.btn-ghost {
  border: none;
  background: transparent;
  text-decoration: underline;
  text-transform: none;
  font-weight: 400;
  padding: 0.2rem 0.4rem;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--hover);
  color: var(--fg);
}

/* ---------- panels / bordered ---------- */

.bordered {
  border: 1px solid var(--border);
}

.panel {
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 1rem;
}

.panel + .panel {
  margin-top: 1rem;
}

.panel-title {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

/* ---------- field row (bordered input + button) ---------- */

.field-row {
  display: flex;
  border: 1px solid var(--border);
}

.field-row input {
  flex: 1;
  border: none;
  background: var(--panel);
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 13px;
  color: var(--fg);
  outline: none;
  min-width: 0;
}

.field-row input::placeholder {
  color: var(--muted);
}

.field-row .btn {
  border: none;
  border-left: 1px solid var(--border);
}

/* ---------- dense list rows ---------- */

.list {
  border: 1px solid var(--border);
  border-top: none;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.row:hover {
  background: var(--hover);
}

.row-main {
  min-width: 0;
  flex: 1;
}

.row-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-meta {
  color: var(--muted);
  font-size: 11px;
  margin-top: 0.15rem;
}

.row-action {
  flex-shrink: 0;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* ---------- badges ---------- */

.badge {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--border);
}

.badge-solid {
  background: var(--fg);
  color: var(--bg);
  font-weight: 700;
}

.badge-dashed {
  border-style: dashed;
  color: var(--muted);
}

.badge-double {
  border-width: 3px;
  border-style: double;
}

/* ---------- stat tiles ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  border: 1px solid var(--border);
}

.stat-tile {
  padding: 0.75rem;
  border-left: 1px solid var(--border);
}

.stat-tile:first-child {
  border-left: none;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
}

.stat-label {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.2rem;
}

/* ---------- login ---------- */

.login-shell {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 22rem;
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 2rem 1.75rem;
  text-align: center;
}

.login-logo {
  width: 96px;
  height: 96px;
  margin: 0 auto 1rem;
  display: block;
  border: 1px solid var(--border);
}

.login-title {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 0.25rem;
}

.login-sub {
  color: var(--muted);
  font-size: 11px;
  margin: 0 0 1.5rem;
}

.google-btn-slot {
  display: flex;
  justify-content: center;
  margin: 0 auto;
}

.login-error {
  margin-top: 1rem;
  font-size: 11px;
  color: var(--fg);
  border: 1px dashed var(--border);
  padding: 0.5rem;
  text-align: left;
}

/* ---------- month nav ---------- */

.month-nav {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}

.month-nav .btn {
  border: none;
  flex-shrink: 0;
}

.month-nav .btn:first-child {
  border-right: 1px solid var(--border);
}

.month-nav .btn:last-child {
  border-left: 1px solid var(--border);
}

.month-nav-label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ---------- bar chart ---------- */

.bar-chart-wrap {
  display: flex;
  gap: 0.5rem;
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 0.75rem 0.5rem 0.5rem;
}

.bar-chart-yaxis {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  height: 140px;
  padding-right: 0.5rem;
  border-right: 1px solid var(--border);
  color: var(--muted);
  font-size: 9px;
  line-height: 1;
}

.bar-chart-body {
  flex: 1;
  min-width: 0;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 140px;
  background-image: repeating-linear-gradient(
    to top,
    var(--empty) 0,
    var(--empty) 1px,
    transparent 1px,
    transparent 25%
  );
}

.bar-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  min-width: 2px;
}

.bar {
  background: var(--fg);
  min-height: 1px;
}

.bar-col:hover .bar {
  background: var(--muted);
}

.bar-chart-labels {
  display: flex;
  gap: 2px;
  margin-top: 0.25rem;
}

.bar-col-label {
  flex: 1;
  min-width: 2px;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
  line-height: 1;
}

/* ---------- empty / loading ---------- */

.empty-line {
  color: var(--muted);
  padding: 0.75rem;
}

/* ---------- focus ---------- */

:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 2px;
}
