/* ABOUTME: Sketch UI theme — soft, hand-drawn feel that looks like a polished wireframe */
/* ABOUTME: Caveat headings, warm grays, rounded cards, paper-like background */

:root {
  --bg: #f8f6f3;
  --bg-card: #ffffff;
  --text: #2d2a26;
  --text-secondary: #6b6560;
  --text-muted: #9a958f;
  --accent: #6b8f71;
  --accent-hover: #5a7d60;
  --accent-light: #e8f0e9;
  --border: #d9d4ce;
  --border-light: #ebe7e2;
  --danger: #c4544a;
  --danger-light: #fdf0ef;
  --warning: #c49a3c;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-pill: 100px;
  --shadow: 0 2px 8px rgba(45, 42, 38, 0.06);
  --shadow-lg: 0 4px 20px rgba(45, 42, 38, 0.08);
  --font-sketch: 'Caveat', cursive;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-sketch);
  font-weight: 600;
  line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }

/* Sketch Card */
.sketch-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease;
}

.sketch-card:hover {
  box-shadow: var(--shadow-lg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1.5px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--text-secondary);
  background: var(--bg);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger-light);
}

.btn-sm {
  padding: 6px 16px;
  font-size: 13px;
}

.btn-icon {
  padding: 4px 6px;
  min-width: 0;
}

.btn-outline.btn-sent {
  color: var(--accent);
  border-color: var(--accent);
}

.btn-outline.btn-error {
  color: var(--danger);
  border-color: var(--danger);
}

.badge-success {
  background: var(--accent-light);
  color: var(--accent);
}

/* Input */
.input {
  width: 100%;
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--bg-card);
  color: var(--text);
  transition: border-color 0.15s ease;
  outline: none;
}

.input:focus {
  border-color: var(--accent);
}

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

/* Select */
.select {
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--bg-card);
  color: var(--text);
  outline: none;
  cursor: pointer;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
}

.badge-accent {
  background: var(--accent-light);
  color: var(--accent);
}

.badge-muted {
  background: var(--border-light);
  color: var(--text-secondary);
}

.badge-danger {
  background: var(--danger-light);
  color: var(--danger);
}

/* Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* 3 brand stripes at top of main content, aligned with sidebar logo bottom */
.brand-stripes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: -32px -40px 28px;
  padding: 0 40px;
  padding-top: 70px;
}

.brand-stripes span {
  display: block;
  width: 100%;
  height: 5px;
}

.brand-stripes span:nth-child(1) { background: #FF6432; }
.brand-stripes span:nth-child(2) { background: #FFC81E; }
.brand-stripes span:nth-child(3) { background: #1B3926; }

.sidebar {
  width: 240px;
  background: var(--bg-card);
  border-right: 1.5px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-brand {
  padding: 4px 8px 16px;
  border-bottom: 1.5px solid var(--border-light);
  margin-bottom: 16px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.sidebar-link:hover {
  background: var(--bg);
  color: var(--text);
}

.sidebar-link.active {
  background: var(--accent-light);
  color: var(--accent);
}

.sidebar-section {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 16px 12px 6px;
}

.main-content {
  flex: 1;
  padding: 32px 40px;
  max-width: 1200px;
}

.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  margin-bottom: 4px;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  text-align: center;
  padding: 20px;
}

.stat-value {
  font-family: var(--font-sketch);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Table */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1.5px solid var(--border);
}

td {
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-light);
}

tr:hover td {
  background: var(--bg);
}

/* Login page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-card h1 {
  font-size: 3rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.login-card p {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-form .input {
  text-align: center;
  font-size: 16px;
  padding: 14px 20px;
}

.login-success {
  color: var(--accent);
  font-weight: 500;
  padding: 16px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 42, 38, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
}

.modal h2 {
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* Invitation banner */
.invitation-banner {
  background: var(--accent-light);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--text-muted);
  font-size: 15px;
}

/* Spacing utilities */
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.gap-3 { gap: 12px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* Developer portal: numbered step indicators */
.doc-steps {
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.doc-step {
  counter-increment: step;
  position: relative;
  padding-left: 40px;
}

.doc-step::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
