/* ===================================================================
   ANIMOOX STUDIO — Office Management System
   Shared Design System — v1.0 (Phase 1)
   ===================================================================
   Brand Colors:
     #6333FB  Electric Violet (primary brand)
     #855EFF  Light Violet (accent)
     #BB3CFB  Magenta (pop accent)
     #C9B8FF  Lavender (soft accent)
     #0F0726  Darkest Purple (background/text)
     #FFFFFF  White
   Typography:
     Poppins (Google Fonts — Light/Regular/Medium/SemiBold/Bold)
   =================================================================== */

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

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

:root {
  /* Brand Colors */
  --violet: #6333FB;
  --violet-dark: #4F1FE0;
  --violet-light: #855EFF;
  --magenta: #BB3CFB;
  --lavender: #C9B8FF;
  --lavender-light: #E8E0FF;
  --darkest: #0F0726;
  --darkest-lift: #1A0E3D;

  /* Neutrals */
  --bg: #F7F6FB;
  --card: #FFFFFF;
  --border: #E8E5F1;
  --border-strong: #D5CFE6;
  --text: #0F0726;
  --text-muted: #6B6580;
  --text-dim: #A09BB0;

  /* Semantic */
  --success: #1B9E75;
  --success-bg: #E1F5EE;
  --danger: #D63A3A;
  --danger-bg: #FCEBEB;
  --warning: #E59A0F;
  --warning-bg: #FFF4D9;

  /* Effects */
  --shadow-sm: 0 1px 3px rgba(15, 7, 38, 0.06), 0 1px 2px rgba(15, 7, 38, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 7, 38, 0.08);
  --shadow-lg: 0 16px 48px rgba(15, 7, 38, 0.18);
  --shadow-violet: 0 8px 24px rgba(99, 51, 251, 0.25);

  /* Layout */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* Transitions */
  --t-fast: 0.15s ease;
  --t-base: 0.25s ease;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ===================================================================
   LOGO SVG (inline, uses currentColor)
   =================================================================== */
.logo-svg { display: inline-block; vertical-align: middle; }

/* ===================================================================
   LOGIN PAGE
   =================================================================== */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(160deg, #0F0726 0%, #2A1454 50%, #6333FB 100%);
  position: relative;
  overflow: hidden;
}

.login-wrap::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(187, 60, 251, 0.3) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  filter: blur(40px);
}

.login-wrap::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 184, 255, 0.2) 0%, transparent 70%);
  bottom: -150px;
  left: -150px;
  filter: blur(40px);
}

.login-card {
  position: relative;
  z-index: 2;
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: 36px 32px 30px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.brand-mark {
  text-align: center;
  margin-bottom: 20px;
}

.brand-logo {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--darkest);
  color: var(--lavender);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(15, 7, 38, 0.25);
}

.brand-eyebrow {
  font-size: 11px;
  font-weight: 600;
  color: var(--violet);
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.brand-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--darkest);
  letter-spacing: -0.3px;
  margin: 4px 0 0;
  line-height: 1.2;
}

.brand-tagline {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
  margin: 20px 0;
}

/* ===================================================================
   TABS (Sign in / Sign up)
   =================================================================== */
.tab-switch {
  display: flex;
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 20px;
}

.tab-switch button {
  flex: 1;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t-fast);
}

.tab-switch button.active {
  background: var(--card);
  color: var(--violet);
  box-shadow: var(--shadow-sm);
}

/* ===================================================================
   FORM
   =================================================================== */
.field {
  margin-bottom: 14px;
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.field-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--card);
  transition: all var(--t-fast);
}

.field-input::placeholder {
  color: var(--text-dim);
}

.field-input:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(99, 51, 251, 0.1);
}

.field-input:disabled {
  background: var(--bg);
  cursor: not-allowed;
}

/* ===================================================================
   BUTTONS
   =================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.btn:hover { background: var(--bg); }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--violet);
  color: #fff;
  border-color: var(--violet);
  box-shadow: var(--shadow-violet);
}

.btn-primary:hover {
  background: var(--violet-dark);
  border-color: var(--violet-dark);
}

.btn-primary:disabled {
  background: var(--text-dim);
  border-color: var(--text-dim);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 14px 20px;
  font-size: 14px;
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
}

.btn-ghost:hover { background: var(--bg); }

.btn-danger {
  color: var(--danger);
  border-color: transparent;
}

.btn-danger:hover {
  background: var(--danger-bg);
}

.link {
  color: var(--violet);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
}

.link:hover { text-decoration: underline; }

/* ===================================================================
   ALERTS & MESSAGES
   =================================================================== */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
  display: none;
}

.alert.show { display: block; }

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(214, 58, 58, 0.2);
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(27, 158, 117, 0.2);
}

.alert-info {
  background: var(--lavender-light);
  color: var(--violet-dark);
  border: 1px solid rgba(99, 51, 251, 0.15);
}

/* ===================================================================
   TOAST
   =================================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: var(--darkest);
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  transition: all var(--t-base);
  pointer-events: none;
  box-shadow: var(--shadow-lg);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ===================================================================
   LOADER
   =================================================================== */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-full {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.loading-full .spinner {
  width: 32px;
  height: 32px;
  border-color: var(--lavender-light);
  border-top-color: var(--violet);
}

/* ===================================================================
   DASHBOARD LAYOUT
   =================================================================== */
.app {
  display: none;
  min-height: 100vh;
}

.app.show { display: block; }

.app-header {
  background: var(--darkest);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(15, 7, 38, 0.3);
}

.header-row {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--lavender);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.2px;
}

.header-subtitle {
  font-size: 10.5px;
  font-weight: 400;
  opacity: 0.65;
  letter-spacing: 0.3px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.role-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  background: rgba(201, 184, 255, 0.15);
  color: var(--lavender);
  border-radius: var(--radius-pill);
  letter-spacing: 0.3px;
  text-transform: capitalize;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  padding: 4px 12px 4px 4px;
  cursor: pointer;
  transition: background var(--t-fast);
}

.user-menu:hover { background: rgba(255, 255, 255, 0.14); }

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--violet);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.user-name {
  font-size: 12px;
  font-weight: 500;
  color: #fff;
}

.logout-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-fast);
}

.logout-btn:hover { background: rgba(255, 255, 255, 0.16); }

/* Sidebar navigation */
.nav-bar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 64px;
  z-index: 90;
}

.nav-row {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  overflow-x: auto;
  gap: 4px;
  scrollbar-width: thin;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all var(--t-fast);
  text-decoration: none;
}

.nav-tab:hover { color: var(--text); }

.nav-tab.active {
  color: var(--violet);
  border-bottom-color: var(--violet);
}

.nav-tab .nav-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-tab .nav-badge {
  font-size: 9.5px;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  background: var(--lavender-light);
  color: var(--violet-dark);
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.main-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

/* ===================================================================
   DASHBOARD CONTENT
   =================================================================== */
.welcome-card {
  background: linear-gradient(135deg, var(--darkest) 0%, var(--violet-dark) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.welcome-card::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(187, 60, 251, 0.3) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  filter: blur(40px);
}

.welcome-eyebrow {
  font-size: 11px;
  font-weight: 600;
  color: var(--lavender);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  margin-bottom: 8px;
  position: relative;
}

.welcome-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
  position: relative;
}

.welcome-text {
  font-size: 14px;
  opacity: 0.85;
  max-width: 580px;
  position: relative;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin: 28px 0 14px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.module-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: all var(--t-base);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 160px;
}

.module-card:hover {
  transform: translateY(-2px);
  border-color: var(--lavender);
  box-shadow: var(--shadow-md);
}

.module-card.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.module-card.disabled:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: none;
}

.module-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--lavender-light);
  color: var(--violet);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.module-card.disabled .module-icon {
  background: var(--bg);
  color: var(--text-dim);
}

.module-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.module-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.module-status {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--text-muted);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-top: 12px;
  align-self: flex-start;
}

.module-status.ready {
  background: var(--success-bg);
  color: var(--success);
}

.module-status.soon {
  background: var(--warning-bg);
  color: var(--warning);
}

/* ===================================================================
   STAT CARDS
   =================================================================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  border-left: 4px solid var(--violet);
}

.stat-card.green { border-left-color: var(--success); }
.stat-card.red { border-left-color: var(--danger); }
.stat-card.amber { border-left-color: var(--warning); }
.stat-card.magenta { border-left-color: var(--magenta); }

.stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}

/* ===================================================================
   FOOTER
   =================================================================== */
.app-footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: var(--text-dim);
}

.app-footer strong {
  color: var(--text-muted);
  font-weight: 600;
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (max-width: 700px) {
  .login-card {
    padding: 28px 22px 24px;
  }
  .brand-name { font-size: 19px; }
  .header-row {
    padding: 0 14px;
    height: 56px;
  }
  .header-subtitle { display: none; }
  .role-badge { display: none; }
  .user-name { display: none; }
  .nav-row { padding: 0 12px; }
  .nav-tab { padding: 12px 10px; font-size: 12px; }
  .main-wrap { padding: 20px 14px 60px; }
  .welcome-card { padding: 22px; }
  .welcome-title { font-size: 22px; }
  .module-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .module-card { padding: 16px; min-height: 140px; }
  .module-icon { width: 38px; height: 38px; }
  .module-title { font-size: 13.5px; }
  .module-desc { font-size: 11.5px; }
}

@media (max-width: 480px) {
  .module-grid { grid-template-columns: 1fr; }
}
