/* ===================================================================
   PMG Client Manager - WGG Management Dashboard
   Dark theme matching client-facing dashboard
   Mobile-first responsive design
   =================================================================== */

/* -- Inherit base variables from main styles.css ------------------- */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-card: rgba(255, 255, 255, 0.08);
  --text-primary: #f0f0f5;
  --text-secondary: #9a9ab0;
  --text-muted: #65657a;
  --accent: #f97316;
  --accent-glow: rgba(249, 115, 22, 0.15);
  --accent-soft: rgba(249, 115, 22, 0.08);
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.1);
  --green-border: rgba(34, 197, 94, 0.25);
  --yellow: #eab308;
  --yellow-bg: rgba(234, 179, 8, 0.1);
  --yellow-border: rgba(234, 179, 8, 0.25);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.1);
  --red-border: rgba(239, 68, 68, 0.25);
  --blue: #3b82f6;
  --blue-bg: rgba(59, 130, 246, 0.1);
  --blue-border: rgba(59, 130, 246, 0.25);
  --purple: #a855f7;
  --purple-bg: rgba(168, 85, 247, 0.1);
  --purple-border: rgba(168, 85, 247, 0.25);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.15);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.2);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sidebar-width: 260px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ================================================================== */
/* LOGIN OVERLAY                                                       */
/* ================================================================== */

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
}

.login-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.login-logo {
  height: 36px;
  width: auto;
  margin-bottom: 1.5rem;
  opacity: 0.9;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.login-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(249, 115, 22, 0.2);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.login-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.login-input {
  background: var(--bg-primary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-family: var(--font);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}

.login-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.login-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
}

.login-btn:hover {
  background: #ea6c0a;
  transform: translateY(-1px);
}

.login-btn:active {
  transform: translateY(0);
}

.login-error {
  color: var(--red);
  font-size: 0.8125rem;
  margin-top: 0.75rem;
}

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

.admin-app {
  display: flex;
  min-height: 100vh;
}

/* -- Sidebar ------------------------------------------------------- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo {
  height: 28px;
  width: auto;
  opacity: 0.9;
  display: block;
  margin-bottom: 0.625rem;
}

.sidebar-label {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(249, 115, 22, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
}

.sidebar-section-label {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.75rem 1.25rem 0.375rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 1.25rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}

.sidebar-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-item.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.sidebar-item-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-item-badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.125rem 0.375rem;
  border-radius: 999px;
}

.sidebar-item.active .sidebar-item-badge {
  background: rgba(249, 115, 22, 0.15);
  color: var(--accent);
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
}

.sidebar-username {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.sidebar-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: flex;
  align-items: center;
}

.sidebar-logout:hover {
  color: var(--red);
  background: var(--red-bg);
}

/* Mobile hamburger */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 60;
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.mobile-menu-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 40;
}

/* -- Main Content -------------------------------------------------- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* -- Top Header Bar ------------------------------------------------ */
.top-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 30;
}

.top-bar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.top-bar-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  text-decoration: none;
}

.top-bar-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.top-bar-btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.top-bar-btn--primary:hover {
  background: #ea6c0a;
  border-color: #ea6c0a;
  color: #fff;
}

/* -- Week Selector ------------------------------------------------- */
.week-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.week-select {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-family: var(--font);
  padding: 0.375rem 0.75rem;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
  -webkit-appearance: none;
  appearance: none;
  padding-right: 1.75rem;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239a9ab0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
}

.week-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* ================================================================== */
/* CONTENT PANELS                                                      */
/* ================================================================== */

.content-area {
  flex: 1;
  padding: 1.5rem;
}

.panel {
  display: none;
  animation: panelFadeIn 0.3s ease;
}

.panel.active {
  display: block;
}

@keyframes panelFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* -- Summary Stats Row --------------------------------------------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

.stat-card-number {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-card-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card--green .stat-card-number { color: var(--green); }
.stat-card--yellow .stat-card-number { color: var(--yellow); }
.stat-card--red .stat-card-number { color: var(--red); }
.stat-card--blue .stat-card-number { color: var(--blue); }

/* ================================================================== */
/* ALL CLIENTS TABLE                                                   */
/* ================================================================== */

.clients-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.clients-table thead {
  background: rgba(255, 255, 255, 0.03);
}

.clients-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
}

.clients-table td {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

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

.clients-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

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

.client-row-members {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  color: var(--text-secondary);
}

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

.status-summary {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
}

.status-pill--progress {
  background: var(--yellow-bg);
  color: var(--yellow);
  border: 1px solid var(--yellow-border);
}

.status-pill--completed {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}

.status-pill--not-started {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.action-btns {
  display: flex;
  gap: 0.375rem;
}

.action-btn {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 0.25rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.action-btn--view {
  color: var(--blue);
}

.action-btn--view:hover {
  border-color: var(--blue);
  background: var(--blue-bg);
}

.action-btn--share {
  color: var(--green);
}

.action-btn--share:hover {
  border-color: var(--green);
  background: var(--green-bg);
}

/* ================================================================== */
/* CLIENT DETAIL VIEW                                                  */
/* ================================================================== */

.client-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.client-detail-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
}

.client-detail-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* -- View Mode Toggle --------------------------------------------- */
.view-mode-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  width: fit-content;
}

.view-mode-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-mode-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}

.view-mode-btn.active {
  background: var(--accent);
  color: #fff;
}

/* -- Portal View Container ---------------------------------------- */
.portal-view-container {
  background: var(--bg-primary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 600px;
}

.portal-iframe {
  width: 100%;
  height: calc(100vh - 200px);
  min-height: 600px;
  border: none;
  background: var(--bg-primary);
}

/* -- Edit View Container ------------------------------------------ */
.edit-view-container {
  /* wrapper for existing detail tabs + tab contents */
}

/* -- Tab Bar for Goals/Updates/Achievements ------------------------ */
.detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.detail-tabs::-webkit-scrollbar { display: none; }

.detail-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.625rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--font);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

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

.detail-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.detail-tab-content {
  display: none;
}

.detail-tab-content.active {
  display: block;
  animation: panelFadeIn 0.25s ease;
}

/* ================================================================== */
/* EDITABLE GOALS TABLE                                                */
/* ================================================================== */

.goals-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1rem;
}

.goals-table thead {
  background: rgba(255, 255, 255, 0.03);
}

.goals-table th {
  text-align: left;
  padding: 0.625rem 0.75rem;
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
}

.goals-table td {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

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

.goals-table tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

/* Editable fields */
.editable-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.375rem;
  font-size: 0.8125rem;
  font-family: var(--font);
  color: var(--text-primary);
  width: 100%;
  outline: none;
  transition: all var(--transition);
}

.editable-input:hover {
  border-color: var(--border-card);
}

.editable-input:focus {
  border-color: var(--accent);
  background: var(--bg-primary);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.editable-textarea {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.375rem;
  font-size: 0.8125rem;
  font-family: var(--font);
  color: var(--text-primary);
  width: 100%;
  outline: none;
  resize: vertical;
  min-height: 2rem;
  line-height: 1.5;
  transition: all var(--transition);
}

.editable-textarea:hover {
  border-color: var(--border-card);
}

.editable-textarea:focus {
  border-color: var(--accent);
  background: var(--bg-primary);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.editable-select {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.375rem;
  font-size: 0.8125rem;
  font-family: var(--font);
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  transition: all var(--transition);
  -webkit-appearance: none;
  appearance: none;
  padding-right: 1.25rem;
  background-image: url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 8 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l3 3 3-3' stroke='%239a9ab0' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.25rem center;
}

.editable-select:hover {
  border-color: var(--border-card);
}

.editable-select:focus {
  border-color: var(--accent);
  background-color: var(--bg-primary);
}

/* Delete row button */
.row-delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}

.goals-table tr:hover .row-delete-btn {
  opacity: 1;
}

.row-delete-btn:hover {
  color: var(--red);
  background: var(--red-bg);
}

/* -- Add Buttons --------------------------------------------------- */
.add-row-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: none;
  border: 1px dashed var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--font);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
  justify-content: center;
}

.add-row-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* ================================================================== */
/* CLIENT TASKS SECTION                                                */
/* ================================================================== */

.client-tasks-admin {
  background: var(--bg-card);
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.client-tasks-admin-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.client-tasks-admin-title svg {
  color: var(--accent);
  flex-shrink: 0;
}

.ct-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.ct-text {
  flex: 1;
}

.ct-status {
  flex-shrink: 0;
  width: 130px;
}

.ct-delete {
  flex-shrink: 0;
}

/* ================================================================== */
/* SAVE / EXPORT BAR                                                   */
/* ================================================================== */

.save-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  z-index: 20;
}

.save-bar.hidden {
  display: none;
}

.save-bar-status {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.save-bar-status .unsaved-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--yellow);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.save-bar-actions {
  display: flex;
  gap: 0.5rem;
}

.save-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.save-btn:hover {
  background: #ea6c0a;
}

.save-btn--primary {
  background: #22c55e;
  font-weight: 700;
}

.save-btn--primary:hover {
  background: #16a34a;
}

.save-btn--primary:disabled {
  background: #6b7280;
  cursor: not-allowed;
  opacity: 0.7;
}

.save-btn--saving {
  background: #3b82f6;
  pointer-events: none;
}

.export-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.export-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

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

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.visible {
  display: flex;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  max-width: 700px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

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

.modal-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: flex;
}

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

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
}

.modal-json {
  background: var(--bg-primary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 50vh;
  overflow-y: auto;
  line-height: 1.6;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

/* ================================================================== */
/* EMPTY STATE                                                         */
/* ================================================================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
  text-align: center;
  gap: 0.75rem;
}

.empty-state svg {
  opacity: 0.3;
}

.empty-state p {
  font-size: 0.875rem;
}

/* ================================================================== */
/* TOAST NOTIFICATION                                                  */
/* ================================================================== */

.toast {
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  font-size: 0.8125rem;
  color: var(--text-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast--success {
  border-color: var(--green-border);
}

.toast--error {
  border-color: var(--red-border);
}

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

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

  .clients-table th:nth-child(4),
  .clients-table td:nth-child(4) {
    display: none;
  }
}

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

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

  .sidebar-overlay.visible {
    display: block;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .main-content {
    margin-left: 0;
  }

  .top-bar {
    padding-left: 3.5rem;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-area {
    padding: 1rem;
  }

  .clients-table {
    font-size: 0.8125rem;
  }

  .clients-table th:nth-child(2),
  .clients-table td:nth-child(2) {
    display: none;
  }

  .clients-table th:nth-child(4),
  .clients-table td:nth-child(4) {
    display: none;
  }

  .client-detail-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .goals-table th:nth-child(5),
  .goals-table td:nth-child(5) {
    display: none;
  }

  .goals-table th:nth-child(6),
  .goals-table td:nth-child(6) {
    display: none;
  }

  .save-bar {
    flex-direction: column;
    gap: 0.5rem;
  }

  .save-bar-actions {
    width: 100%;
  }

  .save-btn, .export-btn {
    flex: 1;
    justify-content: center;
  }

  .login-card {
    padding: 2rem 1.5rem;
  }
}

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

  .stats-row .stat-card:last-child {
    grid-column: span 2;
  }

  .top-bar-title {
    font-size: 0.875rem;
  }

  .detail-tab {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }

  .ct-row {
    flex-direction: column;
  }

  .ct-status {
    width: 100%;
  }
}

/* ================================================================== */
/* SCOREBOARD                                                          */
/* ================================================================== */

/* -- Scoreboard Tabs ---------------------------------------------- */
.sb-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
}

.sb-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

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

.sb-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.sb-tab-content {
  display: none;
  animation: panelFadeIn 0.25s ease;
}

.sb-tab-content.active {
  display: block;
}

/* -- Summary Bar -------------------------------------------------- */
.sb-summary-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.sb-summary-stat {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sb-summary-number {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.sb-summary-number--accent { color: var(--accent); }
.sb-summary-number--green { color: var(--green); }
.sb-summary-number--yellow { color: var(--yellow); }
.sb-summary-number--red { color: var(--red); }
.sb-summary-number--blue { color: var(--blue); }

.sb-summary-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* -- Scoreboard Table --------------------------------------------- */
.sb-table-wrap {
  overflow-x: auto;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-card);
}

.sb-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
}

.sb-table thead {
  background: rgba(255, 255, 255, 0.03);
}

.sb-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.sb-table td {
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

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

.sb-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.sb-table .sb-client-name {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.sb-table .sb-num {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* -- Status Badges ------------------------------------------------ */
.sb-status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  white-space: nowrap;
}

.sb-status--on-track {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}

.sb-status--needs-attention {
  background: var(--yellow-bg);
  color: var(--yellow);
  border: 1px solid var(--yellow-border);
}

.sb-status--behind {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red-border);
}

.sb-status--complete {
  background: var(--blue-bg);
  color: var(--blue);
  border: 1px solid var(--blue-border);
}

/* -- Status dot (inline) ------------------------------------------ */
.sb-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sb-status--on-track .sb-status-dot { background: var(--green); }
.sb-status--needs-attention .sb-status-dot { background: var(--yellow); }
.sb-status--behind .sb-status-dot { background: var(--red); }
.sb-status--complete .sb-status-dot { background: var(--blue); }

/* -- Team Tracker Submission Badges ------------------------------- */
.sb-submission {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
}

.sb-submission--submitted {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}

.sb-submission--missing {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red-border);
}

.sb-submission--pending {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.sb-submission-icon {
  width: 12px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* -- Team member client chips ------------------------------------- */
.sb-client-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.sb-client-chip {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.125rem 0.5rem;
  font-size: 0.625rem;
  color: var(--text-secondary);
}

/* -- Team member name with avatar dot ----------------------------- */
.sb-member-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

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

.sb-member-label {
  font-weight: 600;
  color: var(--text-primary);
}

/* -- Action Buttons in scoreboard --------------------------------- */
.sb-actions {
  display: flex;
  gap: 0.375rem;
}

/* -- Info Note ---------------------------------------------------- */
.sb-note {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.sb-note svg {
  color: var(--blue);
  flex-shrink: 0;
  margin-top: 0.125rem;
}

/* -- Scoreboard Responsive ---------------------------------------- */
@media (max-width: 1024px) {
  .sb-summary-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .sb-table th:nth-child(6),
  .sb-table td:nth-child(6) {
    display: none;
  }
}

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

  .sb-table th:nth-child(3),
  .sb-table td:nth-child(3),
  .sb-table th:nth-child(4),
  .sb-table td:nth-child(4),
  .sb-table th:nth-child(5),
  .sb-table td:nth-child(5),
  .sb-table th:nth-child(6),
  .sb-table td:nth-child(6) {
    display: none;
  }

  .sb-tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sb-tabs::-webkit-scrollbar { display: none; }

  .sb-tab {
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
  }

  /* Team tracker: hide Clients Assigned on small screens */
  .sb-table--team th:nth-child(2),
  .sb-table--team td:nth-child(2) {
    display: none;
  }
}

@media (max-width: 480px) {
  .sb-summary-bar {
    grid-template-columns: 1fr 1fr;
  }

  .sb-summary-stat {
    padding: 0.75rem;
  }

  .sb-summary-number {
    font-size: 1.375rem;
  }
}

/* ================================================================== */
/* TASK SHEET                                                          */
/* ================================================================== */

/* -- Filter Bar --------------------------------------------------- */
.ts-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
}

.ts-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 160px;
}

.ts-filter-label {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ts-filter-select {
  background: var(--bg-primary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-family: var(--font);
  padding: 0.375rem 1.75rem 0.375rem 0.625rem;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239a9ab0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
}

.ts-filter-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.ts-row-count {
  margin-left: auto;
  display: flex;
  align-items: flex-end;
  min-width: auto;
}

.ts-count-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* -- Task Sheet Table --------------------------------------------- */
.ts-table-wrap {
  overflow-x: auto;
}

.ts-table td {
  vertical-align: top;
}

/* Sortable header styles */
.ts-sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 1.25rem !important;
}

.ts-sortable:hover {
  color: var(--text-primary);
}

.ts-sortable::after {
  content: '';
  position: absolute;
  right: 0.375rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 4px solid var(--text-muted);
  opacity: 0.3;
  transition: opacity var(--transition), transform var(--transition);
}

.ts-sortable.ts-sort-asc::after {
  border-top: none;
  border-bottom: 4px solid var(--accent);
  opacity: 1;
}

.ts-sortable.ts-sort-desc::after {
  border-top: 4px solid var(--accent);
  opacity: 1;
}

/* Goal list in cells */
.ts-goal-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ts-goal-list li {
  position: relative;
  padding-left: 0.75rem;
  padding-top: 0.125rem;
  padding-bottom: 0.125rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

.ts-goal-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
}

.ts-goal-list li + li {
  border-top: 1px solid var(--border-subtle);
}

.ts-goals-cell {
  min-width: 220px;
  max-width: 350px;
}

.ts-update-cell {
  min-width: 180px;
  max-width: 300px;
}

.ts-empty {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* -- Status Badges ------------------------------------------------ */
.ts-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  white-space: nowrap;
}

.ts-status--completed {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}

.ts-status--progress {
  background: var(--yellow-bg);
  color: var(--yellow);
  border: 1px solid var(--yellow-border);
}

.ts-status--review {
  background: var(--blue-bg);
  color: var(--blue);
  border: 1px solid var(--blue-border);
}

.ts-status--new {
  background: var(--purple-bg);
  color: var(--purple);
  border: 1px solid var(--purple-border);
}

.ts-status--not-started {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

/* -- Priority Badges ---------------------------------------------- */
.ts-priority-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  white-space: nowrap;
}

.ts-priority--high {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red-border);
}

.ts-priority--normal {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

/* -- Task Sheet Responsive ---------------------------------------- */
@media (max-width: 1024px) {
  .ts-update-cell {
    min-width: 150px;
  }

  .ts-goals-cell {
    min-width: 180px;
  }
}

@media (max-width: 768px) {
  .ts-filters {
    flex-direction: column;
    gap: 0.5rem;
  }

  .ts-filter-group {
    min-width: 100%;
  }

  .ts-row-count {
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  .ts-filters {
    padding: 0.75rem;
  }
}

/* -- Client Feedback View ----------------------------------------- */
.feedback-view-container {
  padding: 1.5rem;
}
.feedback-section {
  margin-bottom: 1.5rem;
}
.feedback-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}
.feedback-section-title svg {
  color: var(--accent);
  flex-shrink: 0;
}
.feedback-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.feedback-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 1rem;
  text-align: center;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px dashed var(--border-subtle);
}
.feedback-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}
.feedback-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.375rem;
}
.feedback-card-author {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent);
}
.feedback-card-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.feedback-card-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.feedback-card-context {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-style: italic;
}
.approval-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  font-size: 0.85rem;
}
.approval-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.approval-badge--approved {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}
.approval-badge--pending {
  background: rgba(250, 204, 21, 0.15);
  color: #facc15;
}
.approval-item-text {
  color: var(--text-secondary);
  flex: 1;
}
.approval-item-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
}
.approval-item-status--approved {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}
.approval-item-status--pending {
  background: rgba(250, 204, 21, 0.12);
  color: #facc15;
}

/* -- Feedback Panel (all clients view) ----------------------------- */
.feedback-panel-header {
  padding: 1.5rem 1.5rem 1rem;
}
.feedback-panel-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.feedback-panel-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0;
}
.feedback-all-clients {
  padding: 0 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.feedback-client-block {
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}
.feedback-client-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}
.feedback-client-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0;
}
.feedback-client-link {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  transition: all 0.15s;
}
.feedback-client-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.feedback-sub-section {
  margin-top: 0.5rem;
}
.feedback-sub-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
}

/* ================================================================== */
/* CREATIVE BRIEF VIEW                                                 */
/* ================================================================== */

.creative-brief-view-container {
  padding: 1.5rem;
  max-width: 820px;
}

.cb-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.cb-link {
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.875rem;
  transition: all var(--transition);
}

.cb-link:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.cb-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.cb-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card-hover);
  border-bottom: 1px solid var(--border-subtle);
}

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

.cb-card-submitted {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.cb-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  padding: 1.25rem 1.5rem;
}

.cb-field--full {
  grid-column: 1 / -1;
}

.cb-field-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.cb-field-value {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.cb-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.cb-tag {
  display: inline-flex;
  align-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.625rem;
}

.cb-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.cb-changes-section {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.cb-changes-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.cb-feedback-textarea {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-family: var(--font);
  color: var(--text-primary);
  line-height: 1.5;
  resize: vertical;
  min-height: 80px;
  outline: none;
  transition: border-color var(--transition);
  margin-bottom: 0.75rem;
}

.cb-feedback-textarea::placeholder {
  color: var(--text-muted);
}

.cb-feedback-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.cb-regen-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.cb-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.cb-btn--primary {
  background: #FF6600;
  color: #fff;
}

.cb-btn--primary:hover {
  background: #e05a00;
  transform: translateY(-1px);
}

.cb-btn--primary:active {
  transform: translateY(0);
}

.cb-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.cb-status-msg {
  font-size: 0.825rem;
  line-height: 1.4;
  padding: 0.45rem 0.875rem;
  border-radius: var(--radius-sm);
}

.cb-status-msg--loading {
  background: var(--yellow-bg);
  color: var(--yellow);
  border: 1px solid var(--yellow-border);
}

.cb-status-msg--success {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}

.cb-status-msg--info {
  background: var(--blue-bg);
  color: var(--blue);
  border: 1px solid var(--blue-border);
}

@media (max-width: 600px) {
  .creative-brief-view-container {
    padding: 1rem;
  }

  .cb-card-header {
    padding: 1rem;
    flex-direction: column;
    gap: 0.25rem;
  }

  .cb-fields {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .cb-actions {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .cb-changes-section {
    padding: 1rem;
  }
}

/* ================================================================
   CHAT WITH LYRA PANEL
   ================================================================ */

.chat-panel-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 720px;
}

.chat-history {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  min-height: 200px;
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 2rem 0;
}

.chat-message {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.chat-message.chat-msg-sent {
  border-left: 3px solid var(--purple);
}

.chat-message.chat-msg-failed {
  border-left: 3px solid var(--red);
  opacity: 0.7;
}

.chat-message.chat-msg-sending {
  border-left: 3px solid var(--yellow);
  opacity: 0.8;
}

.chat-message-text {
  font-size: 0.92rem;
  color: var(--text-primary);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-message-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chat-msg-status-icon {
  font-size: 0.8rem;
}

.chat-msg-sent .chat-msg-status-icon { color: var(--green); }
.chat-msg-failed .chat-msg-status-icon { color: var(--red); }
.chat-msg-sending .chat-msg-status-icon { color: var(--yellow); }

.chat-compose {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-input {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.92rem;
  padding: 0.75rem 1rem;
  resize: vertical;
  width: 100%;
  line-height: 1.55;
  transition: border-color var(--transition);
}

.chat-input:focus {
  outline: none;
  border-color: var(--purple);
}

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

.chat-compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.chat-send-btn {
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: opacity var(--transition), background var(--transition);
  flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
  opacity: 0.85;
}

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

.chat-status {
  font-size: 0.85rem;
  font-weight: 500;
  flex: 1;
}

.chat-status--success {
  color: var(--green);
}

.chat-status--error {
  color: var(--red);
}

@media (max-width: 600px) {
  .chat-compose-footer {
    flex-direction: column-reverse;
    align-items: flex-start;
  }

  .chat-send-btn {
    width: 100%;
    justify-content: center;
  }
}
