/* =====================================================
   MODERN APP-LIKE INTERFACE FOR CPM CLIENT PORTAL
   ===================================================== */

:root {
  /* Primary Brand Colors */
  --cpm-teal: #17a2b8;
  --cpm-teal-dark: #138496;

  /* Background & Surface */
  --cpm-bg: #f8fafc;
  --cpm-white: #ffffff;
  --cpm-bg-secondary: #f0f0f0;
  --cpm-bg-tertiary: #fcfcfc;

  /* Text Colors */
  --cpm-text: #334155;
  --cpm-heading: #1e293b;
  --cpm-text-light: #64748b;
  --cpm-text-lighter: #94a3b8;
  --cpm-text-muted: #475569;
  --cpm-surface-text: #334155;
  --cpm-surface-heading: #1e293b;
  --cpm-surface-muted: #64748b;

  /* Borders */
  --cpm-border: #e2e8f0;
  --cpm-border-light: #cbd5e1;
  --cpm-border-subtle: #dddddd;

  /* Cards */
  --cpm-card-bg: #ffffff;
  --cpm-card-border: #e2e8f0;
  --cpm-card-bg-secondary: #e5e7eb;

  /* Subtask Surfaces */
  --cpm-subtask-bg: #ffffff;
  --cpm-subtask-border: #e2e8f0;
  --cpm-subtask-text: #334155;
  --cpm-subtask-meta: #64748b;

  /* Status - Success */
  --cpm-success: #22c55e;
  --cpm-success-light: #dcfce7;
  --cpm-success-bg: #ecfdf5;
  --cpm-success-text-dark: #166534;

  /* Status - Warning */
  --cpm-warning: #f59e0b;
  --cpm-warning-light: #fef3c7;
  --cpm-warning-bg: #fffbeb;

  /* Status - Danger */
  --cpm-danger: #ef4444;
  --cpm-danger-light: #fee2e2;
  --cpm-danger-dark: #dc2626;
  --cpm-danger-bg: #fef2f2;

  /* Status - Info */
  --cpm-info: #3b82f6;
  --cpm-info-light: #dbeafe;
  --cpm-info-bg: #f0f9ff;
  --cpm-info-text-dark: #0c4a6e;

  /* Overlays & Shadows */
  --cpm-overlay-dark: rgba(0, 0, 0, 0.85);
  --cpm-overlay-light: rgba(0, 0, 0, 0.5);
  --cpm-shadow-soft: rgba(0, 0, 0, 0.03);
  --cpm-shadow-medium: rgba(0, 0, 0, 0.1);
}

/* Dark Mode (Auto) */
@media (prefers-color-scheme: dark) {
  :root {
    --cpm-bg: #0f172a;
    --cpm-white: #0f172a;
    --cpm-bg-secondary: #111827;
    --cpm-bg-tertiary: #1f2937;
    --cpm-text: #e2e8f0;
    --cpm-heading: #f8fafc;
    --cpm-text-light: #cbd5e1;
    --cpm-text-lighter: #94a3b8;
    --cpm-text-muted: #a1a1aa;
    --cpm-surface-text: #1e293b;
    --cpm-surface-heading: #0f172a;
    --cpm-surface-muted: #475569;
    --cpm-border: #1f2937;
    --cpm-border-light: #334155;
    --cpm-border-subtle: #374151;
    --cpm-card-bg: #111827;
    --cpm-card-border: #1f2937;
    --cpm-card-bg-secondary: #1e293b;
    --cpm-subtask-bg: #111827;
    --cpm-subtask-border: #1f2937;
    --cpm-subtask-text: #e2e8f0;
    --cpm-subtask-meta: #cbd5e1;
    --cpm-shadow-soft: rgba(0, 0, 0, 0.2);
    --cpm-shadow-medium: rgba(0, 0, 0, 0.35);
  }
}

/* Manual Theme Overrides */
body.cpm-theme-light {
  --cpm-bg: #f8fafc;
  --cpm-white: #ffffff;
  --cpm-bg-secondary: #f0f0f0;
  --cpm-bg-tertiary: #fcfcfc;
  --cpm-text: #334155;
  --cpm-heading: #1e293b;
  --cpm-text-light: #64748b;
  --cpm-text-lighter: #94a3b8;
  --cpm-text-muted: #475569;
  --cpm-surface-text: #334155;
  --cpm-surface-heading: #1e293b;
  --cpm-surface-muted: #64748b;
  --cpm-border: #e2e8f0;
  --cpm-border-light: #cbd5e1;
  --cpm-border-subtle: #dddddd;
  --cpm-card-bg: #ffffff;
  --cpm-card-border: #e2e8f0;
  --cpm-card-bg-secondary: #e5e7eb;
  --cpm-subtask-bg: #ffffff;
  --cpm-subtask-border: #e2e8f0;
  --cpm-subtask-text: #334155;
  --cpm-subtask-meta: #64748b;
  --cpm-shadow-soft: rgba(0, 0, 0, 0.03);
  --cpm-shadow-medium: rgba(0, 0, 0, 0.1);
}

body.cpm-theme-dark {
  --cpm-bg: #0f172a;
  --cpm-white: #0f172a;
  --cpm-bg-secondary: #111827;
  --cpm-bg-tertiary: #1f2937;
  --cpm-text: #e2e8f0;
  --cpm-heading: #f8fafc;
  --cpm-text-light: #cbd5e1;
  --cpm-text-lighter: #94a3b8;
  --cpm-text-muted: #a1a1aa;
  --cpm-surface-text: #1e293b;
  --cpm-surface-heading: #0f172a;
  --cpm-surface-muted: #475569;
  --cpm-border: #1f2937;
  --cpm-border-light: #334155;
  --cpm-border-subtle: #374151;
  --cpm-card-bg: #111827;
  --cpm-card-border: #1f2937;
  --cpm-card-bg-secondary: #1e293b;
  --cpm-subtask-bg: #111827;
  --cpm-subtask-border: #1f2937;
  --cpm-subtask-text: #e2e8f0;
  --cpm-subtask-meta: #cbd5e1;
  --cpm-shadow-soft: rgba(0, 0, 0, 0.2);
  --cpm-shadow-medium: rgba(0, 0, 0, 0.35);
}

/* =====================================================
   BASE RESET & CORE STYLES
   ===================================================== */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    sans-serif;
  background-color: var(--cpm-bg);
  color: var(--cpm-text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =====================================================
   TYPOGRAPHY
   ===================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--cpm-heading);
  font-weight: 700;
  line-height: 1.3;
  margin-top: 0;
}

h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
}

h2 {
  font-size: clamp(1.3rem, 3vw, 1.75rem);
}

h3 {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
}

p {
  color: var(--cpm-text);
  margin: 0 0 1rem 0;
}

a {
  color: var(--cpm-teal);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--cpm-teal-dark);
  text-decoration: none;
}

a:focus-visible {
  outline: 3px solid var(--cpm-teal);
  outline-offset: 2px;
  border-radius: 4px;
}

.cpm-container a,
.cpm-nav-tabs a,
.cpm-card-link,
.cpm-btn {
  text-decoration: none !important;
}

/* =====================================================
   CONTAINER & LAYOUT
   ===================================================== */

.cpm-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 30px;
  width: 100%;
}

/* Hero sections - Top of page */
.cpm-hero,
.cpm-hero-small {
  margin-bottom: 30px;
}

.cpm-hero-small h1 {
  margin: 0 0 8px 0;
}

.cpm-hero-small p {
  margin: 0;
  color: var(--cpm-text-light);
  font-size: 1rem;
}

/* Dashboard header */
.cpm-dashboard-header {
  margin-bottom: 40px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.cpm-page-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--cpm-heading);
  margin: 0 0 8px 0;
  line-height: 1.2;
}

.cpm-page-description {
  font-size: 1.05rem;
  color: var(--cpm-text-light);
  margin: 0;
  line-height: 1.5;
}

/* =====================================================
   CARDS & SURFACES
   ===================================================== */

.cpm-card,
.cpm-project-card,
.cpm-task-card,
.cpm-support-card {
  background: var(--cpm-card-bg, var(--cpm-white));
  border: 1px solid var(--cpm-card-border, var(--cpm-border));
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  color: var(--cpm-surface-text, var(--cpm-text));
}

.cpm-card:hover,
.cpm-project-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border-color: var(--cpm-teal);
}

.cpm-card {
  padding: 8px 16px;
  display: flex;
  flex-direction: row;
  align-items: center;
  height: auto;
  min-height: auto;
  gap: 12px;
}

.cpm-card h3 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.1;
  color: var(--cpm-surface-heading, var(--cpm-heading));
  font-weight: 600;
}

.cpm-card p {
  color: var(--cpm-surface-text, var(--cpm-text));
}

/* Dashboard project cards */
.project-card {
  border-radius: 8px;
  padding: 8px 16px;
  background: var(--cpm-white);
  border: 1px solid var(--cpm-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: row;
  align-items: center;
  height: auto;
  gap: 12px;
}

.project-card .cpm-card-header {
  margin-bottom: 0;
  align-items: center;
}

.project-card .cpm-date {
  font-weight: 500;
  color: var(--cpm-surface-muted, var(--cpm-text-light));
  font-size: 0.75rem;
}

.project-card h3 {
  margin: 0;
  color: var(--cpm-surface-heading, var(--cpm-heading));
  font-size: 0.95rem;
  font-weight: 600;
}

.project-card .cpm-progress-container {
  margin: 0;
}

.project-card .cpm-card-footer {
  margin-top: 0;
  padding-top: 0;
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
}

.cpm-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.cpm-card-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--cpm-surface-muted, var(--cpm-text-light));
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--cpm-border, #f1f5f9);
  font-weight: 500;
}

.cpm-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.2s ease;
  height: 100%;
}

.cpm-card-link:hover {
  transform: translateY(-3px);
  text-decoration: none;
}

.cpm-card-link:focus-visible {
  outline: 3px solid var(--cpm-teal);
  outline-offset: 4px;
  border-radius: 12px;
}

/* =====================================================
   GRID LAYOUT - VERTICAL ROWS
   ===================================================== */

.cpm-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 0;
}

.cpm-empty {
  text-align: center;
  padding: 60px 20px;
  background: var(--cpm-white);
  border-radius: 12px;
  border: 2px dashed var(--cpm-border);
  color: var(--cpm-text-light);
  grid-column: 1 / -1;
}

.cpm-empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 15px;
  opacity: 0.6;
}

/* =====================================================
   BUTTONS - FLAT DESIGN
   ===================================================== */

.cpm-btn {
  background: var(--cpm-teal);
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  font-size: 1rem;
  line-height: 1.5;
  min-height: 44px;
  min-width: 44px;
  font-family: inherit;
}

.cpm-btn:hover {
  background: var(--cpm-teal-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cpm-btn:focus-visible {
  outline: 3px solid var(--cpm-teal);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.2);
}

.cpm-btn:active {
  transform: translateY(0);
}

.cpm-btn.full {
  width: 100%;
}

.cpm-btn.small {
  padding: 8px 16px;
  font-size: 0.875rem;
  min-height: 36px;
}

.cpm-btn.primary {
  background: var(--cpm-teal);
}

.cpm-btn.danger {
  background: var(--cpm-danger);
}

.cpm-btn.danger:hover {
  background: var(--cpm-danger-dark, #dc2626);
}

.cpm-btn.outline {
  background: transparent;
  color: var(--cpm-teal);
  border: 1px solid var(--cpm-border);
}

.cpm-btn.outline:hover {
  background: var(--cpm-bg);
  border-color: var(--cpm-teal);
}

/* =====================================================
   FORM INPUTS
   ===================================================== */

.cpm-input-group {
  text-align: left;
  margin-bottom: 20px;
}

.cpm-input-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--cpm-heading, #1e293b);
}

.cpm-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--cpm-border-light);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--cpm-text);
  background: var(--cpm-white);
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.cpm-input:focus,
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--cpm-teal);
  box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.1);
}

.cpm-textarea {
  resize: vertical;
  font-family: inherit;
}

/* =====================================================
   BADGES - PILL SHAPE WITH SOLID COLORS
   ===================================================== */

.cpm-badge {
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  letter-spacing: 0.5px;
}

/* Complete / Accepted - Green */
.cpm-badge.complete,
.cpm-badge.accepted {
  background: var(--cpm-success);
  color: white;
}

/* Open / In Progress - Teal */
.cpm-badge.open,
.cpm-badge.in-progress,
.cpm-badge.sent {
  background: var(--cpm-teal);
  color: white;
}

/* Pending / Draft - Amber */
.cpm-badge.pending,
.cpm-badge.draft,
.cpm-badge.on-hold {
  background: var(--cpm-warning);
  color: white;
}

/* Declined / Closed - Red */
.cpm-badge.declined,
.cpm-badge.closed {
  background: var(--cpm-danger);
  color: white;
}

.cpm-badge.small {
  font-size: 0.7rem;
  padding: 3px 10px;
}

/* =====================================================
   PROGRESS BARS
   ===================================================== */

.cpm-progress-container,
.cpm-progress-bg {
  background: var(--cpm-card-bg-secondary, #e5e7eb);
  border-radius: 100px;
  height: 10px;
  overflow: hidden;
  width: 100%;
  position: relative;
  margin-top: 15px;
}

.cpm-progress-bar {
  background: var(--cpm-teal);
  height: 100%;
  border-radius: 100px;
  transition: width 0.4s ease;
}

/* =====================================================
   NAVIGATION TABS - MINIMALIST
   ===================================================== */

.cpm-nav-tabs,
.cpm-tabs {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: center;
  border-bottom: 2px solid var(--cpm-border);
  margin-bottom: 40px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 0;
}

.cpm-nav-tabs a,
.cpm-tab {
  text-decoration: none;
  color: var(--cpm-text-light);
  padding: 12px 8px;
  font-weight: 600;
  font-size: clamp(0.9rem, 2vw, 1rem);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}

.cpm-nav-tabs a:hover,
.cpm-tab:hover {
  color: var(--cpm-teal);
}

.cpm-nav-tabs a:focus-visible,
.cpm-tab:focus-visible {
  outline: 2px solid var(--cpm-teal);
  outline-offset: 4px;
  border-radius: 4px;
}

.cpm-nav-tabs a.active,
.cpm-tab.active {
  color: var(--cpm-teal);
  border-bottom-color: var(--cpm-teal);
}

@media (min-width: 768px) {
  .cpm-nav-tabs {
    gap: 20px;
  }

  .cpm-nav-tabs a {
    padding: 12px 5px;
  }
}

.cpm-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 15px;
  width: 100%;
}

.cpm-nav-header a {
  text-decoration: none;
  color: var(--cpm-text-light);
}

.cpm-logout-btn {
  padding: 6px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  min-height: 36px;
  border-radius: 6px;
  color: var(--cpm-text-light);
  border-color: var(--cpm-border);
  margin-left: auto;
  display: flex;
  align-items: center;
  height: 36px;
}

/* =====================================================
   LOGIN PAGE
   ===================================================== */

.cpm-login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  background: var(--cpm-bg);
}

.cpm-login-box {
  background: var(--cpm-white);
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--cpm-border);
  color: var(--cpm-text);
}

.cpm-login-box h2 {
  color: var(--cpm-heading, #1e293b);
  margin: 0 0 10px 0;
}

.cpm-login-box p {
  color: var(--cpm-text, #334155);
  margin: 0 0 30px 0;
  font-size: 0.95rem;
}

body.cpm-full-page .cpm-login-box,
body.cpm-full-page .cpm-login-box h2,
body.cpm-full-page .cpm-login-box p,
body.cpm-full-page .cpm-login-box label {
  color: var(--cpm-surface-heading, #1e293b) !important;
}

body.cpm-full-page .cpm-login-box input,
body.cpm-full-page .cpm-login-box textarea,
body.cpm-full-page .cpm-login-box select {
  color: var(--cpm-surface-heading, #1e293b) !important;
  background: var(--cpm-white, #ffffff) !important;
  border-color: var(--cpm-border-light, #cbd5e1) !important;
}

.cpm-subtask-note {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--cpm-text-muted, #475569);
}

.cpm-subtask-evidence {
  margin-top: 6px;
}

/* =====================================================
   CHAT INTERFACE
   ===================================================== */

.cpm-support-card {
  background: var(--cpm-white);
  border: 1px solid var(--cpm-border);
  padding: 24px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 15px;
  color: var(--cpm-surface-text, var(--cpm-text));
}

.cpm-support-card h2 {
  margin: 0 0 5px 0;
  font-size: 1.25rem;
  color: var(--cpm-surface-heading, var(--cpm-heading));
}

.cpm-support-card .cpm-date {
  font-size: 0.85rem;
  color: var(--cpm-surface-muted, var(--cpm-text-light));
  margin: 0;
}

.cpm-support-card p {
  color: var(--cpm-surface-text, var(--cpm-text));
}

.cpm-support-chat {
  background: white;
  border: 1px solid var(--cpm-border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  height: 600px;
  overflow: hidden;
  margin-bottom: 15px;
}

.cpm-chat-history {
  padding: 25px;
  background: var(--cpm-bg, #f8fafc);
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.cpm-chat-msg {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Client messages - Right aligned */
.cpm-chat-msg.client {
  align-items: flex-end;
}

/* Admin messages - Left aligned */
.cpm-chat-msg.admin {
  align-items: flex-start;
}

.cpm-chat-bubble {
  padding: 12px 18px;
  border-radius: 12px;
  max-width: 75%;
  font-size: 0.95rem;
  line-height: 1.5;
  word-wrap: break-word;
}

/* Client Bubble - Teal background, white text, sharp bottom-right corner */
.cpm-chat-msg.client .cpm-chat-bubble {
  background: var(--cpm-teal);
  color: white;
  border-radius: 12px 0 12px 12px;
}

/* Admin Bubble - White background, grey border, sharp bottom-left corner */
.cpm-chat-msg.admin .cpm-chat-bubble {
  background: var(--cpm-white);
  color: var(--cpm-surface-text, var(--cpm-text));
  border: 1px solid var(--cpm-border);
  border-radius: 0 12px 12px 12px;
}

.cpm-chat-bubble a {
  color: inherit;
  text-decoration: underline;
}

.cpm-chat-msg.client .cpm-chat-bubble a {
  color: white;
}

.cpm-chat-msg.admin .cpm-chat-bubble a {
  color: var(--cpm-teal);
}

.cpm-chat-date {
  font-size: 0.75rem;
  color: var(--cpm-text-lighter);
  padding: 0 12px;
}

.cpm-chat-form {
  padding: 20px;
  background: white;
  border-top: 1px solid var(--cpm-border);
  flex-shrink: 0;
}

.cpm-chat-form label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cpm-surface-heading, var(--cpm-heading));
  display: block;
  margin-bottom: 8px;
}

/* =====================================================
   NAVIGATION HEADER
   ===================================================== */

.cpm-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  gap: 15px;
  flex-wrap: wrap;
}

.cpm-nav-header a {
  text-decoration: none;
  color: var(--cpm-teal);
  font-weight: 600;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cpm-nav-header a:hover {
  color: var(--cpm-teal-dark);
  text-decoration: underline;
}

.cpm-nav-header a:first-child {
  color: var(--cpm-text-light);
}

.cpm-nav-header a:first-child:hover {
  color: var(--cpm-teal);
}

/* =====================================================
   PROJECT DETAIL LAYOUT - TOP-DOWN FLOW
   ===================================================== */

.cpm-project-info-box {
  background: var(--cpm-white);
  border-radius: 12px;
  padding: 30px;
  border: 1px solid var(--cpm-border);
  margin-bottom: 40px;
  width: 100%;
  color: var(--cpm-surface-text, var(--cpm-text));
}

.cpm-info-main {
  display: flex;
  gap: 25px;
  margin-bottom: 30px;
  align-items: flex-start;
}

.cpm-client-logo {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--cpm-border);
  flex-shrink: 0;
}

.cpm-info-main > div {
  flex: 1;
}

.cpm-info-main h1 {
  margin: 0 0 15px 0;
  font-size: 2rem;
  color: var(--cpm-surface-heading, var(--cpm-heading));
  font-weight: 700;
}

.cpm-meta-row {
  color: var(--cpm-surface-muted, var(--cpm-text-light));
  font-size: 0.95rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cpm-meta-row span {
  display: inline;
  color: var(--cpm-surface-muted, var(--cpm-text-light));
}

.cpm-meta-row strong {
  color: var(--cpm-surface-heading, var(--cpm-heading));
  font-weight: 600;
}

/* Project scope section */
.cpm-info-desc {
  border-top: 1px solid var(--cpm-border);
  padding-top: 25px;
  margin-top: 25px;
}

.cpm-info-desc strong {
  color: var(--cpm-surface-heading, var(--cpm-heading));
  display: block;
  margin-bottom: 15px;
  font-size: 1.1rem;
  font-weight: 600;
}

.cpm-desc-content {
  color: var(--cpm-surface-text, var(--cpm-text));
  line-height: 1.7;
}

.cpm-desc-content p {
  margin: 0 0 15px 0;
  color: var(--cpm-text);
}

.cpm-desc-content p:last-child {
  margin-bottom: 0;
}

/* =====================================================
   TASK LIST - FULL WIDTH TOP-DOWN
   ===================================================== */

.cpm-task-list-modern {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
}

/* =====================================================
   SECTION HEADINGS
   ===================================================== */

.cpm-section-heading {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cpm-heading);
  margin: 40px 0 25px 0;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--cpm-border);
}

.cpm-section-heading:first-child {
  margin-top: 0;
}

/* Dark background override */
body.cpm-full-page .cpm-section-heading {
  color: var(--cpm-white, #f8fafc);
  border-bottom-color: rgba(255, 255, 255, 0.15);
}

.cpm-task-card {
  background: var(--cpm-white);
  border: 1px solid var(--cpm-border);
  border-radius: 8px;
  margin-bottom: 15px;

  .cpm-task-deadline {
    font-size: 0.85rem;
    color: var(--cpm-text-light);
    margin-right: 8px;
  }

  .cpm-subtask-deadline {
    font-size: 0.85rem;
    color: var(--cpm-text-lighter);
    margin-top: 4px;
  }
  overflow: hidden;
  transition: all 0.2s ease;
}

.cpm-task-card.is-complete {
  opacity: 0.8;
}

.cpm-task-head {
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: white;
  transition: background 0.2s ease;
}

.cpm-task-head:hover {
  background: var(--cpm-bg, #f8fafc);
}

.cpm-task-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
  color: var(--cpm-surface-heading, #0f172a);
  font-weight: 600;
}

.cpm-task-title strong {
  color: var(--cpm-surface-heading, #0f172a);
}

.cpm-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.cpm-indicator.complete {
  background: var(--cpm-success);
}

.cpm-indicator.in-progress {
  background: var(--cpm-teal);
}

.cpm-indicator.pending {
  background: var(--cpm-warning);
}

.cpm-task-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cpm-chevron {
  transition: transform 0.2s ease;
  font-size: 18px !important;
}

.cpm-task-card.open .cpm-chevron {
  transform: rotate(180deg);
}

.cpm-task-body {
  display: none;
  padding: 20px;
  border-top: 1px solid var(--cpm-border);
  background: var(--cpm-bg-tertiary, #fcfcfc);
  color: var(--cpm-surface-text, var(--cpm-text));
}

.cpm-task-card.open .cpm-task-body {
  display: block;
}

.cpm-checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

.cpm-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.95rem;
  color: var(--cpm-surface-text, var(--cpm-text));
  font-weight: 500;
}

.cpm-subtask-item {
  list-style: none;
  padding: 12px;
  border: 1px solid var(--cpm-subtask-border, var(--cpm-border));
  background: var(--cpm-subtask-bg, var(--cpm-card-bg));
  border-radius: 10px;
}

.cpm-subtask-content {
  flex: 1;
}

.cpm-subtask-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.cpm-subtask-status {
  color: var(--cpm-white, #ffffff);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.cpm-subtask-text {
  color: var(--cpm-subtask-text, var(--cpm-surface-text, var(--cpm-text)));
  font-size: 0.95rem;
}

.cpm-subtask-deadline {
  font-size: 0.85rem;
  color: var(--cpm-subtask-meta, var(--cpm-surface-muted, var(--cpm-text-light)));
  margin-bottom: 8px;
}

.cpm-subtask-evidence-link {
  display: inline-block;
}

.cpm-subtask-evidence-img {
  max-width: 120px;
  max-height: 120px;
  border-radius: 6px;
  border: 1px solid var(--cpm-border, #e2e8f0);
  object-fit: cover;
}

.cpm-subtask-evidence-video {
  max-width: 240px;
  max-height: 160px;
  border-radius: 6px;
  border: 1px solid var(--cpm-border, #e2e8f0);
}

.cpm-checklist li .dashicons {
  color: var(--cpm-border-light);
  font-size: 18px;
  flex-shrink: 0;
}

.cpm-checklist li.checked {
  text-decoration: line-through;
  color: var(--cpm-text-lighter);
}

.cpm-checklist li.checked .dashicons {
  color: var(--cpm-success);
}

.cpm-evidence {
  margin-top: 15px;
}

.cpm-evidence h4 {
  margin: 0 0 10px 0;
  font-size: 0.95rem;
  color: var(--cpm-heading, #1e293b);
  font-weight: 600;
}

.cpm-content-box {
  background: white;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--cpm-border);
  color: var(--cpm-text, #334155);
}

.cpm-content-box p {
  margin: 0;
  color: var(--cpm-text, #334155);
}

.cpm-content-box p + p {
  margin-top: 10px;
}

/* =====================================================
   QUOTE CARDS
   ===================================================== */

.quote-card {
  border-left: 4px solid var(--cpm-warning);
}

.cpm-quote-desc {
  color: var(--cpm-text-light);
  font-size: 0.9rem;
  margin: 10px 0 20px 0;
  line-height: 1.5;
}

.cpm-card-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

@media (max-width: 600px) {
  .cpm-card-actions {
    flex-direction: column;
  }

  .cpm-card-actions .cpm-btn {
    width: 100%;
  }
}

/* =====================================================
   LIGHTBOX
   ===================================================== */

.cpm-lightbox-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.2s ease-in-out;
}

.cpm-lightbox-overlay.active {
  display: flex;
}

.cpm-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cpm-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.cpm-lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--cpm-surface-heading, #000);
  transition: background 0.2s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.cpm-lightbox-close:hover {
  background: var(--cpm-bg-secondary, #f0f0f0);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* =====================================================
   UTILITY CLASSES
   ===================================================== */

.cpm-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.cpm-date {
  font-size: 0.85rem;
  color: var(--cpm-text-lighter);
  margin: 0;
}

.cpm-logout-link {
  text-align: center;
  margin-top: 40px;
}

.cpm-logout-link a {
  color: var(--cpm-text-lighter);
  text-decoration: none;
  font-size: 0.9rem;
}

.cpm-logout-link a:hover {
  color: var(--cpm-teal);
  text-decoration: underline;
}

.cpm-loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(23, 162, 184, 0.3);
  border-radius: 50%;
  border-top-color: var(--cpm-teal);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =====================================================
   ALERTS & MESSAGES
   ===================================================== */

.cpm-alert {
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid var(--cpm-teal);
  background: var(--cpm-info-bg, #dbeafe);
  color: var(--cpm-info-text-dark, #1e3a8a);
  font-weight: 500;
  line-height: 1.6;
}

.cpm-alert[role="alert"] {
  position: relative;
}

/* =====================================================
   RESPONSIVE DESIGN - MOBILE-FIRST
   ===================================================== */

@media (max-width: 768px) {
  .cpm-container {
    padding: 20px 15px;
  }

  .cpm-hero h1,
  .cpm-hero-small h1 {
    font-size: 1.5rem;
  }

  .cpm-hero p,
  .cpm-hero-small p {
    font-size: 1rem;
  }

  .cpm-card {
    padding: 20px;
  }

  .cpm-btn {
    font-size: 1rem;
    padding: 12px 16px;
  }

  .cpm-input,
  textarea,
  input {
    font-size: 16px; /* Prevent iOS zoom */
    padding: 14px;
    min-height: 44px;
  }

  .cpm-chat-bubble {
    max-width: 85%;
    font-size: 0.9rem;
  }

  .cpm-chat-history {
    max-height: 400px;
  }

  .cpm-info-main {
    flex-direction: column;
    gap: 15px;
  }

  .cpm-client-logo {
    width: 60px;
    height: 60px;
  }

  .cpm-info-main h1 {
    font-size: 1.5rem;
  }

  .cpm-nav-tabs {
    gap: 12px;
  }

  .cpm-nav-tabs a {
    font-size: 0.95rem;
    padding: 10px 6px;
  }

  .cpm-support-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .cpm-login-box {
    padding: 30px 20px;
    max-width: 100%;
    margin: 0 10px;
  }

  .cpm-project-info-box {
    padding: 20px;
  }

  .cpm-chat-history {
    padding: 15px;
  }

  .cpm-nav-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .cpm-meta-row {
    flex-direction: column;
    gap: 6px;
  }

  .cpm-meta-row span {
    display: block;
  }

  .cpm-section-heading {
    font-size: 1.25rem;
    margin: 30px 0 20px 0;
  }
}

@media (max-width: 480px) {
  .cpm-container {
    padding: 15px 10px;
  }

  .cpm-card {
    padding: 15px;
  }

  .cpm-hero h1,
  .cpm-hero-small h1 {
    font-size: 1.25rem;
  }

  .cpm-nav-tabs {
    gap: 8px;
  }

  .cpm-nav-tabs a {
    font-size: 0.875rem;
    padding: 10px 6px;
  }

  .cpm-card h3 {
    font-size: 1.1rem;
  }

  .cpm-btn {
    padding: 10px 14px;
    font-size: 0.95rem;
  }

  .cpm-chat-bubble {
    max-width: 100%;
  }
}

/* =====================================================
   ACCESSIBILITY ENHANCEMENTS
   ===================================================== */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: high) {
  .cpm-card,
  .cpm-btn,
  .cpm-badge {
    border-width: 2px;
  }

  .cpm-nav-tabs a.active {
    border-bottom-width: 4px;
  }
}

@media print {
  .cpm-nav-tabs,
  .cpm-logout-link,
  .cpm-btn {
    display: none !important;
  }

  .cpm-card {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid var(--cpm-surface-heading, #000);
  }

  .cpm-container {
    max-width: 100%;
  }
}
