/* ========================================
   Archilist — Interior Design CRM
   Design: Soft Blush & Midnight

   Local Fonts (Plus Jakarta Sans)
   ======================================== */

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../assets/fonts/plus-jakarta-sans/PlusJakartaSans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../assets/fonts/plus-jakarta-sans/PlusJakartaSans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ========================================
   Reset
   ======================================== */

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

/* ========================================
   CSS Custom Properties
   ======================================== */

:root {
  --bg-start: #fefcfb;
  --bg-end: #fdf6f0;

  --sidebar: #1c1e2e;
  --sidebar-end: #252840;
  --sidebar-text: #a0a3b5;
  --sidebar-active: #ffffff;

  --card: #ffffff;
  --card-border: rgba(0, 0, 0, 0.04);
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);

  --coral: #d4726a;
  --periwinkle: #7c8cf5;
  --teal: #6ab895;
  --amber: #e4a853;

  --text-primary: #1a1a2e;
  --text-secondary: #6e7191;
  --highlight: #fff5f3;

  --row-alt: #faf8f6;

  --sidebar-w: 250px;

  --radius-card: 14px;
  --radius-btn: 10px;
  --radius-stat: 24px;

  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
}

/* ========================================
   Base
   ======================================== */

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.12) transparent;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
  color: var(--text-primary);
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  display: flex;
  overflow-x: hidden;
}

/* Background decorative circle */
body::before {
  content: '';
  position: fixed;
  top: -120px;
  right: -120px;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 114, 106, 0.12) 0%, rgba(212, 114, 106, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* ========================================
   Sidebar
   ======================================== */

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-end) 100%);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 24px 20px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo-img {
  max-width: 100%;
  max-height: 40px;
  width: auto;
  height: auto;
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--coral), #e0877f);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.sidebar-logo-text span {
  color: var(--coral);
}

/* Sidebar Navigation */

.sidebar-nav {
  flex: 1;
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  text-decoration: none;
  border-left: 3px solid transparent;
  margin-left: -3px;
}

.nav-item:hover {
  color: #cdd0e0;
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: var(--sidebar-active);
  background: rgba(212, 114, 106, 0.1);
  border-left-color: var(--coral);
}

.nav-item.active i {
  color: var(--coral);
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 15px;
  transition: color 0.2s;
}

.nav-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 12px 16px;
}

/* Sidebar User */

.sidebar-user {
  padding: 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--coral), #e0877f);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

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

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--sidebar-text);
  margin-top: 2px;
}

.user-logout {
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
}

.user-logout:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

/* ========================================
   Main Content
   ======================================== */

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.main-inner {
  padding: 24px 24px 40px;
}

/* Mobile Toggle */

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-primary);
  transition: all 0.2s;
}

.sidebar-toggle:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.3s;
}

/* ========================================
   Header
   ======================================== */

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 36px;
  gap: 20px;
  flex-wrap: wrap;
}

.header-left h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.header-left p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 6px;
  font-weight: 400;
}

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

.search-bar {
  position: relative;
}

.search-bar input {
  width: 280px;
  height: 44px;
  border-radius: 22px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--card);
  padding: 0 20px 0 44px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.25s;
}

.search-bar input::placeholder {
  color: #b0b3c6;
}

.search-bar input:focus {
  border-color: rgba(212, 114, 106, 0.3);
  box-shadow: 0 0 0 4px rgba(212, 114, 106, 0.06);
}

.search-bar i {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #b0b3c6;
  font-size: 14px;
}

.bell-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 16px;
  transition: all 0.2s;
}

.bell-btn:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  color: var(--text-primary);
}

.bell-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e05454;
  border: 2px solid var(--card);
}

/* ========================================
   Stats Cards
   ======================================== */

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-stat);
  padding: 28px 26px;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* Decorative dot in top-right */
.stat-card::after {
  content: '';
  position: absolute;
  top: -16px;
  right: -16px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  opacity: 0.18;
  pointer-events: none;
}

.stat-card:nth-child(1)::after { background: var(--coral); }
.stat-card:nth-child(2)::after { background: var(--periwinkle); }
.stat-card:nth-child(3)::after { background: var(--teal); }
.stat-card:nth-child(4)::after { background: var(--amber); }

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 18px;
}

.stat-card:nth-child(1) .stat-icon { background: rgba(212, 114, 106, 0.1); color: var(--coral); }
.stat-card:nth-child(2) .stat-icon { background: rgba(124, 140, 245, 0.1); color: var(--periwinkle); }
.stat-card:nth-child(3) .stat-icon { background: rgba(106, 184, 149, 0.1); color: var(--teal); }
.stat-card:nth-child(4) .stat-icon { background: rgba(228, 168, 83, 0.1); color: var(--amber); }

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
  font-weight: 500;
}

/* ========================================
   Quick Actions
   ======================================== */

.quick-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  outline: none;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--coral), #e0877f);
  color: #fff;
  box-shadow: 0 4px 14px rgba(212, 114, 106, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(212, 114, 106, 0.35);
  transform: translateY(-1px);
}

.btn-outline-coral {
  background: transparent;
  border: 1.5px solid rgba(212, 114, 106, 0.35);
  color: var(--coral);
}

.btn-outline-coral:hover {
  background: rgba(212, 114, 106, 0.05);
  border-color: var(--coral);
}

.btn-outline-peri {
  background: transparent;
  border: 1.5px solid rgba(124, 140, 245, 0.35);
  color: var(--periwinkle);
}

.btn-outline-peri:hover {
  background: rgba(124, 140, 245, 0.05);
  border-color: var(--periwinkle);
}

/* ========================================
   Table Cards
   ======================================== */

.table-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  margin-bottom: 28px;
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px 18px;
}

.table-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.table-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--coral);
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s;
}

.table-link:hover {
  opacity: 0.7;
}

.table-link i {
  font-size: 11px;
  margin-left: 4px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

thead th {
  text-align: left;
  padding: 12px 26px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: var(--row-alt);
}

tbody tr {
  transition: background 0.15s;
}

tbody tr:nth-child(even) {
  background: var(--row-alt);
}

tbody tr:hover {
  background: #f5f0ed;
}

tbody td {
  padding: 14px 26px;
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
  vertical-align: middle;
}

/* ========================================
   Status Badges (Table)
   ======================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

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

.badge-progress {
  background: rgba(212, 114, 106, 0.1);
  color: var(--coral);
}

.badge-progress::before {
  background: var(--coral);
}

.badge-planning {
  background: rgba(124, 140, 245, 0.1);
  color: var(--periwinkle);
}

.badge-planning::before {
  background: var(--periwinkle);
}

.badge-completed {
  background: rgba(106, 184, 149, 0.1);
  color: var(--teal);
}

.badge-completed::before {
  background: var(--teal);
}

.badge-hold {
  background: rgba(110, 113, 145, 0.1);
  color: var(--text-secondary);
}

.badge-hold::before {
  background: var(--text-secondary);
}

/* ========================================
   Status Badges (Items)
   ======================================== */

/* Client acceptance status -- slightly larger */
/* Shared status select base */
.status-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  position: relative;
  transition: all 0.15s;
  white-space: nowrap;
}
.status-select:hover {
  filter: brightness(0.95);
}
.status-select::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Client acceptance status */
.status-pending {
  background: rgba(148,163,184,0.12);
  color: #64748b;
}
.status-pending::before {
  background: #94a3b8;
}
.status-accepted {
  background: rgba(16,185,129,0.1);
  color: #059669;
}
.status-accepted::before {
  background: #10b981;
}
.status-rejected {
  background: rgba(239,68,68,0.08);
  color: #dc2626;
}
.status-rejected::before {
  background: #ef4444;
}

/* Order status */
.status-ordered {
  background: rgba(124,140,245,0.1);
  color: var(--periwinkle);
}
.status-ordered::before {
  background: var(--periwinkle);
}
.status-delivered {
  background: rgba(16,185,129,0.1);
  color: #059669;
}
.status-delivered::before {
  background: #10b981;
}
.status-none {
  background: rgba(148,163,184,0.08);
  color: #94a3b8;
}
.status-none::before {
  background: #cbd5e1;
}

/* Status dropdown */
.status-dropdown-wrap {
  position: relative;
}
.status-dropdown {
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  background: var(--card);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 180px;
  z-index: 350;
  border: 1px solid var(--color-gray-100);
  overflow: hidden;
  animation: modal-slide 0.12s ease;
}
.status-dropdown[hidden] {
  display: none;
}
.status-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}
.status-dropdown-item:hover {
  background: var(--color-gray-50);
}
.status-dropdown-item::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
}

/* ========================================
   Progress Bars
   ======================================== */

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 120px;
}

.progress-bar {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill.coral { background: var(--coral); }
.progress-fill.peri { background: var(--periwinkle); }
.progress-fill.teal { background: var(--teal); }
.progress-fill.gray { background: var(--text-secondary); }

.progress-pct {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 32px;
}

/* ========================================
   Client Avatars
   ======================================== */

.client-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.client-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

/* ========================================
   Lists Page -- Two Panel Layout
   ======================================== */

.lists-layout {
  display: flex;
  gap: 24px;
  min-height: calc(100vh - 180px);
  align-items: flex-start;
}

/* Lists Panel (left) */

.lists-panel {
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: 24px;
}

.lists-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.lists-panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.lists-panel-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--row-alt);
  padding: 2px 10px;
  border-radius: 12px;
}

.lists-panel-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* List Card */

.list-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 16px 18px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 3px solid transparent;
}

.list-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.list-card.active {
  border-left-color: var(--coral);
  background: var(--highlight);
}

.list-card-drag {
  color: var(--text-secondary);
  cursor: grab;
  opacity: 0.4;
  transition: opacity 0.2s;
  font-size: 14px;
  flex-shrink: 0;
}

.list-card-drag:hover {
  opacity: 1 !important;
}

.list-card-info {
  flex: 1;
  min-width: 0;
}

.list-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.list-card-type {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(124, 140, 245, 0.08);
  color: var(--periwinkle);
}

.list-card-items {
  font-size: 12px;
  color: var(--text-secondary);
}

.list-card-activity {
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.6;
  margin-top: 4px;
}

.lists-panel-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  border: 1.5px dashed rgba(212, 114, 106, 0.25);
  border-radius: var(--radius-card);
  background: none;
  color: var(--coral);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.lists-panel-add:hover {
  border-color: var(--coral);
  background: var(--highlight);
}

.lists-panel-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 10px 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.15s;
}

.lists-panel-toggle:hover {
  color: var(--text-primary);
}

.lists-panel-toggle i {
  font-size: 10px;
  transition: transform 0.3s;
}

.lists-panel-body.collapsed {
  display: none;
}

.lists-panel-body.collapsed + .lists-panel-add {
  display: none;
}

.lists-panel-toggle.collapsed i {
  transform: rotate(-90deg);
}

.avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* List Content (right) */

.list-content {
  flex: 1;
  min-width: 0;
}

.list-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.list-content-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.list-content-summary {
  display: flex;
  align-items: center;
  gap: 16px;
}

.list-summary-item {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.list-summary-item strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* Budget progress bar */
/* Budget pill progress */
.budget-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  height: 30px;
  border-radius: 15px;
  background: var(--color-gray-100);
  overflow: hidden;
}

.budget-pill-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 15px;
  transition: width 0.6s ease;
  opacity: 0.2;
}

.budget-pill-text {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0 14px;
  white-space: nowrap;
}

.budget-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  max-width: 300px;
}

.budget-bar {
  flex: 1;
  height: 8px;
  background: var(--color-gray-100);
  border-radius: 4px;
  overflow: hidden;
}

.budget-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--teal);
  transition: width 0.6s ease;
}

.budget-bar-fill.over-budget {
  background: var(--coral);
}

.budget-bar-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* List footer (below all sections) */
.list-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0 0;
  margin-top: 8px;
  /* no border-top */
  flex-wrap: wrap;
}

.list-footer-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.list-footer-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Empty State */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
}

.empty-state i {
  font-size: 48px;
  color: var(--card-border);
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ========================================
   Sections
   ======================================== */

.sections-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-block {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  overflow: visible;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.section-header:hover {
  background: var(--row-alt);
}

.section-drag {
  color: var(--text-secondary);
  cursor: grab;
  opacity: 0.4;
  transition: opacity 0.2s;
  font-size: 14px;
  flex-shrink: 0;
}

.section-drag:hover {
  opacity: 1 !important;
}

.section-chevron {
  color: var(--text-secondary);
  font-size: 12px;
  transition: transform 0.3s ease;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.section-block.collapsed .section-chevron {
  transform: rotate(-90deg);
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.section-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--row-alt);
  padding: 2px 10px;
  border-radius: 10px;
  flex-shrink: 0;
}

.section-status-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  flex-shrink: 0;
}

.section-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.section-progress-bar {
  width: 60px;
  height: 5px;
  background: var(--color-gray-100);
  border-radius: 3px;
  overflow: hidden;
}

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

.section-progress-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.section-total {
  font-size: 12px;
  font-weight: 600;
  color: var(--coral);
  flex-shrink: 0;
}

.section-body {
  padding: 4px 15px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: visible;
  transition: max-height 0.4s ease, padding 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}

.section-block.collapsed .section-body {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  overflow: hidden;
}

.section-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 16px 4px;
  margin-top: 6px;
}

.section-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* List filter/toolbar bar */
.list-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--row-alt);
  padding: 12px 15px;
  margin-bottom: 12px;
  border-radius: var(--radius-card);
  transition: background 0.2s;
}

.list-toolbar.stuck {
  background: #ede8e4;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  box-shadow: var(--card-shadow);
}

.list-toolbar .search-bar {
  flex: 0 1 240px;
}

.list-toolbar .search-bar input {
  width: 100%;
  height: 38px;
  font-size: 12px;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  background: var(--card);
  color: var(--text-secondary);
  transition: all 0.15s;
  white-space: nowrap;
}

.toolbar-btn:hover {
  border-color: rgba(0, 0, 0, 0.15);
  color: var(--text-primary);
}

.toolbar-btn.active {
  border-color: var(--periwinkle);
  color: var(--periwinkle);
  background: rgba(124, 140, 245, 0.04);
}

.toolbar-btn i {
  font-size: 12px;
}

.toolbar-separator {
  width: 1px;
  height: 24px;
  background: var(--card-border);
  flex-shrink: 0;
}

.toolbar-reset {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s;
}

.toolbar-reset:hover {
  color: var(--coral);
}

/* Filter dropdown */
.filter-dropdown-wrap {
  position: relative;
}

.filter-dropdown {
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  background: var(--card);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  min-width: 180px;
  z-index: 300;
  border: 1px solid var(--color-gray-100);
  overflow: hidden;
  animation: modal-slide 0.12s ease;
  padding: 6px 0;
}

.filter-dropdown[hidden] {
  display: none;
}

.filter-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 14px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}

.filter-dropdown-item:hover {
  background: var(--color-gray-50);
}

.filter-dropdown-item.active {
  color: var(--coral);
  font-weight: 600;
}

.btn-add-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: linear-gradient(135deg, var(--coral), #e0877f);
  color: #fff;
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(212, 114, 106, 0.2);
}

.btn-add-item:hover {
  box-shadow: 0 4px 14px rgba(212, 114, 106, 0.3);
  transform: translateY(-1px);
}

.section-footer-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.section-footer-total {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ========================================
   Item Cards
   ======================================== */

.item-card {
  display: flex;
  gap: 0;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  transition: all 0.2s;
  align-items: stretch;
}

.item-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.item-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-right: 12px;
  flex-shrink: 0;
  width: 32px;
}

.item-drag {
  color: var(--text-secondary);
  cursor: grab;
  opacity: 0.4;
  font-size: 13px;
}

.item-check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: transparent;
  transition: all 0.15s;
  padding: 0;
}

.item-check:hover {
  border-color: var(--coral);
  color: rgba(212, 114, 106, 0.3);
}

.item-check.checked {
  background: var(--coral);
  border-color: var(--coral);
  color: #fff;
}

.item-drag:hover {
  opacity: 1;
}

.item-photo {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--row-alt);
  flex-shrink: 0;
}

.item-photo-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  background: var(--row-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--card-border);
  flex-shrink: 0;
}

.item-info {
  width: 500px;
  flex-shrink: 0;
  min-width: 0;
  padding-left: 14px;
  padding-right: 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.item-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-title-link {
  color: var(--periwinkle);
  font-size: 12px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.item-title-link:hover {
  opacity: 1;
}

.item-statuses {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
}

.item-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.item-meta-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-secondary);
  opacity: 0.4;
  flex-shrink: 0;
}

.item-note {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
}

/* Tooltip appended to body via JS */
.note-tooltip {
  position: fixed;
  background: var(--sidebar);
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: normal;
  word-wrap: break-word;
  max-width: 320px;
  min-width: 160px;
  z-index: 9000;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.note-tooltip.visible {
  opacity: 1;
}

.note-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 16px;
  border: 5px solid transparent;
  border-top-color: var(--sidebar);
}

.item-middle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  flex-shrink: 0;
  border-left: 1px solid var(--card-border);
}

.item-middle--details {
  width: 250px;
}

.item-middle--comments {
  width: auto;
  border-left: none;
  padding: 0 8px;
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.btn-comments {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--card);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-comments:hover {
  border-color: var(--periwinkle);
  color: var(--periwinkle);
}

.comments-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--periwinkle);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.comments-badge--read {
  background: var(--color-gray-200);
  color: var(--text-secondary);
}

/* Comment Tabs */
.comment-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.comment-tab {
  flex: 1;
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

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

.comment-tab.active {
  color: var(--coral);
  border-bottom-color: var(--coral);
}

.comment-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--color-gray-200);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
}

.comment-tab-count--unread {
  background: var(--periwinkle);
  color: #fff;
}

/* Comment Thread */
.comments-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding: 16px 0;
  margin-bottom: 16px;
}

.comment-bubble {
  max-width: 85%;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.comment-bubble__body {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  flex: 1;
  min-width: 0;
}

.comment-bubble--staff {
  align-self: flex-start;
}

.comment-bubble--staff .comment-bubble__body {
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  border-top-left-radius: 4px;
}

.comment-bubble--client {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.comment-bubble--client .comment-bubble__body {
  background: var(--periwinkle);
  color: #fff;
  border-top-right-radius: 4px;
}

.comment-bubble__meta {
  font-size: 11px;
  opacity: 0.6;
  margin-bottom: 3px;
}

.comment-bubble__text {
  word-wrap: break-word;
}

/* Comment tabs */
.comment-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--card-border);
  margin-bottom: 0;
}

.comment-tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  background: none;
  font-family: inherit;
  transition: all 0.15s;
}

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

.comment-tab.active {
  color: var(--coral);
  border-bottom-color: var(--coral);
}

/* Files Modal */
.files-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}
.files-add-row .form-select,
.files-add-row .cs-wrap {
  flex: 1;
  min-width: 0;
}

.files-list { display: flex; flex-direction: column; gap: 4px; }
.files-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background 0.1s;
}
.files-item:hover { background: var(--row-alt); }
.files-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(212,114,106,0.08);
  color: var(--coral);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.files-item-info { flex: 1; min-width: 0; }
a.files-item-name { display: block; font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
a.files-item-name:hover { color: var(--periwinkle); text-decoration: underline; }
.files-item-meta { font-size: 11px; color: var(--text-secondary); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.files-item-cat {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(124,140,245,0.08);
  color: var(--periwinkle);
}
.files-item-delete {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12px;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.15s;
  opacity: 0;
  flex-shrink: 0;
}
.files-item:hover .files-item-delete { opacity: 1; }
.files-item-delete:hover { color: #e74c3c; background: #fdf2f2; }

.files-empty {
  text-align: center;
  padding: 24px;
  color: var(--text-secondary);
  font-size: 13px;
  opacity: 0.5;
}
.files-empty i { margin-right: 6px; }

.files-format-hint {
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--periwinkle);
  background: rgba(124,140,245,0.08);
  padding: 8px 12px;
  margin-top: 10px;
  margin-bottom: 20px;
  border-radius: 8px;
  border: 1px solid rgba(124,140,245,0.15);
}

.files-format-error {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 12px;
  margin-top: 6px;
  border-radius: 8px;
  background: rgba(212,114,106,0.08);
  color: var(--coral);
  font-size: 12px;
  font-weight: 500;
}

/* Form validation */
.form-input.error,
.form-textarea.error,
.form-select.error {
  border-color: #dc2626;
}

.form-error {
  font-size: 12px;
  color: #dc2626;
  margin-top: 4px;
}

.form-alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-alert--error {
  background: rgba(220, 38, 38, 0.06);
  color: #dc2626;
}

.form-alert--success {
  background: rgba(16, 185, 129, 0.06);
  color: #059669;
}

/* Password strength */
.password-strength {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.password-strength-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--color-gray-100);
  transition: background 0.2s;
}

.password-strength-bar.weak { background: #dc2626; }
.password-strength-bar.medium { background: var(--amber); }
.password-strength-bar.strong { background: var(--teal); }

.password-strength-text {
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}

.password-requirements {
  list-style: none;
  padding: 0;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.password-requirements li {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.password-requirements li i { font-size: 10px; }
.password-requirements li.met { color: var(--teal); }
.password-requirements li.met i { color: var(--teal); }

/* Social login */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--card-border);
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 46px;
  border-radius: 10px;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  background: var(--card);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-social:hover {
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.btn-social i {
  font-size: 18px;
}

.btn-social--google i { color: #ea4335; }
.btn-social--facebook i { color: #1877f2; }

.social-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-input-row {
  display: flex;
  gap: 8px;
}

.item-middle--statuses {
  width: 190px;
}

.item-middle--statuses .status-select {
  width: 100%;
}

.item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  flex-shrink: 0;
  gap: 4px;
  padding-left: 16px;
  border-left: 1px solid var(--card-border);
}

.item-pricing {
  text-align: right;
}

.item-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
}

.item-qty {
  font-weight: 500;
  color: var(--text-secondary);
}



.item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-url-link {
  color: var(--periwinkle);
  font-size: 13px;
  transition: color 0.2s;
  opacity: 0.6;
}

.item-url-link:hover {
  opacity: 1;
}

/* ========================================
   SortableJS Drag States
   ======================================== */

.sortable-ghost {
  opacity: 0.35;
}

.sortable-drag {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12) !important;
}

.sortable-chosen {
  cursor: grabbing;
}

/* ========================================
   Forms
   ======================================== */

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.form-input {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  border: 1.5px solid rgba(0,0,0,0.08);
  background: var(--card);
  padding: 0 14px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s;
}

.form-input:focus {
  border-color: rgba(212,114,106,0.4);
  box-shadow: 0 0 0 4px rgba(212,114,106,0.06);
}

.form-textarea,
textarea.form-input {
  width: 100%;
  min-height: 80px;
  border-radius: 10px;
  border: 1.5px solid rgba(0,0,0,0.08);
  background: var(--card);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  resize: vertical;
  transition: all 0.2s;
}

.form-textarea:focus,
textarea.form-input:focus {
  border-color: rgba(212,114,106,0.4);
  box-shadow: 0 0 0 4px rgba(212,114,106,0.06);
}

/* Per-field validation — toggle `.has-error` on the parent .form-group to paint
   the input coral and reveal the label-side exclamation icon. Mirrors the
   canonical auth-form pattern in page-login.php + auth.js. */
.form-group.has-error .form-input,
.form-group.has-error .form-textarea,
.form-group.has-error .form-select,
.form-group.has-error .phone-input {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(212, 114, 106, 0.08);
}

.form-label-error {
  display: none !important; /* beats Font Awesome's .fa-solid { display: inline-block } */
  float: right;
  margin-top: 1px;
  color: var(--coral);
  font-size: 12px;
}

.form-group.has-error .form-label-error {
  display: inline-block !important;
}

.form-select {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  border: 1.5px solid rgba(0,0,0,0.08);
  background: var(--card);
  padding: 0 14px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236e7191' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
  transition: all 0.2s;
}

.form-select:focus {
  border-color: rgba(212,114,106,0.4);
  box-shadow: 0 0 0 4px rgba(212,114,106,0.06);
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row > * {
  flex: 1;
}

/* Color swatches (avatar color picker) */
.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s;
  border: 2px solid transparent;
  position: relative;
}
.color-swatch:hover {
  transform: scale(1.15);
}
.color-swatch.selected {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--text-primary);
}

.form-checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.form-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid rgba(0,0,0,0.15);
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.form-checkbox:checked {
  background: var(--coral);
  border-color: var(--coral);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M10 3L4.5 8.5 2 6'/%3E%3C/svg%3E");
  background-size: 12px;
  background-position: center;
  background-repeat: no-repeat;
}

/* File Upload Label */

.file-upload-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  width: 100%;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 8px 12px;
  background: var(--card);
  transition: border-color 0.15s;
  overflow: hidden;
}

.file-upload-label:hover {
  border-color: rgba(212, 114, 106, 0.3);
}

.file-upload-label__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--row-alt);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.file-upload-label__name {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.6;
}

/* ========================================
   Custom Select
   ======================================== */

.cs-wrap {
  position: relative;
  width: 100%;
}

.cs-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  background: var(--card);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
}

.cs-trigger:hover {
  border-color: rgba(0, 0, 0, 0.15);
}

.cs-trigger:focus,
.cs-wrap.open .cs-trigger {
  border-color: rgba(212, 114, 106, 0.4);
  box-shadow: 0 0 0 4px rgba(212, 114, 106, 0.06);
}

.cs-trigger-chevron {
  font-size: 10px;
  color: var(--text-secondary);
  transition: transform 0.2s;
}

.cs-wrap.open .cs-trigger-chevron {
  transform: rotate(180deg);
}

.cs-dropdown {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  width: 100%;
  background: var(--card);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--color-gray-100);
  z-index: 300;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px 0;
  animation: modal-slide 0.12s ease;
}

.cs-wrap.open .cs-dropdown {
  display: block;
}

.cs-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.1s;
}

.cs-option:hover {
  background: var(--color-gray-50);
}

.cs-option.selected {
  background: var(--highlight);
  color: var(--coral);
  font-weight: 600;
}

.cs-option-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cs-trigger-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cs-trigger--sm {
  height: 34px;
  font-size: 12px;
  padding: 0 10px;
  border-radius: 8px;
}

/* ========================================
   Stacked Avatars (Asana style)
   ======================================== */

.avatar-stack {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.avatar-stack .avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  border: 2px solid var(--card);
  margin-left: -10px;
  overflow: hidden;
}

.avatar-stack .avatar-sm:last-child {
  margin-left: 0;
}

/* Stage completion badge */
.harm-stage__badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--teal);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
}

/* Delete confirmation modal text */
.modal-confirm-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 12px 0;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.2);
}

.btn-danger:hover {
  background: #b91c1c;
}

/* ========================================
   Schedule Add Task
   ======================================== */

.harm-add-task {
}

/* ========================================
   Header Help Icon
   ======================================== */

.header-help {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--periwinkle);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
}
.header-help:hover {
  box-shadow: 0 4px 12px rgba(124,140,245,0.3);
  opacity: 0.9;
}

/* Help Modal */
.help-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}
.help-divider::before,
.help-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--card-border);
}
.help-form-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}
.help-info-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}
.help-info-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--coral);
  text-decoration: none;
  transition: opacity 0.15s;
}
.help-info-link:hover {
  opacity: 0.8;
}
.help-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.help-form .form-group {
  margin-bottom: 12px;
}
.help-form .form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: block;
}
/* ========================================
   Modals
   ======================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 9999;
  padding: 32px 16px;
  overflow-y: auto;
  animation: modal-fade 0.15s ease;
  opacity: 1;
}

.modal-overlay.closing {
  opacity: 0;
  transition: opacity 0.15s;
}

@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

body.modal-open {
  overflow: hidden;
}

.modal-dialog {
  position: relative;
  background: var(--card);
  border-radius: 16px;
  padding: 28px;
  max-width: 480px;
  width: 100%;
  margin: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
  animation: modal-slide 0.2s ease;
}

.modal-dialog--wide {
  max-width: 600px;
}

@keyframes modal-slide {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--color-gray-100);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.15s;
}

.modal-close:hover {
  background: var(--color-gray-200);
  color: var(--text-primary);
}

.modal-header {
  margin-bottom: 20px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.modal-body {
  margin-top: 16px;
}

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

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

.modal-photo-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.modal-photo-preview {
  aspect-ratio: 1;
  background: var(--row-alt);
  border: 1.5px dashed rgba(0,0,0,0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 32px;
}

.modal-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ========================================
   Kebab Dropdown Menu
   ======================================== */

.kebab-trigger {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  transition: all 0.15s;
  border: none;
  background: none;
}

.kebab-trigger:hover {
  background: var(--row-alt);
  color: var(--text-primary);
}

.kebab-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 180px;
  z-index: 300;
  border: 1px solid var(--color-gray-100);
  overflow: hidden;
  animation: modal-slide 0.12s ease;
}

.kebab-dropdown[hidden] {
  display: none;
}

.kebab-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}

.kebab-item:hover {
  background: var(--color-gray-50);
}

.kebab-item i {
  width: 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

.kebab-item--danger {
  color: #dc2626;
}

.kebab-item--danger i {
  color: #dc2626;
}

.kebab-item--danger:hover {
  background: rgba(239,68,68,0.06);
}

.kebab-separator {
  height: 1px;
  background: var(--color-gray-100);
  margin: 4px 0;
}

/* ========================================
   Image Hover Preview
   ======================================== */

.img-hover-wrap {
  position: relative;
}

.img-hover-preview {
  display: none;
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  max-width: 400px;
  max-height: 400px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  overflow: hidden;
  z-index: 400;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.img-hover-wrap:hover .img-hover-preview {
  display: block;
  opacity: 1;
}

.img-hover-preview img {
  display: block;
  max-width: 400px;
  max-height: 400px;
  width: auto;
  height: auto;
}

/* ========================================
   Favorites Grid
   ======================================== */

.fav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.fav-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: all 0.2s;
  cursor: pointer;
}

.fav-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.fav-card-photo {
  aspect-ratio: 1;
  background: var(--row-alt);
  overflow: hidden;
}

.fav-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fav-card-body {
  padding: 14px 16px;
}

.fav-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fav-card-brand {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.fav-card-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 6px;
}

.fav-card-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber);
  font-size: 12px;
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ========================================
   Style List Page
   ======================================== */

.stylelist-section {
  margin-bottom: 48px;
}

.stylelist-section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--card-border);
}

.stylelist-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  align-items: flex-start;
}

.stylelist-demo-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--card-shadow);
}

/* Blockquote */
blockquote {
  border-left: 3px solid var(--coral);
  padding: 16px 20px;
  background: var(--highlight);
  border-radius: 0 10px 10px 0;
  font-style: italic;
  color: var(--text-secondary);
  margin: 12px 0;
}

blockquote strong {
  color: var(--text-primary);
  font-style: normal;
}

/* Alerts */
.alert {
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert i {
  font-size: 16px;
  flex-shrink: 0;
}

.alert-info {
  background: rgba(124,140,245,0.08);
  color: var(--periwinkle);
}

.alert-success {
  background: rgba(106,184,149,0.08);
  color: var(--teal);
}

.alert-warning {
  background: rgba(228,168,83,0.08);
  color: var(--amber);
}

.alert-error {
  background: rgba(212,114,106,0.08);
  color: var(--coral);
}

/* Toggle switch */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--color-gray-200);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
  appearance: none;
  border: none;
}

.toggle:checked {
  background: var(--coral);
}

.toggle::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.2s;
}

.toggle:checked::after {
  transform: translateX(20px);
}

/* ========================================
   Sidebar Collapse
   ======================================== */

.sidebar-collapse-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--sidebar-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.15s;
  margin-left: auto;
  flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--sidebar-active);
}

/* Sidebar collapse transitions */
.sidebar {
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main {
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-logo-img {
  transition: opacity 0.2s ease;
}

.sidebar-collapse-btn {
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.nav-item {
  transition: all 0.2s ease;
}

.sidebar-user .user-info,
.sidebar-user .user-logout {
  transition: opacity 0.15s ease;
}

/* ---- Collapsed state ---- */

.sidebar.collapsed {
  width: 74px;
  overflow: visible;
}

.sidebar.collapsed .sidebar-logo-img {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

.sidebar.collapsed .sidebar-header {
  padding: 16px 16px 12px;
  justify-content: center;
  gap: 0;
}

.sidebar.collapsed .sidebar-collapse-btn {
  margin: 0 auto;
}

.sidebar.collapsed .sidebar-nav {
  padding: 8px 16px;
  align-items: center;
  overflow: visible;
}

.sidebar.collapsed .nav-item {
  width: 42px;
  height: 42px;
  padding: 0;
  justify-content: center;
  border-left-color: transparent;
  border-radius: 10px;
  gap: 0;
  margin-left: 0;
}

.nav-label {
  transition: opacity 0.2s ease, width 0.25s ease;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar.collapsed .nav-label {
  opacity: 0;
  width: 0;
  pointer-events: none;
}

.sidebar.collapsed .nav-item i {
  width: auto;
  min-width: auto;
  font-size: 17px;
  flex-shrink: 0;
}

/* Tooltip on collapsed nav items */
/* Hide tooltip when sidebar is NOT collapsed */
.sidebar:not(.collapsed) .nav-item::after {
  content: none !important;
  display: none !important;
}

.sidebar.collapsed .nav-item {
  position: relative;
}

.sidebar.collapsed .nav-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--sidebar);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  transform: translateY(-50%) translateX(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 1000;
}

.sidebar.collapsed .nav-item:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.sidebar.collapsed .nav-divider {
  margin: 6px 0;
  width: 42px;
}

.sidebar.collapsed .sidebar-user {
  padding: 12px 16px;
  justify-content: center;
  gap: 0;
}

.sidebar.collapsed .user-info,
.sidebar.collapsed .user-logout {
  display: none;
}

.sidebar.collapsed .user-avatar {
  width: 36px;
  height: 36px;
}

.sidebar.collapsed ~ .main {
  margin-left: 74px;
}

/* ========================================
   Alternative Products
   ======================================== */

.item-card.alt-product {
  border-left: 3px solid var(--periwinkle);
  background: rgba(124, 140, 245, 0.02);
}

.alt-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(124, 140, 245, 0.1);
  color: var(--periwinkle);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

/* Bulk actions toolbar button */
.toolbar-actions-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--periwinkle);
  background: rgba(124, 140, 245, 0.04);
  color: var(--periwinkle);
  transition: all 0.15s;
  white-space: nowrap;
  position: relative;
}

.toolbar-actions-btn:hover {
  background: rgba(124, 140, 245, 0.08);
}

.toolbar-actions-btn .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--periwinkle);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

/* ========================================
   Chat Page
   ======================================== */

.chat-layout {
  display: flex;
  gap: 20px;
  height: calc(100vh - 140px);
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.chat-thread {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* SimpleBar — chat thread uses data-simplebar, keep flex layout via content wrapper */
.chat-thread[data-simplebar] {
  padding: 0;
}

.chat-thread .simplebar-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 32px 24px 24px !important;
}

/* SimpleBar — Archilist scrollbar styling */
.chat-thread .simplebar-scrollbar::before {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
}
.chat-thread .simplebar-scrollbar.simplebar-visible::before {
  opacity: 0.5;
}
.chat-thread .simplebar-track.simplebar-vertical {
  width: 10px;
  right: 2px;
}
.chat-thread .simplebar-track.simplebar-vertical .simplebar-scrollbar::before {
  left: 2px;
  right: 2px;
}

.chat-input-bar {
  padding: 16px 24px;
  border-top: 1px solid var(--card-border);
  display: flex;
  gap: 10px;
}

.chat-input-bar .form-input {
  flex: 1;
}

.chat-participants {
  width: 240px;
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-participants-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
  font-size: 14px;
  font-weight: 700;
}

.chat-participants-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-participant {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background 0.1s;
}

.chat-participant:hover {
  background: var(--row-alt);
}

.chat-participant-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.chat-participant-info {
  flex: 1;
}

.chat-participant-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.chat-participant-role {
  font-size: 11px;
  color: var(--text-secondary);
}

.chat-participant-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chat-participant-status.online {
  background: var(--teal);
}

.chat-participant-status.offline {
  background: var(--color-gray-200);
}

/* ========================================
   Responsive: Tablet (< 1024px)
   ======================================== */

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .sidebar-overlay.open {
    display: block;
    opacity: 1;
  }

  .sidebar-toggle {
    display: flex;
  }

  .main {
    margin-left: 0;
  }

  .main-inner {
    padding: 24px 16px;
    padding-top: 76px;
  }

  .lists-panel {
    width: 260px;
  }
}

/* ========================================
   Responsive: Small Tablet (< 768px)
   ======================================== */

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

  .search-bar input {
    width: 200px;
  }

  .lists-layout {
    flex-direction: column;
  }

  .lists-panel {
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
  }
}

/* ========================================
   Responsive: Mobile (< 640px)
   ======================================== */

@media (max-width: 640px) {
  .stats-row {
    grid-template-columns: 1fr;
  }

  .header {
    flex-direction: column;
  }

  .header-right {
    width: 100%;
  }

  .search-bar {
    flex: 1;
  }

  .search-bar input {
    width: 100%;
  }

  .item-card {
    flex-wrap: wrap;
  }

  .item-info {
    width: auto;
    flex: 1;
    min-width: 200px;
  }

  .item-middle--details {
    width: auto;
    min-width: 0;
  }

  .item-middle--statuses {
    width: auto;
    min-width: 0;
  }

  .item-photo,
  .item-photo-placeholder {
    width: 56px;
    height: 56px;
  }

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

  .fav-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }

  .item-left {
    width: 24px;
  }

  table {
    min-width: auto;
  }
}

/* ========================================
   Form Builder
   ======================================== */

.fb-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding: 12px 16px;
  background: var(--row-alt);
  border-radius: var(--radius-card);
  flex-wrap: wrap;
}

.fb-form-header {
  margin-bottom: 28px;
}

.fb-form-title-input {
  width: 100%;
  font-size: 24px;
  font-weight: 700;
  border: none;
  background: none;
  color: var(--text-primary);
  outline: none;
  padding: 4px 0;
  font-family: inherit;
}

.fb-form-title-input::placeholder { color: var(--color-gray-200); }

.fb-form-desc-input {
  width: 100%;
  font-size: 14px;
  border: none;
  background: none;
  color: var(--text-secondary);
  outline: none;
  padding: 4px 0;
  margin-top: 4px;
  font-family: inherit;
  resize: none;
}

.fb-form-desc-input::placeholder { color: var(--color-gray-200); }

/* Sections */
.fb-sections {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.fb-section {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  overflow: visible;
}

.fb-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--row-alt);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  cursor: pointer;
}

.fb-section-drag {
  color: var(--text-secondary);
  opacity: 0.4;
  cursor: grab;
  font-size: 14px;
}

.fb-section-title {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  border: none;
  background: none;
  outline: none;
  font-family: inherit;
  padding: 0;
}

.fb-section-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--card);
  padding: 2px 10px;
  border-radius: 10px;
}

.fb-section-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Question Cards */
.fb-question {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--card);
  border: 1.5px solid var(--card-border);
  border-radius: 12px;
  transition: all 0.15s;
  align-items: flex-start;
}

.fb-question:hover {
  border-color: rgba(212, 114, 106, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.fb-question.active {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(212, 114, 106, 0.08);
}

.fb-question-drag {
  color: var(--text-secondary);
  opacity: 0.3;
  cursor: grab;
  font-size: 13px;
  margin-top: 4px;
  flex-shrink: 0;
}

.fb-question:hover .fb-question-drag { opacity: 0.6; }

.fb-question-type-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  background: rgba(124, 140, 245, 0.08);
  color: var(--periwinkle);
}

.fb-question-content {
  flex: 1;
  min-width: 0;
}

.fb-question-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  width: 100%;
  border: none;
  background: none;
  outline: none;
  font-family: inherit;
  padding: 0;
}

.fb-question-label::placeholder { color: var(--color-gray-200); }

.fb-question-type {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.fb-question-preview {
  margin-top: 8px;
}

.fb-question-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.fb-question-action {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.fb-question-action:hover {
  background: var(--row-alt);
  color: var(--text-primary);
}

/* Required toggle */
.fb-required-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
}

.fb-required-toggle.active {
  color: var(--coral);
}

/* Condition indicator */
.fb-condition-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(228, 168, 83, 0.1);
  color: var(--amber);
  font-size: 10px;
  font-weight: 600;
}

/* Add buttons */
.fb-add-question {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border: 1.5px dashed rgba(212, 114, 106, 0.25);
  border-radius: 10px;
  background: none;
  color: var(--coral);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
}

.fb-add-question:hover {
  border-color: var(--coral);
  background: var(--highlight);
}

.fb-add-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border: 2px dashed rgba(124, 140, 245, 0.2);
  border-radius: var(--radius-card);
  background: none;
  color: var(--periwinkle);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
}

.fb-add-section:hover {
  border-color: var(--periwinkle);
  background: rgba(124, 140, 245, 0.02);
}

/* Question type specific previews */
.fb-preview-choices {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fb-preview-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.fb-preview-radio {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--color-gray-200);
  flex-shrink: 0;
}

.fb-preview-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 2px solid var(--color-gray-200);
  flex-shrink: 0;
}

.fb-preview-scale {
  display: flex;
  gap: 6px;
}

.fb-preview-scale-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1.5px solid var(--card-border);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.fb-preview-scale-btn:hover,
.fb-preview-scale-btn.selected {
  border-color: var(--coral);
  color: var(--coral);
  background: var(--highlight);
}

.fb-preview-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.fb-preview-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--color-gray-100);
  appearance: none;
  outline: none;
}

.fb-preview-slider::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--coral);
  cursor: pointer;
}

/* Color palette */
.fb-preview-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fb-color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s;
}

.fb-color-swatch:hover {
  transform: scale(1.1);
}

.fb-color-swatch.selected {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--text-primary);
}

/* Grid question */
.fb-preview-grid {
  display: grid;
  gap: 1px;
  background: var(--card-border);
  border-radius: 8px;
  overflow: hidden;
}

.fb-grid-cell {
  background: var(--card);
  padding: 8px 12px;
  font-size: 12px;
  text-align: center;
}

.fb-grid-header {
  background: var(--row-alt);
  font-weight: 600;
  color: var(--text-secondary);
}

.fb-grid-row-label {
  text-align: left;
  font-weight: 500;
}

/* Client form fill */
.cf-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.cf-progress-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--color-gray-100);
  overflow: hidden;
}

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

.cf-progress-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.cf-section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.cf-section-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.cf-question {
  margin-bottom: 28px;
}

.cf-question-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.cf-question-label .required-star {
  color: var(--coral);
}

.cf-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--card-border);
}

/* Template list */
.form-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.form-template-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.form-template-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.form-template-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(124, 140, 245, 0.08);
  color: var(--periwinkle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
}

.form-template-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.form-template-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.form-template-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.form-template-meta i {
  font-size: 11px;
  opacity: 0.5;
  margin-right: 3px;
}

.form-template-kebab {
  position: absolute;
  top: 16px;
  right: 16px;
}

/* ========================================
   Air Datepicker — Coral Theme
   ======================================== */

.air-datepicker {
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important;
  border: 1px solid rgba(0,0,0,0.06) !important;
}
.air-datepicker-cell.-selected- {
  background: #d4726a !important;
}
.air-datepicker-cell.-current- {
  color: #d4726a !important;
}
.air-datepicker-cell.-focus- {
  background: #fff5f3 !important;
}
.air-datepicker-button {
  color: #d4726a !important;
}
.air-datepicker-nav--title {
  font-weight: 600 !important;
}

/* ========================================
   Form Templates Grid (forms.html)
   ======================================== */

.form-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.form-template-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.form-template-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.form-template-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(212, 114, 106, 0.1);
  color: var(--coral);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
}

.form-template-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-template-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.form-template-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

.form-template-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.form-template-meta i {
  font-size: 11px;
  color: var(--periwinkle);
}

.form-template-kebab {
  position: absolute;
  top: 16px;
  right: 16px;
}

/* ========================================
   Form Builder (fb-* classes)
   ======================================== */

.fb-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  margin-bottom: 20px;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-btn);
  background: var(--card);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
}

.toolbar-btn:hover {
  background: var(--highlight);
  border-color: var(--coral);
  color: var(--coral);
}

.toolbar-btn i {
  font-size: 12px;
}

.toolbar-separator {
  width: 1px;
  height: 24px;
  background: rgba(0,0,0,0.08);
  margin: 0 4px;
}

.fb-form-header {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.fb-form-title-input {
  width: 100%;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  background: transparent;
  margin-bottom: 8px;
}

.fb-form-title-input::placeholder {
  color: #c0c0c0;
}

.fb-form-desc-input {
  width: 100%;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-secondary);
  background: transparent;
  resize: none;
  line-height: 1.5;
}

.fb-form-desc-input::placeholder {
  color: #c0c0c0;
}

.fb-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 20px;
}

.fb-section {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  overflow: visible;
}

.fb-section-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.fb-section-drag {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c0c0c0;
  cursor: grab;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 2px;
}

.fb-section-drag:active {
  cursor: grabbing;
}

.fb-section-info {
  flex: 1;
  min-width: 0;
}

.fb-section-title-input {
  width: 100%;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  background: transparent;
  margin-bottom: 4px;
}

.fb-section-title-input::placeholder {
  color: #c0c0c0;
}

.fb-section-desc-input {
  width: 100%;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-secondary);
  background: transparent;
  resize: none;
}

.fb-section-desc-input::placeholder {
  color: #c0c0c0;
}

.fb-section-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.fb-questions {
  padding: 0 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fb-question {
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  padding: 16px;
  background: var(--row-alt);
  transition: all 0.15s;
  position: relative;
}

.fb-question:hover {
  border-color: rgba(0,0,0,0.1);
  background: #fff;
}

.fb-question.sortable-ghost {
  opacity: 0.4;
  background: var(--highlight);
  border-color: var(--coral);
}

.fb-question-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.fb-question-drag {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c0c0c0;
  cursor: grab;
  font-size: 11px;
  flex-shrink: 0;
}

.fb-question-drag:active {
  cursor: grabbing;
}

.fb-question-type-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(124, 140, 245, 0.1);
  color: var(--periwinkle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.fb-question-label-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  background: transparent;
}

.fb-question-label-input::placeholder {
  color: #c0c0c0;
}

.fb-question-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.fb-badge-required {
  font-size: 11px;
  font-weight: 600;
  color: var(--coral);
  background: rgba(212, 114, 106, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}

.fb-badge-required.off {
  color: var(--text-secondary);
  background: rgba(0,0,0,0.04);
}

.fb-badge-condition {
  font-size: 11px;
  font-weight: 500;
  color: var(--teal);
  background: rgba(106, 184, 149, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
}

.fb-question-kebab {
  position: relative;
  flex-shrink: 0;
}

.fb-question-preview {
  padding-top: 4px;
  margin-left: 58px;
}

/* Preview: short_text */
.fb-preview-input {
  width: 100%;
  max-width: 380px;
  padding: 8px 12px;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-secondary);
  background: #fff;
  pointer-events: none;
}

/* Preview: long_text */
.fb-preview-textarea {
  width: 100%;
  max-width: 500px;
  padding: 8px 12px;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-secondary);
  background: #fff;
  resize: none;
  pointer-events: none;
  min-height: 60px;
}

/* Preview: radio / checkbox options */
.fb-preview-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fb-preview-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.fb-preview-option i {
  font-size: 14px;
  color: var(--periwinkle);
}

/* Preview: scale */
.fb-preview-scale {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fb-preview-scale-label {
  font-size: 11px;
  color: var(--text-secondary);
}

.fb-preview-scale-btns {
  display: flex;
  gap: 4px;
}

.fb-preview-scale-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.1);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  pointer-events: none;
}

/* Preview: slider */
.fb-preview-slider {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 400px;
}

.fb-preview-slider-label {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.fb-preview-slider input[type="range"] {
  flex: 1;
  accent-color: var(--coral);
  pointer-events: none;
}

/* Preview: image upload dropzone */
.fb-preview-dropzone {
  width: 100%;
  max-width: 400px;
  padding: 24px;
  border: 2px dashed rgba(0,0,0,0.1);
  border-radius: 12px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  pointer-events: none;
}

.fb-preview-dropzone i {
  display: block;
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--periwinkle);
}

/* Preview: color palette */
.fb-preview-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fb-preview-color {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.06);
  cursor: default;
  transition: transform 0.15s;
}

/* Preview: grid table */
.fb-preview-grid {
  width: 100%;
  max-width: 500px;
  overflow-x: auto;
}

.fb-preview-grid table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.fb-preview-grid th {
  padding: 6px 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  background: rgba(0,0,0,0.02);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.fb-preview-grid td {
  padding: 6px 10px;
  text-align: center;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  color: var(--text-secondary);
}

.fb-preview-grid td:first-child,
.fb-preview-grid th:first-child {
  text-align: left;
  font-weight: 500;
  color: var(--text-primary);
}

.fb-preview-grid .grid-radio {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.15);
  display: inline-block;
}

/* Preview: dropdown */
.fb-preview-dropdown {
  max-width: 300px;
}

/* Add question inside section */
.fb-add-question {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  margin: 8px 0 8px;
  border: 1.5px dashed rgba(0,0,0,0.08);
  border-radius: 10px;
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.fb-add-question:hover {
  border-color: var(--coral);
  color: var(--coral);
  background: rgba(212, 114, 106, 0.04);
}

/* Add section button */
.fb-add-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border: 2px dashed rgba(0,0,0,0.08);
  border-radius: var(--radius-card);
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.fb-add-section:hover {
  border-color: var(--periwinkle);
  color: var(--periwinkle);
  background: rgba(124, 140, 245, 0.04);
}

/* Toast notification */
.fb-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--sidebar);
  color: #fff;
  padding: 12px 24px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.fb-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Type selector dropdown */
.fb-type-selector {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 220px;
  z-index: 300;
  border: 1px solid rgba(0,0,0,0.06);
  overflow: hidden;
  animation: modal-slide 0.12s ease;
}

.fb-type-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}

.fb-type-option:hover {
  background: var(--highlight);
}

.fb-type-option i {
  width: 16px;
  text-align: center;
  color: var(--periwinkle);
  font-size: 13px;
}

.fb-type-option.active {
  background: rgba(124, 140, 245, 0.08);
  color: var(--periwinkle);
}

@media (max-width: 768px) {
  .form-template-grid {
    grid-template-columns: 1fr;
  }
  .fb-question-preview {
    margin-left: 0;
    margin-top: 8px;
  }
  .fb-toolbar {
    flex-wrap: wrap;
  }
}

/* ============================================================================
   Archilist sticky toasts  (Archilist.toast helper in dashboard.js / app.js)
   Separate from `.form-alert` banners — those stay inline above a form; these
   float at the bottom-right of the viewport and auto-dismiss after ~4 seconds.
   ========================================================================= */
.al-toasts {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
  max-width: calc(100vw - 48px);
}
.al-toast {
  pointer-events: auto;
  min-width: 260px;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--card, #fff);
  color: var(--text-primary, #1f2937);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.14);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid var(--card-border, #e5e7eb);
  animation: al-toast-in 200ms ease-out;
}
.al-toast .icon   { font-size: 14px; flex-shrink: 0; }
.al-toast .msg    { flex: 1; line-height: 1.35; }
.al-toast .close  {
  background: none; border: none; cursor: pointer; color: inherit;
  opacity: 0.55; padding: 0 0 0 6px; line-height: 1; font-size: 13px;
}
.al-toast .close:hover { opacity: 1; }

.al-toast--success { border-left-color: #059669; color: #047857; }
.al-toast--error   { border-left-color: #e74c3c; color: #b1382e; }
.al-toast--info    { border-left-color: var(--periwinkle, #7c8cf5); color: #4c5ae0; }

.al-toast--leaving { animation: al-toast-out 180ms ease-in forwards; }

@keyframes al-toast-in  { from { opacity: 0; transform: translateY(12px); } to   { opacity: 1; transform: translateY(0); } }
@keyframes al-toast-out { from { opacity: 1; transform: translateY(0); }   to   { opacity: 0; transform: translateY(12px); } }

@media (max-width: 480px) {
  .al-toasts { left: 12px; right: 12px; bottom: 12px; }
  .al-toast  { min-width: 0; max-width: none; }
}

