/* Tokomama Interface — minimal, calm UI */

:root {
  --tm-bg: #f4f4f5;
  --tm-surface: #ffffff;
  --tm-sidebar-bg: #fafafa;
  --tm-border: rgba(24, 24, 27, 0.08);
  --tm-text: #18181b;
  --tm-muted: #71717a;
  --tm-accent: #0284c7;
  --tm-accent-hover: #0369a1;
  --tm-accent-muted: rgba(2, 132, 199, 0.1);
  --tm-radius: 16px;
  --tm-radius-sm: 12px;
  --tm-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 24px rgba(0, 0, 0, 0.04);
  --tm-font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.tm-body {
  margin: 0;
  background: var(--tm-bg);
  color: var(--tm-text);
  font-family: var(--tm-font);
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
}

.tm-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

/* Sidebar — light, airy */
.tm-sidebar {
  background: var(--tm-sidebar-bg);
  border-right: 1px solid var(--tm-border);
  display: flex;
  flex-direction: column;
}

.tm-brand {
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid var(--tm-border);
}

.tm-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--tm-accent) 0%, #06b6d4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: -0.02em;
}

.tm-brand-title {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.03em;
  color: var(--tm-text);
  line-height: 1.25;
}

.tm-brand-sub {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--tm-muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.tm-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.75rem;
  flex: 1;
  overflow-y: auto;
}

.tm-nav-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tm-muted);
  padding: 0.75rem 0.65rem 0.35rem;
}

.tm-nav-item {
  color: #52525b;
  text-decoration: none;
  padding: 0.55rem 0.75rem;
  border-radius: var(--tm-radius-sm);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.tm-nav-item i {
  font-size: 1.05rem;
  opacity: 0.85;
}

.tm-nav-item:hover {
  background: rgba(24, 24, 27, 0.04);
  color: var(--tm-text);
}

.tm-nav-item.active {
  background: var(--tm-accent-muted);
  color: var(--tm-accent);
  font-weight: 600;
}

.tm-nav-item.active i {
  opacity: 1;
}

.tm-main {
  background: var(--tm-bg);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tm-header {
  background: var(--tm-surface);
  border-bottom: 1px solid var(--tm-border);
  padding: 1rem 1.5rem;
}

.tm-page-title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--tm-text);
  margin: 0;
  line-height: 1.3;
}

.tm-page-hint {
  font-size: 0.8125rem;
  color: var(--tm-muted);
  margin-top: 0.25rem;
  line-height: 1.45;
  max-width: 52ch;
}

.tm-btn-logout {
  border: 1px solid var(--tm-border);
  background: var(--tm-surface);
  color: var(--tm-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.tm-btn-logout:hover {
  border-color: rgba(24, 24, 27, 0.15);
  color: var(--tm-text);
  background: rgba(24, 24, 27, 0.03);
}

.tm-section {
  padding: 1.5rem;
  flex: 1;
}

.tm-content-max {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.tm-card {
  background: var(--tm-surface);
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius);
  box-shadow: var(--tm-shadow);
}

.tm-card-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tm-muted);
  margin-bottom: 1rem;
}

.tm-mode-tabs {
  display: inline-flex;
  padding: 4px;
  background: #f4f4f5;
  border-radius: 999px;
  gap: 2px;
}

.tm-mode-tab {
  border: none;
  background: transparent;
  color: var(--tm-muted);
  padding: 0.4rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}

.tm-mode-tab:hover {
  color: var(--tm-text);
}

.tm-mode-tab.active {
  background: var(--tm-surface);
  color: var(--tm-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.tm-mode-tab:focus-visible {
  outline: 2px solid rgba(2, 132, 199, 0.45);
  outline-offset: 2px;
}

.tm-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--tm-text);
  margin-bottom: 0.35rem;
}

.tm-lead-muted {
  font-size: 0.875rem;
  color: var(--tm-muted);
  line-height: 1.55;
  margin: 0;
}

.tm-input,
.tm-select {
  border-radius: var(--tm-radius-sm);
  border: 1px solid var(--tm-border);
  padding: 0.55rem 0.85rem;
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tm-input:focus,
.tm-select:focus {
  border-color: rgba(2, 132, 199, 0.45);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
  outline: none;
}

.tm-btn-primary {
  background: var(--tm-accent);
  border: none;
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1.15rem;
  border-radius: 999px;
  transition: background 0.15s, transform 0.1s;
}

.tm-btn-primary:hover:not(:disabled) {
  background: var(--tm-accent-hover);
}

.tm-btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}

.tm-btn-primary:disabled {
  opacity: 0.55;
}

.tm-btn-secondary {
  background: var(--tm-surface);
  border: 1px solid var(--tm-border);
  color: var(--tm-text);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1.15rem;
  border-radius: 999px;
  transition: background 0.15s, border-color 0.15s;
}

.tm-btn-secondary:hover:not(:disabled) {
  background: #fafafa;
  border-color: rgba(24, 24, 27, 0.12);
}

.tm-btn-secondary:disabled {
  opacity: 0.55;
}

.tm-btn-ghost {
  background: transparent;
  border: none;
  color: var(--tm-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.5rem 0.65rem;
}

.tm-btn-ghost:hover {
  color: var(--tm-text);
}

.tm-pre-wrap {
  margin-top: 0.75rem;
}

.tm-pre {
  background: #27272a;
  color: #e4e4e7;
  border-radius: var(--tm-radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1.1rem 1.15rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  overflow: auto;
  max-height: min(65vh, 560px);
  margin: 0;
}

.tm-meta-line {
  font-size: 0.75rem;
  color: var(--tm-muted);
  font-family: ui-monospace, monospace;
  word-break: break-all;
}

.tm-status-ok {
  color: #15803d;
  font-weight: 600;
  font-size: 0.75rem;
}

.tm-status-err {
  color: #dc2626;
  font-weight: 600;
  font-size: 0.75rem;
}

.tm-status-warn {
  color: #ca8a04;
  font-weight: 600;
  font-size: 0.75rem;
}

.tm-status-loading {
  color: var(--tm-muted);
  font-weight: 500;
  font-size: 0.75rem;
}

.text-heading {
  color: var(--tm-text);
}

/* Mobile horizontal nav */
.tm-mobile-bar {
  background: var(--tm-surface);
  border-bottom: 1px solid var(--tm-border);
  overflow: hidden;
}

.tm-mobile-scroll {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 0.65rem 1rem;
  -webkit-overflow-scrolling: touch;
}

.tm-mobile-scroll::-webkit-scrollbar {
  height: 0;
}

.tm-mobile-chip {
  flex-shrink: 0;
  scroll-snap-align: start;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--tm-muted);
  background: #f4f4f5;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.tm-mobile-chip:hover {
  color: var(--tm-text);
  background: #e4e4e7;
}

.tm-mobile-chip.active {
  background: var(--tm-accent-muted);
  color: var(--tm-accent);
}

/* Login */
.tm-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(2, 132, 199, 0.12), transparent),
    var(--tm-bg);
}

.tm-login-card {
  width: 100%;
  max-width: 420px;
}

.tm-login-card-inner {
  overflow: hidden;
}

.tm-login-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--tm-accent), #06b6d4);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.tm-login-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin: 0 0 0.35rem;
  color: var(--tm-text);
}

.tm-login-lead {
  font-size: 0.9rem;
  color: var(--tm-muted);
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

.tm-login .form-control {
  border-radius: var(--tm-radius-sm);
  border: 1px solid var(--tm-border);
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
}

.tm-login .form-control:focus {
  border-color: rgba(2, 132, 199, 0.45);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.tm-login .btn-primary {
  border-radius: var(--tm-radius-sm);
  padding: 0.65rem;
  font-weight: 600;
  background: var(--tm-accent);
  border: none;
}

.tm-login .btn-primary:hover {
  background: var(--tm-accent-hover);
}

@media (max-width: 991.98px) {
  .tm-shell {
    grid-template-columns: 1fr;
  }

  .tm-sidebar {
    display: none;
  }

  .tm-section {
    padding: 1rem;
  }

  .tm-header {
    padding: 0.85rem 1rem;
  }
}
