:root {
  --bg: #0a0a0a;
  --bg-card: #141414;
  --bg-card-hover: #1a1a1a;
  --bg-input: #1a1a1a;
  --border: #2a2a2a;
  --border-focus: #555;
  --text: #e8e8e8;
  --text-muted: #888;
  --text-dim: #555;
  --accent: #c9a84c;
  --accent-hover: #d4b65e;
  --danger: #c44;
  --success: #4a9;
  --warning: #c90;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* Nav */
.nav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 1.1rem;
}
.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: var(--bg);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }
.nav-user {
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 500;
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

/* Main */
.main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* Typography */
h1 { font-size: 2rem; font-weight: 700; margin-bottom: 1rem; }
h2 { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.75rem; }
h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.5rem; }
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.page-header h1 { margin-bottom: 0; }
.subtitle { color: var(--text-muted); margin-top: 0.25rem; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-focus); }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.card-img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--text-muted); }
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { opacity: 0.9; }
.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.875rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  font-family: inherit;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-select { cursor: pointer; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-hint { font-size: 0.8rem; color: var(--text-dim); margin-top: 0.25rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
tr:hover td { background: var(--bg-card-hover); }

/* Badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-booked { background: #1a3a5c; color: #6cb4ee; }
.badge-confirmed { background: #1a3c2a; color: #4a9; }
.badge-completed { background: #2a2a1a; color: var(--accent); }
.badge-cancelled { background: #3a1a1a; color: var(--danger); }
.badge-available { background: #1a3c2a; color: #4a9; }
.badge-claimed { background: #3a2a1a; color: var(--warning); }
.badge-waiting { background: #1a3a5c; color: #6cb4ee; }

/* Alerts */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.alert-success { background: #0d2818; border: 1px solid #1a3c2a; color: #4a9; }
.alert-error { background: #2a0d0d; border: 1px solid #3a1a1a; color: var(--danger); }
.alert-info { background: #0d1a2a; border: 1px solid #1a3a5c; color: #6cb4ee; }

/* Signature pad */
.signature-pad {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: crosshair;
  touch-action: none;
}

/* Image grid (portfolio/flash) */
.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}
.img-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}
.img-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.img-card img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  display: block;
}
.img-card-body { padding: 1rem; }
.img-card-title { font-weight: 600; margin-bottom: 0.25rem; }
.img-card-meta { font-size: 0.8rem; color: var(--text-muted); }
.img-card-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 0.5rem;
}
.img-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-close {
  float: right;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.tab {
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Empty state */
.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.3; }
.empty-text { font-size: 1.1rem; margin-bottom: 1rem; }

/* Responsive */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav.open .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    gap: 0.75rem;
  }
  .nav-toggle { display: flex; }
  .form-row { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 1.5rem; }
}

/* HTMX loading indicator */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }
.htmx-request.htmx-indicator { display: inline-block; }
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Consultation message thread */
.consult-thread {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 500px;
  overflow-y: auto;
  padding: 0.5rem;
}
.consult-msg {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.consult-msg-system {
  background: transparent;
  border-color: transparent;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-style: italic;
  padding: 0.5rem;
}
.consult-msg-system .consult-msg-header { justify-content: center; }
.consult-msg-system .consult-msg-body { color: var(--text-dim); }
.consult-msg-artist {
  border-left: 3px solid var(--accent);
  background: var(--bg-card-hover);
}
.consult-msg-client {
  border-left: 3px solid var(--success);
}
.consult-msg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.375rem;
  font-size: 0.85rem;
}
.consult-msg-header strong {
  color: var(--text);
}
.consult-msg-time {
  font-size: 0.75rem;
  color: var(--text-dim);
}
.consult-msg-body {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
  white-space: pre-wrap;
}

/* Team Board */
.board-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.5rem;
  align-items: start;
}
.board-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.board-thread {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.board-sidebar {
  position: sticky;
  top: 76px;
}
.board-compose {
  border-color: var(--border-focus);
}
.board-post {
  transition: border-color 0.2s;
}
.board-post:hover {
  border-color: var(--border-focus);
}
.board-post-pinned {
  border-left: 3px solid var(--accent);
}
.board-post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.board-post-author {
  color: var(--accent);
  font-size: 0.9rem;
}
.board-post-time {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-left: 0.5rem;
}
.board-post-body {
  font-size: 0.925rem;
  line-height: 1.6;
  color: var(--text);
}
.board-post-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.board-mention {
  color: var(--accent);
  font-weight: 600;
}
.board-topic-card {
  display: block;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.board-topic-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}
.board-topic-title {
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}
.board-topic-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
}
/* Dropdown menu for post actions */
.board-dropdown {
  position: relative;
}
.board-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 140px;
  z-index: 50;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.board-dropdown.open .board-dropdown-menu {
  display: block;
}
.board-dropdown-menu a,
.board-dropdown-menu button {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.board-dropdown-menu a:hover,
.board-dropdown-menu button:hover {
  background: var(--bg-card-hover);
}
@media (max-width: 768px) {
  .board-layout {
    grid-template-columns: 1fr;
  }
  .board-sidebar {
    position: static;
    order: -1;
  }
}

/* Hub */
.hub-header {
  margin-bottom: 2rem;
}
.hub-greeting {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.hub-date {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.hub-tile {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  position: relative;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.hub-tile:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}
.hub-tile--accent:hover { border-color: var(--accent); }
.hub-tile--blue:hover { border-color: #5b8af0; }
.hub-tile--green:hover { border-color: #4a9; }
.hub-tile--purple:hover { border-color: #a78bfa; }
.hub-tile--red:hover { border-color: #c44; }
.hub-tile--teal:hover { border-color: #2dd4bf; }
.hub-tile--yellow:hover { border-color: #eab308; }
.hub-tile--pink:hover { border-color: #f472b6; }
.hub-tile--cyan:hover { border-color: #22d3ee; }
.hub-tile--orange:hover { border-color: #f97316; }
.hub-tile-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
}
.hub-tile-icon svg {
  width: 22px;
  height: 22px;
}
.hub-tile--accent .hub-tile-icon { color: var(--accent); }
.hub-tile--blue .hub-tile-icon { color: #5b8af0; }
.hub-tile--green .hub-tile-icon { color: #4a9; }
.hub-tile--purple .hub-tile-icon { color: #a78bfa; }
.hub-tile--red .hub-tile-icon { color: #c44; }
.hub-tile--teal .hub-tile-icon { color: #2dd4bf; }
.hub-tile--yellow .hub-tile-icon { color: #eab308; }
.hub-tile--pink .hub-tile-icon { color: #f472b6; }
.hub-tile--cyan .hub-tile-icon { color: #22d3ee; }
.hub-tile--orange .hub-tile-icon { color: #f97316; }
.hub-tile-body {
  flex: 1;
  min-width: 0;
}
.hub-tile-title {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
}
.hub-tile-desc {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 0.15rem;
  line-height: 1.4;
}
.hub-tile-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.hub-tile-badge--accent { background: rgba(201,168,76,0.15); color: var(--accent); }
.hub-tile-badge--blue { background: rgba(91,138,240,0.15); color: #5b8af0; }
.hub-tile-badge--green { background: rgba(68,170,153,0.15); color: #4a9; }
.hub-tile-badge--purple { background: rgba(167,139,250,0.15); color: #a78bfa; }
.hub-tile-badge--red { background: rgba(204,68,68,0.18); color: #e66; }
.hub-tile-badge--teal { background: rgba(45,212,191,0.15); color: #2dd4bf; }
.hub-tile-badge--yellow { background: rgba(234,179,8,0.15); color: #eab308; }
.hub-tile-badge--pink { background: rgba(244,114,182,0.15); color: #f472b6; }
.hub-tile-badge--cyan { background: rgba(34,211,238,0.15); color: #22d3ee; }
.hub-tile-badge--orange { background: rgba(249,115,22,0.15); color: #f97316; }
@media (max-width: 600px) {
  .hub-grid {
    grid-template-columns: 1fr;
  }
  .hub-greeting {
    font-size: 1.35rem;
  }
}
