:root {
  color-scheme: light;
  --ink: #18212f;
  --muted: #667085;
  --line: #d9dee8;
  --paper: #ffffff;
  --soft: #f5f7fb;
  --green: #147d64;
  --green-dark: #0f604d;
  --blue: #1d5f9f;
  --club-blue: rgb(0, 86, 184);
  --club-gold: rgb(208, 184, 136);
  --navy: rgb(8, 32, 70);
  --navy-dark: rgb(4, 20, 48);
  --red: #c73737;
  --shadow: 0 18px 50px rgba(17, 24, 39, 0.12);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--soft);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px clamp(16px, 4vw, 44px);
  background: var(--club-blue);
  color: #fff;
  border-bottom: 5px solid var(--club-gold);
}

.app-header h1,
.section-heading h2,
.dialog-header h2 {
  margin: 0;
  letter-spacing: 0;
}

.app-header h1 {
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  line-height: 1.05;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.club-logo {
  width: 70px;
  height: 84px;
  object-fit: contain;
  flex: 0 0 auto;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-actions,
.week-controls,
.filters,
.form-actions,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.app-shell {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 18px clamp(12px, 3vw, 32px) 32px;
}

.backlog,
.calendar {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.workspace {
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-heading h2 {
  font-size: 1.05rem;
}

.publication-form {
  display: grid;
  gap: 14px;
}

label,
fieldset {
  min-width: 0;
}

label span,
legend {
  display: block;
  margin-bottom: 6px;
  color: #354052;
  font-size: 0.83rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cdd4df;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

.app-header .eyebrow {
  color: var(--club-gold);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(8, 32, 70, 0.16);
}

fieldset {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.platform-copy-fields {
  display: grid;
  gap: 12px;
}

.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: #344054;
  font-size: 0.88rem;
}

.checkbox-grid input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--navy);
}

.form-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.form-note.warning {
  color: var(--red);
  font-weight: 750;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.icon-button,
.file-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 800;
}

.primary-button {
  width: 100%;
  background: var(--navy);
  color: #fff;
}

.compact-button {
  width: auto;
  min-height: 38px;
  padding: 0 14px;
}

.primary-button:hover {
  background: var(--navy-dark);
}

.secondary-button,
.ghost-button {
  background: #fff;
  border-color: #cdd4df;
  color: #263345;
}

.secondary-button {
  padding: 0 12px;
}

.ghost-button {
  min-height: 34px;
  padding: 0 10px;
}

.danger-button {
  padding: 0 12px;
  background: #fff;
  border-color: #f1b9b9;
  color: var(--red);
}

.icon-button,
.file-action {
  width: 38px;
  flex: 0 0 38px;
  background: #fff;
  border-color: #cdd4df;
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
}

.icon-button svg,
.file-action svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.app-header .icon-button,
.app-header .file-action {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.app-header .primary-button {
  background: var(--navy);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  box-shadow: none;
}

.header-secondary {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.header-secondary #backlogBadge {
  margin-left: 4px;
  color: inherit;
  font-weight: 900;
}

.file-action input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  opacity: 0;
  pointer-events: none;
}

.toolbar {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.calendar-range {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 850;
}

.calendar-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.filters {
  justify-content: flex-end;
}

.filters select {
  width: auto;
  min-width: 150px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.stats div {
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stats span {
  display: block;
  font-size: 1.55rem;
  font-weight: 900;
}

.stats p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.backlog {
  margin-bottom: 14px;
  padding: 14px;
}

.pill,
.platform-chip,
.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.pill {
  background: rgba(8, 32, 70, 0.1);
  color: var(--club-blue);
}

.backlog-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

.backlog-card,
.publication-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
}

.backlog-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.card-reset {
  display: grid;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.backlog-card h3,
.publication-card h3 {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.28;
}

.backlog-card p,
.publication-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.backlog-card footer {
  display: grid;
  grid-template-columns: 1fr 92px auto;
  gap: 8px;
  align-items: end;
}

.backlog-card input {
  min-height: 36px;
  padding: 7px 8px;
}

.calendar {
  padding: 14px;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.day-column {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 150px;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.day-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
}

.day-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid var(--navy);
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
}

.day-add-button:hover {
  background: var(--navy-dark);
}

.day-name {
  display: block;
  font-weight: 900;
  text-transform: capitalize;
}

.day-date {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
}

.day-stack {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 8px;
}

.publication-card {
  display: grid;
  gap: 7px;
  padding: 10px;
  border-left: 4px solid var(--blue);
}

.publication-card[data-status="publie"] {
  border-left-color: var(--green);
}

.publication-card:hover,
.backlog-card:hover {
  border-color: #a8b2c2;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.time {
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--blue);
}

.status-chip[data-status="idee"] {
  background: rgba(8, 32, 70, 0.1);
  color: var(--navy);
}

.status-chip[data-status="a-faire"] {
  background: #eaf2fb;
  color: var(--blue);
}

.status-chip[data-status="publie"] {
  background: #e8f6ef;
  color: var(--green-dark);
}

.platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.platform-chip {
  background: #f0f2f6;
  color: #4b5565;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 120px;
  padding: 18px;
  border: 1px dashed #bdc6d3;
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  color: #354052;
}

.empty-state p {
  max-width: 32rem;
  margin: 5px 0 0;
}

.detail-dialog,
.form-dialog,
.backlog-dialog,
.accounts-dialog,
.password-dialog {
  width: min(620px, calc(100% - 24px));
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--shadow);
}

.form-dialog {
  width: min(720px, calc(100% - 24px));
}

.backlog-dialog {
  width: min(980px, calc(100% - 24px));
}

.accounts-dialog {
  width: min(920px, calc(100% - 24px));
}

.detail-dialog::backdrop,
.form-dialog::backdrop,
.backlog-dialog::backdrop,
.accounts-dialog::backdrop,
.password-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

.detail-dialog article,
.form-dialog article,
.backlog-dialog article,
.accounts-dialog article,
.password-dialog article {
  background: #fff;
}

.dialog-header,
.dialog-body,
.dialog-actions {
  padding: 18px;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.dialog-header .eyebrow {
  color: var(--navy);
}

.dialog-body {
  display: grid;
  gap: 16px;
}

.form-dialog-body {
  max-height: min(70vh, 720px);
  overflow: auto;
}

.backlog-dialog-body {
  max-height: min(72vh, 760px);
  overflow: auto;
}

.accounts-dialog-body {
  max-height: min(76vh, 780px);
  overflow: auto;
}

.account-form {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}

.temporary-password {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(8, 32, 70, 0.18);
  border-radius: var(--radius);
  background: rgba(8, 32, 70, 0.08);
}

.temporary-password span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.temporary-password strong {
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.users-list {
  display: grid;
  gap: 8px;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.user-row h3 {
  margin: 0;
  font-size: 0.96rem;
}

.user-row p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.submit-dialog-button {
  width: auto;
  min-width: 150px;
  padding: 0 16px;
}

#dialogContent {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.5;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 800;
}

.detail-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.copy-list {
  display: grid;
  gap: 10px;
}

.copy-list article {
  display: grid;
  gap: 4px;
  padding: 10px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.copy-list h3 {
  margin: 0;
  font-size: 0.82rem;
}

.copy-list p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.45;
}

.dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.is-today .day-header {
  box-shadow: inset 0 4px 0 var(--navy);
}

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

  .filters,
  .week-controls {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-block {
    gap: 12px;
  }

  .club-logo {
    width: 54px;
    height: 66px;
  }

  .form-grid,
  .checkbox-grid,
  .stats,
  .backlog-card footer {
    grid-template-columns: 1fr;
  }

  .filters select {
    width: 100%;
  }

  .detail-list div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .user-row {
    grid-template-columns: 1fr;
  }

  .user-actions {
    justify-content: flex-start;
  }
}
