/* =========================================================
   AegisIQ Stock Ledger - App Styles
   Dark Navy & Gold Executive Theme
   Two-Pane Drawer Grid Layout
   ========================================================= */

/* ===============================
   CSS Variables / Design Tokens
================================ */
:root {
  /* Navy & Gold Brand Colors */
  --navy-900: hsl(243 51% 15%);
  --navy-800: hsl(220 35% 10%);
  --navy-700: hsl(220 30% 14%);
  --navy-600: hsl(220 25% 20%);
  --navy-500: #1a2234;
  --navy-400: #1e293b;
  --navy-300: #334155;
  
  --gold-500: #d4af37;
  --gold-400: #e6c65c;
  --gold-600: #b8962e;
  --gold-300: #f0d878;
  --gold: hsl(38 51% 62%);
  --gold-light: hsl(42 70% 70%);
  --gold-dark: hsl(42 60% 45%);

  /* Semantic Colors */
  --bg-app: var(--navy-900);
  --bg-surface: var(--navy-700);
  --bg-surface-alt: var(--navy-600);
  --bg-card: var(--navy-800);
  --bg-elevated: var(--navy-500);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-gold: rgba(212, 175, 55, 0.3);
  --border-gold-strong: rgba(212, 175, 55, 0.5);

  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --text-gold: var(--gold);

  /* Status Colors */
  --success: #22c55e;
  --success-muted: rgba(34, 197, 94, 0.15);
  --danger: #ef4444;
  --danger-muted: rgba(239, 68, 68, 0.15);
  --warning: #f59e0b;
  --info: #3b82f6;

  /* Shadows */
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-gold: 0 4px 30px -5px hsl(42 65% 58% / 0.3);
  --shadow-glow: 0 0 20px rgba(212, 175, 55, 0.1);

  /* Radius */
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-xs: 4px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
}

/* ===============================
   Reset & Base Styles
================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===============================
   Typography Helpers
================================ */
.gold-text {
  color: var(--gold-500);
}

.text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}

/* ===============================
   Header / Navigation
================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(15, 23, 42, 0.95) 100%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
}

.navy-bg {
  background-color: var(--navy-700);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 24px;
}

.logo-img {
  height: 80px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-link {
  padding: 8px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: var(--gold-500);
  background: rgba(212, 175, 55, 0.1);
}

/* ===============================
   User Dropdown
================================ */
.user-dropdown {
  position: relative;
}

.user-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.user-trigger:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold-500);
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-600) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--bg-app);
  text-transform: uppercase;
}

.user-name {
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-trigger .chevron {
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.user-dropdown.open .chevron {
  transform: rotate(180deg);
}

/* User Dropdown Menu */
.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
}

.user-dropdown.open .user-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-menu-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.user-menu-email {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.user-menu-role {
  display: block;
  font-size: 0.75rem;
  color: var(--gold-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.user-menu-divider {
  height: 1px;
  background: var(--border-subtle);
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.user-menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.user-menu-item.danger {
  color: var(--danger);
}

.user-menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 16px 24px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

.mobile-menu.hidden {
  display: none;
}

.mobile-nav-link {
  padding: 12px 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--border-subtle);
}

/* ===============================
   Main Content
================================ */
main {
  margin-top: 72px;
  padding: 32px 0 0;
  min-height: calc(100vh - 72px - 80px);
  display: flex;
  flex-direction: column;
}

.section-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  flex: 1;
}

/* ===============================
   App Shell
================================ */
.app-shell {
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-card) 100%);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
}

/* ===============================
   Page Header
================================ */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 24px;
  flex-wrap: wrap;
}

.app-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.app-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.app-subtitle strong {
  color: var(--text-secondary);
}

.page-header-stats {
  display: flex;
  gap: 16px;
}

.stat-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 20px;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  min-width: 130px;
}

.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold-500);
  font-variant-numeric: tabular-nums;
}

/* ===============================
   Cards
================================ */
.card {
  background: rgba(12, 18, 32, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* ===============================
   Filters Container
================================ */
.filters-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1;
}

.filter-actions {
  display: flex;
  gap: 10px;
}

input, select, textarea {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: all var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

input::placeholder {
  color: var(--text-muted);
}

select {
  min-width: 140px;
  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='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 36px;
}

/* ===============================
   Buttons
================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--gold-500);
  color: var(--bg-app);
}

.btn-primary:hover {
  background: var(--gold-400);
  box-shadow: var(--shadow-gold);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-600) 100%);
  color: var(--bg-app);
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-400) 0%, var(--gold-500) 100%);
  box-shadow: var(--shadow-gold);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--gold-500);
  color: var(--gold-500);
}

.btn-outline:hover {
  background: rgba(212, 175, 55, 0.1);
}

.btn-icon {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 6px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--navy-400);
  border-color: var(--navy-300);
  color: var(--gold-500);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
}

.full-width {
  width: 100%;
}

.hidden {
  display: none !important;
}

/* ===============================
   Holdings Matrix Grid - Dark Executive Style
================================ */
.holdings-matrix {
  overflow-x: auto;
  background: var(--navy-900);
  border-radius: var(--radius-md);
  border: 1px solid var(--navy-500);
  display: flex;
  flex-direction: column;
  min-height: 300px;
  max-height: calc(100vh - 380px);
}

/* Grid Layout - Flexible columns that don't wrap */
.matrix-header,
.matrix-footer,
.grid-row {
  display: flex;
  min-width: max-content;
  align-items: stretch;
}

/* Fixed width columns */
.cell-expand { width: 40px; flex-shrink: 0; }
.cell-account { width: 100px; flex-shrink: 0; }
.cell-name { width: 180px; flex-shrink: 0; }
.cell-address { width: 160px; flex-shrink: 0; }
.cell-shares { width: 100px; flex-shrink: 0; }
.cell-total { width: 100px; flex-shrink: 0; }
.cell-pct { width: 60px; flex-shrink: 0; }
.cell-actions { width: 80px; flex-shrink: 0; }

.matrix-header {
  background: linear-gradient(180deg, var(--navy-700) 0%, var(--navy-800) 100%);
  border-bottom: 2px solid var(--gold-600);
  position: sticky;
  top: 0;
  z-index: 10;
}

.matrix-header .grid-cell {
  padding: 14px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-400);
  border-right: 1px solid var(--navy-500);
}

.matrix-header .grid-cell:last-child {
  border-right: none;
}

.matrix-footer {
  border-top: 2px solid var(--gold-600);
  background: linear-gradient(180deg, var(--navy-600) 0%, var(--navy-800) 100%);
  position: sticky;
  bottom: 0;
}

.matrix-footer .grid-cell {
  padding: 12px 10px;
  font-size: 0.8rem;
  color: var(--gold-500);
  border-right: 1px solid var(--navy-500);
}

.matrix-footer .grid-cell:last-child {
  border-right: none;
}

.matrix-body {
  flex: 1;
					
  overflow-y: auto;
}

/* Scrollbar styling */
.matrix-body::-webkit-scrollbar {
  width: 6px;
}

.matrix-body::-webkit-scrollbar-track {
  background: var(--navy-900);
}

.matrix-body::-webkit-scrollbar-thumb {
  background: var(--navy-300);
  border-radius: 3px;
}

.matrix-body::-webkit-scrollbar-thumb:hover {
  background: var(--gold-600);
}

/* Grid Rows */
.grid-row {
  border-bottom: 1px solid var(--navy-500);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.grid-row.row-odd {
  background: var(--navy-800);
}

.grid-row.row-even {
  background: var(--navy-900);
}

.grid-row:hover {
  background: var(--navy-600);
}

.grid-row.expanded {
  background: var(--navy-600);
  border-left: 3px solid var(--gold-500);
}

/* Grid Cells */
.grid-cell {
  padding: 12px 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-right: 1px solid rgba(26, 34, 52, 0.5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grid-cell:last-child {
  border-right: none;
}

/* Cell types */
.cell-expand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.expand-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.expand-btn:hover {
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold-500);
}

.chevron-icon {
  transition: transform 0.2s ease;
}

.chevron-icon.rotated {
  transform: rotate(90deg);
}

.cell-account {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--gold-400);
}

.cell-name {
  font-weight: 600;
  color: var(--text-primary);
}

.cell-address {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.cell-shares {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.cell-total {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.cell-pct {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.cell-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* ===============================
   Detail Panel (Two-Pane Drawer with Tabs)
================================ */
.detail-panel {
  background: var(--navy-900);
  border-bottom: 1px solid var(--navy-400);
  border-left: 3px solid var(--gold-500);
  animation: slideDown 0.25s ease;
}

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

.detail-content {
  padding: 20px 24px 20px 48px;
}

/* Tab Navigation */
.detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--navy-400);
  margin-bottom: 20px;
}

.detail-tab {
  padding: 12px 24px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.detail-tab:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

.detail-tab.active {
  color: var(--gold-500);
}

.detail-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold-500);
}

/* Tab Content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Holdings Tab - Stock Type Sections */
.holdings-section {
  margin-bottom: 16px;
}

.holdings-section:last-child {
  margin-bottom: 0;
}

.stock-type-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--navy-700);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.stock-type-header:hover {
  background: var(--navy-600);
}

.stock-type-toggle {
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.stock-type-toggle.open {
  transform: rotate(90deg);
}

.stock-type-name {
  flex: 1;
  font-weight: 600;
  color: var(--gold-400);
}

.stock-type-shares {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--text-primary);
}

.stock-type-shares-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 4px;
}

/* Book Entries Table within Holdings */
.book-entries-section {
  display: none;
  padding: 8px 0 8px 32px;
}

.book-entries-section.open {
  display: block;
}

.book-entries-table {
  width: 100%;
  border-collapse: collapse;
}

.book-entries-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--navy-400);
}

.book-entries-table th:nth-child(2),
.book-entries-table th:nth-child(3),
.book-entries-table td:nth-child(2),
.book-entries-table td:nth-child(3) {
  text-align: right;
}

.book-entries-table td {
  padding: 10px 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--navy-500);
}

.book-entries-table td:first-child {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--gold-400);
}

.book-entries-table td:nth-child(2) {
  font-family: 'JetBrains Mono', monospace;
}

.book-entries-table tr:last-child td {
  border-bottom: none;
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: var(--radius-xs);
}

.status-badge.active {
  background: var(--success-muted);
  color: var(--success);
}

.status-badge.cancelled {
  background: var(--danger-muted);
  color: var(--danger);
}

/* Holdings Summary */
.holdings-summary {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--navy-400);
}

.holdings-summary-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.holdings-summary-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold-500);
}

/* Book Entries Tab */
.book-entries-full-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.book-entries-full-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold-400);
  background: var(--navy-700);
  border-bottom: 1px solid var(--gold-600);
}

.book-entries-full-table th:nth-child(3),
.book-entries-full-table td:nth-child(3) {
  text-align: right;
}

.book-entries-full-table td {
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--navy-500);
}

.book-entries-full-table td:first-child {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--gold-400);
}

.book-entries-full-table td:nth-child(3) {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--text-primary);
}

.book-entries-full-table tr:hover {
  background: var(--navy-700);
}

/* ===============================
   Shareholder Details Card (Two-Pane Detail View)
================================ */
.shareholder-details-card {
  display: flex;
  gap: 24px;
  padding: 20px;
  background: var(--navy-700);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.shareholder-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.shareholder-avatar-large {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-600) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--bg-app);
  text-transform: uppercase;
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
}

.shareholder-type-badge {
  display: inline-flex;
  padding: 4px 12px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 20px;
  white-space: nowrap;
}

.shareholder-type-badge.individual {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.shareholder-type-badge.institution {
  background: rgba(168, 85, 247, 0.15);
  color: #a78bfa;
}

.shareholder-type-badge.trust {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.shareholder-type-badge.estate {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.shareholder-info-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.shareholder-info-row {
  display: flex;
  gap: 24px;
}

.shareholder-info-item {
  flex: 1;
  min-width: 0;
}

.shareholder-info-item.full-width {
  flex: 100%;
}

.info-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.info-value {
  display: block;
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
  word-break: break-word;
}

.info-value.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
}

.info-value.gold {
  color: var(--gold-500);
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

/* Holdings Breakdown */
.holdings-breakdown {
  padding: 16px 20px;
  background: var(--navy-800);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.holdings-breakdown-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold-400);
  margin-bottom: 12px;
}

.holding-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--navy-500);
}

.holding-item:last-child {
  border-bottom: none;
}

.holding-name {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.holding-shares {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.shares-pct {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.8rem;
}

/* Empty state for book entries */
.empty-book-entries {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===============================
   Loading & Empty States
================================ */
.loading-state,
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  gap: 16px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--gold-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ===============================
   Admin Toolbar
================================ */
.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(180deg, var(--navy-600) 0%, var(--navy-700) 100%);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-toolbar.hidden {
  display: none;
}

.toolbar-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* Corporate Actions Dropdown */
.toolbar-dropdown {
  position: relative;
}

.toolbar-dropdown .btn .chevron {
  transition: transform 0.2s ease;
  margin-left: 2px;
}

.toolbar-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  background: var(--navy-600);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  overflow: hidden;
}

.toolbar-dropdown-menu.hidden {
  display: none;
}

.toolbar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.toolbar-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.toolbar-dropdown-item.danger {
  color: var(--danger);
}

.toolbar-dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.toolbar-dropdown-item + .toolbar-dropdown-item {
  border-top: 1px solid var(--border-subtle);
}

/* File Upload */
.file-upload-area {
  position: relative;
}

.file-upload-area input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.file-upload-placeholder {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.file-upload-area:hover .file-upload-placeholder {
  border-color: var(--gold-500);
  color: var(--gold-400);
  background: rgba(212, 175, 55, 0.05);
}

.file-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--navy-800);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  color: var(--text-muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.file-remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  transition: all var(--transition-fast);
}

.file-remove:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #f87171 0%, var(--danger) 100%);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

/* ===============================
   Modal
================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--navy-700);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-lg {
  max-width: 750px;
}

/* Form Sections */
.form-section {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--navy-800);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.form-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold-400);
  margin-bottom: 12px;
}

.form-help-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
  font-style: italic;
}

/* Checkbox Label */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold-500);
  cursor: pointer;
}

.checkbox-label span {
  user-select: none;
}

/* Transaction Type Badge */
.type-badge {
  display: inline-flex;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: var(--radius-xs);
}

.type-badge.issuance {
  background: var(--success-muted);
  color: var(--success);
}

.type-badge.transfer {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.type-badge.cancellation {
  background: var(--danger-muted);
  color: var(--danger);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold-500);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-xs);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.modal-body {
  padding: 24px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

/* Form Styles */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.form-row .form-group {
  margin-bottom: 0;
}

/* ===============================
   Toast Notifications
================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--navy-600);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  animation: slideIn 0.3s ease;
  max-width: 400px;
}

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

.toast.success {
  border-left: 3px solid var(--success);
}

.toast.error {
  border-left: 3px solid var(--danger);
}

.toast.warning {
  border-left: 3px solid var(--warning);
}

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

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

/* ===============================
   Footer
================================ */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 24px 0;
  margin-top: 32px;
  flex-shrink: 0;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-container a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-container a:hover {
  color: var(--gold-500);
}

.separator {
  opacity: 0.4;
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.back-to-top:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--gold-500);
  border-color: var(--border-gold);
}

/* ===============================
   Responsive
================================ */
@media (max-width: 1024px) {
  .detail-content {
    padding: 16px 20px 16px 32px;
  }
  
  .shareholder-details-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .shareholder-info-row {
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .mobile-menu:not(.hidden) {
    display: flex;
  }

  .page-header {
    flex-direction: column;
  }

  .filter-group {
    flex-direction: column;
    width: 100%;
  }

  .filter-group input,
  .filter-group select {
    width: 100%;
  }

  .filter-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .filter-actions .btn {
    flex: 1;
  }

  .app-shell {
    padding: 20px 16px;
  }
  
  .detail-content {
    padding: 16px;
  }
  
  .shareholder-details-card {
    padding: 16px;
    gap: 16px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .modal {
    max-width: 100%;
    margin: 16px;
  }
}