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

:root {
 --font-main: 'Inter', 'Segoe UI', sans-serif;
 --display-font: 'Inter', 'Segoe UI', sans-serif;
 --radius-sm: 8px;
 --radius: 12px;
 --radius-md: 12px;
 --radius-lg: 20px;
 --transition: all 0.18s ease;
 color-scheme: light;
}

:root, [data-theme="light"] {
 --bg: #ffffff;
 --card: #ffffff;
 --card-light: #f4f4f4;
 --card-hover: #eeeeef;
 --text: #191c1f;
 --text-dim: #505a63;
 --border: #e2e2e7;
 --border-focus: #494fdf;
 --topbar-bg: rgba(255, 255, 255, 0.92);
 --primary: #494fdf;
 --primary-hover: #3a40c4;
 --primary-light: rgba(73, 79, 223, 0.1);
 --button-bg: #494fdf;
 --button-hover: #3a40c4;
 --button-text: #ffffff;
 --accent: #008b69;
 --accent-light: rgba(0, 139, 105, 0.1);
 --warn: #a65e00;
 --warn-light: rgba(236, 126, 0, 0.12);
 --danger: #c83245;
 --danger-light: rgba(226, 59, 74, 0.1);
 --shadow-sm: none;
 --shadow-md: none;
 --table-th-bg: #f4f4f4;
 --table-hover: #f8f8f9;
 --input-bg: #ffffff;
 --input-border: #e2e2e7;
 --chip-bg: #f4f4f4;
 --chip-border: #e2e2e7;
 --toggle-bg: #f4f4f4;
 --toggle-color: #191c1f;
}

[data-theme="dark"] {
 color-scheme: dark;
 --bg: #000000;
 --card: #16181a;
 --card-light: #0a0a0a;
 --card-hover: #222426;
 --text: #ffffff;
 --text-dim: rgba(255, 255, 255, 0.72);
 --border: rgba(255, 255, 255, 0.12);
 --border-focus: #7c81ff;
 --topbar-bg: rgba(0, 0, 0, 0.92);
 --primary: #494fdf;
 --primary-hover: #3a40c4;
 --primary-light: rgba(73, 79, 223, 0.2);
 --button-bg: #ffffff;
 --button-hover: #e8e8eb;
 --button-text: #191c1f;
 --accent: #00a87e;
 --accent-light: rgba(0, 168, 126, 0.14);
 --warn: #ec9a39;
 --warn-light: rgba(236, 126, 0, 0.14);
 --danger: #ff7380;
 --danger-light: rgba(226, 59, 74, 0.14);
 --shadow-sm: none;
 --shadow-md: none;
 --table-th-bg: #0a0a0a;
 --table-hover: #111315;
 --input-bg: #0a0a0a;
 --input-border: rgba(255, 255, 255, 0.16);
 --chip-bg: #16181a;
 --chip-border: rgba(255, 255, 255, 0.12);
 --toggle-bg: #16181a;
 --toggle-color: #ffffff;
}

* {
 box-sizing: border-box;
}

body {
 margin: 0;
 font-family: var(--font-main);
 background: var(--bg);
 color: var(--text);
 min-height: 100vh;
 line-height: 1.5;
 letter-spacing: 0.01em;
 -webkit-font-smoothing: antialiased;
 -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, .display {
 font-family: var(--display-font);
 letter-spacing: -0.03em;
}

a {
 color: var(--primary);
 text-decoration: none;
 transition: var(--transition);
}

a:hover {
 text-decoration: underline;
}

.framer-shell {
 width: min(1200px, calc(100% - 32px));
 margin: 0 auto;
 padding: 24px 0 72px;
}

.framer-header {
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 16px;
 padding: 8px 0 18px;
}

.brand-lockup {
 display: inline-flex;
 align-items: center;
 gap: 10px;
 font-weight: 600;
 color: var(--text);
}

.brand-mark {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 width: 30px;
 height: 30px;
 border-radius: var(--radius-sm);
 background: var(--primary);
 color: #ffffff;
 border: 1px solid var(--border);
}

.brand-mark svg {
 width: 18px;
 height: 18px;
}

.site-logo {
 width: 100%;
 height: 100%;
 display: block;
 object-fit: contain;
}

.ghost-pill, .secondary-pill, .primary-pill {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 border-radius: 999px;
 font-weight: 600;
 transition: var(--transition);
}

.ghost-pill {
 padding: 10px 16px;
 background: var(--card);
 border: 1px solid var(--border);
 color: var(--text);
}

.ghost-pill:hover {
 text-decoration: none;
 background: var(--card-light);
}

.framer-hero {
 display: grid;
 grid-template-columns: 1.15fr 0.85fr;
 gap: 28px;
 align-items: center;
 padding-top: 32px;
}

.framer-copy {
 padding-right: 18px;
}

.eyebrow {
 display: inline-flex;
 align-items: center;
 padding: 7px 10px;
 border: 1px solid var(--border);
 border-radius: 999px;
 background: var(--card-light);
 color: var(--text-dim);
 font-size: 11px;
 font-weight: 600;
 letter-spacing: 0.11em;
 text-transform: uppercase;
}

.framer-copy h1 {
 margin: 18px 0 16px;
 font-size: clamp(2.75rem, 6vw, 5rem);
 line-height: 1;
 color: var(--text);
 letter-spacing: -0.065em;
}

.framer-copy p {
 max-width: 620px;
 margin: 0;
 color: var(--text-dim);
 font-size: 18px;
 line-height: 1.5;
}

.hero-actions {
 display: flex;
 flex-wrap: wrap;
 gap: 14px;
 margin-top: 28px;
 margin-bottom: 28px;
}

.primary-pill, .secondary-pill {
 padding: 14px 22px;
 font-size: 14px;
 border: 1px solid transparent;
}

.primary-pill {
 background: var(--button-bg);
 color: var(--button-text);
}

.primary-pill:hover {
 text-decoration: none;
 transform: translateY(-1px);
 background: var(--button-hover);
 color: var(--button-text);
}

.secondary-pill {
 background: var(--card);
 border-color: var(--border);
 color: var(--text);
}

.secondary-pill:hover {
 text-decoration: none;
 background: var(--card-light);
}

.portal-context {
 display: grid;
 gap: 12px;
 max-width: 500px;
 margin-top: 32px;
 padding-top: 20px;
 border-top: 1px solid var(--border);
}

.portal-context p {
 display: grid;
 grid-template-columns: 100px 1fr;
 gap: 12px;
 margin: 0;
 color: var(--text-dim);
 font-size: 14px;
}

.portal-context strong {
 color: var(--text);
 font-weight: 600;
}

.portal-panel {
 position: relative;
}

.login-card {
 position: relative;
 background: var(--card);
 border: 1px solid var(--border);
 border-radius: var(--radius-lg);
 padding: 28px;
}

@media (max-width: 900px) {
 .framer-header { flex-wrap: wrap; }
 .framer-hero { grid-template-columns: 1fr; }
 .framer-copy { padding-right: 0; }
 .framer-copy h1 { max-width: 520px; }
}

@media (max-width: 600px) {
 .framer-shell { padding-top: 16px; }
 .framer-hero { gap: 24px; padding-top: 24px; }
 .framer-copy h1 { font-size: clamp(2.5rem, 12vw, 3.5rem); }
 .portal-context p { grid-template-columns: 1fr; gap: 2px; }
}

/* Containers */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.narrow {
  max-width: 420px;
  margin: 64px auto;
  padding: 0 16px;
}

/* Page Headers */
.page-header {
  margin-bottom: 24px;
}

.page-title {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin: 0 0 4px;
  color: var(--text);
}

.page-desc {
  font-size: 13.5px;
  color: var(--text-dim);
  margin: 0;
}

/* Card */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

/* Topbar Navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #ffffff;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.desktop-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  transition: var(--transition);
}

.desktop-nav a:hover {
  color: var(--text);
  background: var(--card-light);
  text-decoration: none;
}

.desktop-nav a.active {
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-light);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* User Chip */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}

.user-chip-role {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--border);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-dim);
}

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

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-logout:hover {
  background: var(--danger-light);
  border-color: var(--danger);
  color: var(--danger);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--toggle-bg);
  color: var(--toggle-color);
  cursor: pointer;
  padding: 0;
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  border-color: var(--text-dim);
}

.theme-toggle-floating {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

/* Mobile Toggle Hamburger Button */
.mobile-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card-light);
  color: var(--text);
  cursor: pointer;
  padding: 0;
}

/* Mobile Menu Drawer */
.mobile-menu {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  box-shadow: var(--shadow-md);
}

.mobile-user-info {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.mobile-user-name {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
}

.mobile-user-role {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.mobile-links {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mobile-links a {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
}

.mobile-links a:hover {
  background: var(--card-light);
  color: var(--text);
}

.mobile-links a.active {
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-light);
}

.mobile-menu-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

@media (max-width: 820px) {
  .desktop-nav { display: none; }
  .user-chip, .btn-logout { display: none; }
  .mobile-toggle-btn { display: inline-flex; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--button-bg);
  color: var(--button-text);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  transition: var(--transition);
}

.btn:hover {
  background: var(--button-hover);
  color: var(--button-text);
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--card-light);
  border-color: var(--border);
  color: var(--text);
}

.btn-accent {
  background: var(--button-bg);
  color: var(--button-text);
}

.btn-accent:hover {
  background: var(--button-hover);
  color: var(--button-text);
}

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

.btn-danger:hover {
  opacity: 0.9;
  color: #ffffff;
}

.btn-sm {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.login-captcha {
 margin-top: 16px;
}

.captcha-challenge-row {
 display: flex;
 align-items: center;
 gap: 10px;
 margin: 6px 0 10px;
}

.captcha-question {
 flex: 1;
 min-height: 42px;
 display: flex;
 align-items: center;
 overflow: hidden;
 padding: 8px 12px;
 border: 1px solid var(--border);
 border-radius: var(--radius-sm);
 background: var(--card-light);
 color: var(--text);
}

.captcha-image {
 display: block;
 width: 190px;
 max-width: 100%;
 height: 64px;
 object-fit: contain;
}

.captcha-hint {
 margin: 5px 0 0;
 color: var(--text-dim);
 font-size: 12px;
}

.cookie-notice {
 position: fixed;
 z-index: 1200;
 right: 20px;
 bottom: 20px;
 display: flex;
 align-items: center;
 gap: 20px;
 width: min(680px, calc(100% - 32px));
 padding: 18px;
 border: 1px solid var(--border);
 border-radius: var(--radius-md);
 background: var(--card);
 color: var(--text);
 box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}

.cookie-notice p {
 margin: 0;
 color: var(--text-dim);
 font-size: 13px;
}

.cookie-notice strong {
 display: block;
 margin-bottom: 4px;
 color: var(--text);
}

.cookie-notice-actions {
 display: flex;
 flex-shrink: 0;
 gap: 8px;
}

.cookie-notice-actions button {
 min-height: 38px;
 padding: 8px 12px;
 border: 1px solid var(--border);
 border-radius: 999px;
 background: var(--card-light);
 color: var(--text);
 font: inherit;
 font-size: 12px;
 font-weight: 600;
 cursor: pointer;
}

.cookie-notice-actions .cookie-accept {
 border-color: var(--button-bg);
 background: var(--button-bg);
 color: var(--button-text);
}

@media (max-width: 600px) {
 .cookie-notice {
  right: 12px;
  bottom: 12px;
  align-items: stretch;
  flex-direction: column;
  gap: 12px;
  width: calc(100% - 24px);
 }

 .cookie-notice-actions button {
  flex: 1;
 }
}

/* Forms */
label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
  display: block;
  margin-bottom: 5px;
}

input, select, textarea {
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  margin-bottom: 14px;
  outline: none;
  transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
}

input[type="file"] {
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}

input[type="checkbox"], input[type="radio"] {
  width: auto;
  min-height: 0;
  margin: 0;
  accent-color: var(--primary);
}

input::placeholder, textarea::placeholder {
  color: var(--text-dim);
  opacity: 0.75;
}

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* Grids */
.grid {
  display: grid;
  gap: 16px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 860px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .container { padding: 18px 14px 40px; }
}

/* Stats */
.stat-box {
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Progress Bar */
.progress-bar {
  background: var(--card-light);
  border-radius: 999px;
  overflow: hidden;
  height: 8px;
  margin: 8px 0;
  border: 1px solid var(--border);
}

.progress-fill {
  background: var(--primary);
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--table-th-bg);
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
}

tbody tr:hover {
  background: var(--table-hover);
}

/* Status Badges */
.badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid transparent;
}

.pill-ontime, .pill-approved {
  background: var(--accent-light);
  color: var(--accent);
  border-color: rgba(34, 197, 94, 0.2);
}

.pill-late, .pill-pending {
  background: var(--warn-light);
  color: var(--warn);
  border-color: rgba(245, 158, 11, 0.2);
}

.pill-rejected {
  background: var(--danger-light);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.2);
}

/* Badge Showcase */
.badge-item {
  text-align: center;
  padding: 18px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
}

.badge-item.locked {
  opacity: 0.4;
  filter: grayscale(1);
}

.badge-icon {
  font-size: 32px;
  margin-bottom: 6px;
  display: inline-block;
}

/* Messages / Alerts */
.msg {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
}

.msg-error {
  background: var(--danger-light);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.2);
}

.msg-success {
  background: var(--accent-light);
  color: var(--accent);
  border-color: rgba(34, 197, 94, 0.2);
}

/* Tabs */
.tabs {
  display: inline-flex;
  gap: 2px;
  background: var(--card-light);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.tab-btn {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  transition: var(--transition);
}

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

.tab-btn.active {
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-dim);
  font-size: 13px;
}

/* Demo Credentials Box */
.demo-box {
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--card-light);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* Animations & Micro-interactions */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalZoomIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

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

.animate-fade-in {
  animation: fadeInUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.shake {
  animation: shakeError 0.4s ease-in-out both;
}

/* Button & interactive press states */
.btn {
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

/* Form Input Wrapper with Icons & Password Toggle */
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.input-with-icon .input-icon-left {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.input-with-icon input {
  margin-bottom: 0;
  padding-left: 38px;
  padding-right: 40px;
}

.input-with-icon:focus-within .input-icon-left {
  color: var(--primary);
}

.btn-toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 6px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.btn-toggle-password:hover {
  color: var(--text);
  background: var(--card-light);
}

.btn-toggle-password:focus-visible {
  outline: 2px solid var(--border-focus);
}

/* Confirmation Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeInUp 0.18s ease-out;
}

.modal-dialog {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 440px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  animation: modalZoomIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.modal-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.modal-icon-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.modal-desc {
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0 0 22px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Demo Switcher Chips */
.demo-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.demo-chip-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  font-family: inherit;
}

.demo-chip-btn:hover {
  background: var(--card-light);
  border-color: var(--border-focus);
  transform: translateY(-1px);
}

.demo-chip-btn:active {
  transform: scale(0.98);
}

.demo-chip-role {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
}

.demo-chip-email {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  word-break: break-all;
}

.assistant-widget {
  position: fixed;
  z-index: 900;
  bottom: 20px;
  left: 20px;
}

.assistant-toggle {
  display: flex;
  width: 54px;
  height: 54px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.assistant-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.assistant-slime-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.assistant-panel {
  position: absolute;
  left: 0;
  bottom: 68px;
  display: none;
  flex-direction: column;
  width: min(380px, calc(100vw - 32px));
  height: min(520px, calc(100dvh - 112px));
  min-height: min(300px, calc(100dvh - 112px));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}

.assistant-panel-open {
  display: flex;
}

.assistant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

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

.assistant-avatar {
  display: block;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.assistant-message-avatar {
  width: 28px;
  height: 28px;
}

.assistant-header strong,
.assistant-header span {
  display: block;
}

.assistant-header span {
  margin-top: 2px;
  color: var(--text-dim);
  font-size: 12px;
}

.assistant-close {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.assistant-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 14px;
}

.assistant-message-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  max-width: 100%;
}

.assistant-message-row-user {
  justify-content: flex-end;
}

.assistant-message {
  max-width: calc(100% - 34px);
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--card-light);
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.assistant-message-row-user .assistant-message {
  max-width: 90%;
}

.assistant-message-user {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
}

.assistant-message-action {
  border: 1px solid var(--accent);
  background: var(--accent-light);
}

.assistant-message-error {
  border: 1px solid var(--danger);
  background: var(--danger-light);
}

.assistant-message-typing {
  color: var(--text-dim);
  font-style: italic;
}

.assistant-confirmation {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-light);
}

.assistant-confirmation p {
  margin: 0;
  font-size: 13px;
}

.assistant-confirmation input {
  width: 100%;
  margin: 0;
}

.assistant-confirmation button,
.assistant-form button {
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.assistant-confirmation button {
  padding: 9px 12px;
}

.assistant-confirmation button:disabled,
.assistant-form button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.assistant-credentials {
  display: grid;
  gap: 10px;
  max-width: 100%;
  padding: 12px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--card-light);
}

.assistant-credentials p {
  margin: 0;
  color: var(--text-dim);
  font-size: 12px;
}

.assistant-credential-row {
  display: grid;
  gap: 6px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.assistant-credential-row strong,
.assistant-credential-row code {
  font-size: 12px;
}

.assistant-credential-row code {
  color: var(--text);
  user-select: all;
}

.assistant-credential-row button {
  justify-self: start;
  padding: 6px 9px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.assistant-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
}

.assistant-voice-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
}

.assistant-voice-status {
  flex: 1 1 100%;
  min-width: 0;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.4;
}

.assistant-voice-controls button {
  padding: 6px 8px;
}

.assistant-voice-controls button[hidden] {
  display: none;
}

.assistant-attachment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
}

.assistant-attachment[hidden] {
  display: none;
}

.assistant-attachment span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-attachment-image-preview {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: var(--card);
}

.assistant-attachment-image-preview[hidden] {
  display: none;
}

.assistant-attachment button,
.assistant-tool-button,
.assistant-speak-button {
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--card-light);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.assistant-attachment button {
  flex: 0 0 auto;
  padding: 2px 8px;
  font-size: 18px;
}

.assistant-tool-button {
  flex: 0 0 auto;
  padding: 8px 9px;
  font-size: 12px;
}

.assistant-tool-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.assistant-speak-button {
  display: block;
  margin-top: 7px;
  padding: 4px 7px;
  font-size: 11px;
}

.assistant-form input {
  min-width: 0;
  flex: 1;
  margin: 0;
}

.assistant-form button {
  padding: 0 14px;
}

.points-modal-dialog {
  max-width: 520px;
}

.points-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.points-history-table th,
.points-history-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.points-history-table th {
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
}

@media (max-width: 600px) {
  .assistant-widget {
    bottom: 14px;
    left: 14px;
  }

  .assistant-panel {
    position: fixed;
    right: 12px;
    bottom: 78px;
    left: 12px;
    width: auto;
    height: min(520px, calc(100dvh - 100px));
    min-height: min(300px, calc(100dvh - 100px));
  }

  .assistant-toggle {
    width: 50px;
    height: 50px;
  }
}
