/* AirHub Design System — AirbyAir branded UI */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #faf7f2;
  --primary: #1a3c34;
  --primary-light: #264e44;
  --accent: #7a9e8e;
  --accent-hover: #6b8f7f;
  --gold: #c4a46c;
  --gold-light: #d4b87c;
  --error: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --info: #2563eb;
  --card-bg: #ffffff;
  --text: #333333;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border: #e5e0d8;
  --border-light: #f0ebe4;
  --table-header-bg: #f0f5f3;
  --table-alt-row: #faf8f5;
  --sidebar-width: 220px;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }
::selection { background: var(--accent); color: #fff; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ── Sidebar ────────────────────────────────────────── */
.airhub-sidebar {
  width: var(--sidebar-width); background: var(--primary); color: #fff;
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0;
  height: 100vh; z-index: 100; transition: transform .25s ease;
}
.airhub-sidebar .sidebar-header {
  padding: 20px 16px 12px; border-bottom: 1px solid rgba(255,255,255,.1);
}
.airhub-sidebar .sidebar-logo {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff;
}
.airhub-sidebar .sidebar-logo img,
.airhub-sidebar .sidebar-logo svg { width: 32px; height: 32px; }
.airhub-sidebar .sidebar-logo .brand-name {
  font-family: 'Cormorant Garamond', Georgia, serif; font-size: 18px; font-weight: 600; letter-spacing: .5px;
}
.airhub-sidebar .sidebar-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px;
  color: rgba(255,255,255,.4); padding: 16px 16px 6px; font-weight: 600;
}
.airhub-sidebar nav { flex: 1; padding: 8px 0; overflow-y: auto; }
.airhub-sidebar .nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 16px;
  color: rgba(255,255,255,.7); text-decoration: none; font-size: 13px;
  font-weight: 500; transition: all .15s; border-left: 3px solid transparent;
}
.airhub-sidebar .nav-item:hover {
  color: #fff; background: rgba(255,255,255,.08); text-decoration: none;
}
.airhub-sidebar .nav-item.active {
  color: #fff; background: rgba(255,255,255,.12);
  border-left-color: var(--gold);
}
.airhub-sidebar .nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; }
.airhub-sidebar .nav-separator { height: 1px; background: rgba(255,255,255,.1); margin: 8px 16px; }
.airhub-sidebar .sidebar-footer {
  padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.1);
  font-size: 11px; color: rgba(255,255,255,.35);
}

/* ── Main Content ───────────────────────────────────── */
.airhub-main { flex: 1; margin-left: var(--sidebar-width); min-height: 100vh; background: var(--bg); }
.airhub-topbar {
  padding: 20px 28px 0; display: flex; align-items: center; justify-content: space-between;
}
.airhub-topbar h1 {
  font-family: 'Cormorant Garamond', Georgia, serif; font-size: 28px;
  font-weight: 600; color: var(--primary); letter-spacing: -.3px;
}
.airhub-topbar .topbar-actions { display: flex; gap: 8px; align-items: center; }
.airhub-content { padding: 20px 28px 40px; }

/* ── Cards ──────────────────────────────────────────── */
.airhub-card {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px;
}
.airhub-card h2 {
  font-family: 'Cormorant Garamond', Georgia, serif; font-size: 18px;
  font-weight: 600; color: var(--primary); margin-bottom: 12px;
}
.airhub-card h3 {
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 10px;
}

/* ── Stat Cards ─────────────────────────────────────── */
.airhub-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.airhub-stat {
  background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; text-align: left;
}
.airhub-stat .label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; margin-bottom: 4px; }
.airhub-stat .number { font-size: 28px; font-weight: 700; color: var(--primary); line-height: 1.1; }
.airhub-stat .number.gold { color: var(--gold); }
.airhub-stat .number.success { color: var(--success); }
.airhub-stat .sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Tables ─────────────────────────────────────────── */
.airhub-table { width: 100%; border-collapse: collapse; }
.airhub-table thead th {
  background: var(--table-header-bg); text-align: left; font-size: 11px;
  font-weight: 600; color: var(--text-secondary); text-transform: uppercase;
  letter-spacing: .4px; padding: 10px 12px; border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.airhub-table tbody td {
  padding: 10px 12px; font-size: 13px; border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.airhub-table tbody tr:nth-child(even) { background: var(--table-alt-row); }
.airhub-table tbody tr:hover { background: #eef2ef; }
.airhub-table tbody tr.clickable { cursor: pointer; }

/* ── Badges ─────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap; letter-spacing: .2px;
}
.badge-ready { background: #e8f5e9; color: var(--success); }
.badge-draft { background: #fff8e1; color: var(--warning); }
.badge-sold { background: #fce4ec; color: var(--error); }
.badge-pipeline { background: #e3f2fd; color: var(--info); }
.badge-listed { background: #e8f5e9; color: var(--success); }
.badge-reserved { background: #f3e5f5; color: #7b1fa2; }
.badge-open { background: #e3f2fd; color: var(--info); }
.badge-closed { background: #fff8e1; color: var(--warning); }
.badge-in_transit { background: #fff8e1; color: var(--warning); }
.badge-arrived { background: #e8f5e9; color: var(--success); }
.badge-pending { background: #fff8e1; color: var(--warning); }
.badge-confirmed { background: #e3f2fd; color: var(--info); }
.badge-shipped { background: #e8f5e9; color: var(--success); }
.badge-delivered { background: #e8f5e9; color: #0d7a2e; }
.badge-cancelled { background: #fce4ec; color: var(--error); }

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px;
  border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer;
  border: none; transition: all .15s; white-space: nowrap; text-decoration: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-secondary:hover:not(:disabled) { background: rgba(122,158,142,.08); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #15803d; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover:not(:disabled) { background: #b45309; }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--border-light); color: var(--text); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 14px 32px; font-size: 16px; font-weight: 600; border-radius: 8px; }

/* ── Forms ──────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .3px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 8px 12px; border: 1.5px solid var(--border);
  border-radius: 6px; font-size: 13px; color: var(--text); background: #fff;
  outline: none; transition: border-color .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }

/* ── Alerts ─────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: 6px; font-size: 13px; margin-bottom: 12px;
  border-left: 4px solid; display: flex; align-items: flex-start; gap: 8px;
}
.alert-error { background: #fef2f2; border-left-color: var(--error); color: #991b1b; }
.alert-warning { background: #fffbeb; border-left-color: var(--warning); color: #92400e; }
.alert-success { background: #f0fdf4; border-left-color: var(--success); color: #166534; }
.alert-info { background: #eff6ff; border-left-color: var(--info); color: #1e40af; }

/* ── Search / Filter Bar ────────────────────────────── */
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search-box { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.search-box input {
  width: 100%; padding: 8px 12px 8px 36px; border: 1.5px solid var(--border);
  border-radius: 6px; font-size: 13px; outline: none; background: #fff; transition: .15s;
}
.search-box input:focus { border-color: var(--accent); }
.search-box input::placeholder { color: var(--text-muted); }
.search-box .search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.filter-select {
  padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 6px;
  font-size: 13px; color: var(--text-secondary); background: #fff; cursor: pointer;
  outline: none; transition: .15s;
}
.filter-select:hover { border-color: var(--accent); }
.filter-select:focus { border-color: var(--accent); }

/* ── Thumbnails ─────────────────────────────────────── */
.thumb {
  width: 40px; height: 40px; border-radius: 6px; overflow: hidden;
  background: var(--border-light); display: flex; align-items: center;
  justify-content: center; color: var(--text-muted); font-size: 16px; flex-shrink: 0;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ── Toast ──────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px; padding: 12px 20px;
  border-radius: var(--radius); font-size: 13px; color: #fff; z-index: 500;
  box-shadow: var(--shadow-md); animation: toastIn .25s ease;
  max-width: 380px;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--error); }
.toast-info { background: var(--accent); }
.toast-warning { background: var(--warning); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ── Modal / Overlay ────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4);
  z-index: 200; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--card-bg); border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.15);
  width: 90%; max-width: 500px; padding: 24px;
}
.modal-box h2 { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 20px; font-weight: 600; color: var(--primary); margin-bottom: 12px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ── SKU + Monospace ────────────────────────────────── */
.mono { font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; font-size: 12px; }

/* ── Pagination ─────────────────────────────────────── */
.pagination {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; font-size: 12px; color: var(--text-muted);
}
.pagination button {
  padding: 5px 12px; border: 1px solid var(--border); border-radius: 4px;
  background: #fff; color: var(--text-secondary); cursor: pointer; font-size: 12px;
}
.pagination button:disabled { opacity: .4; cursor: default; }
.pagination button:hover:not(:disabled) { background: var(--border-light); }

/* ── Deploy button ──────────────────────────────────── */
.deploy-btn {
  padding: 20px 48px; font-size: 20px; font-weight: 700;
  border-radius: 12px; cursor: pointer; border: none;
  background: var(--success); color: #fff;
  box-shadow: 0 4px 16px rgba(22,163,74,.3); transition: all .2s;
}
.deploy-btn:hover:not(:disabled) { background: #15803d; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(22,163,74,.35); }
.deploy-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ── Log area ───────────────────────────────────────── */
.log-area {
  background: var(--primary); color: #b8d4c8; font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px; line-height: 1.6; padding: 16px; border-radius: var(--radius);
  max-height: 300px; overflow-y: auto; white-space: pre-wrap; word-break: break-all;
}

/* ── Empty state ────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state h3 { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 18px; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ── Loading ────────────────────────────────────────── */
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .6s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: var(--text-muted); font-size: 13px; text-align: center; padding: 30px; }

/* ── Hamburger (mobile) ─────────────────────────────── */
.hamburger {
  display: none; position: fixed; top: 12px; left: 12px; z-index: 150;
  background: var(--primary); color: #fff; border: none; border-radius: 6px;
  width: 40px; height: 40px; font-size: 20px; cursor: pointer;
  align-items: center; justify-content: center; box-shadow: var(--shadow-md);
}

/* ── Kanban columns ─────────────────────────────────── */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col { min-width: 150px; flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.kanban-head { padding: 10px 12px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: var(--table-header-bg); }
.kanban-head .col-label { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .3px; }
.kanban-head .col-count { font-size: 18px; font-weight: 700; color: var(--primary); }
.kanban-body { padding: 6px; max-height: 280px; overflow-y: auto; }
.kanban-item { padding: 8px 10px; border-radius: 6px; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; background: var(--card-bg); border: 1px solid var(--border-light); }
.kanban-item:hover { border-color: var(--border); }
.kanban-item .item-sku { font-size: 10px; color: var(--text-muted); font-family: 'SF Mono', monospace; }

/* ── Expanded detail row ────────────────────────────── */
.detail-row td { padding: 0 !important; }
.detail-content { padding: 16px 20px; background: #f4f8f6; border-left: 3px solid var(--accent); }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  .airhub-sidebar { transform: translateX(-100%); }
  .airhub-sidebar.open { transform: translateX(0); }
  .airhub-main { margin-left: 0; }
  .hamburger { display: flex; }
  .airhub-topbar { padding: 16px 16px 0; padding-left: 56px; }
  .airhub-topbar h1 { font-size: 22px; }
  .airhub-content { padding: 16px; }
  .airhub-stats { grid-template-columns: repeat(2, 1fr); }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .search-box { max-width: 100%; }
  .kanban { flex-direction: column; }
  .kanban-col { min-width: unset; }
  .airhub-table { font-size: 12px; }
}
