/* VAST TECH Support — design tokens & styles
   Brand colors are sampled directly from VAST TECH's real logo artwork:
   the near-black navy background, the vivid electric-blue of the lion's
   mane, and the fiery orange-red of its eye (used for "urgent" accents). */

:root {
  --color-primary: #0B0A2E;
  --color-primary-light: #181752;
  --color-accent: #0000E5;
  --color-accent-dark: #0000AE;
  --color-ember: #FF6A00;
  --color-ember-dark: #E85A00;
  --color-bg: #F5F6FA;
  --color-surface: #FFFFFF;
  --color-border: #E1E2EC;
  --color-text: #14132E;
  --color-text-muted: #5C5B78;
  --color-danger: #D6334A;
  --color-warning: #D98C1F;
  --color-success: #1E9E6B;
  --color-info: #2D6CDF;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-1: 0 1px 3px rgba(11, 10, 46, 0.10), 0 1px 2px rgba(11, 10, 46, 0.07);
  --shadow-2: 0 4px 14px rgba(11, 10, 46, 0.16);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-brand: "Orbitron", var(--font-sans);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body { overscroll-behavior-y: none; }

a { color: var(--color-accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell { min-height: 100dvh; display: flex; flex-direction: column; }

.boot-loader {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--color-text-muted);
  background: var(--color-primary);
}
.boot-logo {
  width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
}
.boot-logo img { height: 100%; width: auto; }
.boot-loader p { color: rgba(255,255,255,0.7); }

/* Top navigation */
.topbar {
  background: var(--color-primary);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--shadow-1);
}
.topbar-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.3px; font-family: var(--font-brand); font-size: 14px; text-transform: uppercase; }
.topbar-brand .mark { height: 34px; display: flex; align-items: center; }
.topbar-brand .mark img { height: 100%; width: auto; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar button.icon-btn {
  background: rgba(255,255,255,0.12); border: none; color: #fff; border-radius: 8px;
  width: 34px; height: 34px; cursor: pointer; font-size: 16px;
}
.topbar button.icon-btn:hover { background: rgba(255,255,255,0.22); }

/* Bottom nav (mobile-first, since this ships as an Android app) */
.bottombar {
  position: sticky; bottom: 0; z-index: 20;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.bottombar a {
  flex: 1; text-align: center; padding: 8px 4px; border-radius: var(--radius-sm);
  color: var(--color-text-muted); font-size: 12px; font-weight: 600; text-decoration: none;
}
.bottombar a.active { color: var(--color-accent-dark); background: rgba(0,180,166,0.1); }
.bottombar a .nav-icon { display: block; font-size: 18px; margin-bottom: 2px; }

main.content { flex: 1; padding: 16px; padding-bottom: 84px; max-width: 760px; margin: 0 auto; width: 100%; }

/* Cards / lists */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-1);
}
.card + .card { margin-top: 12px; }

.ticket-card { display: block; cursor: pointer; }
.ticket-card:hover { border-color: var(--color-accent); text-decoration: none; }
.ticket-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ticket-subject { font-weight: 700; font-size: 15px; color: var(--color-text); }
.ticket-meta { color: var(--color-text-muted); font-size: 13px; margin-top: 4px; }
.ticket-number { font-weight: 700; color: var(--color-text-muted); font-size: 0.75em; margin-right: 4px; white-space: nowrap; }
.ticket-id { color: var(--color-text-muted); font-size: 12px; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  padding: 3px 8px; border-radius: 999px;
}
.badge-open { background: #E7F0FF; color: var(--color-info); }
.badge-in_progress { background: #FFF3E0; color: var(--color-warning); }
.badge-waiting { background: #F1E9FF; color: #7C4DBF; }
.badge-parked { background: #FFF0E0; color: var(--color-ember-dark); }
.badge-resolved { background: #E6F7EF; color: var(--color-success); }
.badge-closed { background: #EDF1F5; color: var(--color-text-muted); }

.badge-review-due { background: var(--color-ember); color: #fff; animation: pulse-review 2s ease-in-out infinite; }
.badge-quote { background: #E7E6FF; color: var(--color-accent-dark); }
.badge-private { background: #EDF1F5; color: var(--color-text-muted); }
@keyframes pulse-review { 0%, 100% { opacity: 1; } 50% { opacity: 0.72; } }

.priority-low { color: var(--color-text-muted); }
.priority-medium { color: var(--color-info); }
.priority-high { color: var(--color-warning); }
.priority-urgent { color: var(--color-ember-dark); font-weight: 700; }

/* Forms */
.form-group { margin-bottom: 16px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--color-text); }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  font-size: 15px; font-family: inherit; background: var(--color-surface); color: var(--color-text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(0,180,166,0.15); }
textarea { min-height: 120px; resize: vertical; }
.field-hint { font-size: 12px; color: var(--color-text-muted); margin-top: 4px; }
.field-error { font-size: 12px; color: var(--color-danger); margin-top: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; border-radius: var(--radius-sm); border: none; cursor: pointer;
  font-size: 15px; font-weight: 600; font-family: inherit; transition: background 0.15s ease;
}
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-dark); }
.btn-secondary { background: var(--color-surface); color: var(--color-primary); border: 1px solid var(--color-border); }
.btn-secondary:hover { background: #EEF2F6; }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* Auth screens */
.auth-wrap { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--color-primary); background: radial-gradient(circle at 50% 0%, var(--color-primary-light), var(--color-primary) 70%); }
.auth-card { background: var(--color-surface); border-radius: var(--radius-lg); padding: 32px 28px; width: 100%; max-width: 420px; box-shadow: var(--shadow-2); }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 20px; }
.auth-logo img { max-width: 100%; height: auto; max-height: 130px; }
.auth-logo h1 { font-size: 15px; margin: 4px 0 0; font-family: var(--font-brand); text-transform: uppercase; letter-spacing: 0.5px; color: var(--color-text-muted); font-weight: 600; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 14px; color: var(--color-text-muted); }
.auth-error { background: #FDECEC; color: var(--color-danger); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }

/* Ticket detail / thread */
.detail-header { margin-bottom: 16px; }
.detail-header h1 { font-size: 19px; margin: 8px 0 4px; }
.detail-badges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.back-link { font-size: 13px; color: var(--color-text-muted); display: inline-flex; align-items: center; gap: 4px; margin-bottom: 8px; }

.control-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.control-row .form-group { flex: 1; min-width: 140px; margin-bottom: 0; }

.thread { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.msg { border-radius: var(--radius-md); padding: 12px 14px; max-width: 88%; }
.msg-customer { background: #EEF2F6; align-self: flex-start; }
.msg-staff { background: #E6F7F5; align-self: flex-end; }
.msg-internal { background: #FFF7E0; border: 1px dashed var(--color-warning); align-self: flex-end; }
.msg-meta { font-size: 11px; color: var(--color-text-muted); margin-bottom: 4px; display: flex; justify-content: space-between; gap: 8px; }
.msg-body { font-size: 14px; white-space: pre-wrap; word-break: break-word; }

.reply-box { margin-top: 16px; }
.internal-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-text-muted); margin-top: 8px; }
.internal-toggle input { width: auto; }

/* Empty / loading states */
.empty-state { text-align: center; color: var(--color-text-muted); padding: 48px 16px; }
.empty-state .mark { font-size: 32px; margin-bottom: 8px; }
.spinner {
  width: 22px; height: 22px; border: 3px solid var(--color-border); border-top-color: var(--color-accent);
  border-radius: 50%; animation: spin 0.7s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.fab {
  position: fixed; bottom: 84px; right: 20px; z-index: 25;
  width: 56px; height: 56px; border-radius: 50%; background: var(--color-ember); color: #fff;
  border: none; font-size: 26px; box-shadow: var(--shadow-2); cursor: pointer;
}
.fab:hover { background: var(--color-ember-dark); }

.stat-row { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.stat-tile { flex: 1; min-width: 100px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 12px; text-align: center; }
.stat-tile .num { font-size: 22px; font-weight: 800; color: var(--color-primary); }
.stat-tile .label { font-size: 11px; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.4px; }

.toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
  background: var(--color-text); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13px;
  z-index: 40; box-shadow: var(--shadow-2);
}

/* Staff calendar / diary */
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: 10px; }
.cal-nav .btn { padding: 8px 12px; }

.cal-swatch-row { display: flex; gap: 8px; flex-wrap: wrap; }
.cal-swatch-btn {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0;
}
.cal-swatch-btn-active { border-color: var(--color-text); box-shadow: 0 0 0 2px var(--color-surface) inset; }

.cal-attendee-list {
  display: flex; flex-direction: column; gap: 6px; max-height: 160px; overflow-y: auto;
  border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--color-bg);
}
.cal-attendee-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.cal-attendee-item input { width: auto; }

.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.cal-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--color-text-muted); }
.cal-swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

.cal-grid-labels { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.cal-grid-labels div { text-align: center; font-size: 11px; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell {
  aspect-ratio: 1; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-surface); cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start; padding: 4px 2px; font-family: inherit;
  gap: 3px; min-height: 44px;
}
.cal-cell:hover { border-color: var(--color-accent); }
.cal-cell-blank { visibility: hidden; cursor: default; border: none; background: none; }
.cal-cell-today .cal-daynum { color: var(--color-accent-dark); font-weight: 800; }
.cal-cell-selected { border-color: var(--color-accent); box-shadow: 0 0 0 2px rgba(0,0,229,0.15); }
.cal-daynum { font-size: 12px; font-weight: 600; color: var(--color-text); }
.cal-dots { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.cal-dot-more { font-size: 9px; color: var(--color-text-muted); }

.cal-event-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: none; border-left: 4px solid var(--color-border); background: var(--color-bg);
  border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 8px; cursor: pointer; font-family: inherit;
}
.cal-event-row:hover { background: #EEF2F6; }
.cal-event-time { font-size: 12px; color: var(--color-text-muted); white-space: nowrap; }
.cal-event-title { font-size: 14px; font-weight: 600; flex: 1; }

@media (min-width: 640px) {
  .bottombar { display: none; }
  main.content { padding-bottom: 32px; }
}
