/* ── STITCH DESIGN SYSTEM — AllinOneGig ── */
/* Primary: #2ab87a  |  Bg: #0d141d  |  Font: Inter */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap');

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

:root {
  /* ── Brand ── */
  --primary:            #2ab87a;
  --primary-dim:        #1a9961;
  --primary-glow:       rgba(42,184,122,0.25);
  --primary-glow-sm:    rgba(42,184,122,0.15);
  --secondary:          #35cf94;
  --error:              #ffb4ab;
  --error-glow:         rgba(255,180,171,0.3);

  /* ── Surfaces ── */
  --bg:                 #0d141d;
  --surface-lowest:     #080f17;
  --surface-low:        #151c25;
  --surface:            #192029;
  --surface-high:       #232a34;
  --surface-highest:    #2e353f;

  /* ── Text ── */
  --text:               #dce3f0;
  --text-muted:         #bbcabf;
  --text-dim:           #86948a;

  /* ── Borders ── */
  --outline:            #3c4a42;

  /* ── Sidebar ── */
  --sidebar-w:          248px;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ── MATERIAL ICONS ── */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-size: 20px;
  line-height: 1;
  vertical-align: middle;
  flex-shrink: 0;
}
.icon-fill { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }

/* ── TYPOGRAPHY ── */
.text-display { font-size: 48px; line-height: 1.1; letter-spacing: -0.02em; font-weight: 700; }
.text-h1  { font-size: 32px; line-height: 1.2; letter-spacing: -0.01em; font-weight: 600; }
.text-h2  { font-size: 24px; line-height: 1.3; font-weight: 600; }
.text-h3  { font-size: 20px; line-height: 1.4; font-weight: 500; }
.text-lg  { font-size: 18px; line-height: 1.6; }
.text-md  { font-size: 16px; line-height: 1.6; }
.text-sm  { font-size: 14px; line-height: 1.5; }
.text-xs  { font-size: 12px; line-height: 1; letter-spacing: 0.05em; font-weight: 600; }
.text-mono { font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.text-label { font-size: 12px; letter-spacing: 0.05em; font-weight: 600; text-transform: uppercase; }
.text-primary  { color: var(--primary); }
.text-muted    { color: var(--text-muted); }
.text-dim      { color: var(--text-dim); }
.text-error    { color: var(--error); }

/* ── LAYOUT ── */
.app-layout { display: flex; min-height: 100vh; }
.page-content { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }
@media (max-width: 768px) { .page-content { margin-left: 0; } }

/* ── TOPBAR ── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 64px;
  background: rgba(13,20,29,0.92);
  border-bottom: 1px solid var(--outline);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
}
.topbar-brand { font-size: 18px; font-weight: 600; color: var(--primary); letter-spacing: -0.3px; text-decoration: none; }
.topbar-nav { display: flex; align-items: center; gap: 6px; }
.topbar-nav a { color: var(--text-muted); text-decoration: none; font-size: 14px; font-weight: 500; padding: 6px 12px; border-radius: 6px; transition: all 0.2s; }
.topbar-nav a:hover { color: var(--text); background: var(--surface); }
.topbar-nav a.active { color: var(--primary); border-bottom: 2px solid var(--primary); border-radius: 0; padding-bottom: 4px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-search { display: flex; align-items: center; gap: 8px; background: var(--surface-low); border: 1px solid var(--outline); border-radius: 8px; padding: 6px 12px; }
.topbar-search input { background: none; border: none; outline: none; color: var(--text); font-size: 14px; width: 200px; font-family: inherit; }
.topbar-search input::placeholder { color: var(--text-dim); }
.topbar-icon { color: var(--text-muted); cursor: pointer; transition: color 0.2s; background: none; border: none; padding: 4px; }
.topbar-icon:hover { color: var(--primary); }
.avatar { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; border: 1px solid var(--outline); cursor: pointer; display: flex; align-items: center; justify-content: center; background: var(--primary); font-size: 13px; font-weight: 700; color: var(--bg); }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  position: fixed; left: 0; top: 64px;
  background: rgba(19,32,41,0.5);
  backdrop-filter: blur(8px);
  border-right: 1px solid var(--outline);
  display: flex; flex-direction: column;
  padding: 16px 12px;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s;
}
.sidebar-brand { padding: 4px 12px 16px; }
.sidebar-brand-name { font-size: 16px; font-weight: 600; color: var(--primary); text-shadow: 0 0 10px var(--primary-glow-sm); }
.sidebar-brand-sub { font-size: 10px; letter-spacing: 0.12em; font-weight: 600; text-transform: uppercase; color: var(--text-dim); margin-top: 2px; }
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: var(--text-muted); text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: all 0.15s; cursor: pointer; border: none; background: none; width: 100%; text-align: left;
}
.sidebar-link:hover { background: var(--surface-high); color: var(--text); }
.sidebar-link.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--bg);
  font-weight: 600;
  box-shadow: 0 0 18px var(--primary-glow-sm);
}
.sidebar-divider { height: 1px; background: var(--outline); margin: 12px 0; }
.sidebar-footer { padding-top: 8px; }
.sidebar-upgrade {
  background: var(--surface-high);
  border: 1px solid var(--outline);
  border-radius: 10px; padding: 14px; margin-bottom: 12px;
  position: relative; overflow: hidden;
}
.sidebar-upgrade::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(42,184,122,0.06), transparent); }
.sidebar-upgrade-title { font-size: 13px; font-weight: 700; color: var(--primary); margin-bottom: 4px; position: relative; }
.sidebar-upgrade-desc { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; line-height: 1.5; position: relative; }

/* Mobile sidebar */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 99; }
.sidebar-overlay.open { display: block; }
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); top: 0; height: 100vh; padding-top: 20px; z-index: 300; }
  .sidebar.open { transform: translateX(0); }
  .page-content { margin-left: 0; }
  .topbar-search { display: none; }
}

/* ── MAIN CANVAS ── */
.main-canvas { padding: 32px 28px; padding-top: 96px; max-width: 1280px; }
@media (max-width: 768px) { .main-canvas { padding: 80px 16px 24px; } }

/* ── CARDS ── */
.card {
  background: rgba(21,28,37,0.8);
  border: 1px solid var(--outline);
  border-radius: 12px; padding: 20px;
  backdrop-filter: blur(8px);
  transition: all 0.2s;
}
.card:hover { border-color: rgba(42,184,122,0.35); }
.card:hover.card-glow { box-shadow: 0 0 18px var(--primary-glow-sm); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 16px; font-weight: 600; color: var(--text); }
.card-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ── STAT CARDS ── */
.stat-card { background: rgba(21,28,37,0.8); border: 1px solid var(--outline); border-radius: 12px; padding: 16px; transition: all 0.2s; }
.stat-card:hover { border-color: rgba(42,184,122,0.4); box-shadow: 0 0 18px var(--primary-glow-sm); }
.stat-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-card-label { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; color: var(--text-muted); }
.stat-card-icon { color: var(--primary); text-shadow: 0 0 8px var(--primary-glow-sm); }
.stat-card-value { font-size: 26px; font-weight: 600; color: var(--text); margin-bottom: 6px; transition: color 0.2s; }
.stat-card:hover .stat-card-value { color: var(--primary); }
.stat-card-sub { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.stat-card-sub.positive { color: var(--primary); }
.stat-card-sub.negative { color: var(--error); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 1024px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .stats-grid { grid-template-columns: 1fr; } }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 20px; border-radius: 8px;
  font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none; border: none; transition: all 0.2s; white-space: nowrap;
}
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 6px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dim)); color: #fff; box-shadow: 0 4px 16px var(--primary-glow-sm); }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 6px 24px var(--primary-glow); }
.btn-primary:active { transform: translateY(0); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--outline); }
.btn-outline:hover { background: var(--surface-high); border-color: rgba(42,184,122,0.4); }
.btn-ghost  { background: transparent; color: var(--text-muted); }
.btn-ghost:hover  { background: var(--surface); color: var(--text); }
.btn-danger { background: rgba(255,180,171,0.12); color: var(--error); border: 1px solid rgba(255,180,171,0.3); }
.btn-danger:hover { background: rgba(255,180,171,0.2); }

/* ── BADGE / PILL ── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-green  { background: rgba(42,184,122,0.12);  color: var(--primary); border: 1px solid rgba(42,184,122,0.25); }
.badge-red    { background: rgba(255,180,171,0.10);  color: var(--error);   border: 1px solid rgba(255,180,171,0.25); }
.badge-amber  { background: rgba(245,158,11,0.12);   color: #f59e0b;        border: 1px solid rgba(245,158,11,0.25); }
.badge-blue   { background: rgba(96,165,250,0.12);   color: #60a5fa;        border: 1px solid rgba(96,165,250,0.25); }
.badge-gray   { background: rgba(255,255,255,0.06);  color: var(--text-muted); border: 1px solid var(--outline); }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 10px 13px;
  background: var(--surface-low); border: 1px solid var(--outline);
  border-radius: 8px; color: var(--text); font-size: 14px; font-family: inherit;
  outline: none; transition: all 0.2s;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(42,184,122,0.1); }
.form-control::placeholder { color: var(--text-dim); }
.form-control-sm { padding: 7px 10px; font-size: 13px; }
select.form-control { cursor: pointer; }
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #151c25 inset !important;
  -webkit-text-fill-color: #dce3f0 !important;
  border-color: var(--outline) !important;
  transition: background-color 5000s ease-in-out 0s !important;
}

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: rgba(8,15,23,0.5); border-bottom: 1px solid var(--outline); }
thead th { padding: 10px 14px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); text-align: left; }
tbody tr { border-bottom: 1px solid rgba(60,74,66,0.4); transition: background 0.15s; }
tbody tr:hover { background: var(--surface-high); }
tbody td { padding: 13px 14px; font-size: 14px; color: var(--text); }
.table-mono { font-family: 'JetBrains Mono', monospace; font-size: 13px; }

/* ── ONLINE DOT ── */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-green { background: var(--primary); box-shadow: 0 0 8px var(--primary); }
.dot-red   { background: var(--error);   box-shadow: 0 0 8px var(--error-glow); }
.dot-amber { background: #f59e0b; }

/* ── PROGRESS BAR ── */
.progress { height: 6px; background: var(--surface-highest); border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 3px; transition: width 0.4s; }

/* ── AUTH ── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--bg); position: relative; }
.auth-page::before { content: ''; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 20% 25%, rgba(42,184,122,0.07) 0%, transparent 55%), radial-gradient(ellipse at 80% 75%, rgba(42,184,122,0.04) 0%, transparent 55%); }
.auth-card { width: 100%; max-width: 440px; background: var(--surface-low); border: 1px solid var(--outline); border-radius: 16px; padding: 36px 32px; position: relative; z-index: 1; box-shadow: 0 0 0 1px rgba(42,184,122,0.06), 0 24px 64px rgba(0,0,0,0.5); }
.auth-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-bottom: 28px; }
.auth-logo img { height: 36px; width: 36px; object-fit: contain; border-radius: 8px; }
.auth-logo-name { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: 1.2px; }
.auth-title { font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -0.4px; margin-bottom: 6px; }
.auth-sub   { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 26px; }
.auth-footer { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.auth-footer a { color: var(--primary); text-decoration: none; font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }
.alert { padding: 11px 13px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; display: none; }
.alert-error   { background: rgba(255,180,171,0.08); border: 1px solid rgba(255,180,171,0.2); color: #fca5a5; }
.alert-success { background: rgba(42,184,122,0.08); border: 1px solid rgba(42,184,122,0.2); color: var(--primary); }

/* ── CHAT ── */
.chat-layout { display: grid; grid-template-columns: 300px 1fr 320px; height: calc(100vh - 64px); gap: 0; }
@media (max-width: 1100px) { .chat-layout { grid-template-columns: 260px 1fr; } .chat-profile { display: none; } }
@media (max-width: 768px) { .chat-layout { grid-template-columns: 1fr; } }
.chat-msg-bubble { max-width: 75%; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.chat-msg-bubble.incoming { background: var(--surface-high); border: 1px solid var(--outline); border-bottom-left-radius: 3px; color: var(--text); }
.chat-msg-bubble.outgoing { background: var(--primary); color: #003824; border-bottom-right-radius: 3px; align-self: flex-end; }

/* ── FOOTER ── */
.page-footer { background: var(--surface-lowest); border-top: 1px solid var(--outline); padding: 48px 28px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 32px; max-width: 1280px; margin: 0 auto; }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-bottom { max-width: 1280px; margin: 24px auto 0; padding-top: 16px; border-top: 1px solid rgba(60,74,66,0.3); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.footer-link { font-size: 13px; color: var(--text-muted); text-decoration: underline; transition: color 0.2s; display: block; margin-bottom: 6px; }
.footer-link:hover { color: var(--text); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-highest); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--outline); }

/* ── ANIMATIONS ── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
.animate-fade-up { animation: fadeUp 0.3s ease; }
.spin { animation: spin 0.7s linear infinite; }
