/* ConverClick Delivery Portal v2 — Complete Brand CSS */
/* Magenta #E6007E | Púrpura #662483 | Teal #2BBBC7 | Body #333333 */
/* Fonts: Montserrat (headings/UI) | Roboto (body) */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&family=Roboto:wght@300;400;500;700&display=swap');

:root {
  --cc-magenta:     #E6007E;
  --cc-purple:      #662483;
  --cc-purple-dark: #4A1A60;
  --cc-teal:        #2BBBC7;
  --white:          #FFFFFF;
  --gray-body:      #333333;
  --gray-secondary: #4E4E4E;
  --gray-muted:     #7A7A7A;
  --gray-bg:        #EDEDED;
  --gray-50:        #FAFAFA;
  --gray-100:       #F5F5F5;
  --gray-200:       #EEEEEE;
  --gray-300:       #E0E0E0;
  --green:          #2E7D32;
  --green-bg:       #E8F5E9;
  --yellow:         #F9A825;
  --yellow-bg:      #FFF8E1;
  --red:            #C62828;
  --red-bg:         #FFEBEE;
  --blue:           #1565C0;
  --blue-bg:        #E3F2FD;
  --orange:         #E65100;
  --orange-bg:      #FFF3E0;
  --radius:         12px;
  --radius-sm:      8px;
  --shadow:         0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg:      0 8px 32px rgba(0,0,0,0.14);
  --font-heading:   'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:      'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition:     0.2s ease;
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--gray-50);
  color: var(--gray-body);
  line-height: 1.6;
  font-size: 14px;
}

/* ============================================================
   AUTH SCREENS (login / reset / new-pass)
   ============================================================ */
.screen {
  min-height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
}
.screen.visible { display: flex; }

#login-screen,
#reset-screen,
#new-pass-screen {
  background: linear-gradient(135deg, var(--cc-purple) 0%, var(--cc-magenta) 100%);
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--cc-magenta);
}

.auth-brand {
  text-align: center;
  margin-bottom: 36px;
}
.auth-brand img {
  max-width: 200px;
  margin-bottom: 12px;
}
.auth-tagline {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  margin-top: 4px;
}

/* Auth form wrapper outside the card */
.auth-wrapper {
  width: 100%;
  max-width: 460px;
  padding: 60px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.auth-logo-area {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo-area img {
  max-width: 200px;
}
.auth-tagline-outer {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  margin-top: 6px;
}

/* Form groups */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-secondary);
  margin-bottom: 6px;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group input[type="date"],
.form-group select,
.form-group textarea,
.settings-input {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--gray-body);
  background: var(--white);
  transition: border-color var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.settings-input:focus {
  outline: none;
  border-color: var(--cc-purple);
}

.auth-msg {
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.auth-msg--error { color: var(--red);   background: var(--red-bg);   }
.auth-msg--ok    { color: var(--green); background: var(--green-bg); }

.auth-link {
  display: block;
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--cc-purple);
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
  font-family: var(--font-body);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn-login {
  width: 100%;
  justify-content: center;
  background: var(--cc-purple);
  color: var(--white);
  font-size: 14px;
  padding: 14px;
  margin-top: 4px;
}
.btn-login:hover { background: var(--cc-purple-dark); }
.btn-primary     { background: var(--cc-purple);  color: var(--white); }
.btn-primary:hover { background: var(--cc-purple-dark); }
.btn-magenta     { background: var(--cc-magenta); color: var(--white); }
.btn-magenta:hover { opacity: 0.88; }
.btn-approve     { background: var(--green);      color: var(--white); }
.btn-approve:hover { background: #1B5E20; }
.btn-reject      { background: var(--red);        color: var(--white); }
.btn-reject:hover  { background: #B71C1C; }
.btn-outline {
  background: var(--white);
  color: var(--gray-secondary);
  border: 2px solid var(--gray-300);
}
.btn-outline:hover { border-color: var(--cc-purple); color: var(--cc-purple); background: var(--gray-100); }
.btn-ghost        { background: transparent; color: var(--gray-muted); text-transform: none; letter-spacing: 0; }
.btn-ghost:hover  { color: var(--gray-body); }
.btn-sm  { padding: 7px 14px; font-size: 11px; }
.btn-xs  { padding: 4px 10px; font-size: 10px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================================
   APP WRAPPER
   ============================================================ */
#app-wrapper {
  display: none;
  flex-direction: column;
  min-height: 100vh;
}

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
  background: linear-gradient(90deg, var(--cc-magenta) 0%, var(--cc-purple) 100%);
  color: var(--white);
  padding: 12px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

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

.header-logo {
  height: 30px;
  width: auto;
  display: block;
}

.header-sep {
  color: rgba(255,255,255,0.35);
  font-size: 20px;
  line-height: 1;
}

.header-project-name {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.9);
}

#project-selector {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  max-width: 200px;
}
#project-selector option { color: var(--gray-body); background: var(--white); }
#project-selector:focus  { outline: none; }

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

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.4);
}

.user-name-text {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ============================================================
   NAV
   ============================================================ */
.app-nav {
  background: var(--white);
  border-bottom: 2px solid var(--gray-200);
  padding: 0 28px;
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.app-nav::-webkit-scrollbar { display: none; }

.nav-btn {
  padding: 14px 18px;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gray-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all var(--transition);
}
.nav-btn:hover      { color: var(--cc-purple); background: var(--gray-100); }
.nav-btn.active     { color: var(--cc-purple); border-bottom-color: var(--cc-magenta); }

/* ============================================================
   CONTENT
   ============================================================ */
.app-content {
  padding: 28px 32px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  min-height: calc(100vh - 180px);
}

/* ============================================================
   FOOTER
   ============================================================ */
.app-footer {
  padding: 18px 32px;
  border-top: 2px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--gray-muted);
  background: var(--white);
}
.footer-logo {
  height: 22px;
  width: auto;
}
.footer-right {
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.sec-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.3px;
  color: var(--gray-body);
  margin-bottom: 6px;
}
.sec-desc {
  font-size: 14px;
  color: var(--gray-muted);
  margin-bottom: 24px;
}
.subsec-title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--cc-purple);
  margin: 28px 0 16px;
  border-left: 4px solid var(--cc-magenta);
  padding-left: 12px;
}

/* ============================================================
   DASHBOARD STAT CARDS
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  border: 1px solid var(--gray-200);
  border-top: 3px solid var(--cc-magenta);
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-lg); }
.stat-label {
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--gray-muted);
}
.stat-value {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 800;
  margin-top: 6px;
  color: var(--cc-purple);
}

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline { margin: 16px 0 24px; }
.tl-item  {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-200);
}
.tl-item:last-child { border-bottom: none; }
.tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.tl-green  { background: var(--green);  }
.tl-yellow { background: var(--yellow); }
.tl-gray   { background: var(--gray-300); }
.tl-red    { background: var(--red); }
.tl-purple { background: var(--cc-purple); }
.tl-content { flex: 1; }
.tl-title  { font-size: 13px; font-weight: 500; }
.tl-date   { font-size: 11px; color: var(--gray-muted); }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 9px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
}
.badge-draft      { background: var(--gray-100);   color: var(--gray-muted); }
.badge-info       { background: var(--blue-bg);    color: var(--blue); }
.badge-pending    { background: var(--yellow-bg);  color: #B8860B; }
.badge-approved   { background: var(--green-bg);   color: var(--green); }
.badge-rejected   { background: var(--red-bg);     color: var(--red); }
.badge-published  { background: #FFD6ED;            color: var(--cc-magenta); }
.badge-purple     { background: #F0E6FF;            color: var(--cc-purple); }
.badge-revision   { background: var(--orange-bg);  color: var(--orange); }

/* Type badges */
.badge-type         { font-size: 8px; border-radius: 4px; padding: 2px 8px; }
.badge-type--email  { background: #E3F2FD; color: #1565C0; }
.badge-type--ads    { background: #FFF3E0; color: #E65100; }
.badge-type--lp     { background: #F3E5F5; color: #6A1B9A; }
.badge-type--criativos { background: #E8F5E9; color: #2E7D32; }
.badge-type--other  { background: var(--gray-100); color: var(--gray-muted); }

/* ============================================================
   DELIVERABLE CARDS
   ============================================================ */
.deliverable-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}
.d-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--cc-magenta);
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}
.d-card:hover {
  box-shadow: 0 6px 24px rgba(230,0,126,0.12);
  transform: translateY(-2px);
}
.d-card-header {
  padding: 14px 18px;
  background: var(--cc-purple);
  color: var(--white);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.d-card-title {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex: 1;
  line-height: 1.4;
}
.d-card-body  { padding: 16px 18px; }
.d-card-body p { font-size: 13px; color: var(--gray-secondary); margin-bottom: 6px; }
.d-card-meta  { font-size: 11px; color: var(--gray-muted); margin-top: 8px; }
.d-card-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--gray-50);
}

/* ============================================================
   KANBAN
   ============================================================ */
.kanban-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.kfilter-btn {
  padding: 6px 14px;
  border: 2px solid var(--gray-300);
  border-radius: 20px;
  background: var(--white);
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  color: var(--gray-muted);
  transition: all var(--transition);
}
.kfilter-btn:hover { border-color: var(--cc-purple); color: var(--cc-purple); }
.kfilter-btn.active {
  background: var(--cc-purple);
  border-color: var(--cc-purple);
  color: var(--white);
}

.kanban-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 16px;
  align-items: flex-start;
}

.kanban-col {
  flex: 0 0 230px;
  min-width: 230px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.kanban-col-header {
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kanban-col-title {
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.kanban-count {
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 700;
  background: rgba(0,0,0,0.15);
  border-radius: 20px;
  padding: 1px 8px;
}

/* Column header colors */
.kcol--gray      { background: #E0E0E0; color: #555555; }
.kcol--blue      { background: var(--blue); color: var(--white); }
.kcol--lightgray { background: #BDBDBD; color: #444444; }
.kcol--yellow    { background: #F59F00; color: #3D2600; }
.kcol--green     { background: #2E7D32; color: var(--white); }
.kcol--red       { background: var(--red); color: var(--white); }
.kcol--purple    { background: var(--cc-purple); color: var(--white); }
.kcol--magenta   { background: var(--cc-magenta); color: var(--white); }

.kanban-cards {
  min-height: 120px;
  padding: 10px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0;
  cursor: grab;
  transition: box-shadow var(--transition), transform var(--transition);
  user-select: none;
}
.kanban-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}
.kanban-card--ghost { opacity: 0.4; }

.kcard-header {
  padding: 8px 10px 6px;
  border-bottom: 1px solid var(--gray-200);
}
.kcard-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-body);
  line-height: 1.4;
  margin-bottom: 5px;
}
.kcard-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.kcard-actions {
  padding: 6px 8px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* ============================================================
   GANTT
   ============================================================ */
.gantt-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.gantt-view-btn.active {
  background: var(--cc-purple);
  color: var(--white);
  border-color: var(--cc-purple);
}
.gantt-container {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 20px;
  overflow-x: auto;
  box-shadow: var(--shadow);
}
.gantt-container .gantt .bar-wrapper .bar {
  fill: var(--cc-purple) !important;
}
.gantt-container .gantt .bar-wrapper.gantt-status--approved .bar { fill: var(--green) !important; }
.gantt-container .gantt .bar-wrapper.gantt-status--rejected  .bar { fill: var(--red) !important; }
.gantt-container .gantt .bar-wrapper.gantt-status--published .bar { fill: var(--cc-magenta) !important; }
.gantt-container .gantt .bar-wrapper.gantt-status--review    .bar { fill: var(--yellow) !important; }
.gantt-container .gantt .bar-wrapper.gantt-status--draft     .bar { fill: #BDBDBD !important; }

.gantt-popup {
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.6;
  min-width: 180px;
}
.gantt-popup strong { font-family: var(--font-heading); font-size: 12px; font-weight: 700; }

/* ============================================================
   SETTINGS
   ============================================================ */
.settings-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.settings-tab-btn {
  padding: 11px 20px;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--gray-muted);
  border-bottom: 3px solid transparent;
  transition: all var(--transition);
  margin-bottom: -2px;
}
.settings-tab-btn:hover  { color: var(--cc-purple); }
.settings-tab-btn.active { color: var(--cc-purple); border-bottom-color: var(--cc-magenta); }

.settings-form {
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  height: 28px;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  width: 48px;
  height: 24px;
  background: var(--gray-300);
  border-radius: 12px;
  transition: background var(--transition);
  position: relative;
  display: inline-block;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--white);
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle input:checked + .toggle-slider { background: var(--cc-purple); }
.toggle input:checked + .toggle-slider::after { transform: translateX(24px); }

/* Data tables (Users, Projects) */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 13px;
}
.data-table thead { background: var(--cc-purple); }
.data-table th {
  padding: 11px 14px;
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--white);
  text-align: left;
}
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-body);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--gray-50); }

/* API key row */
.api-keys-list { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.api-key-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.api-key-code {
  flex: 1;
  font-family: monospace;
  font-size: 12px;
  word-break: break-all;
  color: var(--cc-purple);
}

/* ============================================================
   MODALS
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(102,36,131,0.55);
  backdrop-filter: blur(2px);
}
.modal-content {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--cc-magenta);
  overflow: hidden;
}
.modal-lg   { max-width: 760px; }
.modal-xl   { max-width: 1100px; width: 96vw; height: 90vh; }

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--white);
  flex-shrink: 0;
}
.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--cc-purple);
}
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--gray-muted);
  padding: 4px;
  line-height: 1;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--red); }
.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
  background: var(--gray-50);
}

/* ============================================================
   COMMENTS MODAL
   ============================================================ */
.comments-list {
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 16px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
}
.comment-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
}
.comment-item:last-child  { border-bottom: none; }
.comment-item:hover       { background: var(--gray-50); }
.comment-item--revision   { border-left: 3px solid var(--orange); padding-left: 11px; }
.comment-item--status     { background: var(--gray-50); }
.comment-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.comment-author {
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--cc-purple);
}
.comment-date { font-size: 11px; color: var(--gray-muted); }
.comment-text { font-size: 13px; color: var(--gray-secondary); line-height: 1.5; }

.comment-input textarea {
  width: 100%;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  font-family: var(--font-body);
  resize: vertical;
  min-height: 80px;
  transition: border-color var(--transition);
}
.comment-input textarea:focus {
  outline: none;
  border-color: var(--cc-purple);
}
.comment-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ============================================================
   EMAIL PREVIEW MODAL
   ============================================================ */
.preview-subject-line {
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  margin-bottom: 6px;
}
.preview-subject-line strong { color: var(--cc-purple); }

#email-preview-iframe {
  width: 100%;
  height: calc(90vh - 380px);
  min-height: 300px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  margin-top: 12px;
}

/* ============================================================
   EDITOR MODAL (XL split pane)
   ============================================================ */
.editor-panes {
  display: flex;
  gap: 0;
  height: calc(90vh - 130px);
  overflow: hidden;
}

.editor-left {
  width: 40%;
  min-width: 300px;
  overflow-y: auto;
  padding: 20px;
  border-right: 2px solid var(--gray-200);
  background: var(--gray-50);
  flex-shrink: 0;
}

.editor-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-right-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  background: var(--white);
  flex-shrink: 0;
}
.editor-right-tab {
  padding: 10px 18px;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--gray-muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.editor-right-tab.active { color: var(--cc-purple); border-bottom-color: var(--cc-magenta); }

.codemirror-wrap {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#codemirror-editor {
  flex: 1;
  overflow: auto;
}
.CodeMirror {
  height: 100%;
  font-size: 13px;
  font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
  border-radius: 0;
}
.CodeMirror-scroll { min-height: 200px; }

#editor-preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: var(--white);
  flex: 1;
  display: none;
}

.editor-form .form-group { margin-bottom: 16px; }
.editor-form select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-body);
  background: var(--white);
  color: var(--gray-body);
}
.editor-form select:focus { outline: none; border-color: var(--cc-purple); }
.editor-form input,
.editor-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-body);
  transition: border-color var(--transition);
}
.editor-form input:focus,
.editor-form textarea:focus {
  outline: none;
  border-color: var(--cc-purple);
}

/* ============================================================
   USER / PROJECT MODALS (small forms)
   ============================================================ */
#modal-user   .modal-content { max-width: 500px; }
#modal-project .modal-content { max-width: 520px; }

/* ============================================================
   REPORTS
   ============================================================ */
.embed-container {
  background: var(--white);
  border: 2px solid var(--cc-magenta);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.embed-header {
  padding: 14px 20px;
  background: var(--cc-purple);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.embed-placeholder {
  height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-muted);
  font-size: 14px;
  background: var(--gray-50);
  text-align: center;
  padding: 20px;
}

/* ============================================================
   TOASTS
   ============================================================ */
#toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: auto;
}
.toast--show     { opacity: 1; transform: translateY(0); }
.toast--ok       { background: var(--green);  color: var(--white); }
.toast--error    { background: var(--red);    color: var(--white); }
.toast--info     { background: var(--cc-purple); color: var(--white); }

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 0;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--cc-purple);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   ROLE-BASED VISIBILITY
   ============================================================ */
.admin-only         { display: none !important; }
.admin-only-inline  { display: none !important; }

body.role-admin .admin-only,
body.role-superadmin .admin-only          { display: block !important; }
body.role-admin .admin-only-inline,
body.role-superadmin .admin-only-inline   { display: inline-flex !important; }

/* Superadmin-only elements */
.superadmin-only { display: none !important; }
body.role-superadmin .superadmin-only { display: block !important; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: var(--gray-muted);
  text-align: center;
}
.empty-state p { font-size: 16px; }

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 900px) {
  /* Editor: stack panes vertically */
  .editor-panes {
    flex-direction: column;
    height: auto;
  }
  .editor-left  { width: 100%; border-right: none; border-bottom: 2px solid var(--gray-200); }
  .editor-right { height: 400px; }
}

@media (max-width: 768px) {
  .app-header  { padding: 10px 14px; }
  .header-project-name { display: none; }
  .app-nav     { padding: 0 12px; }
  .app-content { padding: 18px 14px; }
  .app-footer  { padding: 14px 14px; }

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

  /* Kanban: single-column scrollable */
  .kanban-board {
    flex-direction: column;
  }
  .kanban-col {
    flex: none;
    width: 100%;
    min-width: 0;
  }

  .modal-content { max-width: 100%; margin: 0 10px; }
  .modal-xl      { width: 100%; height: 100vh; border-radius: 0; max-height: 100vh; }

  .gantt-toolbar { flex-wrap: wrap; }

  .settings-tabs { flex-wrap: wrap; }

  #toast-container { bottom: 16px; right: 16px; left: 16px; }
}

@media (max-width: 480px) {
  .auth-card  { padding: 28px 20px; }
  .stat-value { font-size: 24px; }
  .sec-title  { font-size: 18px; }
  .user-name-text { display: none; }
}

/* ============================================================
   ADMIN HUB (superadmin landing)
   ============================================================ */
.admin-hub-header { margin-bottom: 8px; }

.admin-hub-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

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

.admin-hub-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--cc-purple);
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-hub-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.admin-hub-card-header h3 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-body);
  margin: 0;
}

.admin-hub-slug {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--gray-muted);
}

.admin-hub-mods {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge-module {
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.badge-lang {
  background: var(--gray-100);
  color: var(--gray-muted);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
}

.admin-hub-status {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-hub-enter {
  margin-top: auto;
  align-self: flex-start;
}

/* Back bar */
.admin-back-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  background: var(--cc-purple);
  color: rgba(255,255,255,0.9);
  font-family: var(--font-body);
  font-size: 13px;
}
.admin-back-bar strong {
  color: var(--white);
  font-weight: 600;
}
.admin-back-bar .btn-ghost {
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.3);
  font-size: 11px;
}
.admin-back-bar .btn-ghost:hover {
  background: rgba(255,255,255,0.15);
  color: var(--white);
}

/* Admin Hub filter bar */
.admin-hub-filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.admin-hub-filter-select {
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  background: var(--white);
  min-width: 180px;
  cursor: pointer;
}
.admin-hub-filter-select:focus {
  border-color: var(--cc-purple);
  outline: none;
  box-shadow: 0 0 0 2px rgba(102,36,131,0.15);
}
/* Admin Hub tabs spacing */
.admin-hub-tabs {
  margin-bottom: 20px;
}
.admin-hub-tab-body {
  min-height: 300px;
}
/* Kanban project tag on cards */
.kcard-project-tag {
  display: inline-block;
  border-radius: 4px;
  padding: 1px 6px;
}

@media (max-width: 640px) {
  .admin-hub-grid { grid-template-columns: 1fr; }
  .admin-hub-filter-bar { flex-direction: column; }
  .admin-hub-filter-select { min-width: 100%; }
}

/* User form — project checkboxes */
.uf-projects-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--gray-50);
}
.uf-project-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}
.uf-project-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--cc-purple);
}
/* Kanban card status dropdown */
.kcard-status-select {
  padding: 3px 6px;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  font-size: 11px;
  background: var(--white);
  cursor: pointer;
}

/* ====================================================================
   Revision Workflow
   ==================================================================== */
.revision-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 8px;
  background: #fff3cd;
  color: #856404;
  font-weight: 600;
  margin-left: 4px;
  vertical-align: middle;
}
.revision-badge.needs-approval {
  background: #f8d7da;
  color: #721c24;
}
.revision-bar {
  padding: 12px;
  background: #fffde7;
  border: 1px solid #ffe082;
  border-radius: 6px;
  margin-top: 10px;
}
.revision-count {
  font-size: 12px;
  font-weight: 600;
  color: #856404;
  margin-bottom: 6px;
}
.revision-objection {
  font-size: 13px;
  color: #5d4037;
  margin-bottom: 8px;
  padding: 8px 10px;
  background: #fff;
  border-left: 3px solid #ff9800;
  border-radius: 4px;
}
.revision-defense {
  font-size: 13px;
  color: #1b5e20;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: #e8f5e9;
  border-left: 3px solid #4caf50;
  border-radius: 4px;
}
.revision-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.revision-actions .text-muted {
  font-size: 12px;
  color: #999;
  font-style: italic;
}
#revision-objection-input textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  resize: vertical;
}
/* Defense comment style in comments list */
.comment-item--defense {
  background: #e8f5e9;
  border-left: 3px solid #4caf50;
}

/* Admin revision controls in editor */
.revision-admin-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  background: #fff3e0;
  border-radius: 6px;
  font-size: 12px;
}
