/* ============================================================
   GROWTHIC ONE — Global Styles
   Brand: Pigment Blue #0F4799 (primary) · Picton Blue #45BBF0 (secondary)
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --primary:          #0F4799;
  --primary-hover:    #0A3570;
  --primary-light:    #EEF2FF;
  --secondary:        #45BBF0;
  --secondary-light:  #E0F4FD;

  --success:          #1D9E75;
  --success-light:    #ECFDF5;
  --warning:          #F59E0B;
  --warning-light:    #FFFBEB;
  --danger:           #EF4444;
  --danger-light:     #FEF2F2;

  --bg:               #FFFFFF;
  --surface:          #F8FAFC;
  --border:           #E2E8F0;
  --border-light:     #F1F5F9;

  --text:             #0F172A;
  --text-secondary:   #475569;
  --text-muted:       #94A3B8;

  --sidebar-width:    240px;
  --header-height:    56px;

  --font:             'Helvetica Neue', Helvetica, Arial, sans-serif;
  --radius-sm:        4px;
  --radius:           8px;
  --radius-lg:        12px;
  --radius-xl:        16px;

  --shadow-sm:        0 1px 2px rgba(0,0,0,0.05);
  --shadow:           0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:        0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg:        0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
}

/* ── Dark Mode ──────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:               #1E293B;
  --surface:          #0F172A;
  --border:           #334155;
  --border-light:     #1E293B;

  --text:             #F1F5F9;
  --text-secondary:   #94A3B8;
  --text-muted:       #64748B;

  --primary-light:    rgba(15, 71, 153, 0.3);
  --secondary-light:  rgba(69, 187, 240, 0.15);
  --success-light:    rgba(29, 158, 117, 0.2);
  --warning-light:    rgba(245, 158, 11, 0.2);
  --danger-light:     rgba(239, 68, 68, 0.2);

  --shadow-sm:        0 1px 2px rgba(0,0,0,0.4);
  --shadow:           0 1px 3px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md:        0 4px 6px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.3);
  --shadow-lg:        0 10px 15px rgba(0,0,0,0.5), 0 4px 6px rgba(0,0,0,0.3);
}

/* Active nav item: white bg is too jarring against dark content area */
[data-theme="dark"] .nav-item--active,
[data-theme="dark"] .nav-item--active:hover {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

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

html { font-size: 14px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font); cursor: pointer; }
input, textarea, select { font-family: var(--font); }
img, svg { display: block; }
ul, ol { list-style: none; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   AUTH / LOGIN PAGE
   ============================================================ */
.auth-body {
  background: linear-gradient(135deg, #0a3a87 0%, #0F4799 50%, #1a72c7 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

/* ── Mesh blob layer ───────────────────────────────────────── */
.auth-mesh {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}

/* Top-right — large cyan */
.auth-blob-1 {
  width: 560px;
  height: 560px;
  background: #45BBF0;
  top: -180px;
  right: -160px;
  opacity: 0.38;
  animation: blob1 14s ease-in-out infinite;
}

/* Bottom-left — mid cyan */
.auth-blob-2 {
  width: 420px;
  height: 420px;
  background: #45BBF0;
  bottom: -140px;
  left: -100px;
  opacity: 0.28;
  animation: blob2 17s ease-in-out infinite;
}

/* Centre-left — pale blue accent */
.auth-blob-3 {
  width: 280px;
  height: 280px;
  background: #7dd3fc;
  top: 35%;
  left: 5%;
  opacity: 0.18;
  animation: blob3 11s ease-in-out infinite;
}

/* Bottom-right — deeper indigo */
.auth-blob-4 {
  width: 320px;
  height: 320px;
  background: #1e3a8a;
  bottom: 10%;
  right: -60px;
  opacity: 0.45;
  animation: blob4 13s ease-in-out infinite;
}

/* Top-centre — tiny highlight */
.auth-blob-5 {
  width: 180px;
  height: 180px;
  background: #bae6fd;
  top: 12%;
  left: 38%;
  opacity: 0.15;
  animation: blob3 8s ease-in-out infinite reverse;
}

@keyframes blob1 {
  0%, 100% { transform: translate(0,   0)   scale(1);    }
  25%       { transform: translate(-28px, 38px) scale(1.07); }
  50%       { transform: translate(18px, 55px) scale(0.94); }
  75%       { transform: translate(-38px, 20px) scale(1.04); }
}
@keyframes blob2 {
  0%, 100% { transform: translate(0,   0)   scale(1);    }
  30%       { transform: translate(36px, -28px) scale(1.1);  }
  60%       { transform: translate(16px, -48px) scale(0.92); }
}
@keyframes blob3 {
  0%, 100% { transform: translate(0,  0);  }
  50%       { transform: translate(22px, -16px); }
}
@keyframes blob4 {
  0%, 100% { transform: translate(0,  0)   scale(1);    }
  40%       { transform: translate(-22px, 18px) scale(1.06); }
  70%       { transform: translate(12px, -14px) scale(0.97); }
}

/* Card entrance */
@keyframes auth-card-enter {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Logo bounce */
@keyframes auth-logo-bounce {
  0%   { transform: translateY(0); }
  25%  { transform: translateY(-7px); }
  50%  { transform: translateY(-2px); }
  70%  { transform: translateY(-5px); }
  100% { transform: translateY(0); }
}

.auth-container {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  z-index: 1;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.auth-brand-mark {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  animation: auth-logo-bounce 0.65s ease-out 0.15s both;
}

.auth-brand-name {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.auth-brand-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  margin-top: 1px;
}

.auth-card {
  background: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.22), 0 4px 12px rgba(0,0,0,0.1);
  animation: auth-card-enter 0.4s ease-out 0.05s both;
  position: relative;
  z-index: 1;
}

.auth-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.auth-footer {
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  position: relative;
  z-index: 1;
}

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app-body {
  margin: 0;
  padding: 0;
  background: var(--surface);
  overflow: hidden;
}

.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.sidebar-logo-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.sidebar-brand {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.sidebar-brand-sub {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-top: 1px;
}

/* ── Sidebar Nav ────────────────────────────────────────────── */
.sidebar-nav {
  flex: 1;
  padding: 10px 10px 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: rgba(255,255,255,0.7);
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.95);
}

.nav-item--active {
  background: #fff;
  color: var(--primary);
}

.nav-item--active:hover {
  background: #fff;
  color: var(--primary);
}

.nav-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.nav-icon svg { width: 16px; height: 16px; }

.nav-label {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* Announcement nudge dot */
.nav-ann-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f87171;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(248,113,113,0.3);
  animation: ann-dot-pulse 2s ease-in-out infinite;
}

@keyframes ann-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(248,113,113,0.3); }
  50%       { box-shadow: 0 0 0 4px rgba(248,113,113,0.15); }
}

/* ── Sidebar Footer ─────────────────────────────────────────── */
.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  transition: background 0.15s;
}

.sidebar-user:hover { background: rgba(255,255,255,0.08); }

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  background: var(--secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  margin-top: 1px;
}

.sidebar-user-dept {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Main Wrapper ───────────────────────────────────────────── */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── App Header ─────────────────────────────────────────────── */
.app-header {
  height: var(--header-height);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  gap: 16px;
}

.page-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Notification bell button */
.btn-icon {
  position: relative;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.btn-icon:hover {
  background: var(--surface);
  border-color: var(--text-muted);
  color: var(--text);
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--bg);
}

/* User menu */
.user-menu-wrap {
  position: relative;
}

.user-avatar-btn {
  border: none;
  background: none;
  padding: 2px;
  border-radius: 50%;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s;
}

.user-avatar:hover { opacity: 0.85; }

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  z-index: 1000;
  overflow: hidden;
}

.user-dropdown-info {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border-light);
}

.dropdown-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.dropdown-user-role {
  font-size: 12px;
  color: var(--text-muted);
}

.dropdown-user-dept {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  padding-top: 3px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 5px;
}

.dropdown-user-dept::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: 4px 0;
}

.user-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  transition: background 0.12s, color 0.12s;
  cursor: pointer;
}

.user-dropdown-item:hover {
  background: var(--surface);
  color: var(--text);
}

.user-dropdown-item--danger { color: var(--danger); }
.user-dropdown-item--danger:hover { background: var(--danger-light); }

/* ── Page Content ───────────────────────────────────────────── */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* Page inner wrapper */
.page-inner {
  max-width: 1200px;
}

/* Page section header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.page-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

/* Page loading state */
.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Toast Notifications ────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--text);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
  max-width: 320px;
  pointer-events: auto;
}

.toast--visible { opacity: 1; transform: translateY(0); }
.toast--success { background: var(--success); }
.toast--error   { background: var(--danger); }
.toast--warning { background: var(--warning); }

/* ── Page Stub (placeholder for unbuilt modules) ────────────── */
.stub-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.stub-card {
  text-align: center;
  max-width: 380px;
}

.stub-icon {
  width: 56px;
  height: 56px;
  background: var(--primary-light);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--primary);
}

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

.stub-card h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.stub-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}
