/* ==========================================================================
   ACCOUNTING CERTIFICATION & TRAINING INSTITUTE — CONTROL CENTER
   3D Neumorphic Teal Theme — Identity Verification & Secure Portal
   Main Admin: dcchamie25@gmail.com
   Font: Poppins exclusively
   ========================================================================== */

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

:root {
  --teal: #086375;
  --teal-dark: #054a57;
  --teal-deep: #023840;
  --teal-ocean: #065a68;
  --teal-light: #0d8299;
  --teal-pale: #e0f2f1;
  --teal-cyan: #22d3ee;
  --teal-mint: #2dd4bf;

  --ink: #0f172a;
  --ink-dim: #475569;
  --bg: #f4f9fa;
  --surface: #ffffff;
  --surface-2: #eef6f8;
  --line: #cfe6ea;

  --error: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;

  --shadow: 0 4px 12px rgba(8, 99, 117, 0.08);
  --shadow-sm: 0 2px 6px rgba(8, 99, 117, 0.04);
  --radius: 14px;
  --radius-sm: 8px;

  --font-head: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --transition: 200ms ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  font-family: inherit;
  border: none;
  outline: none;
  background: none;
  cursor: pointer;
}

input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
}

::selection { background: var(--teal-mint); color: #022c33; }

/* ==========================================================================
   3D NEUMORPHIC TEAL AUTHENTICATION / VERIFY YOUR IDENTITY (IMAGE 1, 2, 3)
   ========================================================================== */

.auth-3d-body {
  min-height: 100vh;
  width: 100vw;
  background: radial-gradient(circle at 20% 20%, #0d7f92 0%, #085a68 35%, #043841 70%, #022329 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
  font-family: var(--font-body);
}

.auth-page-container {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  position: relative;
  z-index: 2;
}

/* Background ripple wave circles radiating in deep teal */
.bg-ripple-waves {
  position: fixed;
  right: -120px;
  top: 50%;
  transform: translateY(-50%);
  width: 1100px;
  height: 850px;
  pointer-events: none;
  z-index: 1;
}

/* Top ACTI Seal & Brand Title */
.acti-brand-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
  z-index: 5;
  user-select: none;
}

.acti-seal-badge {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: #ffffff;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 30px rgba(2, 28, 33, 0.45);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.acti-seal-badge:hover {
  transform: scale(1.04);
}

.acti-seal-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.acti-brand-text {
  display: flex;
  flex-direction: column;
}

.acti-title {
  font-family: var(--font-head);
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  font-weight: 700;
  color: #ffffff;
  line-height: 1.18;
  letter-spacing: -0.4px;
  margin: 0;
  text-shadow: 0 2px 8px rgba(2, 28, 33, 0.35);
}

/* Main 3D Neumorphic Card */
.auth-3d-card {
  display: flex;
  flex-direction: row;
  width: 100%;
  max-width: 840px;
  min-height: 440px;
  border-radius: 32px;
  background: linear-gradient(145deg, #096878 0%, #064e5b 45%, #043a44 100%);
  box-shadow:
    22px 22px 65px #021a1f,
    -12px -12px 42px rgba(18, 142, 163, 0.32),
    inset 1px 1px 2px rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 24px;
  gap: 32px;
  position: relative;
  z-index: 5;
  backdrop-filter: blur(8px);
  box-sizing: border-box;
}

/* Left Panel: Recessed Inset Well */
.auth-3d-left {
  flex: 0 0 340px;
  display: flex;
  flex-direction: column;
}

.auth-3d-well {
  position: relative;
  flex: 1;
  border-radius: 24px;
  background: linear-gradient(145deg, #032b32 0%, #053b45 100%);
  box-shadow:
    inset 8px 8px 18px #021c21,
    inset -8px -8px 18px #085563;
  border: 1px solid rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  overflow: hidden;
}

/* Concentric ripples inside well */
.well-ripples {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  height: 320px;
  pointer-events: none;
  z-index: 1;
}

/* 3D Padlock and 3D Dial Visual Wrappers */
.visual-lock-wrap,
.visual-dial-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 220px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.lock-3d-svg {
  filter: drop-shadow(0 14px 24px rgba(2, 22, 27, 0.45));
  transition: transform 0.3s ease;
}

.lock-3d-svg:hover {
  transform: scale(1.03);
}

/* Status LED Pulse */
.led-pulse-dot {
  animation: ledGlowPulse 2s infinite ease-in-out;
}

@keyframes ledGlowPulse {
  0%, 100% { fill: #22d3ee; filter: drop-shadow(0 0 2px #22d3ee); }
  50% { fill: #38bdf8; filter: drop-shadow(0 0 8px #38bdf8); }
}

.dial-3d-svg {
  filter: drop-shadow(0 14px 26px rgba(2, 22, 27, 0.5));
}

.dial-check-path {
  animation: checkmarkPop 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes checkmarkPop {
  0% { stroke-dasharray: 80; stroke-dashoffset: 80; opacity: 0; }
  100% { stroke-dasharray: 80; stroke-dashoffset: 0; opacity: 1; }
}

/* Well Footer */
.well-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  position: relative;
  z-index: 2;
  user-select: none;
}

.well-secure-label {
  font-family: var(--font-head);
  font-size: 10.5px;
  font-weight: 700;
  color: #5b929c;
  letter-spacing: 1.5px;
}

.well-protected-label {
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 600;
  color: #a4cbd2;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-green-dot {
  width: 7.5px;
  height: 7.5px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  display: inline-block;
}

/* Right Panel: Authentication Form */
.auth-3d-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 12px 8px 0;
}

.auth-header-block {
  margin-bottom: 22px;
}

.auth-category-tag {
  display: block;
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  color: #2dd4bf;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.auth-main-title {
  font-family: var(--font-head);
  font-size: clamp(1.65rem, 2.5vw, 2.1rem);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin: 0 0 8px 0;
  line-height: 1.2;
}

.auth-sub-desc {
  font-family: var(--font-body);
  font-size: 13.5px;
  color: #a2cbd2;
  line-height: 1.5;
  margin: 0;
}

/* Super Admin Account Selector */
.account-selector-box {
  margin-top: 18px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.account-selector-label {
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  color: #a5f3fc;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.select-3d-wrapper {
  position: relative;
  width: 100%;
}

.select-3d-account {
  width: 100%;
  height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #032b32;
  box-shadow:
    inset 3px 3px 8px #021a1e,
    inset -2px -2px 6px #085563;
  color: #ffffff;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  padding: 0 36px 0 14px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2322d3ee' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: all 0.2s ease;
}

.select-3d-account:focus {
  border-color: #22d3ee;
  box-shadow:
    inset 3px 3px 8px #021a1e,
    inset -2px -2px 6px #085563,
    0 0 12px rgba(34, 211, 238, 0.4);
}

.auth-direct-enter-wrap {
  display: flex;
  justify-content: center;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-direct-dashboard {
  font-family: var(--font-head);
  font-size: 12.5px;
  font-weight: 600;
  color: #a5f3fc;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(3, 43, 50, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-direct-dashboard:hover {
  color: #ffffff;
  background: rgba(3, 43, 50, 0.85);
  border-color: #22d3ee;
  transform: translateY(-1px);
}

/* 3D Neumorphic reCAPTCHA Card */
.auth-recaptcha-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 72px;
  background: linear-gradient(145deg, #032b32 0%, #053b45 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 0 18px;
  margin-top: 18px;
  margin-bottom: 20px;
  box-shadow:
    inset 4px 4px 10px #021a1e,
    inset -3px -3px 8px #085563,
    0 4px 12px rgba(2, 28, 33, 0.2);
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.auth-recaptcha-card:hover {
  border-color: rgba(34, 211, 238, 0.35);
}

.recaptcha-left-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.recaptcha-3d-box {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #022228;
  border: 2px solid #0d8294;
  box-shadow: inset 2px 2px 5px #011417, inset -2px -2px 5px #0a6977;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.recaptcha-3d-box:hover {
  border-color: #22d3ee;
  box-shadow: inset 2px 2px 5px #011417, inset -2px -2px 5px #0a6977, 0 0 10px rgba(34, 211, 238, 0.3);
}

.recaptcha-3d-box.checked {
  background: #022f37;
  border-color: #22d3ee;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.5);
}

.recaptcha-check-svg {
  display: none;
}

.recaptcha-3d-box.checked .recaptcha-check-svg {
  display: block;
}

.recaptcha-3d-label {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 500;
  color: #e2f6f8;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.recaptcha-right-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  user-select: none;
}

.recaptcha-brand-txt {
  font-family: var(--font-head);
  font-size: 10px;
  font-weight: 600;
  color: #82aeb6;
  line-height: 1;
}

.recaptcha-terms-txt {
  font-family: var(--font-head);
  font-size: 8px;
  color: #5b929c;
  line-height: 1;
}

.recaptcha-err-hint {
  font-family: var(--font-head);
  font-size: 12.5px;
  font-weight: 600;
  color: #f87171;
  margin-top: -12px;
  margin-bottom: 16px;
  text-align: left;
}

/* 3D Pill Google Sign-In Button */
.btn-3d-google-signin {
  width: 100%;
  height: 52px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(135deg, #0e8c9e 0%, #0a6f7e 100%);
  box-shadow:
    6px 6px 18px #021d22,
    -4px -4px 14px #0e8798,
    inset 1px 1px 2px rgba(255, 255, 255, 0.35);
  color: #ffffff;
  font-family: var(--font-head);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  user-select: none;
}

.btn-3d-google-signin:hover {
  transform: translateY(-2px);
  box-shadow:
    8px 8px 24px #021d22,
    -6px -6px 18px #129bb0,
    0 0 16px rgba(34, 211, 238, 0.3);
  background: linear-gradient(135deg, #129bb0 0%, #0c7c8d 100%);
}

.btn-3d-google-signin:active {
  transform: translateY(1px);
  box-shadow: inset 4px 4px 8px #032c33;
}

.btn-3d-google-signin.verified-btn {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  box-shadow:
    0 0 24px rgba(16, 185, 129, 0.55),
    inset 1px 1px 2px rgba(255, 255, 255, 0.4);
}

.auth-alt-row {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

.btn-alt-account {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 500;
  color: #22d3ee;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
  background: none;
  border: none;
  padding: 4px;
}

.btn-alt-account:hover {
  color: #67e8f9;
  text-decoration: underline;
}

/* Status / Feedback Line */
.auth-feedback-status {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 500;
  color: #82aeb6;
  text-align: center;
  margin-bottom: 14px;
  min-height: 18px;
  transition: all 0.3s ease;
}

.auth-feedback-status.success {
  color: #34d399;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(52, 211, 153, 0.45);
}

.auth-feedback-status.error {
  color: #f87171;
  font-weight: 600;
}

/* Responsive Breakpoints */
@media (max-width: 820px) {
  .auth-3d-card {
    flex-direction: column;
    max-width: 440px;
    padding: 20px;
    gap: 20px;
  }

  .auth-3d-left {
    flex: none;
    width: 100%;
    height: 250px;
  }

  .auth-3d-right {
    padding: 0;
  }

  .acti-brand-header {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
}

/* ==========================================================================
   DASHBOARD / APP SHELL (FULL SYSTEM PRESERVED WITH POPPINS)
   ========================================================================== */

.app-shell {
  display: none;
  height: 100vh;
  width: 100vw;
  background: var(--bg);
  position: fixed;
  top: 0; left: 0;
  z-index: 10;
}

.app-shell.visible {
  display: flex;
}

.app-sidebar {
  width: 275px;
  background: var(--surface);
  border-right: 1px solid #e2edf0;
  display: flex;
  flex-direction: column;
  z-index: 30;
  box-shadow: 2px 0 12px rgba(8, 99, 117, 0.03);
}

.brand-bar {
  padding: 22px 20px;
  background: linear-gradient(135deg, #023840 0%, #065a68 55%, #086375 100%);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
}

.sidebar-brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffffff;
  padding: 2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  flex-shrink: 0;
  object-fit: cover;
}

.brand-text-wrap {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.brand-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.3px;
  line-height: 1.25;
}

.brand-subtitle {
  display: block;
  font-size: 0.72rem;
  color: #a5f3fc;
  font-weight: 500;
  margin-top: 3px;
  line-height: 1.2;
}

.nav-list {
  list-style: none;
  padding: 16px 12px;
  margin: 0;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item { padding: 0; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  border-radius: 12px;
  color: #475569;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: var(--font-head);
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover {
  background: #f0fdfa;
  color: #086375;
  transform: translateX(3px);
  border-color: rgba(8, 99, 117, 0.08);
}

.nav-link.active {
  background: linear-gradient(135deg, #086375 0%, #0a778c 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(8, 99, 117, 0.28);
  transform: translateX(2px);
}

.nav-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: currentColor;
  transition: transform 0.2s;
}

.nav-link:hover svg {
  transform: scale(1.08);
}

.nav-link.active svg {
  stroke: #ffffff;
  stroke-width: 2.3;
}

.nav-footer {
  display: none !important;
}

.app-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.app-topbar {
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  z-index: 20;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.burger { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); color: var(--ink-dim); }
.burger:hover { background: var(--surface-2); }
.page-title { font-weight: 800; font-size: 1.1rem; color: var(--ink); }

.topbar-right { display: flex; align-items: center; gap: 12px; }
.search-wrap { position: relative; }
.search-wrap input {
  padding: 8px 12px 8px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.9rem;
  outline: none;
  width: 200px;
}
.search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-dim); }

.topbar-actions { display: flex; align-items: center; gap: 12px; }

/* Topbar User Chip & Logout */
.topbar-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 4px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  margin-left: 6px;
}

.user-avatar-mini {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--teal);
  color: #ffffff;
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-meta-mini {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-name-mini {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-mini {
  font-size: 10px;
  color: var(--teal-dark);
  font-weight: 600;
}

.btn-topbar-logout {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink-dim);
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-topbar-logout:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}
.btn-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); color: var(--ink-dim); position: relative; }
.btn-icon:hover { background: var(--surface-2); color: var(--teal-dark); }
.notif-badge {
  position: absolute; top: 6px; right: 6px;
  width: 10px; height: 10px;
  background: var(--error); border-radius: 50%;
  font-size: 0; color: #fff;
}
.btn-primary {
  padding: 10px 18px;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--teal-dark); }

.app-content { flex: 1; overflow-y: auto; padding: 24px; }

.module-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.module-header > div { flex: 1; }
.module-header h2 { font-weight: 800; font-size: 1.4rem; color: var(--ink); letter-spacing: -0.5px; }
.module-header .sub { color: var(--ink-dim); font-size: 0.9rem; margin-top: 4px; }
.card-actions { display: flex; gap: 8px; align-items: center; }
.card-actions .btn-sm { padding: 6px 12px; font-size: 0.85rem; }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.kpi-label { font-size: 0.8rem; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; margin-bottom: 6px; }
.kpi-value { font-size: 1.6rem; font-weight: 800; color: var(--ink); }
.kpi-delta { font-size: 0.8rem; margin-top: 4px; }
.kpi-delta.neu { color: var(--ink-dim); }
.kpi-delta.pos { color: var(--success); }
.kpi-delta.neg { color: var(--error); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-weight: 800; font-size: 1rem; color: var(--ink); }
.card-body { padding: 20px; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
th { background: var(--surface-2); font-weight: 800; color: var(--ink-dim); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.4px; }
tr:last-child td { border-bottom: none; }

.badge {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}
.badge-bg { background: var(--teal); color: #fff; }
.badge-success { background: #e8f5e9; color: var(--success); }
.badge-warning { background: #fffde7; color: var(--warning); }
.badge-error { background: #ffebee; color: var(--error); }
.badge-info { background: var(--teal-pale); color: var(--teal-dark); }

.form-grid { display: grid; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.85rem; font-weight: 700; color: var(--ink); }
.hint { font-size: 0.8rem; color: var(--ink-dim); }

.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-header h3 { font-weight: 800; font-size: 1.1rem; color: var(--ink); }
.btn-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--ink-dim);
  font-size: 1.2rem;
}
.btn-close:hover { background: var(--surface-2); color: var(--error); }
.modal-body { padding: 20px; }
.modal-footer {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.btn-sm {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.2s;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-sm:hover { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn-sm.teal { background: var(--teal); color: #fff; }
.btn-sm.teal:hover { background: var(--teal-dark); }
.btn-sm:disabled { opacity: 0.5; cursor: not-allowed; }

.empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 40px; color: var(--ink-dim);
}
.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3 { font-weight: 800; margin-bottom: 6px; }
.empty-state p { font-size: 0.9rem; }

@media (max-width: 768px) {
  .app-sidebar { position: fixed; left: -100%; transition: left 0.3s; z-index: 35; }
  .app-sidebar.open { left: 0; }
  .app-content { padding: 16px; }
  .kpi-row { grid-template-columns: 1fr; }
  .topbar-right .search-wrap input { width: 140px; }
}
