/* ============================================================================
   Tripate Talk - Master Stylesheet v1.0
   Aesthetic: Refined, professional, calm. Linear/Notion-inspired clarity.
   Brand: Navy #053E74 + Gold #F2C400
   ============================================================================ */

/* Import fonts - Manrope for UI, Fraunces for headlines */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Manrope:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Brand */
  --navy: #053E74;
  --navy-dark: #042B52;
  --navy-light: #07599E;
  --gold: #F2C400;
  --gold-dark: #D4AC00;

  /* Surfaces */
  --bg: #FAFAF7;
  --bg-card: #FFFFFF;
  --bg-subtle: #F4F4EF;
  --bg-elevated: #FFFFFF;

  /* Text */
  --text: #1A1F2E;
  --text-muted: #525B73;
  --text-soft: #8893AB;
  --text-inverse: #FFFFFF;

  /* Borders */
  --border: #E5E2D9;
  --border-strong: #D0CCBF;
  --border-focus: var(--navy);

  /* Status */
  --success: #10B981;
  --success-bg: #ECFDF5;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --danger: #EF4444;
  --danger-bg: #FEF2F2;
  --info: #3B82F6;
  --info-bg: #EFF6FF;

  /* Sizing */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(5, 62, 116, 0.06);
  --shadow: 0 2px 8px rgba(5, 62, 116, 0.08);
  --shadow-md: 0 4px 16px rgba(5, 62, 116, 0.10);
  --shadow-lg: 0 12px 32px rgba(5, 62, 116, 0.12);

  /* Typography */
  --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-serif: 'Fraunces', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* Layout */
  --sidebar-width: 240px;
  --header-height: 64px;
  --max-content: 1280px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}
h1 { font-size: 2rem; line-height: 1.15; }
h2 { font-size: 1.5rem; line-height: 1.25; }
h3 { font-size: 1.2rem; line-height: 1.3; }

a {
  color: var(--navy);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--navy-light); }

button { font-family: inherit; cursor: pointer; }

/* Layout containers */
.container { max-width: var(--max-content); margin: 0 auto; padding: 0 24px; }

/* ============================================================================
   Forms
   ============================================================================ */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}
.form-input,
.form-select,
.form-textarea {
  display: block;
  width: 100%;
  padding: 11px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.15s ease;
  outline: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(5, 62, 116, 0.10);
}
.form-input::placeholder { color: var(--text-soft); }
.form-help { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.form-error {
  background: var(--danger-bg);
  color: var(--danger);
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  border-left: 3px solid var(--danger);
  margin-bottom: 20px;
}

/* ============================================================================
   Buttons
   ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.005em;
}
.btn-primary {
  background: var(--navy);
  color: var(--text-inverse);
}
.btn-primary:hover {
  background: var(--navy-dark);
  color: var(--text-inverse);
}
.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg-subtle); }
.btn-gold {
  background: var(--gold);
  color: var(--navy);
}
.btn-gold:hover { background: var(--gold-dark); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 24px; font-size: 15px; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* ============================================================================
   Cards
   ============================================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 1.1rem; }

/* ============================================================================
   Authentication pages (login)
   ============================================================================ */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
.auth-brand {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--text-inverse);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 56px;
  position: relative;
  overflow: hidden;
}
.auth-brand::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 80%;
  height: 200%;
  background: radial-gradient(circle, var(--gold) 0%, transparent 60%);
  opacity: 0.18;
  pointer-events: none;
}
.auth-brand-logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.auth-brand-logo-dot {
  width: 10px; height: 10px;
  background: var(--gold);
  border-radius: 50%;
}
.auth-brand-headline {
  font-family: var(--font-serif);
  font-size: 2.75rem;
  line-height: 1.1;
  font-weight: 500;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  position: relative;
}
.auth-brand-headline em {
  font-style: italic;
  color: var(--gold);
  font-weight: 400;
}
.auth-brand-tagline {
  font-size: 1rem;
  opacity: 0.85;
  max-width: 380px;
  line-height: 1.55;
  position: relative;
}
.auth-brand-footer {
  font-size: 13px;
  opacity: 0.6;
  position: relative;
}

.auth-form-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}
.auth-form {
  width: 100%;
  max-width: 380px;
}
.auth-form h1 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}
.auth-form-subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 14px;
}

@media (max-width: 880px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
}

/* ============================================================================
   App layout (after login)
   ============================================================================ */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--navy);
  color: var(--text-inverse);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  padding: 0 12px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 16px;
}
.sidebar-logo-dot {
  width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 50%;
}
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
}
.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-inverse);
}
.sidebar-nav a.active {
  background: rgba(242, 196, 0, 0.12);
  color: var(--gold);
}
.sidebar-nav a .nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-nav-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.4);
  padding: 16px 12px 6px;
  font-weight: 600;
}
.sidebar-user {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-inverse);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user-role {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: capitalize;
}

.main {
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-height);
}
.main-header h1 { font-size: 1.25rem; }
.main-content { padding: 32px; }

/* ============================================================================
   Dashboard stats
   ============================================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.stat-value {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}
.stat-meta {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 6px;
}
.stat-card-accent {
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--navy);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.stat-card-accent.gold { background: var(--gold); }
.stat-card-accent.success { background: var(--success); }
.stat-card-accent.warning { background: var(--warning); }

/* ============================================================================
   Activity feed
   ============================================================================ */
.activity-list { display: flex; flex-direction: column; }
.activity-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--navy);
  margin-top: 8px;
  flex-shrink: 0;
}
.activity-content { flex: 1; min-width: 0; }
.activity-action { font-size: 14px; color: var(--text); }
.activity-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ============================================================================
   Status badges
   ============================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text);
}
.badge.success { background: var(--success-bg); color: var(--success); }
.badge.warning { background: var(--warning-bg); color: var(--warning); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.info { background: var(--info-bg); color: var(--info); }

/* ============================================================================
   Utilities
   ============================================================================ */
.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.text-mono { font-family: var(--font-mono); }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.mb-8 { margin-bottom: 32px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .main-content { padding: 20px; }
}

/* ============================================================================
   Phase 3b additions - append to /var/www/tripate-talk/public/assets/css/app.css
   ============================================================================ */

/* Flash messages */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid;
}
.flash-success {
  background: var(--success-bg);
  color: var(--success);
  border-left-color: var(--success);
}
.flash-danger,
.flash-error {
  background: var(--danger-bg);
  color: var(--danger);
  border-left-color: var(--danger);
}
.flash-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border-left-color: var(--warning);
}
.flash-info {
  background: var(--info-bg);
  color: var(--info);
  border-left-color: var(--info);
}

/* Table hover */
table tbody tr:hover { background: var(--bg-subtle); }

/* Details/summary */
details summary { user-select: none; }
details[open] summary { margin-bottom: 12px; }
