/* =============================================================================
   HBR BROKERS — ADMIN PANEL DESIGN SYSTEM
   SAP Fiori Horizon Inspired · v2.0
   ============================================================================= */

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

/* =============================================================================
   DESIGN TOKENS
   ============================================================================= */

:root {
  /* Brand */
  --brand-primary: #0a6ed1;
  --brand-primary-hover: #0854a0;
  --brand-primary-active: #0040b0;
  --brand-primary-subtle: #eaf2fb;
  --brand-primary-light: #d1e8fa;

  /* Semantic */
  --success: #107e3e;
  --success-bg: #f1f8f4;
  --success-border: #a8d5b5;
  --warning: #e9730c;
  --warning-bg: #fef4eb;
  --warning-border: #f8c17e;
  --error: #bb0000;
  --error-bg: #fff0f0;
  --error-border: #f5b8b8;
  --info: #0070f2;
  --info-bg: #edf5fd;
  --info-border: #9dc8f5;

  /* Neutral */
  --gray-50: #f8f9fa;
  --gray-100: #f2f3f4;
  --gray-200: #e8e9ea;
  --gray-300: #d9dadb;
  --gray-400: #c4c5c6;
  --gray-500: #a5a6a7;
  --gray-600: #7a7b7c;
  --gray-700: #545556;
  --gray-800: #32363a;
  --gray-900: #1a1c1e;

  /* Shell (Navigation) */
  --shell-bg: #354a5e;
  --shell-bg-2: #293d52;
  --shell-text: rgba(255,255,255,0.9);
  --shell-text-dim: rgba(255,255,255,0.6);
  --shell-border: rgba(255,255,255,0.1);
  --shell-hover: rgba(255,255,255,0.08);
  --shell-active: rgba(255,255,255,0.15);
  --shell-height: 48px;

  /* Side Nav */
  --nav-width: 256px;
  --nav-collapsed: 56px;
  --nav-bg: #ffffff;
  --nav-border: #e4e5e6;
  --nav-item-hover: #f5f6f7;
  --nav-item-active-bg: #eaf2fb;
  --nav-item-active-text: #0a6ed1;
  --nav-item-active-border: #0a6ed1;

  /* Surface */
  --body-bg: #f5f6f7;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-overlay: rgba(255, 255, 255, 0.95);
  --border: #e4e5e6;
  --border-strong: #c5c6c7;
  --border-focus: #0a6ed1;

  /* Text */
  --text-primary: #32363a;
  --text-secondary: #6a6d70;
  --text-tertiary: #a5a6a7;
  --text-disabled: #c4c5c6;
  --text-inverse: #ffffff;
  --text-link: #0a6ed1;
  --text-link-hover: #0854a0;

  /* Typography */
  --font: 'Inter', -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* Border Radius */
  --r-sm: 4px;
  --r: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 6px rgba(0,0,0,0.04);
  --shadow: 0 2px 6px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1), 0 8px 24px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12), 0 16px 48px rgba(0,0,0,0.08);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.16), 0 32px 64px rgba(0,0,0,0.1);
  --shadow-focus: 0 0 0 3px rgba(10, 110, 209, 0.2);

  /* Transitions */
  --t-fast: 0.12s ease;
  --t: 0.2s ease;
  --t-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-Index */
  --z-nav: 100;
  --z-shell: 200;
  --z-drawer: 300;
  --z-modal: 400;
  --z-toast: 500;
  --z-tooltip: 600;
}

/* =============================================================================
   RESET & BASE
   ============================================================================= */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--body-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--t-fast);
}

a:hover { color: var(--text-link-hover); text-decoration: underline; }

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: var(--font);
}

img { max-width: 100%; height: auto; }

ul, ol { list-style: none; }

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

/* =============================================================================
   APP SHELL LAYOUT
   ============================================================================= */

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

/* ---- Shell Bar (Top Header) ---- */

.shell-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--shell-height);
  background: var(--shell-bg);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-4);
  z-index: var(--z-shell);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.shell-bar-start {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}

.shell-bar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  max-width: 480px;
  margin: 0 auto;
}

.shell-bar-end {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  flex-shrink: 0;
  margin-left: auto;
}

/* Menu toggle */
.shell-menu-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  color: var(--shell-text);
  transition: background var(--t-fast);
  font-size: 1rem;
}

.shell-menu-btn:hover { background: var(--shell-hover); }

/* Brand */
.shell-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--r-sm);
}

.shell-brand-logo {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #0a6ed1, #00b4d8);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.shell-brand-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--shell-text);
  letter-spacing: -0.2px;
}

.shell-brand-divider {
  width: 1px;
  height: 20px;
  background: var(--shell-border);
  margin: 0 var(--sp-2);
}

/* Breadcrumb */
.shell-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.8125rem;
}

.breadcrumb-item {
  color: var(--shell-text-dim);
  transition: color var(--t-fast);
}

.breadcrumb-item:hover { color: var(--shell-text); text-decoration: none; }
.breadcrumb-item.current { color: var(--shell-text); font-weight: 500; }

.breadcrumb-sep {
  color: var(--shell-text-dim);
  font-size: 0.625rem;
}

/* Global Search */
.shell-search {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--r-full);
  padding: 0 var(--sp-4);
  height: 34px;
  min-width: 300px;
  transition: all var(--t);
}

.shell-search:focus-within {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.3);
}

.shell-search-icon {
  color: var(--shell-text-dim);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.shell-search-input {
  background: none;
  border: none;
  outline: none;
  color: var(--shell-text);
  font-size: 0.8125rem;
  width: 100%;
}

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

.shell-search-kbd {
  background: rgba(255,255,255,0.15);
  color: var(--shell-text-dim);
  border-radius: var(--r-sm);
  padding: 1px 6px;
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

/* Shell Actions */
.shell-action {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  color: var(--shell-text-dim);
  font-size: 0.9375rem;
  transition: all var(--t-fast);
}

.shell-action:hover {
  background: var(--shell-hover);
  color: var(--shell-text);
}

.shell-action-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  background: #e9730c;
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--shell-bg);
}

/* Shell User Menu */
.shell-user {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t-fast);
  border: 1px solid transparent;
  margin-left: var(--sp-2);
}

.shell-user:hover { background: var(--shell-hover); border-color: var(--shell-border); }

.shell-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, #0a6ed1, #00b4d8);
  color: white;
  font-size: 0.6875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.shell-user-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.shell-user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--shell-text);
  line-height: 1;
}

.shell-user-role {
  font-size: 0.6875rem;
  color: var(--shell-text-dim);
  line-height: 1;
}

.shell-user-caret {
  color: var(--shell-text-dim);
  font-size: 0.6875rem;
  transition: transform var(--t-fast);
}

/* User Dropdown */
.user-dropdown {
  position: absolute;
  top: calc(var(--shell-height) + 4px);
  right: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-2);
  min-width: 220px;
  z-index: var(--z-modal);
  display: none;
}

.user-dropdown.open { display: block; animation: dropdownSlide 0.15s ease; }

@keyframes dropdownSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.user-dropdown-header {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-2);
}

.user-dropdown-name { font-weight: 600; color: var(--text-primary); }
.user-dropdown-email { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: all var(--t-fast);
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover { background: var(--nav-item-hover); color: var(--text-primary); text-decoration: none; }
.dropdown-item.danger:hover { background: var(--error-bg); color: var(--error); }
.dropdown-item i { width: 16px; text-align: center; }

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: var(--sp-2) 0;
}

/* ---- Side Navigation ---- */

.side-nav {
  position: fixed;
  top: var(--shell-height);
  left: 0;
  bottom: 0;
  width: var(--nav-width);
  background: var(--nav-bg);
  border-right: 1px solid var(--nav-border);
  display: flex;
  flex-direction: column;
  z-index: var(--z-nav);
  transition: width var(--t-slow);
  overflow: hidden;
}

.side-nav.collapsed { width: var(--nav-collapsed); }

.nav-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--sp-3) 0;
}

.nav-scroll::-webkit-scrollbar { width: 4px; }
.nav-scroll::-webkit-scrollbar-track { background: transparent; }
.nav-scroll::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }

.nav-section-title {
  padding: var(--sp-3) var(--sp-4) var(--sp-1);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  white-space: nowrap;
  transition: opacity var(--t);
}

.side-nav.collapsed .nav-section-title { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
  height: 40px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all var(--t-fast);
  white-space: nowrap;
  position: relative;
  cursor: pointer;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--nav-item-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.nav-item.active {
  background: var(--nav-item-active-bg);
  color: var(--nav-item-active-text);
  border-left-color: var(--nav-item-active-border);
  font-weight: 600;
}

.nav-item-icon {
  width: 18px;
  text-align: center;
  font-size: 0.9375rem;
  flex-shrink: 0;
}

.nav-item-label {
  flex: 1;
  transition: opacity var(--t);
}

.side-nav.collapsed .nav-item-label { opacity: 0; pointer-events: none; }

.nav-badge {
  background: var(--brand-primary);
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  flex-shrink: 0;
  transition: opacity var(--t);
}

.nav-badge.warning { background: var(--warning); }
.nav-badge.error { background: var(--error); }
.side-nav.collapsed .nav-badge { opacity: 0; }

/* Nav collapse button */
.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--border);
}

.nav-toggle-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: var(--surface);
  font-size: 0.6875rem;
  transition: all var(--t-fast);
  flex-shrink: 0;
}

.nav-toggle-btn:hover { background: var(--nav-item-hover); color: var(--text-primary); border-color: var(--border-strong); }
.side-nav.collapsed .nav-toggle-btn i { transform: rotate(180deg); }

/* Nav tooltip for collapsed state */
.nav-item[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(var(--nav-collapsed) - 4px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--gray-800);
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-sm);
  white-space: nowrap;
  pointer-events: none;
  z-index: var(--z-tooltip);
  opacity: 0;
  animation: tooltipFade 0.15s ease 0.3s forwards;
}

@keyframes tooltipFade {
  to { opacity: 1; }
}

/* ---- App Body ---- */

.app-body {
  flex: 1;
  margin-left: var(--nav-width);
  margin-top: var(--shell-height);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--shell-height));
  transition: margin-left var(--t-slow);
}

.app-body.nav-collapsed { margin-left: var(--nav-collapsed); }

.page-content {
  flex: 1;
  padding: var(--sp-6);
  overflow-y: auto;
  max-width: 100%;
}

/* ---- Page Header ---- */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.page-header-text {}

.page-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  line-height: 1.3;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: var(--sp-1);
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

/* =============================================================================
   BUTTONS
   ============================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-4);
  height: 36px;
  border-radius: var(--r);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  border: 1px solid transparent;
  text-decoration: none !important;
  user-select: none;
}

.btn:focus-visible { box-shadow: var(--shadow-focus); }

/* Sizes */
.btn-sm { height: 28px; padding: 0 var(--sp-3); font-size: 0.8125rem; }
.btn-lg { height: 44px; padding: 0 var(--sp-6); font-size: 0.9375rem; }

/* Primary */
.btn-primary {
  background: var(--brand-primary);
  color: white;
}
.btn-primary:hover { background: var(--brand-primary-hover); color: white; }
.btn-primary:active { background: var(--brand-primary-active); }

/* Secondary */
.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-400); color: var(--text-primary); }

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--gray-100); color: var(--text-primary); }

/* Danger */
.btn-danger {
  background: var(--error);
  color: white;
}
.btn-danger:hover { background: #990000; color: white; }

/* Success */
.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover { background: #0a6030; color: white; }

/* Warning */
.btn-warning {
  background: var(--warning);
  color: white;
}
.btn-warning:hover { background: #c75f08; color: white; }

/* Icon button */
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r);
}

.btn-icon.btn-sm { width: 28px; height: 28px; }

/* =============================================================================
   FORM CONTROLS
   ============================================================================= */

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  margin-bottom: var(--sp-4);
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-label .required {
  color: var(--error);
  margin-left: 2px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.form-error-text {
  font-size: 0.75rem;
  color: var(--error);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.form-control {
  height: 36px;
  padding: 0 var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  font-size: 0.875rem;
  color: var(--text-primary);
  font-family: var(--font);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  width: 100%;
}

.form-control:hover { border-color: var(--gray-500); }

.form-control:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-focus);
}

.form-control.error { border-color: var(--error); }
.form-control.error:focus { box-shadow: 0 0 0 3px rgba(187,0,0,0.15); }

.form-control.success { border-color: var(--success); }

textarea.form-control {
  height: auto;
  padding: var(--sp-3);
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

select.form-control {
  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='%236a6d70' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-3) center;
  padding-right: 36px;
}

/* Input group */
.input-group {
  position: relative;
}

.input-group .form-control { padding-left: 36px; }
.input-group .input-icon {
  position: absolute;
  left: var(--sp-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 0.875rem;
  pointer-events: none;
}

.input-group .input-icon-right {
  position: absolute;
  right: var(--sp-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: color var(--t-fast);
}

.input-group .input-icon-right:hover { color: var(--text-primary); }
.input-group .form-control.has-right-icon { padding-right: 36px; }

/* Checkbox and Radio */
.checkbox-group, .radio-group {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
}

.checkbox-group input[type="checkbox"],
.radio-group input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-group label, .radio-group label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

/* Filter chips */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 0 var(--sp-3);
  height: 28px;
  border-radius: var(--r-full);
  font-size: 0.8125rem;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--t-fast);
  user-select: none;
}

.filter-chip:hover { border-color: var(--brand-primary); color: var(--brand-primary); background: var(--brand-primary-subtle); }
.filter-chip.active { background: var(--brand-primary); border-color: var(--brand-primary); color: white; }

/* =============================================================================
   CARDS
   ============================================================================= */

.card {
  background: var(--surface);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-6);
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.card-body { padding: var(--sp-6); }
.card-body.compact { padding: var(--sp-4); }

.card-footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border);
  background: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

/* =============================================================================
   KPI / STAT CARDS
   ============================================================================= */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.kpi-card {
  background: var(--surface);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: all var(--t-fast);
  cursor: default;
}

.kpi-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--gray-300);
  transform: translateY(-1px);
}

.kpi-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.kpi-icon.blue { background: var(--brand-primary-subtle); color: var(--brand-primary); }
.kpi-icon.green { background: var(--success-bg); color: var(--success); }
.kpi-icon.orange { background: var(--warning-bg); color: var(--warning); }
.kpi-icon.red { background: var(--error-bg); color: var(--error); }
.kpi-icon.purple { background: #f5f0ff; color: #7c3aed; }
.kpi-icon.teal { background: #edfafa; color: #0e7490; }

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px var(--sp-2);
  border-radius: var(--r-full);
  font-size: 0.6875rem;
  font-weight: 700;
}

.kpi-trend.up { background: var(--success-bg); color: var(--success); }
.kpi-trend.down { background: var(--error-bg); color: var(--error); }
.kpi-trend.neutral { background: var(--gray-100); color: var(--text-secondary); }

.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -1px;
  line-height: 1;
}

.kpi-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.kpi-footer {
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* =============================================================================
   LAYOUT GRIDS
   ============================================================================= */

.grid { display: grid; gap: var(--sp-4); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

.grid-70-30 { grid-template-columns: 70fr 30fr; }
.grid-60-40 { grid-template-columns: 60fr 40fr; }

/* =============================================================================
   DATA TABLE
   ============================================================================= */

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table thead {
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
}

.data-table th {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
  user-select: none;
}

.data-table th.sortable {
  cursor: pointer;
  transition: color var(--t-fast);
}

.data-table th.sortable:hover { color: var(--brand-primary); }

.data-table th .sort-icon {
  margin-left: var(--sp-1);
  opacity: 0.5;
  font-size: 0.625rem;
}

.data-table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr {
  transition: background var(--t-fast);
}

.data-table tbody tr:hover { background: var(--gray-50); }

.data-table tbody tr.selected { background: var(--brand-primary-subtle); }

/* Table utilities */
.cell-mono { font-family: var(--font-mono); font-size: 0.8125rem; }
.cell-bold { font-weight: 600; }
.cell-muted { color: var(--text-secondary); font-size: 0.8125rem; }
.cell-actions { display: flex; align-items: center; gap: var(--sp-1); }

/* =============================================================================
   BADGES & STATUS
   ============================================================================= */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 var(--sp-2);
  height: 22px;
  border-radius: var(--r-full);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Color variants */
.badge-blue { background: var(--brand-primary-subtle); color: var(--brand-primary); }
.badge-green { background: var(--success-bg); color: var(--success); }
.badge-orange { background: var(--warning-bg); color: var(--warning); }
.badge-red { background: var(--error-bg); color: var(--error); }
.badge-gray { background: var(--gray-100); color: var(--text-secondary); }
.badge-purple { background: #f5f0ff; color: #7c3aed; }
.badge-teal { background: #edfafa; color: #0e7490; }

.badge-blue .badge-dot { background: var(--brand-primary); }
.badge-green .badge-dot { background: var(--success); }
.badge-orange .badge-dot { background: var(--warning); }
.badge-red .badge-dot { background: var(--error); }

/* Outlined variant */
.badge-outline-blue { background: transparent; color: var(--brand-primary); border: 1px solid var(--brand-primary-light); }
.badge-outline-green { background: transparent; color: var(--success); border: 1px solid var(--success-border); }
.badge-outline-orange { background: transparent; color: var(--warning); border: 1px solid var(--warning-border); }
.badge-outline-red { background: transparent; color: var(--error); border: 1px solid var(--error-border); }

/* =============================================================================
   STATUS INDICATORS
   ============================================================================= */

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.875rem;
}

.status-dot::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-active::before { background: var(--success); box-shadow: 0 0 0 3px rgba(16,126,62,0.2); }
.status-pending::before { background: var(--warning); }
.status-expired::before { background: var(--error); }
.status-cancelled::before { background: var(--gray-500); }
.status-draft::before { background: var(--gray-400); border: 1px dashed var(--gray-500); }

/* =============================================================================
   URGENCY BANDS (Renewal Tracker specific)
   ============================================================================= */

.urgency-critical { background: rgba(187,0,0,0.08); border-left: 3px solid var(--error) !important; }
.urgency-high { background: rgba(233,115,12,0.06); border-left: 3px solid var(--warning) !important; }
.urgency-medium { background: rgba(10,110,209,0.05); }
.urgency-low { }

.urgency-badge-critical { background: var(--error-bg); color: var(--error); }
.urgency-badge-high { background: var(--warning-bg); color: var(--warning); }
.urgency-badge-medium { background: var(--info-bg); color: var(--info); }
.urgency-badge-low { background: var(--success-bg); color: var(--success); }

/* =============================================================================
   PROGRESS BAR
   ============================================================================= */

.progress-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: var(--r-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--r-full);
  background: var(--brand-primary);
  transition: width 0.5s ease;
}

.progress-fill.success { background: var(--success); }
.progress-fill.warning { background: var(--warning); }
.progress-fill.error { background: var(--error); }

/* =============================================================================
   TIMELINE
   ============================================================================= */

.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--sp-5);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--brand-primary);
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 2px var(--brand-primary);
}

.timeline-item.done::before { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.timeline-item.warn::before { background: var(--warning); box-shadow: 0 0 0 2px var(--warning); }

.timeline-meta {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 3px;
}

.timeline-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.timeline-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* =============================================================================
   KANBAN BOARD
   ============================================================================= */

.kanban-board {
  display: flex;
  gap: var(--sp-4);
  overflow-x: auto;
  padding-bottom: var(--sp-2);
}

.kanban-board::-webkit-scrollbar { height: 6px; }
.kanban-board::-webkit-scrollbar-track { background: var(--gray-100); border-radius: 4px; }
.kanban-board::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }

.kanban-col {
  flex: 0 0 280px;
  background: var(--gray-50);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  overflow: hidden;
}

.kanban-col-header {
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.kanban-col-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.kanban-col-count {
  background: var(--gray-200);
  color: var(--text-secondary);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--r-full);
}

.kanban-col-body {
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-height: 200px;
}

.kanban-card {
  background: var(--surface);
  border-radius: var(--r);
  border: 1px solid var(--border);
  padding: var(--sp-3) var(--sp-4);
  cursor: grab;
  transition: all var(--t-fast);
  box-shadow: var(--shadow-xs);
}

.kanban-card:hover {
  border-color: var(--brand-primary-light);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.kanban-card:active { cursor: grabbing; }

.kanban-card.dragging {
  opacity: 0.4;
  transform: scale(0.98);
}

.kanban-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

.kanban-card-id {
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  color: var(--brand-primary);
  font-weight: 600;
}

.kanban-card-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.kanban-card-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--sp-3);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--border);
}

/* =============================================================================
   MODAL / DIALOG
   ============================================================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: var(--sp-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-dialog {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  max-width: 560px;
  width: 100%;
  transform: scale(0.96) translateY(8px);
  transition: transform var(--t);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-overlay.open .modal-dialog {
  transform: scale(1) translateY(0);
}

.modal-dialog.sm { max-width: 400px; }
.modal-dialog.lg { max-width: 800px; }
.modal-dialog.xl { max-width: 960px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title { font-size: 1.0625rem; font-weight: 700; color: var(--text-primary); }
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1rem;
  transition: all var(--t-fast);
}
.modal-close:hover { background: var(--gray-100); color: var(--text-primary); }

.modal-body {
  padding: var(--sp-6);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border);
  background: var(--gray-50);
  flex-shrink: 0;
}

/* =============================================================================
   DRAWER (Side Panel)
   ============================================================================= */

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: var(--z-drawer);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t);
}

.drawer-overlay.open { opacity: 1; pointer-events: all; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  background: var(--surface);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-drawer);
  transform: translateX(100%);
  transition: transform var(--t-slow);
  display: flex;
  flex-direction: column;
}

.drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.drawer-title { font-size: 1rem; font-weight: 700; }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-6);
}

.drawer-footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--sp-3);
  justify-content: flex-end;
  flex-shrink: 0;
}

/* =============================================================================
   TOAST NOTIFICATIONS
   ============================================================================= */

#toast-container {
  position: fixed;
  top: calc(var(--shell-height) + var(--sp-4));
  right: var(--sp-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  background: var(--gray-800);
  color: white;
  padding: var(--sp-4);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 400px;
  pointer-events: all;
  animation: toastIn 0.25s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%) translateY(-4px); }
  to { opacity: 1; transform: translateX(0) translateY(0); }
}

.toast-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.toast-title { font-size: 0.875rem; font-weight: 600; }
.toast-msg { font-size: 0.8125rem; color: rgba(255,255,255,0.75); margin-top: 2px; }
.toast-close { margin-left: auto; opacity: 0.6; cursor: pointer; flex-shrink: 0; padding: 2px; }
.toast-close:hover { opacity: 1; }

.toast.success { background: #0f6b34; }
.toast.warning { background: #c26008; }
.toast.error { background: #aa0000; }
.toast.info { background: #0a6ed1; }

/* =============================================================================
   ALERT BANNERS
   ============================================================================= */

.alert-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--r);
  border: 1px solid;
  margin-bottom: var(--sp-4);
}

.alert-banner.info { background: var(--info-bg); border-color: var(--info-border); color: var(--info); }
.alert-banner.success { background: var(--success-bg); border-color: var(--success-border); color: var(--success); }
.alert-banner.warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning); }
.alert-banner.error { background: var(--error-bg); border-color: var(--error-border); color: var(--error); }

.alert-banner-icon { flex-shrink: 0; font-size: 1rem; }
.alert-banner-body { flex: 1; }
.alert-banner-title { font-weight: 600; font-size: 0.875rem; }
.alert-banner-msg { font-size: 0.8125rem; margin-top: 2px; opacity: 0.9; }

/* =============================================================================
   TABS
   ============================================================================= */

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: var(--sp-5);
}

.tab-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  text-decoration: none;
}

.tab-item:hover { color: var(--brand-primary); text-decoration: none; }

.tab-item.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

.tab-item .tab-badge {
  background: var(--gray-200);
  color: var(--text-secondary);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0 5px;
  border-radius: var(--r-full);
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tab-item.active .tab-badge {
  background: var(--brand-primary-subtle);
  color: var(--brand-primary);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* =============================================================================
   EMPTY STATES
   ============================================================================= */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-16) var(--sp-8);
  text-align: center;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  background: var(--gray-100);
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--text-tertiary);
  margin-bottom: var(--sp-4);
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
}

.empty-state-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  max-width: 360px;
  line-height: 1.6;
  margin-bottom: var(--sp-5);
}

/* =============================================================================
   SKELETON LOADING
   ============================================================================= */

.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  border-radius: var(--r);
  animation: skeletonPulse 1.5s infinite;
}

@keyframes skeletonPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* =============================================================================
   SEARCH & FILTER HEADER
   ============================================================================= */

.table-toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}

.table-search {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  padding: 0 var(--sp-3);
  height: 36px;
  flex: 1;
  max-width: 320px;
  transition: border-color var(--t-fast);
}

.table-search:focus-within { border-color: var(--brand-primary); box-shadow: var(--shadow-focus); }

.table-search input {
  background: none;
  border: none;
  outline: none;
  font-size: 0.875rem;
  color: var(--text-primary);
  width: 100%;
}

.table-search input::placeholder { color: var(--text-tertiary); }
.table-search-icon { color: var(--text-tertiary); font-size: 0.875rem; flex-shrink: 0; }

.table-toolbar-spacer { flex: 1; }

/* =============================================================================
   PAGINATION
   ============================================================================= */

.pagination {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.page-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: all var(--t-fast);
  cursor: pointer;
}

.page-btn:hover { background: var(--gray-100); border-color: var(--border); color: var(--text-primary); }
.page-btn.active { background: var(--brand-primary); color: white; border-color: var(--brand-primary); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* =============================================================================
   DETAIL SECTIONS (Policy Detail)
   ============================================================================= */

.detail-row {
  display: flex;
  gap: var(--sp-4);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child { border-bottom: none; }

.detail-label {
  width: 180px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.detail-value {
  font-size: 0.875rem;
  color: var(--text-primary);
  flex: 1;
}

/* =============================================================================
   DOCUMENT CARDS
   ============================================================================= */

.doc-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  transition: all var(--t-fast);
}

.doc-card:hover { border-color: var(--brand-primary-light); box-shadow: var(--shadow-sm); }

.doc-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.doc-icon.pdf { background: #fff0f0; color: #dc2626; }
.doc-icon.img { background: #f0f5ff; color: #4f46e5; }
.doc-icon.doc { background: #f0f9ff; color: #0ea5e9; }
.doc-icon.xls { background: #f0fdf4; color: #16a34a; }

.doc-info { flex: 1; min-width: 0; }
.doc-name { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); truncate: ellipsis; }
.doc-meta { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }
.doc-actions { display: flex; align-items: center; gap: var(--sp-1); flex-shrink: 0; }

/* =============================================================================
   KYC / COMPLETENESS INDICATOR
   ============================================================================= */

.kyc-bar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.kyc-progress-bar { height: 4px; }

.kyc-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.6875rem;
  color: var(--text-secondary);
}

/* =============================================================================
   ROLE BADGE
   ============================================================================= */

.role-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 2px var(--sp-2);
  border-radius: var(--r-full);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.role-admin { background: #f3e8ff; color: #7c3aed; }
.role-pos { background: var(--info-bg); color: var(--info); }
.role-customer { background: var(--success-bg); color: var(--success); }

/* =============================================================================
   STATS MINI CHART (sparkline)
   ============================================================================= */

.sparkline {
  width: 80px;
  height: 32px;
}

/* =============================================================================
   NOTIFICATION ITEMS
   ============================================================================= */

.notif-item {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast);
  cursor: pointer;
}

.notif-item:hover { background: var(--gray-50); }
.notif-item.unread { background: var(--info-bg); }
.notif-item.unread:hover { background: #dbeeff; }

.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.notif-msg { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 2px; line-height: 1.4; }
.notif-time { font-size: 0.75rem; color: var(--text-tertiary); margin-top: var(--sp-1); }
.notif-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-primary); flex-shrink: 0; margin-top: 6px; }

/* =============================================================================
   UTILITY CLASSES
   ============================================================================= */

/* Display */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-wrap { flex-wrap: wrap; }

/* Gap */
.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-5 { gap: var(--sp-5); }
.gap-6 { gap: var(--sp-6); }

/* Margin */
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }
.mb-6 { margin-bottom: var(--sp-6); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

/* Text */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.8125rem; }
.text-base { font-size: 0.875rem; }
.text-md { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-tertiary); }
.text-link { color: var(--text-link); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--error); }
.text-white { color: white; }
.text-brand { color: var(--brand-primary); }

.text-right { text-align: right; }
.text-center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Width */
.w-full { width: 100%; }

/* Misc */
.rounded { border-radius: var(--r); }
.rounded-full { border-radius: var(--r-full); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.border { border: 1px solid var(--border); }
.bg-surface { background: var(--surface); }
.bg-subtle { background: var(--gray-50); }

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

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

@media (max-width: 1024px) {
  .shell-bar-center { display: none; }
  .grid-70-30 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --nav-width: 256px; }

  .side-nav {
    transform: translateX(-100%);
    transition: transform var(--t-slow);
    width: var(--nav-width) !important;
    z-index: calc(var(--z-shell) + 10);
  }

  .side-nav.mobile-open { transform: translateX(0); }

  .app-body { margin-left: 0 !important; }

  .page-content { padding: var(--sp-4); }

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

  .shell-user-info { display: none; }
  .shell-search { display: none; }

  .page-header { flex-direction: column; }
  .page-header-actions { width: 100%; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page-content { padding: var(--sp-3); }
  .shell-brand-name { display: none; }
}

/* Mobile nav overlay */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: calc(var(--z-shell) + 5);
}

.mobile-overlay.show { display: block; }
