@import url('https://fonts.googleapis.com/css2?family=Anek+Telugu:wght@300;400;500;600;700;800&family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --font-telugu: 'Anek Telugu', sans-serif;
  --font-main: 'Outfit', 'Anek Telugu', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --bg-dark: #080b11;
  --bg-surface: #0f1623;
  --bg-surface-elevated: #151f32;
  --bg-card: rgba(18, 27, 43, 0.75);
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-focus: rgba(99, 102, 241, 0.6);

  --color-primary: #4f46e5;
  --color-primary-hover: #4338ca;
  --color-primary-light: #6366f1;
  --color-primary-glow: rgba(99, 102, 241, 0.3);

  --color-teal: #06b6d4;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(at 10% 10%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
    radial-gradient(at 90% 90%, rgba(6, 182, 212, 0.06) 0px, transparent 50%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* ================= LOGIN SCREEN ================= */
.login-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.95), #06090e);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(17, 25, 40, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.5rem;
  padding: 2.5rem 2rem;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.7),
    0 0 35px -5px rgba(99, 102, 241, 0.15);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4f46e5, #06b6d4, #10b981);
}

.login-logo {
  width: 58px;
  height: 58px;
  border-radius: 1rem;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  box-shadow: 0 10px 20px -5px rgba(79, 70, 229, 0.5);
  font-size: 1.5rem;
  color: #fff;
}

.login-title {
  font-size: 1.65rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.025em;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  pointer-events: none;
}

.form-control {
  width: 100%;
  background: rgba(10, 15, 26, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 0.85rem;
  padding: 0.75rem 1rem 0.75rem 2.6rem;
  font-size: 0.92rem;
  font-family: var(--font-main);
  color: #ffffff;
  outline: none;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
  background: rgba(15, 23, 42, 0.95);
}

.form-control::placeholder {
  color: #475569;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: var(--font-main);
  padding: 0.85rem 1.25rem;
  border-radius: 0.85rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5850ec, #4f46e5);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -5px rgba(79, 70, 229, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.login-info-box {
  margin-top: 1.5rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.login-info-box code {
  font-family: var(--font-mono);
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.15);
  padding: 0.15rem 0.4rem;
  border-radius: 0.35rem;
}

.error-alert {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  font-size: 0.82rem;
  padding: 0.65rem 0.9rem;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  text-align: center;
}

/* ================= HEADER & NAV ================= */
.app-header {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(8, 11, 17, 0.85);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.15rem;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.35);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-gradient {
  background: linear-gradient(135deg, #818cf8, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}

/* ================= PILL SWITCHER ================= */
.provider-pill-group {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-subtle);
  padding: 0.25rem;
  border-radius: 0.85rem;
  gap: 0.25rem;
}

.pill-btn {
  padding: 0.4rem 0.85rem;
  border-radius: 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-main);
}

.pill-btn.active-voicelink {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.pill-btn.active-exotel {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
}

.pill-btn:hover:not(.active-voicelink):not(.active-exotel) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

/* ================= TABS ================= */
.tabs-nav {
  display: flex;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2rem;
  overflow-x: auto;
}

.tab-link {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.75rem 0.25rem;
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.tab-link:hover {
  color: #fff;
}

.tab-link.active {
  color: var(--color-primary-light);
  border-bottom-color: var(--color-primary-light);
}

/* ================= CARDS & CONTAINERS ================= */
.glass-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.panel-header {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ================= TABLES ================= */
.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.custom-table th {
  background: rgba(10, 15, 26, 0.7);
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.custom-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.custom-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: #fff;
}

.font-mono {
  font-family: var(--font-mono);
}

/* Utility Hidden */
.hidden {
  display: none !important;
}

/* Telugu Typography with Google Font Anek Telugu */
:lang(te), .telugu, [lang="te"] {
  font-family: var(--font-telugu), var(--font-main);
  line-height: 1.7;
}

/* Zero-Flicker Instant Authentication State */
html.auth-authenticated #loginScreen {
  display: none !important;
}

html.auth-authenticated #appContainer {
  display: block !important;
}
