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

:root {
  /* ================= LIGHT & CLEAN COLOR PALETTE ================= */
  /* Main Backgrounds (Half White / Pure White) */
  --bg-main: #f8fafc;                 /* Half White / Clean Canvas */
  --bg-sidebar: #ffffff;              /* Pure White */
  --bg-card: #ffffff;                 /* Pure White Card */
  --bg-card-hover: #fcfdfe;           /* Subtle Light Hover */
  --bg-input: #f8fafc;                /* Half White Input */
  --bg-subtle: #f1f5f9;               /* Light Gray-White Surface */

  /* Borders & Dividers */
  --border-light: #e2e8f0;            /* Crisp Hairline Border */
  --border-focus: #7c3aed;            /* Purple Focus */
  --border-subtle: #edf2f7;

  /* Typography Colors (Black & Dark Black) */
  --text-darkblack: #09090b;          /* True Dark Black (Headings & Hero Numbers) */
  --text-black: #1e293b;              /* Deep Black (Body & Titles) */
  --text-halfwhite: #ffffff;          /* White for dark elements / buttons */
  --text-muted: #475569;              /* Slate Muted */
  --text-dim: #94a3b8;                /* Light Slate Dim */

  /* Purple (A Little Bit - Exquisite Brand Accent) */
  --purple-primary: #7c3aed;          /* Refined Purple */
  --purple-hover: #6d28d9;
  --purple-light: #f5f3ff;            /* 5% Purple Tint Background */
  --purple-border: #ddd6fe;           /* Soft Purple Border */
  --purple-glow: rgba(124, 58, 237, 0.20);
  --purple-gradient: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);

  /* Status Colors */
  --color-success: #059669;
  --color-success-bg: #ecfdf5;
  --color-warning: #d97706;
  --color-warning-bg: #fffbeb;
  --color-danger: #dc2626;
  --color-danger-bg: #fef2f2;
  --color-info: #2563eb;
  --color-info-bg: #eff6ff;

  /* Layout & Geometry */
  --titlebar-height: 42px;
  --sidebar-width: 250px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
  --shadow-hover: 0 10px 30px -4px rgba(0, 0, 0, 0.08), 0 0 16px -2px rgba(124, 58, 237, 0.15);
  --shadow-purple: 0 6px 20px -3px rgba(124, 58, 237, 0.35);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-main);
  color: var(--text-black);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ================= SLIM CUSTOM SCROLLBARS ================= */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--purple-primary);
}

/* ================= TITLEBAR ================= */
.custom-titlebar {
  height: var(--titlebar-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 0 18px;
  z-index: 1000;
  -webkit-app-region: drag;
}

.titlebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.titlebar-logo {
  width: 24px;
  height: 24px;
  background: var(--purple-gradient);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px var(--purple-glow);
}

.titlebar-logo svg {
  width: 14px;
  height: 14px;
  fill: #ffffff;
}

.titlebar-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-darkblack);
  letter-spacing: 0.2px;
}

.titlebar-badge {
  font-size: 10.5px;
  font-weight: 700;
  background: var(--purple-light);
  color: var(--purple-primary);
  border: 1px solid var(--purple-border);
  padding: 1.5px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.4px;
}

.titlebar-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  -webkit-app-region: no-drag;
}

.control-btn {
  width: 32px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.control-btn svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
}

.control-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-darkblack);
}

.control-btn.close-btn:hover {
  background: var(--color-danger);
  color: #ffffff;
}

/* ================= MAIN APP CONTAINER ================= */
.app-container {
  flex: 1;
  display: flex;
  height: calc(100vh - var(--titlebar-height));
  overflow: hidden;
}

/* ================= SIDEBAR ================= */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 14px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.9px;
  padding: 0 12px;
  margin-bottom: 10px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  transition: all 0.18s ease;
}

.nav-item:hover {
  background: var(--bg-subtle);
  color: var(--text-darkblack);
}

.nav-item.active {
  background: var(--purple-light);
  color: var(--purple-primary);
  border-color: var(--purple-border);
  font-weight: 600;
}

.nav-item.active svg {
  stroke: var(--purple-primary);
}

/* Sidebar Footer */
.sidebar-footer {
  background: var(--bg-main);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--purple-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  color: #ffffff;
  box-shadow: 0 2px 8px var(--purple-glow);
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-darkblack);
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-plan {
  font-size: 10.5px;
  color: var(--purple-primary);
  font-weight: 600;
}

/* ================= MAIN CONTENT VIEWPORT ================= */
.app-content {
  flex: 1;
  background: var(--bg-main);
  overflow-y: auto;
  padding: 28px 34px;
}

.tab-view {
  display: none;
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Common Header within Tabs */
.tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.tab-title-group h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-darkblack);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.tab-title-group p {
  font-size: 13px;
  color: var(--text-muted);
}
