/* ============================================================
   app.css — Kibo POS Hub / Workspace Home
   
   Aesthetic: Coastal morning. Warm. Welcoming. Purposeful.
   Every staff member starts their shift here.
   Make it feel like a breath of fresh Watamu air.
   Dark base, warm accent, generous space.
============================================================ */

:root {
  --bg:           #000000;
  --bg-raised:    #070a09;
  --bg-card:      #0c1210;
  --surface:      #162018;
  --surface-dim:  #0e1610;
  --surface-hi:   #1e2e20;

  /* Accent — Kibo orange stays primary */
  --accent:       #ed7c31;
  --accent-dim:   #c45e18;
  --accent-glow:  rgba(237,124,49,0.16);
  --accent-hi:    rgba(237,124,49,0.32);

  /* Teal — coastal water */
  --teal:         #0bbfaa;
  --teal-glow:    rgba(11,191,170,0.14);

  /* Seafoam — morning light */
  --seafoam:      #5de0c0;

  --text:         rgba(255,255,255,0.88);
  --text-muted:   rgba(255,255,255,0.45);
  --text-faint:   rgba(255,255,255,0.18);
  --border:       rgba(255,255,255,0.07);
  --border-accent:rgba(237,124,49,0.28);
  --border-teal:  rgba(11,191,170,0.25);

  --success:      #3dd598;
  --warning:      #f9b233;
  --danger:       #ff6b6b;
  --info:         #67b7ff;

  --r-sm:   8px;
  --r-md:   14px;
  --r-lg:   20px;
  --r-xl:   28px;
  --r-pill: 999px;

  --header-h: 66px;

  --shadow-sm:     0 2px 12px rgba(0,0,0,0.45);
  --shadow-md:     0 8px 32px rgba(0,0,0,0.60);
  --shadow-tile:   0 4px 20px rgba(0,0,0,0.55);
  --shadow-accent: 0 6px 28px rgba(237,124,49,0.22);
  --shadow-teal:   0 6px 28px rgba(11,191,170,0.18);

  --t-fast: 130ms ease;
  --t-base: 220ms ease;
  --t-slow: 380ms cubic-bezier(0.22,1,0.36,1);

  --font-body:    'Nunito Sans', sans-serif;
  --font-heading: 'Raleway', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

button { cursor: pointer; font-family: inherit; border: none; background: none; color: inherit; }
.hidden { display: none !important; }


/* ============================================================
   BACKGROUND — coastal atmosphere
============================================================ */
.hub { position: relative; min-height: 100vh; overflow-x: hidden; }

/* Subtle dot grid */
.hub-bg-grid {
  position: fixed; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none; z-index: 0;
}

/* Warm ambient glow — shifts colour based on role */
.hub-bg-glow {
  position: fixed;
  width: 800px; height: 800px;
  border-radius: 50%;
  top: -200px; right: -200px;
  pointer-events: none; z-index: 0;
  transition: background var(--t-slow);
  /* Default orange */
  background: radial-gradient(circle,
    rgba(237,124,49,0.07) 0%,
    transparent 65%
  );
}

/* Role-based glow colour classes */
.hub-bg-glow.glow-teal {
  background: radial-gradient(circle,
    rgba(11,191,170,0.07) 0%,
    transparent 65%
  );
}

.hub-bg-glow.glow-fire {
  background: radial-gradient(circle,
    rgba(249,178,51,0.07) 0%,
    transparent 65%
  );
}


/* ============================================================
   HEADER
============================================================ */
.hub-header {
  position: relative; z-index: 10;
  height: var(--header-h);
  background: rgba(7,10,9,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

/* Brand */
.hub-brand {
  display: flex; align-items: center; gap: 12px;
}

.hub-brand-icon {
  width: 40px; height: 40px;
  background: var(--accent);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: #fff;
  flex-shrink: 0;
  box-shadow: var(--shadow-accent);
}

.hub-brand-text {
  display: flex; flex-direction: column; gap: 1px;
}

.hub-brand-name {
  font-family: var(--font-heading);
  font-size: 1.15rem; font-weight: 900;
  color: #fff; letter-spacing: -0.02em;
  line-height: 1;
}

.hub-brand-location {
  font-size: 0.65rem; color: var(--teal);
  display: flex; align-items: center; gap: 3px;
  letter-spacing: 0.03em;
}

.hub-brand-location i { font-size: 0.6rem; }

/* Clock */
.hub-header-center {
  display: flex; justify-content: center;
}

.hub-clock-wrap { text-align: center; }

.hub-time {
  font-family: var(--font-heading);
  font-size: 1.3rem; font-weight: 800;
  color: #fff; letter-spacing: 0.04em;
  line-height: 1;
}

.hub-date {
  font-size: 0.65rem; color: var(--text-muted);
  letter-spacing: 0.05em; margin-top: 2px;
}

/* Staff + logout */
.hub-header-right {
  display: flex; align-items: center;
  gap: 12px; justify-content: flex-end;
}

.hub-staff-chip {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface-dim);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 5px 14px 5px 5px;
}

.hub-staff-av {
  width: 32px; height: 32px;
  border-radius: var(--r-pill);
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 800; color: #fff;
  flex-shrink: 0;
}

.hub-staff-info { display: flex; flex-direction: column; gap: 1px; }

.hub-staff-name {
  font-size: 0.82rem; font-weight: 700; color: #fff;
}

.hub-staff-role {
  font-size: 0.62rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
}

.hub-logout-btn {
  display: flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--text-muted);
  font-size: 0.78rem; font-weight: 600;
  transition: all var(--t-fast);
}

.hub-logout-btn:hover {
  border-color: rgba(255,107,107,0.40);
  color: var(--danger);
  background: rgba(255,107,107,0.08);
}


/* ============================================================
   HERO SECTION
============================================================ */
.hub-hero {
  position: relative; z-index: 1;
  padding: 40px 32px 28px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

/* Greeting */
.hub-greeting {
  display: flex; align-items: center; gap: 18px;
  animation: fadeUp 0.5s 0.1s ease-out both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hub-greeting-icon {
  width: 56px; height: 56px;
  border-radius: var(--r-lg);
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: var(--accent);
  flex-shrink: 0;
}

/* Time-of-day icon colours */
.hub-greeting-icon.morning { color: var(--warning); background: rgba(249,178,51,0.12); border-color: rgba(249,178,51,0.28); }
.hub-greeting-icon.afternoon { color: var(--accent); }
.hub-greeting-icon.evening  { color: var(--teal);   background: var(--teal-glow);   border-color: var(--border-teal); }
.hub-greeting-icon.night    { color: #a78bfa;        background: rgba(167,139,250,0.12); border-color: rgba(167,139,250,0.28); }

.hub-greeting-title {
  font-family: var(--font-heading);
  font-size: 1.6rem; font-weight: 900;
  color: #fff; letter-spacing: -0.02em;
  line-height: 1.1;
}

.hub-greeting-name {
  font-size: 0.88rem; color: var(--text-muted);
  margin-top: 4px;
}

/* Stats strip */
.hub-stats {
  display: flex; gap: 12px;
  flex-wrap: wrap;
  animation: fadeUp 0.5s 0.2s ease-out both;
}

.hub-stat-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 18px;
  min-width: 140px;
  transition: border-color var(--t-fast);
}

.hub-stat-card:hover { border-color: rgba(255,255,255,0.14); }

.hub-stat-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: var(--text-muted);
  flex-shrink: 0;
}

.hub-stat-icon.warning { color: var(--warning); background: rgba(249,178,51,0.12); }
.hub-stat-icon.success { color: var(--success); background: rgba(61,213,152,0.12); }
.hub-stat-icon.accent  { color: var(--accent);  background: var(--accent-glow); }

.hub-stat-body { display: flex; flex-direction: column; gap: 2px; }

.hub-stat-value {
  font-family: var(--font-heading);
  font-size: 1.15rem; font-weight: 800; color: #fff;
  line-height: 1;
}

.hub-stat-value.warning { color: var(--warning); }
.hub-stat-value.success { color: var(--success); }
.hub-stat-value.accent  { color: var(--accent); }

.hub-stat-label {
  font-size: 0.65rem; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.05em;
}


/* ============================================================
   TOOLS SECTION
============================================================ */
.hub-tools {
  position: relative; z-index: 1;
  padding: 0 32px 40px;
}

.hub-tools-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 16px;
}

/* Tile grid */
.hub-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}


/* ── TOOL TILE ────────────────────────────────────────── */
.hub-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px 22px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  transition: transform var(--t-fast),
              box-shadow var(--t-fast),
              border-color var(--t-fast),
              background var(--t-fast);
  position: relative;
  overflow: hidden;

  /* Staggered entrance */
  animation: tileIn 0.4s ease-out both;
}

.hub-tile:nth-child(1) { animation-delay: 0.10s; }
.hub-tile:nth-child(2) { animation-delay: 0.15s; }
.hub-tile:nth-child(3) { animation-delay: 0.20s; }
.hub-tile:nth-child(4) { animation-delay: 0.25s; }
.hub-tile:nth-child(5) { animation-delay: 0.30s; }
.hub-tile:nth-child(6) { animation-delay: 0.35s; }

@keyframes tileIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* Hover glow line at top */
.hub-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1px;
  background: var(--tile-color, var(--accent));
  opacity: 0;
  transition: opacity var(--t-base);
  border-radius: var(--r-pill);
}

.hub-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-tile);
  border-color: rgba(255,255,255,0.12);
  background: var(--surface-dim);
}

.hub-tile:hover::before { opacity: 0.7; }
.hub-tile:active { transform: scale(0.98); }

/* Tile icon */
.hub-tile-icon {
  width: 52px; height: 52px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  color: var(--tile-color, var(--accent));
  transition: background var(--t-fast), box-shadow var(--t-fast);
  flex-shrink: 0;
}

.hub-tile:hover .hub-tile-icon {
  background: color-mix(in srgb, var(--tile-color, var(--accent)) 15%, transparent);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--tile-color, var(--accent)) 25%, transparent);
}

/* Tile text */
.hub-tile-body { display: flex; flex-direction: column; gap: 4px; }

.hub-tile-title {
  font-family: var(--font-heading);
  font-size: 1rem; font-weight: 800;
  color: #fff; letter-spacing: -0.01em;
  line-height: 1.2;
}

.hub-tile-desc {
  font-size: 0.72rem; color: var(--text-muted);
  line-height: 1.4;
}

/* Badge — shows live count on tile */
.hub-tile-badge {
  position: absolute;
  top: 14px; right: 14px;
  min-width: 22px; height: 22px;
  background: var(--tile-color, var(--accent));
  color: #000;
  border-radius: var(--r-pill);
  font-size: 0.68rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 0 6px;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity var(--t-base), transform var(--t-base);
}

.hub-tile-badge.visible {
  opacity: 1;
  transform: scale(1);
}

/* Arrow — appears on hover */
.hub-tile-arrow {
  position: absolute;
  bottom: 18px; right: 18px;
  font-size: 0.9rem;
  color: var(--text-faint);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity var(--t-base), transform var(--t-base);
}

.hub-tile:hover .hub-tile-arrow {
  opacity: 1;
  transform: translateX(0);
}


/* ── TILE COLOUR VARIANTS ─────────────────────────────── */
/* Each tool has its own personality */

.hub-tile[data-tool="take_order"]    { --tile-color: #ed7c31; }
.hub-tile[data-tool="verify"]        { --tile-color: #f9b233; }
.hub-tile[data-tool="payment"]       { --tile-color: #3dd598; }
.hub-tile[data-tool="kitchen"]       { --tile-color: #ff6b6b; }
.hub-tile[data-tool="bar"]           { --tile-color: #0bbfaa; }
.hub-tile[data-tool="open_orders"]   { --tile-color: #67b7ff; }
.hub-tile[data-tool="history"]       { --tile-color: #a78bfa; }
.hub-tile[data-tool="bar_sale"]      { --tile-color: #0bbfaa; }
.hub-tile[data-tool="quick_sale"] { --tile-color: #0bbfaa; }


/* ============================================================
   FOOTER
============================================================ */
.hub-footer {
  position: relative; z-index: 1;
  padding: 16px 32px 24px;
  display: flex; align-items: center; gap: 10px;
  font-size: 0.68rem; color: var(--text-faint);
  border-top: 1px solid var(--border);
}

.hub-footer-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
  transition: background var(--t-base), box-shadow var(--t-base);
}

.hub-footer-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(61,213,152,0.18);
}

.hub-footer-dot.offline { background: var(--danger); }
.hub-footer-sep { opacity: 0.4; }

