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

:root {
  --bg-primary: #f8fafc; /* Zoho Slate 50 */
  --bg-secondary: #ffffff; /* White */
  --bg-tertiary: #f1f5f9; /* Slate 100 */
  --sidebar-bg: #1e293b; /* Zoho Slate 800 (Dark Sidebar) */
  
  --primary: #1e40af; /* Zoho Corporate Blue */
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff; /* Blue 50 */
  
  --secondary: #64748b; /* Slate 500 */
  --secondary-hover: #475569;
  
  --text-main: #0f172a; /* Slate 900 */
  --text-muted: #64748b; /* Slate 500 */
  --border-color: #e2e8f0; /* Slate 200 */
  
  --accent-blue: #0284c7; /* Sky 600 */
  --accent-amber: #d97706; /* Amber 600 */
  --accent-red: #dc2626; /* Red 600 */
  --glass-bg: #ffffff;
  --glass-border: #e2e8f0;
  --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 4px 6px -1px rgba(0, 0, 0, 0.02);
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Background Gradients (Disabled for Zoho style) */
.bg-glow, .bg-glow-2 {
  display: none !important;
}

/* Login/Landing Layout */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
}

.auth-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  padding: 3rem;
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--card-shadow);
  animation: fadeIn 0.6s var(--transition);
}

.auth-logo {
  text-align: center;
  margin-bottom: 2.5rem;
}

.logo-icon {
  font-size: 2.5rem;
  color: var(--primary);
  background: var(--primary-light);
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  margin-bottom: 1rem;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.auth-logo h2 {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, #a7f3d0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-logo p {
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.5rem;
}

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

.form-input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.85rem 1.2rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn {
  width: 100%;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 0.9rem 1.5rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
}

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

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--text-muted);
  box-shadow: none;
  transform: translateY(-1px);
}

/* Dashboard Workspace Layout */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Styling (Zoho Dark Slate Theme) */
.sidebar {
  width: 280px;
  background: var(--sidebar-bg);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  padding: 2rem 1.5rem;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  padding-left: 0.5rem;
}

.sidebar-logo h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  color: #94a3b8; /* Slate 400 */
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
  cursor: pointer;
}

.nav-item.active a, .nav-item:hover a {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-item.active a {
  font-weight: 600;
}

.user-profile {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  box-shadow: none;
}

.user-info h4 {
  font-size: 0.9rem;
  color: #ffffff;
}
.user-info p {
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: capitalize;
}

.logout-btn {
  color: var(--accent-red);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  margin-left: auto;
  padding: 0.5rem;
  border-radius: 8px;
  transition: var(--transition);
}
.logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  margin-left: 280px;
  padding: 3rem;
  min-height: 100vh;
  background: var(--bg-primary);
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
}

.header-bar h1 {
  font-size: 2.25rem;
  font-weight: 800;
}

.tenant-selector {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: 12px;
  color: var(--text-main);
  font-weight: 600;
  outline: none;
}

/* Tab Panels */
.tab-panel {
  display: none;
  animation: fadeIn 0.4s var(--transition);
}

.tab-panel.active {
  display: block;
}

/* KPI Cards Layout */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.kpi-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 1.75rem;
  border-radius: 18px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.kpi-card:hover {
  transform: translateY(-3px);
  border-color: rgba(16, 185, 129, 0.2);
}

.kpi-info h3 {
  font-size: 2rem;
  margin-top: 0.25rem;
}

.kpi-info p {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-icon {
  font-size: 2rem;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-icon.primary { background: rgba(16, 185, 129, 0.1); color: var(--primary); }
.kpi-icon.blue { background: rgba(14, 165, 233, 0.1); color: var(--accent-blue); }
.kpi-icon.amber { background: rgba(245, 158, 11, 0.1); color: var(--accent-amber); }

/* Bento Layouts / Cards */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }

@media (max-width: 1024px) {
  .col-8, .col-6, .col-4 { grid-column: span 12; }
}

.bento-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
}

/* Table styling */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  background: var(--bg-tertiary);
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
}

tr:hover td {
  background: var(--bg-primary);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge.success { background: rgba(16, 185, 129, 0.15); color: var(--primary); }
.badge.warning { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.badge.danger { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.badge.info { background: rgba(14, 165, 233, 0.15); color: var(--accent-blue); }

/* Blending Worksheet styling */
.blending-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.calculator-results {
  background: var(--bg-tertiary);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
}

.result-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.5rem;
}

.result-val {
  font-weight: 700;
  color: var(--primary);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  padding: 2.5rem;
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  box-shadow: var(--card-shadow);
  animation: modalScale 0.3s ease-out;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
}
.close-btn:hover {
  color: #fff;
}

/* Genealogy Node Visualizer */
.genealogy-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
  background: var(--bg-tertiary);
  border-radius: 16px;
}

.tree-node {
  background: var(--bg-secondary);
  border: 1px solid var(--primary);
  padding: 1rem;
  border-radius: 12px;
  min-width: 180px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.tree-node.parent {
  border-color: var(--secondary);
}

.tree-node.main {
  background: var(--primary-light);
  border-width: 2px;
}

.tree-connector {
  width: 2px;
  height: 32px;
  background: var(--border-color);
}

.nodes-container {
  display: flex;
  gap: 1.5rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
