/* Ppress CRM — Design System */

:root {
  color-scheme: light;

  /* === Ppress brand tokens === */
  --pp-black:       #0D0D0D;
  --pp-black-soft:  #1A1A1A;
  --pp-gold:        #F5A800;
  --pp-gold-dark:   #D4920A;
  --pp-gold-light:  #FFF8E3;
  --pp-gold-subtle: #FEF3C7;
  --pp-white:       #FFFFFF;
  --pp-blue-data:   #1E3A8A;

  /* === Semantic aliases (used throughout existing CSS) === */
  --primary:       #F5A800;
  --primary-dark:  #D4920A;
  --primary-light: #FFF8E3;
  --secondary:     #6b7280;
  --danger:        #dc2626;
  --success:       #15803d;
  --bg:            #F3F4F6;
  --card-bg:       #FFFFFF;
  --border:        #E5E7EB;
  --text:          #1A1A1A;
  --text-light:    #6B7280;

  /* === Typography === */
  --font-brand: 'Nunito', -apple-system, sans-serif;
  --font-body:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-family: var(--font-body);
}

* {
  box-sizing: border-box;
}

html, body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
}

/* ===== LOGIN PAGE ===== */

#login-page {
  background: var(--pp-black);
  background-image:
    radial-gradient(ellipse at 20% 80%, rgba(245,168,0,0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(245,168,0,0.05) 0%, transparent 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

#login-page .card {
  width: min(420px, 100%);
  background: var(--pp-black-soft);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  padding: 40px 36px;
  border: 1px solid rgba(245,168,0,0.15);
}

#login-page h1 {
  color: var(--pp-white);
  font-family: var(--font-brand);
  font-weight: 900;
  text-align: center;
  font-size: 2rem;
  margin-bottom: 6px;
}

#login-page > main > .card > p {
  color: rgba(255,255,255,0.5);
  text-align: center;
  margin-bottom: 28px;
  font-size: 0.9rem;
}

#login-page label {
  color: rgba(255,255,255,0.7);
  font-size: 0.875rem;
}

#login-page input[type="text"],
#login-page input[type="password"] {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--pp-white);
  border-radius: 10px;
}

#login-page input::placeholder {
  color: rgba(255,255,255,0.3);
}

#login-page input:focus {
  border-color: var(--pp-gold);
  outline-color: rgba(245,168,0,0.4);
  background: rgba(255,255,255,0.08);
}

#login-page .btn-primary {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  margin-top: 4px;
}

#login-page .info {
  color: rgba(255,255,255,0.3);
  font-size: 0.78rem;
  text-align: center;
}

#login-page .error {
  color: #FCA5A5;
  text-align: center;
}

/* ===== APP ===== */

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app.hidden {
  display: none;
}

/* ===== NAVBAR ===== */

.navbar {
  background: var(--pp-black);
  border-bottom: none;
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 16px rgba(0,0,0,0.4);
  position: sticky;
  top: 0;
  z-index: 200;
  flex-shrink: 0;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-brand);
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--pp-white);
  margin-right: 28px;
  letter-spacing: -0.5px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.navbar-menu {
  display: flex;
  gap: 4px;
  flex: 1;
  align-items: center;
}

.nav-link {
  padding: 7px 13px;
  border-radius: 8px;
  text-decoration: none;
  color: rgba(255,255,255,0.7);
  transition: background 150ms ease, color 150ms ease;
  cursor: pointer;
  border: none;
  background: none;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  font-family: var(--font-body);
}

.nav-link:hover {
  background: rgba(245,168,0,0.12);
  color: var(--pp-gold);
}

.nav-link.active {
  background: rgba(245,168,0,0.18);
  color: var(--pp-gold);
  font-weight: 600;
}

.nav-link.admin-only {
  display: none;
}

.admin .nav-link.admin-only {
  display: block;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  color: rgba(255,255,255,0.55);
  font-size: 0.8rem;
  flex-shrink: 0;
}

#logout-btn {
  padding: 7px 14px;
  border: 1px solid rgba(245,168,0,0.4);
  border-radius: 8px;
  background: transparent;
  color: var(--pp-gold);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 150ms ease, border-color 150ms ease;
  font-family: var(--font-body);
}

#logout-btn:hover {
  background: rgba(245,168,0,0.15);
  border-color: var(--pp-gold);
}

/* Hamburger — only visible on mobile */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.hamburger-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--pp-white);
  border-radius: 2px;
  transition: transform 250ms ease, opacity 250ms ease;
  transform-origin: center;
}

.navbar.nav-open .hamburger-btn span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.navbar.nav-open .hamburger-btn span:nth-child(2) {
  opacity: 0;
}
.navbar.nav-open .hamburger-btn span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== CONTAINER ===== */

.container {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ===== PAGES ===== */

.page-section {
  animation: fadeIn 200ms ease;
}

.page-section.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1 {
  margin-top: 0;
  margin-bottom: 24px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-family: var(--font-brand);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
}

h2 {
  margin-top: 0;
  margin-bottom: 16px;
  font-family: var(--font-brand);
  font-weight: 800;
}

h3 {
  font-family: var(--font-brand);
  font-weight: 700;
}

/* ===== BUTTONS ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 150ms ease, border-color 150ms ease;
  text-decoration: none;
  min-height: 42px;
  white-space: nowrap;
  font-family: var(--font-body);
  line-height: 1;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--pp-gold);
  color: var(--pp-black);
  font-weight: 700;
}

.btn-primary:hover {
  background: var(--pp-gold-dark);
  box-shadow: 0 4px 14px rgba(245,168,0,0.35);
}

.btn-primary:disabled,
.btn-primary[disabled] {
  background: #E5E7EB;
  color: #9CA3AF;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: #F3F4F6;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #E9EAEC;
  border-color: #D1D5DB;
}

.btn-success {
  background: #15803d;
  color: white;
}

.btn-success:hover {
  background: #166534;
  box-shadow: 0 4px 12px rgba(21,128,61,0.3);
}

.btn-link {
  background: none;
  color: var(--pp-gold);
  padding: 8px 12px;
  margin-bottom: 16px;
  border: none;
  min-height: unset;
}

.btn-link:hover {
  text-decoration: underline;
  transform: none;
}

/* ===== DASHBOARD ===== */

.welcome-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 24px;
}

.welcome-card p {
  margin: 0 0 16px 0;
  font-size: 1.1rem;
}

.role-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-radius: 12px;
  background: var(--primary-light);
}

.role-display strong {
  color: var(--primary);
}

/* ===== FORMS ===== */

form {
  display: grid;
  gap: 16px;
}

.form-large {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  gap: 24px;
}

fieldset {
  border: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}

legend {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 2px solid var(--pp-gold);
  width: 100%;
  font-family: var(--font-brand);
}

label {
  display: grid;
  gap: 8px;
  font-weight: 500;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1rem;
  font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--primary);
  border-color: var(--primary);
}

textarea {
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* ===== MODALS ===== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
}

.modal.hidden {
  display: none;
  pointer-events: none;
}

.modal-content {
  background: var(--card-bg);
  border-radius: 16px;
  width: min(500px, 100%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  margin: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-light);
  transition: color 160ms ease;
}

.modal-close:hover {
  color: var(--text);
}

.modal-content form {
  padding: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  justify-content: flex-end;
}

/* ===== CLIENTS ===== */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.client-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.client-card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.client-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.client-card-header h3 {
  margin: 0;
}

.client-color-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.client-card h3 {
  margin: 0 0 8px 0;
  color: var(--text);
  font-family: var(--font-brand);
  font-weight: 800;
}

/* .subcategory-tag defined with badge-priority section */

/* ===== PERFIL DO CLIENTE ===== */

.color-field-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.color-pair-preview {
  display: flex;
  gap: 6px;
  padding-bottom: 8px;
  flex-shrink: 0;
}

.color-preview-chip {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.subcategory-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sub-item-name {
  font-size: 0.9rem;
  font-weight: 500;
}

.sub-item-actions {
  display: flex;
  gap: 4px;
}

.btn-sub-profile {
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 7px;
  border-radius: 5px;
  color: var(--text-light);
  line-height: 1;
}

.btn-sub-profile:hover {
  background: var(--bg);
  color: var(--primary);
}

.btn-sm {
  font-size: 0.8rem;
  padding: 6px 14px;
}

.subcategory-profile-panel {
  margin-top: 8px;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  display: grid;
  gap: 10px;
}

.subcategory-profile-panel label {
  font-size: 0.82rem;
  color: var(--text-light);
}

.subcategory-profile-panel input,
.subcategory-profile-panel select {
  font-size: 0.85rem;
  padding: 6px 10px;
}

.detail-section-about {
  border-left: 3px solid var(--pp-gold);
  background: var(--pp-gold-light);
  border-radius: 0 10px 10px 0;
  padding: 12px 16px;
  margin-bottom: 4px;
}

.detail-section-about h3 {
  margin: 0 0 10px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--pp-gold-dark);
}

/* Gerenciamento de sub-categorias no modal de cliente */
.form-section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0 12px;
}

.form-section-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 10px;
}

.subcategory-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg);
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.btn-remove-sub {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  font-size: 0.85rem;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}

.btn-remove-sub:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.subcategory-add-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.subcategory-add-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
}

.subcategory-add-row .btn {
  white-space: nowrap;
}

.client-card p {
  margin: 0;
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.5;
}

.client-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.client-card-actions button {
  padding: 6px 12px;
  font-size: 0.9rem;
}

/* ===== DEMANDS TABLE ===== */

.demands-table-wrapper {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.demands-table {
  width: 100%;
  border-collapse: collapse;
}

.demands-table thead {
  background: var(--pp-black);
  border-bottom: 2px solid var(--pp-gold);
}

.demands-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 700;
  color: var(--pp-gold);
  font-family: var(--font-brand);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.demands-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.demands-table tbody tr {
  cursor: pointer;
  transition: background 160ms ease;
}

.demands-table tbody tr:hover {
  background: var(--bg);
}

.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.badge-status {
  background: #DBEAFE;
  color: #1E3A8A;
}

.badge-status.nao-iniciado {
  background: #F3F4F6;
  color: #4B5563;
}

.badge-status.entregue {
  background: #DCFCE7;
  color: #15803D;
}

.badge-status.producao {
  background: #FEF9C3;
  color: #92400E;
}

.badge-status.aguardando {
  background: #FEE2C8;
  color: #9A3412;
}

.badge-priority {
  background: var(--pp-gold-subtle);
  color: #92400E;
}

.badge-priority.urgente {
  background: #FEE2E2;
  color: #991B1B;
  font-weight: 700;
}

.subcategory-tag {
  background: rgba(245,168,0,0.12);
  color: #92400E;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  display: inline-block;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ===== DEMAND DETAIL ===== */

.demand-detail {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.detail-header {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--border);
}

.detail-header h2 {
  margin: 0 0 12px 0;
  color: var(--text);
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.detail-field {
  display: grid;
  gap: 4px;
}

.detail-field label {
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 600;
}

.detail-field value {
  font-size: 1rem;
  color: var(--text);
}

.detail-section {
  margin-bottom: 24px;
}

.detail-section h3 {
  margin: 0 0 12px 0;
  font-size: 0.95rem;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.detail-description {
  background: var(--bg);
  padding: 16px;
  border-radius: 10px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.detail-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
}

/* ===== UTILITIES ===== */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-light);
}

.error {
  color: var(--danger);
  font-size: 0.95rem;
  display: block;
  min-height: 1.2rem;
  margin-top: 4px;
}

.info {
  color: var(--text-light);
  font-size: 0.95rem;
}

.success {
  background: #dcfce7;
  color: var(--success);
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
}

/* ===== CALENDAR ===== */

.cal-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.cal-page-header h1 {
  margin: 0;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cal-month-label {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  min-width: 160px;
  text-align: center;
  font-family: var(--font-brand);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--pp-black);
  border: 1px solid var(--pp-black);
  border-bottom: 2px solid var(--pp-gold);
  border-radius: 12px 12px 0 0;
}

.cal-weekday {
  padding: 10px 6px;
  text-align: center;
  font-weight: 700;
  color: var(--pp-gold);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  font-family: var(--font-brand);
}

.cal-cells {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
  background: var(--card-bg);
  margin-bottom: 32px;
}

.cal-cell {
  min-height: 110px;
  padding: 5px 4px 4px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.cal-cell:nth-child(7n) {
  border-right: none;
}

.cal-cell-empty {
  background: #f9fafb;
}

.cal-cell-today {
  background: #eef2ff;
}

.cal-day-num {
  display: block;
  text-align: right;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--pp-blue-data);
  margin-bottom: 4px;
}

.cal-cell-empty .cal-day-num {
  color: #D1D5DB;
}

.cal-day-today {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--pp-gold);
  color: var(--pp-black);
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 800;
  float: right;
}

.cal-cell-today {
  background: var(--pp-gold-light);
}

.cal-day-demands {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 82px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.cal-card {
  background: #eef2ff;
  border-left: 3px solid var(--primary);
  border-radius: 3px;
  padding: 3px 5px;
  font-size: 0.7rem;
  cursor: pointer;
  line-height: 1.3;
  transition: opacity 150ms ease;
  overflow: hidden;
}

.cal-card:hover {
  opacity: 0.72;
}

.cal-card-urgent {
  background: #fee2e2;
  border-left-color: #dc2626;
}

.cal-card-client {
  display: block;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-card-urgent .cal-card-client {
  color: #b91c1c;
}

.cal-card-title {
  display: block;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-card-dot {
  font-size: 0.65rem;
}

.cal-card-status {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* ===== CLIENT DETAIL PAGE ===== */

.client-detail-header {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 16px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.client-detail-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.client-detail-title-row h2 {
  margin: 0;
  font-size: 1.5rem;
}

.client-detail-notes {
  margin: 4px 0 12px 0;
  color: var(--text-light);
  font-size: 0.95rem;
}

.client-cadence-line {
  margin: 4px 0 10px;
  font-size: 0.85rem;
  color: var(--text-light);
}

.client-detail-stats {
  display: flex;
  gap: 24px;
  font-size: 0.9rem;
  color: var(--text-light);
  flex-wrap: wrap;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-light);
  margin: 6px 0 0;
  line-height: 1.4;
}

.client-detail-stats strong {
  color: var(--text);
}

.cal-card-client-view .cal-card-client {
  display: none;
}

/* ===== KANBAN ===== */

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: start;
}

.kb-column {
  background: #f3f4f6;
  border-radius: 12px;
  padding: 12px;
  min-height: 240px;
  transition: background 140ms ease, outline 140ms ease;
}

.kb-col-over {
  background: #e0e7ff;
  outline: 2px dashed var(--primary);
  outline-offset: -2px;
}

.kb-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 10px;
}

.kb-col-count {
  background: var(--border);
  color: var(--text-light);
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.kb-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kb-card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 11px 13px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  border-left: 3px solid var(--primary);
  cursor: pointer;
  transition: box-shadow 150ms ease, transform 150ms ease, opacity 150ms ease;
}

.kb-card[draggable="true"] {
  cursor: grab;
}

.kb-card[draggable="true"]:active {
  cursor: grabbing;
}

.kb-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transform: translateY(-1px);
}

.kb-dragging {
  opacity: 0.45;
}

.kb-card-urgent {
  border-left-color: #dc2626;
}

.kb-card-locked {
  opacity: 0.6;
  cursor: default;
}

.kb-card-locked:hover {
  transform: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.kb-card-client {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kb-card-urgent .kb-card-client {
  color: #b91c1c;
}

.kb-card-title {
  font-size: 0.875rem;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.35;
}

.kb-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-light);
}

.kb-badge-urgent {
  background: #fee2e2;
  color: #b91c1c;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 600;
}

.kb-badge-locked {
  font-size: 0.68rem;
}

.kb-empty {
  color: var(--text-light);
  font-size: 0.85rem;
  text-align: center;
  padding: 24px 0;
}

@media (max-width: 960px) {
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .kanban-board {
    grid-template-columns: 1fr;
  }
  .cal-weekday { font-size: 0.7rem; padding: 6px 2px; }
}

/* ===== WHATSAPP BUTTON ===== */

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #25d366;
  color: white;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 160ms ease, transform 160ms ease;
  border: none;
  cursor: pointer;
}

.btn-whatsapp:hover {
  background: #1ebe57;
  transform: translateY(-1px);
}

.whatsapp-icon {
  font-size: 1rem;
}

.no-contact-info {
  color: var(--text-light);
  font-size: 0.9rem;
  font-style: italic;
}

.detail-field-whatsapp {
  grid-column: 1 / -1;
}

/* ===== PROFILE PAGE ===== */

.profile-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  max-width: 720px;
  display: grid;
  gap: 28px;
}

/* Identity header */
.profile-identity {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--border);
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.profile-meta {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* Section headers */
.profile-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 14px 0;
}

.profile-section-desc {
  font-size: 0.875rem;
  color: var(--text-light);
  margin: -8px 0 16px 0;
}

/* Statistics */
.profile-stats {
  padding-bottom: 4px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--bg);
  border-radius: 12px;
  padding: 18px 16px;
  text-align: center;
  border: 1px solid var(--border);
}

.stat-card-highlight {
  background: var(--primary-light);
  border-color: var(--primary);
}

.stat-card-urgent {
  background: #fff1f2;
  border-color: #fca5a5;
}

.stat-card-clients {
  background: #f0fdf4;
  border-color: #86efac;
}

.stat-number {
  display: block;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-card-highlight .stat-number {
  color: var(--primary);
}

.stat-card-urgent .stat-number {
  color: #dc2626;
}

.stat-card-clients .stat-number {
  color: #16a34a;
}

.stat-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 500;
  line-height: 1.3;
}

/* WhatsApp section */
.profile-whatsapp-section {
  border-top: 2px solid var(--border);
  padding-top: 20px;
}

/* Legacy fields (kept for back-compat) */
.profile-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border);
}

.field-hint {
  display: block;
  color: var(--text-light);
  font-size: 0.8rem;
  font-weight: 400;
  margin-bottom: 4px;
}

.whatsapp-preview {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #dcfce7;
  color: #166534;
  font-size: 0.9rem;
}

.whatsapp-preview.no-number {
  background: #fef9c3;
  color: #854d0e;
}

.whatsapp-preview a {
  color: #166534;
  font-weight: 600;
}

/* ===== IMPORT CRONOGRAMA ===== */

.import-upload-card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  max-width: 640px;
  display: grid;
  gap: 16px;
}

.import-desc {
  margin: 0;
  color: var(--text-light);
  font-size: 0.95rem;
}

.import-file-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.import-file-btn {
  cursor: pointer;
  white-space: nowrap;
}

.import-file-name {
  font-size: 0.875rem;
  color: var(--text-light);
  font-style: italic;
}

.import-format-hint {
  margin-top: 28px;
  max-width: 640px;
}

.import-format-hint h3 {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 8px;
}

.import-format-pre {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.6;
  white-space: pre;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
}

.import-preview-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.import-preview-summary {
  margin: 4px 0 0;
  color: var(--text-light);
  font-size: 0.9rem;
}

.import-settings-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 24px;
}

.import-settings-card h3 {
  margin: 0 0 14px;
  font-size: 0.95rem;
  color: var(--primary);
  font-weight: 700;
}

.import-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.import-group {
  background: var(--card-bg);
  border-radius: 12px;
  border: 2px solid var(--border);
  margin-bottom: 16px;
  overflow: hidden;
  transition: border-color 200ms ease, opacity 200ms ease;
}

.import-group-alert {
  border-color: #fca5a5;
  background: #fff5f5;
}

.import-group-skipped {
  opacity: 0.45;
}

.import-group-skipped .import-group-bd {
  pointer-events: none;
}

.import-group-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.import-group-alert .import-group-hd {
  background: #fee2e2;
}

.import-group-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  flex: 1;
}

.import-group-badge {
  font-size: 0.75rem;
  background: var(--border);
  color: var(--text-light);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.import-skip-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-light);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.import-group-bd {
  padding: 16px;
}

.import-group-selects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.import-posts {
  display: grid;
  gap: 8px;
}

.import-post {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: grid;
  gap: 5px;
}

.import-post-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.import-post-skip-label {
  font-size: 0.78rem;
}

.imp-post-date {
  font-size: 0.82rem;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  color: var(--text);
}

.import-post-title-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.import-post-desc {
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.4;
}

.imp-desc-preview {
  display: inline;
}

.btn-link-xs {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0 4px;
  text-decoration: underline;
  font-weight: 600;
}

.btn-link-xs:hover {
  color: var(--primary-dark);
}

.import-confirm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--card-bg);
  border-top: 2px solid var(--border);
  padding: 16px 0;
  margin-top: 24px;
  position: sticky;
  bottom: 0;
  flex-wrap: wrap;
}

.import-status-msg {
  font-size: 0.875rem;
  color: var(--text-light);
  flex: 1;
}

.import-success-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 40px 32px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  max-width: 520px;
  text-align: center;
}

.import-success-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

@media (max-width: 640px) {
  .import-group-selects {
    grid-template-columns: 1fr;
  }
  .import-settings-grid {
    grid-template-columns: 1fr 1fr;
  }
  .import-confirm-footer {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ===== RESPONSIVE ===== */

/* --- Tablet (768px) --- */
@media (max-width: 768px) {
  .container {
    padding: 20px 16px;
  }

  .clients-grid {
    grid-template-columns: 1fr;
  }

  .detail-meta {
    grid-template-columns: 1fr;
  }

  .modal-content {
    width: 95%;
  }

  .form-large {
    padding: 18px 16px;
  }

  fieldset {
    grid-template-columns: 1fr;
  }
}

/* --- Mobile hamburger menu (640px) --- */
@media (max-width: 640px) {
  .navbar {
    position: sticky;
    top: 0;
  }

  .hamburger-btn {
    display: flex;
  }

  .navbar-brand {
    margin-right: 0;
  }

  .navbar-user {
    display: none; /* hidden until menu is open on mobile */
  }

  .navbar-menu {
    display: none;
    position: absolute;
    top: 58px;
    left: 0;
    right: 0;
    background: var(--pp-black-soft);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px 20px;
    border-bottom: 2px solid var(--pp-gold);
    z-index: 199;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    gap: 2px;
  }

  .navbar.nav-open .navbar-menu {
    display: flex;
  }

  .nav-link {
    padding: 12px 16px;
    font-size: 1rem;
    border-radius: 10px;
    color: rgba(255,255,255,0.85);
  }

  .nav-link:hover,
  .nav-link.active {
    background: rgba(245,168,0,0.15);
    color: var(--pp-gold);
  }

  .navbar.nav-open .navbar-user {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px 0;
    gap: 10px;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.55);
  }

  /* Calendar — horizontal scroll on mobile */
  #calendar-root {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cal-weekdays,
  .cal-cells {
    min-width: 560px;
  }

  .cal-cell {
    min-height: 80px;
  }

  .cal-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .cal-page-header h1 {
    margin-bottom: 0;
  }

  /* Kanban — horizontal scroll with snap */
  .kanban-board {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 12px;
    padding-bottom: 16px;
  }

  .kb-column {
    min-width: 280px;
    flex-shrink: 0;
    scroll-snap-align: start;
  }

  /* Demands table — horizontal scroll */
  .demands-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .demands-table {
    min-width: 520px;
  }

  /* Modals — full screen on mobile */
  .modal {
    padding: 0;
    align-items: flex-end;
  }

  .modal-content {
    width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    overflow-y: auto;
  }

  /* Forms */
  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Page header */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  /* Detail actions */
  .detail-actions {
    flex-direction: column;
  }

  /* Client card actions */
  .client-card-actions {
    flex-wrap: wrap;
  }

  /* Profile stats */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Import settings */
  .import-settings-grid {
    grid-template-columns: 1fr;
  }

  /* Import group selects */
  .import-group-selects {
    grid-template-columns: 1fr;
  }

  /* Cal nav */
  .cal-nav {
    width: 100%;
    justify-content: space-between;
  }

  /* Container */
  .container {
    padding: 16px 14px;
  }

  /* Success card */
  .import-success-card {
    padding: 28px 20px;
  }
}

