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

:root {
  color-scheme: light;
  
  /* Core Colors */
  --bg-main: #F4F7FA;          /* Very soft cool gray for background */
  --bg-sidebar: #FFFFFF;       /* Pure white sidebar */
  --bg-card: #FFFFFF;          /* Pure white cards */
  --bg-panel: #FFFFFF;
  --bg-hover: #F8FAFC;         /* Light hover state */
  --bg-input: #FFFFFF;         /* White inputs */
  
  /* Text */
  --text-primary: #0F172A;     /* Slate 900 - Almost black for high contrast */
  --text-secondary: #64748B;   /* Slate 500 - Soft gray for secondary */
  --text-muted: #94A3B8;       /* Slate 400 - Muted text */
  
  /* Borders & Dividers */
  --border: #E2E8F0;           /* Slate 200 - Very subtle borders */
  --border-light: #F1F5F9;     /* Slate 100 - Extra light borders */
  --border-focus: #3B82F6;     /* Blue focus ring */
  
  /* Accents */
  --accent-blue: #2563EB;      /* Vibrant blue */
  --accent-blue-hover: #1D4ED8;
  --accent-cyan: #0284C7;
  --accent-glow: rgba(37, 99, 235, 0.1);
  
  /* Status */
  --warn: #FEF2F2;
  --warn-text: #B91C1C;
  --warn-border: #FECACA;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-main);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.dashboard-body {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar Styling (Premium Stripe-like) */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.sidebar-brand {
  height: 72px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

.logo-icon {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  font-size: 16px;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.sidebar-nav {
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 14px;
}

.nav-item svg {
  stroke: var(--text-muted);
  transition: all 0.2s ease;
}

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

.nav-item:hover svg {
  stroke: var(--text-primary);
}

.nav-item.active {
  background: #EFF6FF;
  color: var(--accent-blue);
  font-weight: 600;
}

.nav-item.active svg {
  stroke: var(--accent-blue);
}

/* Top Nav */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.top-nav {
  height: 72px;
  background: var(--bg-main); /* Matches body */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-nav h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-card);
  padding: 6px 16px 6px 6px;
  border-radius: 30px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.user-profile:hover {
  border-color: #CBD5E1;
}

.avatar {
  background: var(--accent-blue);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

/* Dashboard Content Grid */
.dashboard-content {
  padding: 0 40px 40px 40px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.dashboard-col-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dashboard-col-side {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Premium Cards */
.card, .panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
  overflow: hidden;
}

.card:hover, .panel:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}

.card-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-header p {
  margin: 6px 0 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Drag & Drop */
.drag-drop-form {
  padding: 24px;
}

.drag-drop-zone {
  border: 2px dashed #CBD5E1;
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  background: #F8FAFC;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.drag-drop-zone:hover {
  background: #EFF6FF;
  border-color: var(--accent-blue);
}

.upload-icon {
  color: var(--accent-blue);
  margin-bottom: 16px;
  opacity: 0.8;
}

.upload-title {
  display: block;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.upload-subtitle {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  padding: 24px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
}

input[type="text"],
input[type="number"],
select,
input:not([type]) {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  font-family: inherit;
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

select option {
  background: #fff;
  color: var(--text-primary);
}

/* Checkbox specific overrides */
label.check {
  flex-direction: row;
  align-items: center;
  margin-top: 22px;
  cursor: pointer;
}

label.check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent-blue);
}

/* Chip Groups */
.chip-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  padding: 0 24px 24px;
}

.chip-groups h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chips label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  background: #F1F5F9;
  border: 1px solid transparent;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.chips label:hover {
  background: #E2E8F0;
}

.chips label:has(input:checked) {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: var(--accent-blue);
}

.chips label input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--accent-blue);
}

/* Buttons */
.btn-primary, .btn-sm, .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent-blue);
  color: white;
  border: 1px solid transparent;
  padding: 10px 20px;
  font-size: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-primary:hover {
  background: var(--accent-blue-hover);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  background: var(--accent-blue);
  color: #fff;
  border: 1px solid transparent;
}

.btn-sm:hover {
  background: var(--accent-blue-hover);
}

.btn-outline {
  background: #FFFFFF;
  border: 1px solid var(--border);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  padding: 8px 16px;
  font-size: 14px;
}

.btn-outline:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
}

/* Actions List */
.quick-actions-list {
  padding: 16px;
}

.action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  text-align: left;
  color: var(--text-primary);
  border-radius: 8px;
  transition: all 0.2s;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.action-btn:hover {
  background: #F8FAFC;
  border-color: var(--accent-blue);
}

.action-icon {
  background: #EFF6FF;
  color: var(--accent-blue);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.action-text strong {
  font-size: 14px;
  font-weight: 600;
}

.action-text span {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 20px;
  gap: 16px;
}

.stat-box {
  background: #F8FAFC;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
}

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

.recent-table th,
.recent-table td {
  padding: 16px 24px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}

.recent-table th {
  background: #F8FAFC;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.recent-table tr:hover td {
  background: #F8FAFC;
}

/* Configure Panel Adjustments */
.panel {
  padding: 0;
}

.panel h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  background: #F8FAFC;
}

.stats-grid {
  display: flex;
  gap: 40px;
  margin-bottom: 32px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat span {
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.stat strong {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.count-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  padding: 24px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  padding: 24px;
}

.summary-grid h3 {
  color: var(--text-primary);
  font-size: 14px;
  margin: 0 0 16px 0;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 12px;
  font-weight: 600;
}

.summary-grid p {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  margin: 0;
  font-size: 14px;
}

.summary-grid p span {
  color: var(--text-secondary);
}

.summary-grid p strong {
  color: var(--text-primary);
  font-weight: 600;
}

.summary-grid p:last-child {
  border-bottom: none;
}

/* Document Preview Header */
.preview-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.preview-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.preview-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

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

.preview-tabs {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  background: var(--bg-main);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.preview-tab {
  border: none;
  background: transparent;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.preview-tab.active {
  background: #FFFFFF;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  font-weight: 600;
}

.paper-shell {
  padding: 88px 32px 32px 32px !important;
  background: var(--bg-main) !important;
  border-radius: 0 !important;
  min-height: 100vh;
}

.paper-set {
  display: none;
}

.paper-set.active {
  display: block;
}

/* Alert */
.alert {
  padding: 16px 20px;
  border-radius: 8px;
  background: var(--warn);
  color: var(--warn-text);
  border: 1px solid var(--warn-border);
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 24px;
}

/* Paper Generator Preview Tab Specific */
.question-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  color: black;
}
.question-table th, .question-table td, .details-table th, .details-table td {
  border: 1px solid #000;
  padding: 6px;
  color: #000;
}
.question-table th, .signature-table td, .or {
  text-align: center;
}
.details-table th {
  width: 16%;
  text-align: left;
}
.details-table td {
  width: 17%;
}
.question-table th:first-child, .question-table tr>td[rowspan]:first-child {
  width: 38px;
}
.question-table th:nth-last-child(-n + 3), .question-table tr>td[rowspan]:nth-last-child(-n + 3) {
  width: 34px;
  text-align: center;
}
.or { font-weight: 700; }
.matrix-title {
  color: #000;
  text-align: center;
  font-size: 13px;
  margin: 14px 0 6px;
  font-weight: bold;
}
.matrix-note { font-size: 11px; margin: 2px 0; color: #000; }
.signature-table { margin-top: 18px; font-weight: 700; text-align: center; width: 100%; border-collapse: collapse; color: #000;}
.stars { text-align: center; font-weight: 700; margin-top: 18px; color: #000; }
.paper-section h3 { text-align: center; color: #000; margin-top: 28px; font-weight: bold; }
.question {
  break-inside: avoid;
  font-family: "Times New Roman", serif;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 18px;
  color: #000;
}
.question ol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 24px;
  margin-top: 8px;
}

/* Document Paper Styling */
.paper-shell {
  background: #e5e7eb;
  padding: 32px;
  border-radius: 8px;
}

.paper-page {
  background: white;
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  padding: 20mm;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  color: black;
}

.eyebrow {
  margin-top: 0 !important;
}

