/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

[hidden] { display: none !important; }

:root {
  /* Brand */
  --primary-color: #806c00;
  --primary-hover: #6b5a00;
  --secondary-color: #494009;
  --accent-color: #4b4006;
  /* Text */
  --text-dark: #000000;
  --text-light: #6b7280;
  /* Backgrounds */
  --bg-light: #e3e4e6b6;
  --bg-white: #ffffff;
  /* Borders */
  --border-color: #9498a0;
  /* Semantic status — base */
  --success: #10b981;
  --success-bg: #eaf9ef;
  --success-dark: #1a7a46;
  --error: #ef4444;
  --error-bg: #fff5f5;
  --error-dark: #c0392b;
  --warning: #b45309;
  --warning-bg: #fff8e1;
  --warning-dark: #92400e;
  --info: #3b82f6;
  --info-bg: #a1c0e7;
  --info-dark: #0d47a1;
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  /* Spacing scale */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-7:  28px;
  --space-8:  32px;
  --space-9:  36px;
  --space-10: 40px;
  /* Typography scale */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --font-weight-normal:   400;
  --font-weight-medium:   500;
  --font-weight-semibold: 600;
  --font-weight-bold:     700;
  /* Z-index layers */
  --z-dropdown: 200;
  --z-sidebar:  900;
  --z-overlay:  1000;
  --z-modal:    1100;
  --z-toast:    1200;
  /* Border radius */
  --radius-sm:   4px;
  --radius-md:   6px;
  --radius-lg:   8px;
  --radius-xl:   12px;
  --radius-full: 9999px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
}

/* Dark Mode - Manual Override */
body.dark-mode {
  color-scheme: dark;
  /* Brand */
  --primary-color: #d4a843;
  --primary-hover: #c09430;
  --secondary-color: #a88b2f;
  --accent-color: #c09a3a;
  /* Text */
  --text-dark: #e5e5e5;
  --text-light: #a0a0a0;
  /* Backgrounds */
  --bg-light: #1a1a1a;
  --bg-white: #2a2a2a;
  /* Borders */
  --border-color: #3a3a3a;
  /* Semantic status — dark overrides */
  --success: #6dd98e;
  --success-bg: #0f2a1f;
  --success-dark: #3ecf8e;
  --error: #ef4444;
  --error-bg: #2a1010;
  --error-dark: #e57373;
  --warning: #e0a020;
  --warning-bg: #2a2010;
  --warning-dark: #f5c842;
  --info: #5bafe8;
  --info-bg: #1a2a3f;
  --info-dark: #90caf9;
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.7);
}

body {
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--bg-light);
  transition: background-color 0.3s ease, color 0.3s ease;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

html {
  height: 100%;
}

main {
  flex: 1;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.icon-moon {
  display: none;
}

body.dark-mode .icon-sun {
  display: none;
}

body.dark-mode .icon-moon {
  display: block;
}

.language-selector {
  position: relative;
}

.current-lang {
  font-weight: 600;
}

.language-dropdown {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  background-color: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  box-shadow: var(--shadow-md);
  min-width: 120px;
  display: none;
  z-index: calc(var(--z-overlay) + 1);
}

.language-dropdown.show {
  display: block;
}

.lang-option {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--text-dark);
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.lang-option:hover {
  background-color: var(--bg-light);
}

.lang-option.active {
  background-color: var(--primary-color);
  color: var(--bg-white);
  font-weight: 600;
}

.login-btn {
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--bg-white);
  color: var(--primary-color);
}

.btn-primary:hover {
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background-color: transparent;
  color: var(--bg-white);
  border-color: var(--bg-white);
}

.btn-secondary:hover {
  background-color: var(--bg-white);
  color: var(--primary-color);
}

.btn-outline {
  background-color: transparent;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline:hover {
  background-color: var(--primary-color);
  color: var(--bg-white);
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
  text-align: center;
  color: var(--text-dark);
}

.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text-dark);
}

.text-center {
  text-align: center;
  margin-top: 2.5rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.tag {
  background-color: var(--bg-white);
  color: var(--text-dark);
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.card-glow {
  position: relative;
  transition: box-shadow 0.3s ease;
  isolation: isolate;
}

.card-glow::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(90deg, #b87333, #c77a3e, #cd7f32, #a0522d, #b87333);
  opacity: 0;
  filter: blur(2px);
  transition: opacity 0.2s ease;
  animation: copper-hue 3.2s linear infinite;
  pointer-events: none;
  z-index: -1;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.card-glow::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(
    from 0deg,
    rgba(0, 0, 0, 0) 0deg,
    rgba(0, 0, 0, 0) 340deg,
    rgba(255, 200, 140, 0.3) 345deg,
    rgba(184, 115, 51, 0.6) 348deg,
    rgba(255, 200, 140, 0.3) 351deg,
    rgba(0, 0, 0, 0) 360deg
  );
  opacity: 0;
  filter: blur(8px);
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: -1;
  mix-blend-mode: screen;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.card-glow:hover::before {
  opacity: 0.6;
}

.card-glow:hover::after {
  opacity: 0.7;
}

.card-glow > * {
  position: relative;
  z-index: 1;
}


@keyframes copper-hue {
  to {
    filter: blur(2px) hue-rotate(360deg);
  }
}

@keyframes copper-spotlight {
  to {
    transform: rotate(360deg);
  }
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-dark);
}

.form-group input,
.form-group select {
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group textarea {
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  resize: vertical;
  min-height: 120px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* ── Dashboard modal form inputs (canonical — shared across apps) ──────
   App-specific classes (.people-form-group input, etc.) keep only their
   unique padding/font-size overrides. All structural properties are
   defined once here.
   ─────────────────────────────────────────────────────────────────────── */
.form-input,
.people-form-group input,
.people-form-group select,
.people-form-group textarea,
.profile-form-input {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-white);
  color: var(--text-dark);
  font-family: inherit;
  padding: 8px 10px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.form-input:focus,
.people-form-group input:focus,
.people-form-group select:focus,
.people-form-group textarea:focus,
.profile-form-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.social-links {
  display: flex;
  gap: 1.5rem;
}

.social-links a {
  color: var(--text-dark);
  text-decoration: none;
  transition: color 0.3s ease;
}

.social-links a:hover {
  color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
  .section-title {
    font-size: 1.75rem;
  }

  .page-title {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .section {
    padding: 2.5rem 0;
  }
}

/* ══════════════════════════════════════════════════════════════
   Modal System — shared by all user-area services
   Service CSS files retain empty class names for JS targeting.
   ══════════════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: var(--z-modal);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 20px;
}

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

.modal-dialog {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  margin: auto;
  padding: 20px;
}

.modal-sm {
  max-width: 380px;
}

.modal-wide {
  max-width: 680px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.12s;
}

.modal-close:hover {
  background: color-mix(in srgb, var(--border-color) 60%, transparent);
}

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

/* ── Dialog buttons ── */

.btn-action {
  padding: 8px 20px;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-action:hover {
  opacity: 0.88;
}

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

.btn-cancel {
  padding: 8px 18px;
  background: transparent;
  color: var(--text-light);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-cancel:hover {
  background: color-mix(in srgb, var(--border-color) 40%, transparent);
}

/* ==========================================================================
   Shared User-Area Utilities
   Classes reused across dashboard apps (website-builder, people, profile, etc.)
   Loaded for every page via style.css.
   ========================================================================== */

/* ── Chip list — flex-wrap row of pill tags ───────────────────────────────── */
.user-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  min-height: 10px;
}

/* ── Inline text input (inside a highlight / chip row) ───────────────────── */
.user-inline-input {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--bg-white);
  color: inherit;
  transition: border-color 0.15s;
}

.user-inline-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.dark-mode .user-inline-input {
  background: var(--bg-white);
  border-color: var(--border-color);
  color: var(--text-dark);
}

/* ── Row action buttons (shared micro-buttons in table action cells) ────── */
.row-actions {
  display: flex;
  gap: 6px;
}

.row-action-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-light);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.row-action-btn:hover {
  color: var(--primary-color);
  border-color: var(--primary-color);
  background: color-mix(in srgb, var(--primary-color) 8%, transparent);
}

.row-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.row-action-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.row-action-btn--danger:hover {
  color: var(--error);
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.08);
}

/* ── Row delete button — small × at the end of a highlight / chip row ────── */
.user-row-delete-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text-light);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.user-row-delete-btn:hover {
  color: var(--error);
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
}

.user-row-delete-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.user-row-delete-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ── Dashed "add" button (below highlight lists and chip lists) ─────────── */
.user-dashed-add-btn {
  padding: 5px 12px;
  background: none;
  border: 1px dashed var(--border-color, #c0c0c0);
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--text-light);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.user-dashed-add-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* ── Destructive card-level delete button ──────────────────────────────── */
.user-delete-btn {
  margin-left: auto;
  padding: 7px 14px;
  background: none;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--error);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.user-delete-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: var(--error);
}

.user-delete-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Pending-delete staging visual ─────────────────────────────────────── */
.user-pending-delete {
  opacity: 0.35;
  text-decoration: line-through;
}

/* ── Info Stat Cards (reusable label+value chips) ──────────────────────── */

.info-stat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.info-stat-grid + .info-stat-grid {
  padding-top: 16px;
}

.info-stat-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
  flex: 1;
}

.info-stat-card.bordered {
  padding: 14px 20px;
  border-radius: 10px;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
}

.info-stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
}

.info-stat-label {
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 500;
}

@media (max-width: 768px) {
  .info-stat-grid {
    gap: 10px;
  }
  .info-stat-card {
    min-width: 0;
    flex: 1 1 calc(50% - 10px);
  }
  .info-stat-card.bordered {
    padding: 10px 14px;
  }
  .info-stat-value {
    font-size: 1rem;
  }
}

/* ── Analytics Section ──────────────────────────────────────────────────── */

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.analytics-card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.analytics-card-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  color: var(--primary-color);
}

.analytics-card-icon svg {
  width: 100%;
  height: 100%;
}

.analytics-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.analytics-card-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
}

.analytics-card-label {
  font-size: 0.8rem;
  color: var(--text-light);
}

.analytics-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--bg-light);
  overflow: hidden;
  margin-top: 6px;
}

.analytics-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--primary-color);
  transition: width 0.4s ease;
}

.analytics-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 24px;
}

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

.analytics-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  background: var(--bg-light);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
}

.analytics-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-dark);
}

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

@media (max-width: 768px) {
  .analytics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .analytics-card {
    padding: 14px;
    gap: 10px;
  }
  .analytics-card-icon {
    width: 28px;
    height: 28px;
  }
  .analytics-card-value {
    font-size: 1.1rem;
  }
}

/* ── Expandable Card System ─────────────────────────────────── */
/* Shared collapsible card classes used by accounting payroll,   */
/* people analytics, and profile pay stubs.                      */

.expand-card-search { border: none; padding: 0; margin-bottom: 20px; }
.expand-card-search .user-searchbar-inner { max-width: 100%; }

.expand-card-list { display: flex; flex-direction: column; gap: 20px; }

.expand-card-group { display: flex; flex-direction: column; gap: 12px; }

.expand-card-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 2px;
}

.expand-card-group-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

.expand-card-group-count {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-light);
  background: var(--bg-light);
  padding: 1px 8px;
  border-radius: 12px;
  min-width: 20px;
  text-align: center;
}

.expand-card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.expand-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
}

.expand-card-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.expand-card-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
}

.expand-card-badge {
  font-size: 0.75rem;
  color: var(--text-light);
  background: var(--bg-light);
  padding: 2px 10px;
  border-radius: 20px;
}

.expand-card-expand-btn {
  background: none;
  border: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-light);
  transition: transform 0.2s;
  border-radius: 50%;
}
.expand-card-expand-btn:hover { background: var(--bg-light); }
.expand-card-expand-btn.expanded { transform: rotate(180deg); }

.expand-card-body {
  padding: 0 18px 18px;
  border-top: 1px solid var(--border-color);
}

.expand-card-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: 12px;
}

.expand-card-table { font-size: 0.78rem; width: 100%; }
.expand-card-table th,
.expand-card-table td { white-space: nowrap; padding: 6px 10px; }

.expand-card-empty {
  font-size: 0.85rem;
  color: var(--text-light);
  padding-top: 12px;
  margin: 0;
}

@media (max-width: 768px) {
  .expand-card-header { padding: 12px 14px; }
  .expand-card-body { padding: 0 14px 14px; }
}

/* ── In-app Documentation ──────────────────────────────── */
.docs-page { max-width: 760px; }
.docs-page h2 { font-size: 1.15rem; font-weight: 700; color: var(--primary-color); margin: 28px 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--primary-color); }
.docs-page h2:first-child { margin-top: 0; }
.docs-page h3 { font-size: 0.95rem; font-weight: 600; margin: 14px 0 4px; color: var(--text-color); }
.docs-page p { margin: 0 0 10px; line-height: 1.65; }
.docs-page ul, .docs-page ol { padding-left: 22px; margin: 0 0 10px; }
.docs-page li { margin: 4px 0; line-height: 1.6; }
.docs-page .docs-disclaimer { background: var(--bg-white); border-left: 4px solid var(--primary-color); padding: 12px 16px; border-radius: 0 6px 6px 0; margin: 24px 0 0; }
.docs-page .docs-disclaimer p { margin: 0; font-size: 0.9rem; }
[data-theme="dark"] .docs-page .docs-disclaimer { background: #3d2d12; }

/* ── Shared mail-app layout (.mail-*) ────────────────────────────────────────
   Used by Contact Form Inbox and Email — both apps are independent; these are
   purely structural/visual classes shared via this global file only.
   Each app's own CSS file may override individual .mail-* rules safely.
   ─────────────────────────────────────────────────────────────────────────── */

/* Layout */
.mail-container {
    display: flex;
    min-height: calc(100vh - 200px);
    gap: 0;
    background: var(--bg-light);
}
.mail-main {
    flex: 1;
    display: flex;
    min-width: 0;
    position: relative;
}

/* List pane */
.mail-list-pane {
    width: 100%;
    background: var(--bg-white);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Detail pane */
.mail-detail-pane {
    width: 100%;
    flex: 1;
    background: var(--bg-white);
    display: none;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Single-pane toggle with slide animation */
.mail-main.show-detail .mail-list-pane  { display: none; }
.mail-main.show-detail .mail-detail-pane { display: flex; animation: mail-slide-in 0.2s ease-out; }
.mail-main.show-list   .mail-list-pane  { display: flex; animation: mail-slide-back 0.2s ease-out; }
.mail-main.show-list   .mail-detail-pane { display: none; }

@keyframes mail-slide-in {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes mail-slide-back {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* List header */
.mail-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-light);
    min-height: 74.05px;
    box-sizing: border-box;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* List item */
.mail-list-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    gap: 0.75rem;
    transition: background 0.12s;
    position: relative;
}
.mail-list-item.unread                    { background: var(--bg-white); }
body.dark-mode .mail-list-item.unread     { background: var(--bg-light); }
.mail-list-item:not(.unread)              { background: var(--bg-light); }
body.dark-mode .mail-list-item:not(.unread) { background: #2a2a2a; }
.mail-list-item:not(.unread) .mail-item-name,
.mail-list-item:not(.unread) .mail-item-subject { color: var(--text-light); }
.mail-list-item:hover:not(.selected)      { background: var(--info-bg); }
body.dark-mode .mail-list-item:hover:not(.selected) { background: var(--info-bg); }
.mail-list-item.selected                  { background: var(--info-dark); color: #ffffff; opacity: 1; }
body.dark-mode .mail-list-item.selected   { background: var(--info-bg); color: var(--info-dark); }

/* Drag-and-drop messages to folders */
.mail-list-item.email-dragging            { opacity: 0.4; }
.user-nav-item.email-drop-target          { background: var(--info-bg); outline: 2px dashed var(--primary-color); outline-offset: -2px; border-radius: var(--radius-md); }
body.dark-mode .user-nav-item.email-drop-target { background: rgba(59, 130, 246, 0.15); }

/* Star container */
.mail-item-star {
    width: 30px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sender avatar — colored initials circle in list rows */
.mail-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: var(--font-weight-bold);
    color: #fff;
    text-transform: uppercase;
    user-select: none;
}
.mail-item-avatar[data-color="0"] { background: #1a73e8; }
.mail-item-avatar[data-color="1"] { background: #34a853; }
.mail-item-avatar[data-color="2"] { background: #ea4335; }
.mail-item-avatar[data-color="3"] { background: #fa7b17; }
.mail-item-avatar[data-color="4"] { background: #8430ce; }
.mail-item-avatar[data-color="5"] { background: #0f9d58; }
.mail-item-avatar[data-color="6"] { background: #e37400; }
.mail-item-avatar[data-color="7"] { background: #d93025; }
.mail-list-item.selected .mail-item-avatar { opacity: 0.85; }

/* Pin indicator slot — only takes space when pin icon is present */
.mail-item-pin {
    flex-shrink: 0;
    display: none;
    align-items: center;
    justify-content: center;
    width: 0;
}

.mail-item-pin:has(.email-pin-indicator) {
    display: flex;
    width: 20px;
}

/* Star button */
.star-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: color 0.15s;
}
.star-btn:hover,
.star-btn.starred                                          { color: var(--primary-color); }
.mail-list-item.selected .star-btn                         { color: rgba(255, 255, 255, 0.6); }
.mail-list-item.selected .star-btn:hover,
.mail-list-item.selected .star-btn.starred                 { color: #ffffff; }
body.dark-mode .mail-list-item.selected .star-btn:hover,
body.dark-mode .mail-list-item.selected .star-btn.starred  { color: var(--primary-color); }

/* Item content grid */
.mail-item-content {
    flex: 1;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
    min-width: 0;
    overflow: hidden;
}
.mail-item-sender {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    border-right: 1px solid var(--border-color);
    padding-right: 1rem;
}
.mail-list-item.selected .mail-item-sender             { border-right-color: rgba(255, 255, 255, 0.3); }
body.dark-mode .mail-list-item.selected .mail-item-sender { border-right-color: rgba(13, 71, 161, 0.3); }
.mail-item-name {
    font-size: var(--text-sm);
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}
.mail-item-thread-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--text-light);
    color: var(--bg-white);
    font-size: var(--text-xs);
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-full);
    flex-shrink: 0;
}
.mail-list-item.unread .mail-item-name                 { font-weight: var(--font-weight-bold); }
.mail-list-item.selected .mail-item-name               { color: #ffffff; }
body.dark-mode .mail-list-item.selected .mail-item-name { color: var(--info-dark); }
.mail-item-message {
    display: flex;
    align-items: center;
    overflow: hidden;
    gap: 0.5rem;
}
.mail-item-subject {
    font-size: var(--text-sm);
    color: var(--text-dark);
    font-weight: var(--font-weight-semibold);
    white-space: nowrap;
    flex-shrink: 0;
}
.mail-list-item.selected .mail-item-subject                { color: #ffffff; }
body.dark-mode .mail-list-item.selected .mail-item-subject { color: var(--info-dark); }
.mail-item-divider {
    color: var(--text-light);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
    flex-shrink: 0;
}
.mail-list-item.selected .mail-item-divider                { color: rgba(255, 255, 255, 0.6); }
body.dark-mode .mail-list-item.selected .mail-item-divider { color: var(--info); }
.mail-item-preview {
    flex: 1;
    font-size: var(--text-sm);
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mail-list-item.selected .mail-item-preview                { color: rgba(255, 255, 255, 0.8); }
body.dark-mode .mail-list-item.selected .mail-item-preview { color: var(--info); }

/* Item meta + row hover actions */
.mail-item-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 116px;
    position: relative;
    gap: 0.5rem;
    flex-shrink: 0;
    white-space: nowrap;
}
.mail-item-date-text {
    font-size: var(--text-xs);
    color: var(--text-light);
    white-space: nowrap;
}
.mail-list-item.selected .mail-item-date-text    { color: #e0e0e0; }
.mail-list-item:hover .mail-item-date-text        { visibility: hidden; }
.mail-list-item:hover .email-attach-indicator      { visibility: hidden; }
.mail-list-item:hover .email-expire-badge          { visibility: hidden; }
.mail-item-row-actions {
    position: absolute;
    right: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}
.mail-list-item:hover .mail-item-row-actions { opacity: 1; pointer-events: auto; }

/* Control icon (shared across all detail toolbars and action buttons) */
.control-icon {
    width: 20px;
    height: 20px;
    fill: var(--text-dark);
    flex-shrink: 0;
    transition: fill 0.2s ease;
}
body.dark-mode .control-icon { fill: var(--text-light); }

/* Unread "New" badge */
.new-label {
    background-color: var(--primary-color);
    color: white;
    border-radius: 12px;
    padding: 2px var(--space-2);
    font-size: var(--text-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    margin-right: var(--space-1);
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}
.mail-list-item.selected .new-label                { color: #ffffff; }
body.dark-mode .mail-list-item.selected .new-label { color: var(--info-dark); }

/* Detail pane: empty state */
.mail-detail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex: 1;
    color: var(--text-light);
    text-align: center;
    padding: 40px;
}
.mail-detail-empty svg { opacity: 0.4; }
.mail-detail-empty p   { font-size: var(--text-sm); margin: 0; }

/* Detail header */
.mail-detail-header {
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Detail toolbar */
.mail-detail-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.mail-detail-toolbar .control-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-dark);
    padding: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    flex-shrink: 0;
}
.mail-detail-toolbar .control-btn.back-btn {
    width: auto;
    padding: 0.5rem 1rem;
    font-size: var(--text-sm);
    gap: 0.4rem;
}
.mail-detail-toolbar .control-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--bg-light);
}
body.dark-mode .mail-detail-toolbar .control-btn:hover { background: rgba(212, 168, 67, 0.1); }
.mail-detail-toolbar .control-btn:hover .control-icon              { fill: var(--primary-color); }
.mail-detail-toolbar .control-btn.starred .control-icon,
.mail-detail-toolbar .control-btn.starred:hover .control-icon      { fill: var(--primary-color); }
.mail-detail-toolbar .control-btn.pinned .control-icon,
.mail-detail-toolbar .control-btn.pinned:hover .control-icon       { fill: var(--primary-color); }

/* Detail subject / from / date / body */
.mail-detail-subject {
    font-size: var(--text-2xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-dark);
    line-height: 1.3;
}
.mail-detail-from {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: var(--text-sm);
    color: var(--text-dark);
}
.mail-detail-from strong { font-weight: var(--font-weight-semibold); }
.mail-detail-date {
    font-size: var(--text-xs);
    color: var(--text-light);
    line-height: 1.4;
}
.mail-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    color: var(--text-dark);
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Mobile */
@media (max-width: 768px) {
    .mail-container {
        flex-direction: column;
        min-height: unset;
        height: calc(100vh - 106px);
        overflow: hidden;
    }
    .mail-main {
        padding: 0;
        position: relative;
        flex: 1;
        overflow: hidden;
    }
    .mail-list-pane {
        border: none;
        border-bottom: 1px solid var(--border-color);
        height: 100%;
        overflow-y: auto;
    }
    .mail-list-pane > * { flex-shrink: 0; }
    .mail-main.show-detail .mail-detail-pane {
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
        z-index: 10;
        display: flex;
    }
    .mail-item-content { grid-template-columns: 1fr; gap: 0.25rem; }
    .mail-item-sender  { border-right: none; padding-right: 0; }
    .mail-item-meta    { min-width: 80px; }
    .mail-item-row-actions { display: none; }
    .mail-list-item:hover .mail-item-date-text,
    .mail-list-item:hover .email-attach-indicator,
    .mail-list-item:hover .email-expire-badge { visibility: visible; }
}
@media (max-width: 480px) {
    .mail-item-content { display: block; }
    .mail-item-message { margin-top: 2px; }
}
/* ── End shared mail-app layout ── */

/* ═══════════════════════════════════════════════════════════════════════════
   Shared Pagination
   Used by any list view that renders views/pagination/pagination.etlua.
   ═══════════════════════════════════════════════════════════════════════════ */

.pagination-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.pagination-info {
  color: var(--text-light);
  font-size: var(--text-sm);
}

.pagination-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.pagination-controls-mobile {
  display: none;
}

.pagination-mobile-page {
  font-size: var(--text-sm);
  color: var(--text-light);
  min-width: 1.5rem;
  text-align: center;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  background-color: var(--bg-white);
  color: var(--text-dark);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  line-height: 1;
}

.pagination-btn:hover:not(.disabled):not(.active) {
  background-color: var(--bg-light);
  border-color: var(--primary-color);
}

.pagination-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  font-weight: var(--font-weight-semibold);
}

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

.pagination-ellipsis {
  color: var(--text-light);
  padding: 0 0.25rem;
}

body.dark-mode .pagination-btn {
  background-color: var(--bg-white);
  color: var(--text-dark);
  border-color: var(--border-color);
}

body.dark-mode .pagination-btn:hover:not(.disabled):not(.active) {
  background-color: var(--bg-light);
}

body.dark-mode .pagination-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

@media (max-width: 768px) {
  .pagination-info,
  .pagination-controls {
    display: none;
  }

  .pagination-controls-mobile {
    display: flex;
    gap: 0.375rem;
    align-items: center;
  }

  /* Icon-only arrow buttons: square, centred */
  .pagination-controls-mobile .pagination-btn {
    padding: 0.5rem;
  }
}
/* ── End shared pagination ── */

