/* =====================================
   Croissant Digital — Platform Styles
   Branding: oranje #FF4F00, donker #1A1714, cream #FFFCF7
   ===================================== */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --orange: #FF4F00;
  --orange-hover: #E54700;
  --orange-soft: #FFE8DE;
  --dark: #1A1714;
  --cream: #FFFCF7;
  --white: #FFFFFF;
  --text: #1A1714;
  --text-light: #555;
  --text-muted: #888;
  --border: #EEE8E1;
  --border-soft: #F5F0E9;
  --success: #16A34A;
  --warning: #E65100;
  --error: #C62828;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 4px 20px rgba(26,23,20,0.06);
  --shadow-hover: 0 6px 28px rgba(26,23,20,0.1);

  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'DM Serif Display', Georgia, serif;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--cream);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: 1rem; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: all 0.2s;
  border: 2px solid transparent;
  cursor: pointer;
}
.btn--primary { background: var(--orange); color: white; box-shadow: 0 4px 16px rgba(255,79,0,0.25); }
.btn--primary:hover { background: var(--orange-hover); color: white; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255,79,0,0.35); }
.btn--secondary { background: var(--dark); color: white; }
.btn--secondary:hover { background: #000; color: white; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--dark); }
.btn--sm { padding: 8px 16px; font-size: 0.85rem; }
.btn--lg { padding: 16px 32px; font-size: 1rem; }
.btn--block { width: 100%; }
.btn--danger { background: var(--error); color: white; }

/* ===== Forms ===== */
.form { display: flex; flex-direction: column; gap: 20px; }
.form__group { display: flex; flex-direction: column; gap: 8px; }
.form__label { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-light); }
.form__input, .form__textarea, .form__select {
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--text);
  transition: border-color 0.2s;
  font-size: 16px;
}
.form__input:focus, .form__textarea:focus, .form__select:focus {
  outline: none;
  border-color: var(--orange);
}
.form__textarea { min-height: 100px; resize: vertical; font-family: inherit; }
.form__hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.form__error {
  background: #FFEBEE;
  color: var(--error);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  border-left: 3px solid var(--error);
}
.form__success {
  background: #E8F5E9;
  color: var(--success);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  border-left: 3px solid var(--success);
}

/* ===== Auth Pages ===== */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--cream);
}
.auth-page__left {
  background: var(--dark);
  color: white;
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-page__logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
}
.auth-page__logo em { color: var(--orange); font-style: normal; }
.auth-page__intro {
  max-width: 420px;
}
.auth-page__intro h1 {
  font-family: var(--font-display);
  font-size: 3rem;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}
.auth-page__intro h1 em {
  color: var(--orange);
  font-style: italic;
}
.auth-page__intro p {
  color: rgba(255,255,255,0.7);
  font-size: 1.05rem;
  line-height: 1.7;
}
.auth-page__footer {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
}
.auth-page__right {
  padding: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card {
  width: 100%;
  max-width: 440px;
}
.auth-card h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 8px;
}
.auth-card__subtitle {
  color: var(--text-light);
  margin-bottom: 32px;
}
.auth-card__footer {
  margin-top: 24px;
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-page__left { padding: 40px; min-height: auto; }
  .auth-page__intro h1 { font-size: 2rem; }
  .auth-page__right { padding: 40px 24px; }
}

/* ===== Shell (logged in) ===== */
.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.shell__sidebar {
  background: var(--dark);
  color: white;
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.shell__logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
}
.shell__logo em {
  color: var(--orange);
  font-style: normal;
  font-weight: bold;
}
.shell__role {
  display: inline-block;
  padding: 2px 10px;
  background: var(--orange);
  color: white;
  border-radius: 50px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 4px;
  align-self: flex-start;
}
.shell__role--superadmin { background: var(--orange); }
.shell__role--developer { background: #4A90E2; }
.shell__role--client { background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.8); }

.shell__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.shell__nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.shell__nav a:hover {
  background: rgba(255,255,255,0.06);
  color: white;
}
.shell__nav a.active {
  background: var(--orange);
  color: white;
}
.shell__nav a.active:hover {
  background: var(--orange-hover);
  color: white;
}
.shell__nav-icon {
  width: 18px;
  display: flex;
  justify-content: center;
}

.shell__bottom {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.85rem;
}
.shell__user {
  font-weight: 600;
  color: white;
  margin-bottom: 2px;
}
.shell__user-email {
  color: rgba(255,255,255,0.5);
  font-size: 0.8rem;
  margin-bottom: 12px;
  word-break: break-all;
}
.shell__logout {
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
}
.shell__logout:hover { color: white; }

.shell__main {
  padding: 32px 48px;
  overflow-x: hidden;
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .shell__sidebar {
    padding: 20px 24px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
  }
  .shell__nav { flex-direction: row; flex-wrap: wrap; width: 100%; margin-top: 8px; }
  .shell__nav a { padding: 8px 12px; }
  .shell__bottom { margin-top: 0; padding-top: 0; border-top: none; margin-left: auto; display: flex; flex-direction: column; }
  .shell__main { padding: 24px 20px; }
}

/* ===== Page headers ===== */
.page-header {
  margin-bottom: 32px;
}
.page-header__tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 8px;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-bottom: 8px;
}
.page-header p {
  color: var(--text-light);
  font-size: 1rem;
  max-width: 640px;
  line-height: 1.6;
}

/* ===== Cards / Sections ===== */
.card {
  background: white;
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 16px;
}
.card__subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ===== Welcome banner ===== */
.welcome {
  background: var(--dark);
  color: white;
  border-radius: var(--radius);
  padding: 40px;
  margin-bottom: 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
}
.welcome__icon {
  font-size: 3rem;
}
.welcome h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 8px;
}
.welcome p {
  color: rgba(255,255,255,0.75);
  line-height: 1.7;
}
.welcome__flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 24px;
}
.welcome__step {
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.welcome__step-num {
  color: var(--orange);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.welcome__step-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.welcome__step-desc {
  color: rgba(255,255,255,0.6);
  font-size: 0.8rem;
  line-height: 1.4;
}
@media (max-width: 900px) {
  .welcome { grid-template-columns: 1fr; }
  .welcome__flow { grid-template-columns: 1fr 1fr; }
}

/* ===== Kanban board ===== */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
}
.kanban__column {
  background: var(--border-soft);
  border-radius: var(--radius);
  padding: 16px;
  min-height: 400px;
}
.kanban__column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 4px;
}
.kanban__column-title {
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}
.kanban__column-count {
  background: rgba(0,0,0,0.08);
  color: var(--text-light);
  padding: 2px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
}
.kanban__column--backlog { border-top: 3px solid #AAA; }
.kanban__column--in-progress { border-top: 3px solid #4A90E2; }
.kanban__column--finished { border-top: 3px solid var(--orange); }
.kanban__column--approved { border-top: 3px solid var(--success); }

.task-card {
  background: white;
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  transition: all 0.15s;
  cursor: pointer;
}
.task-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}
.task-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
}
.task-card__title {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
  color: var(--text);
}
.task-card__desc {
  color: var(--text-light);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-top: 4px;
}
.task-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge--light { background: #E8F5E9; color: var(--success); }
.badge--medium { background: #FFF3E0; color: #E65100; }
.badge--heavy { background: #FFEBEE; color: var(--error); }
.badge--new { background: #E8EAF4; color: #3F51B5; }
.badge--status { background: var(--border-soft); color: var(--text); }

@media (max-width: 900px) {
  .kanban { grid-template-columns: 1fr; }
}

/* ===== Chat ===== */
.chat-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  height: calc(100vh - 140px);
}
.chat-list {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.chat-list__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.chat-list__title {
  font-weight: 700;
  font-size: 0.9rem;
}
.chat-list__item {
  display: block;
  padding: 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  margin-bottom: 4px;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border-soft);
}
.chat-list__item:last-child { border-bottom: none; }
.chat-list__item:hover { background: var(--border-soft); color: var(--text); }
.chat-list__item.active { background: var(--orange-soft); color: var(--text); }
.chat-list__item-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-list__item-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chat-window {
  background: white;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.chat-window__header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.chat-window__messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-message {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
}
.chat-message--client {
  align-self: flex-end;
  background: var(--orange);
  color: white;
  border-bottom-right-radius: 4px;
}
.chat-message--developer, .chat-message--agent, .chat-message--superadmin {
  align-self: flex-start;
  background: var(--border-soft);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-message__meta {
  font-size: 0.7rem;
  opacity: 0.7;
  margin-top: 4px;
}
.chat-window__compose {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
}
.chat-window__compose textarea {
  flex: 1;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  resize: none;
  font-family: inherit;
  min-height: 44px;
  max-height: 120px;
}
.chat-window__compose textarea:focus {
  outline: none;
  border-color: var(--orange);
}
.chat-window__empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  padding: 40px;
  text-align: center;
}

@media (max-width: 900px) {
  .chat-shell { grid-template-columns: 1fr; height: auto; }
  .chat-list { max-height: 300px; }
}

/* ===== Tables ===== */
.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.table th {
  background: var(--border-soft);
  text-align: left;
  padding: 14px 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.92rem;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--border-soft); }
.table a { color: var(--text); font-weight: 600; }
.table a:hover { color: var(--orange); }

/* ===== Stats grid ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--orange);
}
.stat-card__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 8px;
}
.stat-card__value {
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 1;
  color: var(--text);
}

/* ===== Onboarding ===== */
.onboarding {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--cream);
}
.onboarding__card {
  width: 100%;
  max-width: 680px;
  background: white;
  border-radius: 20px;
  padding: 48px;
  box-shadow: var(--shadow);
}
.onboarding__progress {
  display: flex;
  gap: 4px;
  margin-bottom: 32px;
}
.onboarding__dot {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
}
.onboarding__dot.active { background: var(--orange); }
.onboarding__step {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 8px;
}
.onboarding h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.2;
  margin-bottom: 12px;
}
.onboarding__intro {
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 32px;
}
.onboarding__options {
  display: grid;
  gap: 12px;
  margin-bottom: 32px;
}
.onboarding__option {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.onboarding__option:hover { border-color: var(--orange); background: var(--orange-soft); }
.onboarding__option input { margin-top: 3px; accent-color: var(--orange); flex-shrink: 0; }
.onboarding__option-title { font-weight: 600; margin-bottom: 4px; }
.onboarding__option-desc { font-size: 0.85rem; color: var(--text-light); line-height: 1.5; }

.onboarding__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

@media (max-width: 600px) {
  .onboarding__card { padding: 32px 24px; }
  .onboarding h1 { font-size: 1.6rem; }
}

/* ===== Info blocks ===== */
.info-block {
  background: white;
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  border-left: 4px solid var(--orange);
}
.info-block__category {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 6px;
}
.info-block__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 12px;
}
.info-block__content {
  color: var(--text-light);
  line-height: 1.7;
  white-space: pre-wrap;
}

/* ===== Utils ===== */
.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }
.text-small { font-size: 0.85rem; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.flex { display: flex; gap: 12px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }
