/* 
  Velo Deliverables Portal - Premium Tabular Design System (Vanilla CSS)
  Inspired by Linear, Vercel, and Stripe.
*/

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

:root {
  /* Common System Settings */
  --font-sans: "Euclid Circular B", "Circular", "Circular Std", "Plus Jakarta Sans", "Inter", "Inter Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Euclid Circular B", "Circular", "Circular Std", "Plus Jakarta Sans", "Inter", "Inter Fallback", var(--font-sans);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);

  /* Light Theme Variables */
  --bg-app: #F2FAF7;
  --bg-card: #ffffff;
  --bg-card-hover: #F9FAFB;
  --bg-surface: #e2e8f0;
  --bg-input: #ffffff;
  
  --border-color: #E5EAF2;
  --border-color-hover: #cbd5e1;
  
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  
  --color-brand: #6366f1;
  --color-brand-glow: rgba(99, 102, 241, 0.1);
  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.06);
  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.06);
  --color-danger: #ef4444;
  --color-danger-bg: rgba(239, 68, 68, 0.06);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.03), 0 4px 6px -2px rgba(0, 0, 0, 0.01);
  --shadow-premium: 0 12px 40px rgba(16, 24, 40, 0.08);
  
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.04);
  --bg-app-glow: #e0e7ff;
  --bg-grid: linear-gradient(to right, rgba(0, 0, 0, 0.012) 1px, transparent 1px), linear-gradient(to bottom, rgba(0, 0, 0, 0.012) 1px, transparent 1px);
}

[data-theme="dark"] {
  /* Dark Theme Variables */
  --bg-app-glow: #1e1b4b;
  --bg-app: #09090b;
  --bg-card: #121215;
  --bg-card-hover: #16161a;
  --bg-surface: #18181b;
  --bg-input: #1c1c20;
  
  --border-color: rgba(255, 255, 255, 0.06);
  --border-color-hover: rgba(255, 255, 255, 0.12);
  
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;
  
  --color-brand: #818cf8;
  --color-brand-glow: rgba(129, 140, 248, 0.25);
  --color-success: #34d399;
  --color-success-bg: rgba(52, 211, 153, 0.1);
  --color-warning: #fbbf24;
  --color-warning-bg: rgba(251, 191, 36, 0.1);
  --color-danger: #f87171;
  --color-danger-bg: rgba(248, 113, 113, 0.1);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  
  --glass-bg: rgba(18, 18, 21, 0.7);
  --glass-border: rgba(255, 255, 255, 0.06);
  --bg-grid: linear-gradient(to right, rgba(255, 255, 255, 0.008) 1px, transparent 1px), linear-gradient(to bottom, rgba(255, 255, 255, 0.008) 1px, transparent 1px);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  background-image: var(--bg-grid);
  background-size: 40px 40px;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a {
  text-decoration: none;
  color: var(--color-brand);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color-hover);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Header Navigation Bar */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 64px;
  background-color: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--color-brand), #4f46e5);
  color: #ffffff;
  border-radius: 8px;
  font-weight: 700;
  font-family: var(--font-display);
  box-shadow: 0 0 12px var(--color-brand-glow);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.brand-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
  background: var(--border-color);
  color: var(--text-secondary);
}

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

/* Button & Controls */
.icon-btn {
  background: none;
  border: 1px solid var(--border-color);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-color-hover);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 16px;
  border-left: 1px solid var(--border-color);
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.user-profile:hover {
  opacity: 0.85;
}

#adminControlDrawer {
  width: 440px;
  right: -440px;
}

#adminControlDrawer.active {
  right: 0;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--color-brand);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Dashboard Centered Layout Container */
.dashboard-container {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
}

.dashboard-title-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dashboard-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.dashboard-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
}



/* Premium Tabular deliverables grid */
.table-wrapper {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.04), 0 2px 4px -2px rgba(0, 0, 0, 0.02), 0 0 0 1px rgba(0, 0, 0, 0.015);
  overflow: hidden;
}

[data-theme="dark"] .table-wrapper {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.table-header-toolbar {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.table-toolbar-title {
  font-weight: 600;
  font-size: 0.9rem;
}

/* Tabs for Filtering inside the table card */
.table-filters {
  display: flex;
  gap: 6px;
  background-color: var(--bg-surface);
  padding: 2px;
  border-radius: var(--radius-md);
}

.table-filter-btn {
  background: none;
  border: none;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.table-filter-btn.active {
  background-color: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Grid Table Styling */
.dashboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.dashboard-table th {
  padding: 11px 12px;
  font-weight: 700;
  font-size: 0.70rem;
  text-transform: none;
  letter-spacing: normal;
  color: #344054;
  text-align: left;
  border-bottom: 1px solid #EAECF0;
  background-color: #F8FAFC;
}

[data-theme="dark"] .dashboard-table th {
  background-color: #1a1a1f;
  color: #e2e8f0;
}

.table-row {
  transition: background-color var(--transition-normal);
  cursor: pointer;
}

.table-row:hover {
  background-color: var(--bg-card-hover);
}

.table-row td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  font-size: 0.66rem;
  font-weight: 500;
  color: var(--text-primary);
}

.dashboard-table th:not(:last-child),
.table-row td:not(:last-child) {
  border-right: 1px solid rgba(0, 0, 0, 0.035);
}

[data-theme="dark"] .dashboard-table th:not(:last-child),
[data-theme="dark"] .table-row td:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.025);
}

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

.del-info-col {
  display: flex;
  align-items: center;
  gap: 10px;
}

.del-file-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  transition: transform var(--transition-fast);
}

.del-file-icon.pdf {
  color: #ea4335;
}
.del-file-icon.video {
  color: #a78bfa;
}
.del-file-icon.sheets {
  color: #0f9d58;
}
.del-file-icon.docs {
  color: #4285f4;
}
.del-file-icon.image {
  color: #ec4899;
}

.table-row:hover .del-file-icon {
  transform: scale(1.1);
}

.del-info-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.del-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  white-space: normal;
  max-width: 100%;
}

.del-desc-preview {
  font-size: 0.8rem;
  color: var(--text-secondary);
  max-width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.version-pill {
  font-family: monospace;
  font-size: 0.625rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.date-text {
  font-size: 0.655rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Badge styles */
.status-badge {
  font-size: 0.53rem;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 20px;
  text-transform: capitalize;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

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

.status-badge.pending_review {
  background-color: var(--color-warning-bg);
  color: var(--color-warning);
}
.status-badge.pending_review::before {
  background-color: var(--color-warning);
}

.status-badge.approved {
  background-color: var(--color-success-bg);
  color: var(--color-success);
}
.status-badge.approved::before {
  background-color: var(--color-success);
}

.status-badge.changes_requested {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
}
.status-badge.changes_requested::before {
  background-color: var(--color-danger);
}

.status-badge.rejected {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
}
.status-badge.rejected::before {
  background-color: var(--color-danger);
}

/* Actions cell buttons */
.row-actions-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-row-action {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.btn-row-action:hover {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-color-hover);
}

.btn-row-action.approve-check:hover {
  background-color: var(--color-success-bg);
  border-color: var(--color-success);
  color: var(--color-success);
}

.btn-row-action.changes-edit:hover {
  background-color: var(--color-warning-bg);
  border-color: var(--color-warning);
  color: var(--color-warning);
}

.btn-row-action.comments-chat {
  position: relative;
  background-color: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  width: auto !important;
  padding: 0 12px !important;
}

.btn-row-action.comments-chat:hover {
  background-color: #f1f5f9;
  color: #1e293b;
  border-color: #cbd5e1;
}

.btn-row-action.admin-upload-version {
  background-color: #F2F4F7;
  color: #344054;
  border: none;
}

.btn-row-action.admin-upload-version:hover {
  background-color: #eaecf0;
  color: #1d2939;
}

.btn-row-action.btn-download-action {
  background-color: #F2F4F7;
  color: #344054;
  border: none;
}

.btn-row-action.btn-download-action:hover {
  background-color: #eaecf0;
  color: #1d2939;
}

.btn-row-action.admin-delete-deliverable {
  background-color: #FEF3F2;
  color: #D92D20;
  border: none;
}

.btn-row-action.admin-delete-deliverable:hover {
  background-color: #fee4e2;
  color: #b42318;
}

[data-theme="dark"] .btn-row-action.comments-chat {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .btn-row-action.comments-chat:hover {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-color);
}


[data-theme="dark"] .btn-row-action.admin-upload-version,
[data-theme="dark"] .btn-row-action.btn-download-action {
  background-color: rgba(255, 255, 255, 0.06);
  color: #e4e4e7;
}
[data-theme="dark"] .btn-row-action.admin-upload-version:hover,
[data-theme="dark"] .btn-row-action.btn-download-action:hover {
  background-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .btn-row-action.admin-delete-deliverable {
  background-color: rgba(217, 45, 32, 0.15);
  color: #f87171;
}
[data-theme="dark"] .btn-row-action.admin-delete-deliverable:hover {
  background-color: rgba(217, 45, 32, 0.25);
}

.comments-count-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  font-size: 0.65rem;
  background-color: var(--color-brand);
  color: #ffffff;
  padding: 1px 5px;
  border-radius: 8px;
  font-weight: 700;
  border: 1.5px solid var(--bg-card);
}

/* Sliding Side Drawer Styles */
.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2400;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.side-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 600px;
  background-color: var(--bg-card);
  border-left: 1px solid var(--border-color);
  box-shadow: var(--shadow-premium);
  z-index: 2500;
  transform: translateX(100%);
  transition: transform var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.side-drawer.active {
  transform: translateX(0);
}

.drawer-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.drawer-title-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.drawer-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.drawer-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.drawer-close-btn {
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: 50%;
  transition: background-color var(--transition-fast);
}

.drawer-close-btn:hover {
  background-color: var(--bg-surface);
  color: var(--text-primary);
}

.drawer-close-btn svg {
  width: 18px;
  height: 18px;
}

.drawer-body {
  flex: 1;
  overflow: hidden;
  padding: 0 24px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* File Viewer inside Drawer */
.preview-card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.preview-toolbar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  background-color: var(--bg-card);
}

.file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.file-info svg {
  width: 18px;
  height: 18px;
  color: var(--color-brand);
}

.file-size {
  color: var(--text-secondary);
  font-size: 0.72rem;
}

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

.btn-secondary {
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 16px;
  font-size: 0.78rem;
  font-weight: 550;
  border-radius: var(--radius-md);
  cursor: pointer;
  height: 36px;
  box-sizing: border-box;
  transition: all var(--transition-fast);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--color-brand), #4f46e5);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #ffffff;
  padding: 8px 16px;
  font-size: 0.78rem;
  font-weight: 550;
  border-radius: var(--radius-md);
  cursor: pointer;
  height: 36px;
  box-sizing: border-box;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--color-brand-glow);
}

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

.btn-secondary:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-color-hover);
}

.btn-secondary svg {
  width: 14px;
  height: 14px;
}

.preview-viewport {
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-surface);
  position: relative;
  overflow: hidden;
}

.preview-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: var(--shadow-md);
  border-radius: 4px;
}

.preview-video {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* Split Compare Mode for Drawer */
.comparison-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 8px;
  box-sizing: border-box;
}

.comparison-pane {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.comparison-header {
  padding: 6px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface);
  display: flex;
  justify-content: space-between;
}

/* Version notes block */
.version-notes-card {
  padding: 16px;
  background-color: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notes-title {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.notes-body {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-primary);
}

/* Discussion Pane */
.discussion-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 8px;
  flex: 1;
  overflow: hidden;
}

.discussion-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 !important;
}

.tabs-header {
  display: flex;
  border-bottom: 1px solid var(--border-color);
}

.tab-btn {
  background: none;
  border: none;
  padding: 10px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
}

.tab-btn.active {
  color: var(--color-brand);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--color-brand);
}

.tab-content {
  display: none;
  padding-top: 16px;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow: hidden;
}

/* Slack-like Comment Feed */
.comments-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.comment-bubble {
  display: flex;
  gap: 10px;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.comment-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.comment-author-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.comment-author {
  font-size: 0.8rem;
  font-weight: 600;
}

.comment-time {
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.comment-badge {
  font-size: 0.6rem;
  background: var(--bg-surface);
  color: var(--text-secondary);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: monospace;
}

.comment-text {
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text-primary);
  white-space: pre-wrap;
}

/* Reply Thread Style */
.reply-thread {
  margin-top: 8px;
  padding-left: 10px;
  border-left: 1.5px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reply-item {
  display: flex;
  gap: 8px;
}

.reply-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.reply-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.reply-author {
  font-size: 0.75rem;
  font-weight: 600;
}

.reply-time {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.reply-text {
  font-size: 0.78rem;
  line-height: 1.35;
}

/* System Action Node in Comment Feed */
.system-note {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  line-height: 1.3;
  border-left: 3px solid;
}

.system-note.approved {
  background-color: var(--color-success-bg);
  border-color: var(--color-success);
  color: var(--color-success);
}

.system-note.changes_requested {
  background-color: var(--color-warning-bg);
  border-color: var(--color-warning);
  color: var(--color-warning);
}

.system-note.rejected {
  background-color: var(--color-danger-bg);
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.system-note svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* Reply Action Button triggers local input */
.reply-trigger {
  background: none;
  border: none;
  color: var(--color-brand);
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  padding: 1px 0;
  width: max-content;
}

.reply-input-box {
  margin-top: 6px;
  display: flex;
  gap: 6px;
}

/* Comment Input Area */
.comment-composer {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.composer-input-container {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 6px 10px;
}

.composer-input-container:focus-within {
  border-color: var(--color-brand);
}

.composer-textarea {
  flex: 1;
  border: none;
  background: none;
  resize: none;
  font-size: 0.82rem;
  max-height: 80px;
  min-height: 20px;
  padding: 0;
  outline: none;
  color: var(--text-primary);
}

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

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.btn-send {
  background-color: var(--color-brand);
  color: #ffffff;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-send:hover {
  opacity: 0.9;
}

.btn-send svg {
  width: 12px;
  height: 12px;
}

/* Activity Audit Log Feed */
.audit-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  padding-left: 16px;
}

.audit-timeline::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 4px;
  bottom: 4px;
  width: 1.5px;
  background-color: var(--border-color);
}

.audit-node {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.audit-dot {
  position: absolute;
  left: -16px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--bg-card);
  border: 1.5px solid var(--text-muted);
  box-sizing: border-box;
}

.audit-node.login .audit-dot { border-color: var(--text-muted); }
.audit-node.switched_role .audit-dot { border-color: var(--color-brand); background-color: var(--color-brand-glow); }
.audit-node.approved .audit-dot { border-color: var(--color-success); background-color: var(--color-success-bg); }
.audit-node.requested_changes .audit-dot { border-color: var(--color-warning); background-color: var(--color-warning-bg); }
.audit-node.rejected .audit-dot { border-color: var(--color-danger); background-color: var(--color-danger-bg); }

.audit-message {
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--text-primary);
}

.audit-actor {
  font-weight: 600;
}

.audit-meta {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

/* Bottom Sticky Drawer Action Bar */
.drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background-color: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-approve {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--color-success), #059669);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-approve:hover {
  transform: translateY(-1px);
}

.btn-changes {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color-hover);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-changes:hover {
  background-color: var(--bg-surface);
}

/* Modal dialog: Request changes comments block */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 4000 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn var(--transition-fast) forwards;
}

.modal-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  max-height: 85dvh;
  box-shadow: var(--shadow-premium);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  animation: slideUp var(--transition-normal) forwards;
}

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

.modal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
}

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

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

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input {
  border: 1px solid var(--border-color);
  background-color: var(--bg-input);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  outline: none;
  color: var(--text-primary);
  box-sizing: border-box;
}

select.form-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5' /%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
  padding-right: 36px;
  cursor: pointer;
}

.form-textarea {
  min-height: 70px;
  resize: vertical;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background-color: var(--bg-surface);
}

/* Confetti overlays & notifications */
.confetti-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  pointer-events: none;
  display: none;
  align-items: center;
  justify-content: center;
  background-color: rgba(16, 185, 129, 0.05);
}

.confetti-overlay.active {
  display: flex;
  animation: bgPulse 1.5s forwards;
}

.approval-celebration-card {
  background-color: var(--bg-card);
  padding: 24px 36px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-premium);
  border: 2px solid var(--color-success);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transform: scale(0.8);
  opacity: 0;
}

.confetti-overlay.active .approval-celebration-card {
  animation: scaleInCelebration 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.celebration-icon {
  width: 48px;
  height: 48px;
  background-color: var(--color-success-bg);
  color: var(--color-success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.celebration-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
}

.celebration-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

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

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

@keyframes scaleInCelebration {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes bgPulse {
  0% { opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; }
}

.confetti-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  top: -8px;
  animation: fall 1.8s linear infinite;
}

@keyframes fall {
  to {
    transform: translateY(105vh) rotate(360deg);
  }
}

/* Mobile responsive tabular overrides */
@media (max-width: 1024px) {
  .side-drawer {
    width: 100%; /* Drawer occupies full screen on smaller displays */
  }
}


/* Skeleton Wireframe Responsive Display Rules */
@media (max-width: 768px) {
  .skeleton-sidebar-col {
    display: none !important;
  }
  .skeleton-desktop-only {
    display: none !important;
  }
  .skeleton-mobile-only {
    display: flex !important;
  }
}

@media (min-width: 769px) {
  .skeleton-sidebar-col {
    display: flex !important;
  }
  .skeleton-desktop-only {
    display: flex !important;
  }
  .skeleton-mobile-only {
    display: none !important;
  }
}

@media (max-width: 1024px) {
  /* Mobile fixed bottom footer bar - see canonical rules below */
  .app-content {
    padding-bottom: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
  }
  #tabPaneFiles {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)) !important;
    box-sizing: border-box !important;
  }
  .table-header-toolbar #projectTabsList,
  .table-header-toolbar #adminProjectControls {
    display: none !important;
  }
  #sidebarToggleBtn {
    display: none !important;
  }
  .app-sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 2000 !important;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.15) !important;
  }

  .dashboard-container {
    padding: 20px 15px 120px 15px !important;
  }

  .no-sidebar .tab-pane {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

  .no-sidebar .content-header {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

  .app-header {
    padding: 0 15px !important;
  }

  /* Hide desktop table elements entirely on mobile */
  .dashboard-table {
    display: none !important;
  }
  
  /* Show mobile card container */
  #deliverablesMobileContainer {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    padding: 8px 0 calc(110px + env(safe-area-inset-bottom, 0px)) 0 !important;
    margin: 0 !important;
    background: transparent !important;
  }

  /* Remove border card wrapper on mobile for screen breathing space */
  .table-wrapper {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  /* Make table header toolbar a clean card row */
  .table-header-toolbar {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    padding: 12px 14px !important;
    box-shadow: var(--shadow-sm) !important;
    margin-bottom: 8px !important;
    box-sizing: border-box;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    align-items: stretch !important;
  }

  .table-header-toolbar > div {
    width: 100% !important;
  }

  .table-filters {
    width: 100% !important;
    display: flex !important;
  }

  .table-filter-btn {
    flex: 1 !important;
    text-align: center !important;
    padding: 6px 12px !important;
  }

  .desktop-only-header {
    display: none !important;
  }

  #adminUploadFileBtn {
    display: none !important;
  }
  
  .mobile-only-header-files {
    display: flex !important;
    padding: 0 15px !important;
  }

  .mobile-only-header-brand {
    display: flex !important;
  }

  /* Header adjustments for single-row, no wrapping */
  .content-header {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    min-height: 54px !important;
    gap: 12px !important;
    box-sizing: border-box;
  }
  
  #headerBrandBadgeWrapper {
    display: none !important;
  }

  .header-logo-container {
    display: none !important;
  }

  /* Reduce huge titles size on mobile */
  .dashboard-title {
    font-size: 1.45rem !important;
    line-height: 1.25 !important;
    margin-bottom: 4px !important;
  }

  .dashboard-subtitle {
    font-size: 0.82rem !important;
    line-height: 1.4 !important;
  }

  /* Mobile Deliverable Cards styling */
  .mobile-deliverable-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  .mobile-deliverable-card:active {
    transform: scale(0.985);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02) !important;
  }

  /* Mobile footer active navigation capsule and styles */
  .mobile-nav-item, .mobile-nav-item-more {
    font-family: var(--font-sans) !important;
    transition: all 0.2s ease !important;
    -webkit-tap-highlight-color: transparent;
  }
  
  .mobile-nav-item:active .mobile-nav-icon-container,
  .mobile-nav-item-more:active .mobile-nav-icon-container {
    transform: scale(0.92);
    background-color: rgba(79, 70, 229, 0.12) !important;
  }

  .mobile-nav-item.active {
    color: var(--color-brand) !important;
  }
}

/* Mobile Bottom Navigation - HIDDEN on desktop */
.mobile-bottom-footer {
  display: none !important;
}

/* Mobile Bottom Navigation - VISIBLE on mobile */
@media (max-width: 1024px) {
  .mobile-bottom-footer {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 64px !important;
    z-index: 99999 !important;
    align-items: center !important;
    justify-content: space-around !important;
    background-color: #ffffff !important;
    border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12) !important;
    padding: 2px 4px !important;
    box-sizing: border-box !important;
  }

  [data-theme="dark"] .mobile-bottom-footer {
    background-color: #16161a !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.6) !important;
  }
}

/* ==========================================================================
   Login Screen Styles
   ========================================================================== */
.login-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at top, var(--bg-app-glow) 0%, var(--bg-app) 100%);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 420px;
  padding: 40px 32px;
  box-shadow: var(--shadow-premium);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.login-header-logo {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--color-brand), #4f46e5);
  color: #ffffff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.5rem;
  font-family: var(--font-display);
  box-shadow: 0 0 24px var(--color-brand-glow);
}

.login-title-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.login-profiles-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.login-profile-option {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}

.login-profile-option:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--color-brand);
  transform: translateY(-1px);
}

.login-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
}

.login-profile-option:hover .login-avatar {
  border-color: var(--color-brand);
}

.login-profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.login-profile-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.login-profile-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Version History Drawer List Styles
   ========================================================================== */
.version-history-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
}

.version-history-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.version-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.version-history-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: border-color var(--transition-fast);
}

.version-history-item:hover {
  border-color: var(--border-color-hover);
}

.ver-history-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.ver-history-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ver-history-num {
  font-family: monospace;
  font-size: 0.78rem;
  font-weight: 700;
  background-color: var(--border-color);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--text-primary);
}

.ver-history-date {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.ver-history-notes {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  word-break: break-word;
}

.btn-history-download {
  background: none;
  border: 1px solid var(--border-color);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.btn-history-download:hover {
  background-color: var(--bg-card);
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* Logout Button */
.btn-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.btn-logout:hover {
  background-color: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* App Shell Layout */
.app-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-app);
  background-image: var(--bg-grid);
  background-size: 40px 40px;
}

/* Left Sidebar styling */
.app-sidebar {
  width: 250px;
  flex-shrink: 0;
  height: 100%;
  background-color: var(--bg-card);
  border-right: 1px solid var(--border-color);
  padding: 24px 20px;
  display: none; /* hidden by default to prevent client FOUC */
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 4px 0 20px -4px rgba(0, 0, 0, 0.02);
}

.app-layout.has-sidebar .app-sidebar {
  display: flex;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 18px;
}

.brand-logo {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-hover) 100%);
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 1rem;
}

.brand-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-item svg {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

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

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

.nav-item.active {
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.08) 0%, rgba(79, 70, 229, 0.02) 100%);
  color: var(--color-brand);
  font-weight: 650;
  border-left: 3px solid var(--color-brand);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding-left: 9px;
}

.nav-item.active svg {
  color: var(--color-brand);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* Right Content Panel area */
.app-content {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.content-header {
  height: 56px;
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-card);
  flex-shrink: 0;
  transition: padding 0.2s ease-in-out;
}

.tab-pane {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: none;
  transition: padding 0.2s ease-in-out;
}

#tabPaneFiles {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

#tabPaneFiles.active-pane {
  display: flex !important;
}

.tab-pane.active-pane:not(#tabPaneFiles) {
  display: block;
}

.table-wrapper {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-premium);
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.table-scroll-container th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-card);
}

/* Adjust padding dynamically for client workspace when sidebar is hidden */
.no-sidebar .content-header,
.no-sidebar .tab-pane {
  padding-left: 48px;
  padding-right: 48px;
}

@media (min-width: 1200px) {
  .no-sidebar .content-header,
  .no-sidebar .tab-pane {
    padding-left: 80px;
    padding-right: 80px;
  }
}

/* Dynamic comment suggestion chips styling */
.suggestion-chip-btn:hover {
  background-color: #F9FAFB !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.05) !important;
}
.suggestion-chip-btn:active {
  transform: translateY(0);
}

@media (min-width: 1600px) {
  .no-sidebar .content-header,
  .no-sidebar .tab-pane {
    padding-left: 120px;
    padding-right: 120px;
  }
}

/* Custom Approval & Reject Button Hover States */
.btn-approval-reject:hover {
  background-color: #fdf2f2 !important;
  border-color: #f8b4b4 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.12);
}

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

.btn-approval-approve:hover {
  background-color: #2b534c !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(56, 107, 98, 0.35);
}

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

/* Project Tab Buttons styling */
.project-tab-btn {
  padding: 6px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.project-tab-btn:hover {
  background-color: var(--bg-card-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}
.project-tab-btn.active {
  background-color: #386b62;
  border-color: #386b62;
  color: #ffffff;
}
[data-theme="dark"] .project-tab-btn.active {
  background-color: var(--color-brand);
  border-color: var(--color-brand);
  color: #ffffff;
}

.btn-attach:hover {
  color: var(--color-brand) !important;
}

#drawerApprovalActions {
  display: none !important;
}

/* iOS-style Processing & Haptic Success Loader Card */
.ios-processing-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}
.ios-processing-overlay.active {
  opacity: 1;
  visibility: visible;
}
.ios-processing-card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 28px;
  width: 160px;
  height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.12);
  transform: scale(0.85) translate3d(0, 30px, 0);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ios-processing-overlay.active .ios-processing-card {
  transform: scale(1) translate3d(0, 0, 0);
}
[data-theme="dark"] .ios-processing-card {
  background: rgba(30, 30, 32, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.ios-spinner-container {
  width: 48px;
  height: 48px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ios-spinner {
  width: 36px;
  height: 36px;
  border: 3.5px solid var(--border-color);
  border-top: 3.5px solid var(--color-brand);
  border-radius: 50%;
  animation: ios-spin 0.75s linear infinite;
}
@keyframes ios-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.ios-success-ring {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #10b981;
  color: white;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  animation: ios-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes ios-pop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.ios-processing-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-sans);
  text-align: center;
  transition: color 0.3s;
}

.drawer-back-btn {
  display: none !important;
}

@media (max-width: 768px) {
  .drawer-back-btn {
    display: inline-flex !important;
  }
  .drawer-close-btn {
    display: none !important;
  }
}
