@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Inter:wght@300;400;600;800&display=swap');

:root {
  --bg: #0a0a0a;
  --sidebar: #121212;
  --panel: #1a1a1a;
  --panel-light: #222222;
  --line: rgba(255, 255, 255, 0.08);
  --teal: #00a884;
  --teal-glow: rgba(0, 168, 132, 0.2);
  --text: #ffffff;
  --muted: #888888;
  --green: #22c55e;
  --red: #ef4444;
  --warm: #f59e0b;
  --cold: #3b82f6;
  --accent: #00a884;
  --accent-light: rgba(0, 168, 132, 0.1);
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
}

.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
aside {
  width: 280px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 32px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1001;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
}

.brand img {
  height: 32px;
  display: block;
}

.brand h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

aside nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

aside nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 14px 16px;
  border-radius: 12px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}

aside nav a:hover, aside nav a.active {
  background: var(--panel);
  color: var(--text);
}

aside nav a.active {
  color: var(--teal);
  background: var(--accent-light);
}

/* Main Content */
main {
  flex: 1;
  padding: 48px;
  max-width: 1400px;
  margin: 0 auto;
  transition: padding 0.3s;
}

.header {
  margin-bottom: 48px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

.header-left p {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--teal);
  letter-spacing: 0.15em;
  margin-bottom: 6px;
}

.header-left h2 {
  font-size: 2.25rem;
  font-weight: 800;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.metric-card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: 20px;
  transition: transform 0.3s;
}

.metric-card:hover {
  transform: translateY(-4px);
  border-color: var(--teal);
}

.metric-card label {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 12px;
}

.metric-card .value {
  font-size: 2.25rem;
  font-weight: 900;
  font-family: var(--font-heading);
}

/* Panels */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px;
  margin-bottom: 24px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.panel-head p {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.panel-head h2 {
  font-size: 1.5rem;
  font-weight: 800;
}

/* Phone UI */
.phone-frame {
  background: #000;
  border-radius: 40px;
  padding: 10px;
  border: 8px solid #1a1a1a;
  position: relative;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0,0,0,0.5);
}

.call-screen {
  background: #0a0a0a;
  height: 100%;
  border-radius: 32px;
  display: flex;
  flex-direction: column;
  padding: 32px 16px;
  align-items: center;
}

.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.waveform span {
  width: 4px;
  height: 12px;
  background: var(--teal);
  border-radius: 4px;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { height: 10px; opacity: 0.5; }
  50% { height: 30px; opacity: 1; }
}

.transcript-box {
  flex: 1;
  width: 100%;
  overflow-y: auto;
  padding-right: 4px;
}

.transcript-box div {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 12px;
}

.transcript-box .user { background: var(--panel-light); margin-left: 20px; text-align: right; border-bottom-right-radius: 4px; }
.transcript-box .ai { background: var(--accent-light); margin-right: 20px; border-bottom-left-radius: 4px; color: var(--teal); }

/* Tables */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

th {
  text-align: left;
  padding: 16px;
  font-size: 0.65rem;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

td {
  padding: 20px 16px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.status-badge {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-Hot { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.status-Warm { background: rgba(245, 158, 11, 0.15); color: var(--warm); }
.status-Cold { background: rgba(59, 130, 246, 0.15); color: var(--cold); }

/* Controls */
button {
  font-family: var(--font-body);
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
}

button:active { transform: scale(0.96); }

button.accent { background: var(--teal); color: #000; }
button.accent:hover { box-shadow: 0 0 20px var(--teal-glow); }
button.secondary { background: rgba(255, 255, 255, 0.05); color: #fff; border: 1px solid var(--line); }

textarea, input, select {
  background: var(--panel-light);
  border: 1px solid var(--line);
  color: #fff;
  padding: 14px 18px;
  border-radius: 14px;
  font-family: var(--font-body);
  outline: none;
  width: 100%;
}

textarea:focus, input:focus { border-color: var(--teal); }

/* Sidebar Toggle for Mobile */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--teal);
  color: #000;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 168, 132, 0.3);
}

/* RESPONSIVE OVERRIDES */
@media (max-width: 1200px) {
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
  aside {
    position: fixed;
    left: -280px;
    height: 100vh;
  }
  .sidebar-collapsed aside { left: 0; box-shadow: 20px 0 60px rgba(0,0,0,0.8); }
  .sidebar-toggle { display: flex; }
  main { padding: 100px 20px 40px; }
  
  .header { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 768px) {
  .dashboard-grid { grid-template-columns: 1fr !important; }
  .panel { padding: 24px; }
  
  /* Force stack sections */
  main section, main > div {
    display: flex !important;
    flex-direction: column !important;
  }
  
  .phone-frame { width: 100% !important; max-width: 340px; margin: 0 auto; height: 500px !important; }
  
  .panel-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .panel-head div:last-child { width: 100%; display: flex; gap: 12px; }
  .panel-head button { flex: 1; font-size: 0.7rem; padding: 10px; }
  
  /* Meeting scheduler */
  #schedule > div { grid-template-columns: 1fr !important; }
  
  /* Analytics grid */
  #analytics > div { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
  .header-left h2 { font-size: 1.5rem; }
  .metric-card .value { font-size: 1.75rem; }
  .btn { width: 100%; }
}

/* Utility */
.spinner { animation: spin 0.8s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
