/* ==========================================
   Orin Kit - Pulse Radar Theme
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;900&family=Instrument+Serif:ital@1&display=swap');

/* --- CSS Variables --- */
:root {
  --bg-primary: #04070d;
  --bg-surface: #10131c;
  --bg-nav: rgba(8, 9, 10, 0.75);
  --text-primary: #d5dbe6;
  --text-secondary: rgba(213, 219, 230, 0.7);
  --text-white: #ffffff;
  --accent-cyan: #00d4ff;
  --accent-cyan-dim: rgba(0, 212, 255, 0.15);
  --accent-purple: #7b61ff;
  --border-subtle: rgba(0, 212, 255, 0.08);
  --border-hover: rgba(0, 212, 255, 0.2);
  --glow-cyan: rgba(0, 212, 255, 0.3);
  --glow-soft: rgba(0, 212, 255, 0.08);
  --shadow-card: inset 0px 2px 1px 0px rgba(0, 212, 255, 0.15);
  --radius-pill: 100px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 8px;
  --max-width: 1200px;
  --nav-height: 64px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
}

/* --- Reset --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; font-family: inherit; }
input { font-family: inherit; }

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  animation: fadeIn 0.6s ease 0.3s both;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
}

.nav-logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo .logo-icon {
  filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.4));
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.05);
}

.nav-links .btn-login {
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan-dim);
  margin-left: 8px;
}

.nav-links .btn-login:hover {
  background: var(--accent-cyan-dim);
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  padding: 8px;
}

.nav-hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text-white);
  transition: transform 0.3s, opacity 0.3s;
  display: block;
}

.nav-hamburger.active span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.nav-hamburger.active span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 20px 40px;
  flex-direction: column;
  gap: 4px;
  z-index: 99;
}

.mobile-menu.active {
  display: flex;
}

.mobile-menu a {
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.mobile-menu a:hover {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.05);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 160px 40px 80px;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 900px;
  animation: heroEnter 1.4s cubic-bezier(0.67, 0.33, 0.23, 1.02) both;
}

.hero h1 {
  font-size: clamp(36px, 7vw, 80px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  background: radial-gradient(80% 80% at 50% 50%, var(--text-primary) 30%, var(--bg-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
}

.hero h1 em {
  font-family: var(--font-serif);
  font-style: italic;
  -webkit-text-fill-color: var(--accent-cyan);
  filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.3));
}

.hero-subtitle {
  font-size: clamp(15px, 2vw, 18px);
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 32px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(123, 97, 255, 0.1));
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-pill);
  color: var(--accent-cyan);
  font-size: 15px;
  font-weight: 600;
  transition: all 0.3s;
  text-decoration: none;
}

.hero-cta:hover {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.25), rgba(123, 97, 255, 0.15));
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.15);
  transform: translateY(-2px);
}

.hero-cta svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s;
}

.hero-cta:hover svg {
  transform: translateX(3px);
}

/* Hero Three.js Canvas */
.hero-canvas-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.hero-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Section divider */
.section-divider {
  height: 1px;
  background: radial-gradient(50% 50%, rgba(0, 212, 255, 0.15) 0%, transparent 100%);
}

/* --- Sections Common --- */
.section {
  padding: 100px 40px;
  position: relative;
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-badge {
  display: inline-block;
  padding: 6px 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan-dim);
  border-radius: var(--radius-pill);
  margin-bottom: 20px;
  background: rgba(0, 212, 255, 0.05);
}

.section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 500;
  letter-spacing: -0.02em;
  background: linear-gradient(138deg, var(--text-primary) 52%, var(--bg-primary) 166%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.section-title em {
  font-family: var(--font-serif);
  font-style: italic;
  -webkit-text-fill-color: var(--accent-cyan);
}

.section-desc {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
}

/* --- Card Grid --- */
.card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.card {
  flex: 1 1 300px;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card), 0 0 40px rgba(0, 212, 255, 0.05);
}

.card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  color: var(--accent-cyan);
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

.card h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.card-glow {
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  height: 200px;
  background: radial-gradient(50% 50%, rgba(0, 212, 255, 0.06) 0%, transparent 100%);
  pointer-events: none;
}

/* Feature row (wider cards) */
.feature-row {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
}

.feature-card {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s;
}

.feature-card:hover {
  border-color: var(--border-hover);
}

.feature-card.wide {
  flex: 2;
}

.feature-tag {
  display: inline-block;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  margin: 0 6px 8px 0;
}

.feature-card h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  margin-top: 16px;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* --- CTA Section --- */
.cta-section {
  padding: 120px 40px;
  text-align: center;
  position: relative;
}

.cta-section h2 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 500;
  letter-spacing: -0.02em;
  background: radial-gradient(70% 70% at 50% 50%, var(--text-primary) 30%, var(--bg-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
}

.cta-section p {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 36px;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 18px 42px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.12) 0%, rgba(0, 212, 255, 0.06) 50%, rgba(120, 200, 255, 0.1) 100%);
  color: rgba(0, 232, 255, 0.95);
  font-weight: 700;
  font-size: 15px;
  border-radius: var(--radius-sm);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  border: 1px solid rgba(0, 212, 255, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
    0 0 15px rgba(0, 212, 255, 0.08),
    0 4px 20px rgba(0, 0, 0, 0.3);
  overflow: visible;
  z-index: 1;
  cursor: grab;
}

/* Glass shine */
.cta-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  pointer-events: none;
}

/* Underglow */
.cta-btn::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 10%;
  right: 10%;
  height: 20px;
  background: radial-gradient(ellipse at center, rgba(0, 212, 255, 0.25) 0%, transparent 70%);
  filter: blur(8px);
  opacity: 0.6;
  transition: all 0.4s;
  pointer-events: none;
  z-index: -1;
}

.cta-btn:hover {
  transform: translateY(-3px);
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.2) 0%, rgba(0, 212, 255, 0.1) 50%, rgba(120, 200, 255, 0.18) 100%);
  border-color: rgba(0, 212, 255, 0.4);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
    0 0 30px rgba(0, 212, 255, 0.2),
    0 8px 30px rgba(0, 0, 0, 0.4),
    0 12px 40px rgba(0, 212, 255, 0.15);
}

/* Underglow intensifies on hover */
.cta-btn:hover::after {
  opacity: 1;
  bottom: -12px;
  left: 5%;
  right: 5%;
  height: 28px;
  background: radial-gradient(ellipse at center, rgba(0, 212, 255, 0.5) 0%, rgba(0, 180, 255, 0.2) 40%, transparent 70%);
  filter: blur(12px);
}

/* Ghostly aura ring */
@keyframes aura-pulse {
  0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.08; transform: translate(-50%, -50%) scale(1.4); }
}

.cta-btn-wrap {
  position: relative;
  display: inline-block;
}

.cta-btn-wrap .btn-aura {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 130%;
  height: 160%;
  border: 1px solid rgba(0, 212, 255, 0.12);
  border-radius: 16px;
  animation: aura-pulse 3s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.cta-btn-wrap .btn-aura:nth-child(2) {
  animation-delay: 1s;
  width: 145%;
  height: 180%;
  border-color: rgba(0, 212, 255, 0.06);
}

/* Particle field — 50vw centered around button */
.cta-btn-wrap .particle-field {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50vw;
  height: 300px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

/* Legacy .particle class — replaced by canvas */
.cta-btn-wrap .particle {
  display: none;
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(0, 212, 255, 0.6);
  border-radius: 50%;
  pointer-events: none;
  animation: particle-float var(--dur) ease-in-out infinite;
  animation-delay: var(--delay);
  z-index: 0;
}

.cta-glow {
  position: absolute;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 250px;
  background: radial-gradient(50% 50%, rgba(0, 212, 255, 0.12) 0%, transparent 100%);
  pointer-events: none;
}

/* --- Footer --- */
.footer {
  padding: 40px;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-brand {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
}

.footer-copy {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.3);
}

/* ===========================================
   Auth Pages (Login)
   =========================================== */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 40px 60px;
  position: relative;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-card);
  position: relative;
}

.auth-card h2 {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.auth-card .auth-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.form-group input::placeholder {
  color: rgba(213, 219, 230, 0.3);
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--accent-cyan);
  color: var(--bg-primary);
  font-weight: 700;
  font-size: 15px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary:hover {
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.25);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-error {
  display: none;
  padding: 12px 16px;
  background: rgba(255, 60, 60, 0.1);
  border: 1px solid rgba(255, 60, 60, 0.2);
  border-radius: var(--radius-sm);
  color: #ff6b6b;
  font-size: 13px;
  margin-bottom: 20px;
}

.auth-error.visible {
  display: block;
}

.auth-glow {
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 300px;
  background: radial-gradient(50% 50%, rgba(0, 212, 255, 0.08) 0%, transparent 100%);
  pointer-events: none;
  z-index: -1;
}

/* ===========================================
   Dashboard & Admin Pages
   =========================================== */

.app-layout {
  min-height: 100vh;
  padding-top: var(--nav-height);
}

.app-header {
  padding: 40px 40px 0;
  max-width: var(--max-width);
  margin: 0 auto;
}

.app-header h1 {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.app-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

.app-content {
  padding: 32px 40px 60px;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.3s;
}

.stat-card:hover {
  border-color: var(--border-hover);
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-value.cyan { color: var(--accent-cyan); }
.stat-value.green { color: #4ade80; }
.stat-value.purple { color: var(--accent-purple); }

/* Panel */
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.panel-body {
  padding: 24px;
}

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.data-table td {
  color: var(--text-primary);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(0, 212, 255, 0.02);
}

.role-badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.role-badge.admin {
  background: rgba(123, 97, 255, 0.15);
  color: var(--accent-purple);
}

.role-badge.user {
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent-cyan);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger {
  background: rgba(255, 60, 60, 0.1);
  color: #ff6b6b;
  border: 1px solid rgba(255, 60, 60, 0.2);
}

.btn-danger:hover {
  background: rgba(255, 60, 60, 0.2);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  border-color: var(--border-hover);
}

.btn-accent {
  background: var(--accent-cyan);
  color: var(--bg-primary);
  font-weight: 700;
}

.btn-accent:hover {
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

/* Create User Form */
.create-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.create-form .form-group {
  margin-bottom: 0;
}

.create-form input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.create-form input:focus {
  border-color: var(--accent-cyan);
}

.create-form select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
}

.create-form select:focus {
  border-color: var(--accent-cyan);
}

/* Notification Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.toast.error {
  border-color: rgba(255, 60, 60, 0.3);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

/* Activity List */
.activity-list {
  list-style: none;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-cyan);
  border-radius: 50%;
  flex-shrink: 0;
}

.activity-text {
  font-size: 14px;
  color: var(--text-primary);
}

.activity-time {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: auto;
  white-space: nowrap;
}

/* Nav user info */
.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.btn-logout {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  color: #ff6b6b;
  border-color: rgba(255, 60, 60, 0.2);
}

/* ===========================================
   Animations
   =========================================== */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes heroEnter {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}


@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===========================================
   Service Cards & Animated Components
   =========================================== */

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.service-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.4s, box-shadow 0.4s, transform 0.4s;
}

.service-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card), 0 0 60px rgba(0, 212, 255, 0.06);
  transform: translateY(-4px);
}

.service-visual {
  height: 200px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(0, 212, 255, 0.02) 0%, transparent 100%);
}

.service-content {
  padding: 28px;
}

.service-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  color: var(--accent-cyan);
}

.service-icon svg {
  width: 22px;
  height: 22px;
}

.service-content h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.service-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* --- Animated Chart (PNL Tracking) --- */
.chart-svg {
  width: 90%;
  height: 80%;
  position: absolute;
  bottom: 10px;
  left: 5%;
}

.chart-line {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: drawLine 2s ease forwards;
  animation-play-state: paused;
}

.service-card:hover .chart-line,
.animate-in.visible .chart-line {
  animation-play-state: running;
}

.chart-area {
  opacity: 0;
  animation: fadeArea 1s ease 1.2s forwards;
  animation-play-state: paused;
}

.service-card:hover .chart-area,
.animate-in.visible .chart-area {
  animation-play-state: running;
}

.chart-dot {
  opacity: 0;
  transform-origin: center;
}

.chart-dot.cd-1 { animation: popDot 0.4s ease 1s forwards; }
.chart-dot.cd-2 { animation: popDot 0.4s ease 1.2s forwards; }
.chart-dot.cd-3 { animation: popDot 0.4s ease 1.4s forwards; }
.chart-dot.cd-4 { animation: popDot 0.4s ease 1.6s forwards; }

.animate-in.visible .chart-dot.cd-1 { animation-play-state: running; }
.animate-in.visible .chart-dot.cd-2 { animation-play-state: running; }
.animate-in.visible .chart-dot.cd-3 { animation-play-state: running; }
.animate-in.visible .chart-dot.cd-4 { animation-play-state: running; }

.chart-dot { animation-play-state: paused; }

.chart-ring {
  opacity: 0;
  animation: ringPulse 2s ease-in-out 1.6s infinite;
  animation-play-state: paused;
}

.animate-in.visible .chart-ring {
  animation-play-state: running;
}

.chart-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 700;
  color: #4ade80;
  opacity: 0;
  transform: translateY(10px);
  animation: badgeIn 0.5s ease 1.8s forwards;
  animation-play-state: paused;
}

.animate-in.visible .chart-badge {
  animation-play-state: running;
}

.chart-arrow {
  font-size: 10px;
  margin-right: 2px;
}

@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

@keyframes fadeArea {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popDot {
  0% { opacity: 0; r: 0; }
  70% { opacity: 1; r: 5.5; }
  100% { opacity: 1; r: 4; }
}

@keyframes ringPulse {
  0% { opacity: 0; r: 4; }
  50% { opacity: 0.6; r: 12; }
  100% { opacity: 0; r: 20; }
}

@keyframes badgeIn {
  to { opacity: 1; transform: translateY(0); }
}

/* --- Three.js Canvas Containers --- */
.service-visual canvas {
  display: block;
}

/* --- Float Animation (badge gets both badgeIn then float) --- */
.animate-in.visible .chart-badge {
  animation: badgeIn 0.5s ease 1.8s forwards, floatBadge 3s ease-in-out 2.4s infinite;
}

@keyframes floatBadge {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(-5px); opacity: 1; }
}

/* ===========================================
   Responsive
   =========================================== */

@media (max-width: 810px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  .hero { padding: 120px 24px 60px; }
  .section { padding: 60px 24px; }
  .cta-section { padding: 80px 24px; }

  .card-grid { flex-direction: column; }
  .card { flex: 1 1 auto; }

  .feature-row {
    flex-direction: column;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .service-visual {
    height: 180px;
  }

  .feature-card.wide {
    flex: 1;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .create-form {
    grid-template-columns: 1fr;
  }

  .data-table {
    font-size: 13px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
  }

  .nav-inner { padding: 0 20px; }
  .app-header { padding: 24px 20px 0; }
  .app-content { padding: 20px 20px 40px; }
  .footer-inner { flex-direction: column; gap: 12px; }

}

@media (max-width: 480px) {
  .hero h1 { font-size: 32px; }
  .auth-card { padding: 28px 24px; }
  .stat-value { font-size: 24px; }

  /* Horizontal scroll for table on very small screens */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
