@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&family=Lato:ital,wght@0,400;0,700;0,900;1,400&family=JetBrains+Mono:wght@500;700&display=swap');

@font-face {
  font-family: 'Material Symbols Outlined';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url(https://fonts.gstatic.com/s/materialsymbolsoutlined/v324/kJF1BvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oDMzByHX9rA6RzaxHMPdY43zj-jCxv3fzvRNU22ZXGJpEpjC_1v-p_4MrImHCIJIZrDCvHOem.ttf) format('truetype');
}

:root {
  --ks-primary: #2A4D3F;
  --ks-accent: #B2FF78;
  --ks-nav: #255e3e;
  --ks-success: #10b981;
  --ks-warning: #F59E0B;
  --ks-danger: #EF4444;
  --ks-muted: #6b7280;
  --ks-bg: #F8F8F8;
  --ks-surface: #ffffff;
  --font-display: 'Montserrat', sans-serif;
  --font-body: 'Lato', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  color: var(--ks-primary);
  background: var(--ks-bg);
}

.material-symbols-outlined, .ms {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  -webkit-font-smoothing: antialiased;
}

@keyframes ks-fadeup {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ks-pop {
  from { opacity: 0; transform: scale(.97); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes ks-shimmer {
  0% { background-position: -450px 0; }
  100% { background-position: 450px 0; }
}

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

.ks-fadeup { animation: ks-fadeup .22s ease-out; }
.ks-pop { animation: ks-pop .18s ease-out; }

.ks-sk {
  background: linear-gradient(90deg, #eef1f0 25%, #f7f9f8 37%, #eef1f0 63%);
  background-size: 450px 100%;
  animation: ks-shimmer 1.4s infinite linear;
}

.ks-spin {
  display: inline-block;
  width: 17px;
  height: 17px;
  border: 2.5px dashed currentColor;
  border-radius: 50%;
  animation: ks-spin .9s linear infinite;
}

.ks-row {
  transition: transform .18s, box-shadow .18s;
}

.ks-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(42, 77, 63, .12);
}

/* App shell */
.app-shell { min-height: 100vh; background: var(--ks-bg); }

.top-nav {
  height: 64px;
  background: var(--ks-nav);
  border-bottom: 1px solid #1a4a2e;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
}

.nav-brand img { height: 34px; width: 34px; }

.nav-brand-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 16px;
  color: #fff;
  letter-spacing: .005em;
}

.nav-brand-sub {
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ks-accent);
}

.nav-links { display: flex; gap: 4px; margin-left: 10px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 13px;
  text-decoration: none;
  color: rgba(255, 255, 255, .8);
  font-weight: 500;
  white-space: nowrap;
  transition: all .15s;
  border: none;
  background: transparent;
  cursor: pointer;
}

.nav-item:hover { filter: brightness(1.12); }

.nav-item.active {
  background: rgba(178, 255, 120, .18);
  color: var(--ks-accent);
  font-weight: 700;
}

.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

.icon-btn {
  border: 0;
  background: transparent;
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: rgba(255, 255, 255, .78);
  display: grid;
  place-items: center;
}

.icon-btn:hover { background: rgba(255, 255, 255, .1); }

.icon-btn .notif-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ks-accent);
  border: 1.5px solid var(--ks-nav);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 4px 6px 4px 10px;
  border-radius: 12px;
}

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

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ks-accent);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 13px;
  color: var(--ks-primary);
}

.main-content {
  min-height: calc(100vh - 64px);
  padding: 26px 30px;
}

/* Dropdown menu */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(42, 77, 63, .18);
  border: 1px solid #eef1f0;
  min-width: 200px;
  padding: 8px;
  display: none;
  z-index: 100;
}

.user-dropdown.open { display: block; animation: ks-pop .15s ease-out; }

.user-dropdown a, .user-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--ks-primary);
  cursor: pointer;
  text-decoration: none;
}

.user-dropdown a:hover, .user-dropdown button:hover { background: #F8FAF9; }

/* Toast */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px 16px;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .12);
  min-width: 280px;
  max-width: 380px;
  animation: ks-pop .2s ease-out;
}

.toast-success { background: #ECFDF5; border: 1px solid #A7F3D0; color: #047857; }
.toast-warn { background: #FFFBEB; border: 1px solid #FDE68A; color: #B45309; }
.toast-danger { background: #FEF2F2; border: 1px solid #FECACA; color: #B91C1C; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 23, .45);
  backdrop-filter: blur(4px);
  z-index: 1500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.open { display: flex; animation: ks-fadeup .2s ease-out; }

.modal {
  background: #fff;
  border-radius: 20px;
  padding: 28px 30px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(42, 77, 63, .22);
}

/* Role toggle (demo) */
.role-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  background: #fff;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .15);
  display: flex;
  gap: 4px;
}

.role-toggle button {
  border: 1px solid #E5E7EB;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  background: #fff;
  color: #6b7280;
}

.role-toggle button.active {
  background: #3D6456;
  color: #fff;
  border-color: #3D6456;
}

/* Landing page */
.landing-page { min-height: 100vh; background: #fff; }

.landing-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 40px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #eef1f0;
}

/* Auth split layout */
.auth-page { display: flex; min-height: 100vh; }

.auth-brand {
  width: 520px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #2A4D3F 0%, #16332680 55%, #0d1f17 100%);
  padding: 44px 46px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-form-panel {
  flex: 1;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 56px;
  overflow: auto;
}

.auth-form-inner { width: 100%; max-width: 412px; }

/* Utility */
.hidden { display: none !important; }
.tabular { font-variant-numeric: tabular-nums; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  cursor: pointer;
  background: var(--ks-success);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  padding: 14px 24px;
  border-radius: 13px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, .28);
  text-decoration: none;
  transition: background .15s, transform .15s;
}

.btn-primary:hover { background: #059669; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1.5px solid #E5E7EB;
  cursor: pointer;
  background: #fff;
  color: #3D6456;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13.5px;
  padding: 9px 17px;
  border-radius: 11px;
  text-decoration: none;
}

.btn-secondary:hover { background: #F8FFF1; border-color: var(--ks-accent); }

@media (max-width: 900px) {
  .auth-brand { display: none; }
  .nav-links { display: none; }
  .main-content { padding: 20px 16px; }
  .landing-nav { padding: 0 20px; }
}
