/* =========================================================================
   ESPACE CLIENT expatries-paies.com
   Feuille de style propre au portail. Elle est chargee APRES
   assets/css/style.css et n'est jamais servie sur les pages publiques :
   la charte du site (variables :root, boutons, conteneur, typographies)
   est reprise telle quelle, rien n'y est modifie.
   ========================================================================= */

.portal-body,
.portal-plain { background: var(--paper-alt); min-height: 100vh; }
.portal-body { display: flex; flex-direction: column; }

/* ---------- Marque du portail ---------- */
.portal-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: 0 0 auto; }
.portal-brand img { flex: none; }
.portal-brand .brand-word { display: block; color: var(--white); font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; line-height: 1; letter-spacing: -0.01em; white-space: nowrap; }
.portal-brand .brand-word b { color: var(--gold-light); font-weight: 600; }
.portal-brand .brand-word sup { font-size: 0.48em; font-weight: 400; vertical-align: super; letter-spacing: 0; }
.portal-brand-sub { display: block; margin-top: 5px; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }

/* ---------- Barre du portail ---------- */
.portal-head { background: var(--navy); color: rgba(251,250,245,0.72); }
.portal-head .container { display: flex; align-items: center; gap: 22px; min-height: 76px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }

.portal-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.portal-nav a { padding: 8px 14px; font-size: 0.88rem; font-weight: 500; color: rgba(251,250,245,0.78); text-decoration: none; border-radius: var(--radius); transition: background 0.18s ease, color 0.18s ease; }
.portal-nav a:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.portal-nav a.on { background: rgba(212,160,58,0.18); color: var(--gold-light); }

.portal-user { display: flex; align-items: center; gap: 14px; font-size: 0.8rem; color: rgba(251,250,245,0.6); padding-left: 18px; border-left: 1px solid rgba(255,255,255,0.16); }
.portal-user strong { display: block; color: var(--white); font-weight: 600; font-size: 0.85rem; }

.portal-main { flex: 1; padding: 40px 0 64px; }

.portal-foot { background: var(--navy); color: rgba(251,250,245,0.7); font-size: 0.8rem; padding: 20px 0; }
.portal-foot .container { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.portal-foot a { color: rgba(251,250,245,0.7); text-decoration: none; }
.portal-foot a:hover { color: var(--gold-light); }

.portal-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; flex-wrap: wrap; margin-bottom: 28px; }
.portal-title h1 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); margin: 0 0 4px; }
.portal-title p { margin: 0; color: var(--grey); font-size: 0.92rem; }

/* ---------- Panneaux ---------- */
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; margin-bottom: 24px; box-shadow: var(--shadow-card); }
.panel h2 { font-size: 1.2rem; margin-bottom: 6px; }
.panel .sub { color: var(--grey); font-size: 0.9rem; margin-bottom: 22px; }
.panel .sub.mb-0 { margin-bottom: 0; }
.panel-etroit { max-width: 580px; }
.panel-flush { padding: 0; overflow: hidden; }
.panel-flush > h2 { padding: 24px 28px 0; }
.panel-flush > .sub { padding: 0 28px; }
.panel-annee { padding: 24px 28px 16px; }
.groupe-mois { padding: 12px 28px 10px; background: var(--paper-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.groupe-mois strong { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--grey); font-weight: 500; }

/* ---------- Champs ---------- */
.field { display: flex; flex-direction: column; margin-bottom: 16px; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--font-body); font-size: 0.95rem; background: var(--white); color: var(--ink);
}
.field input:focus, .field select:focus { border-color: var(--gold-deep); outline: none; }

.filters { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 22px; }
.filters .field { min-width: 160px; margin-bottom: 0; }
.filters .field-large { flex: 1; min-width: 220px; }
.filters .btn { margin-bottom: 0; }
.filters-plat { margin-bottom: 0; }

/* ---------- Zone de dépôt ---------- */
.dropzone {
  display: block; width: 100%;
  border: 1.6px dashed var(--gold); border-radius: var(--radius);
  background: rgba(212,160,58,0.09);
  padding: 38px 26px; text-align: center; cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.dropzone:hover, .dropzone.hot { background: rgba(212,160,58,0.2); border-color: var(--gold-deep); }
.dropzone .big { display: block; font-family: var(--font-display); font-size: 1.2rem; color: var(--navy); margin-bottom: 6px; }
.dropzone .small { display: block; color: var(--gold-deep); font-size: 0.85rem; }
.dropzone input[type=file] { display: none; }

.file-list { margin-top: 18px; }
.file-line { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.file-line:last-child { border-bottom: 0; }
.file-line .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-line .st { font-size: 0.8rem; color: var(--grey); }
.file-line .st.ok { color: var(--success); }
.file-line .st.ko { color: var(--warn); }

/* ---------- Tableaux ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.tbl th {
  text-align: left; padding: 12px 28px; background: var(--paper-alt); color: var(--grey);
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase;
  font-weight: 500; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.tbl td { padding: 14px 28px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: var(--paper); }
table.tbl .doc { display: flex; align-items: center; gap: 12px; }
table.tbl .ext {
  width: 36px; height: 36px; border-radius: var(--radius); background: var(--navy); color: var(--gold-light);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.6rem; font-weight: 500; flex: none; letter-spacing: 0.04em;
}
table.tbl .nom { font-weight: 500; color: var(--navy); }
table.tbl .nom-lien { text-decoration: none; font-weight: 600; }
table.tbl .nom-lien:hover { color: var(--gold-deep); }
table.tbl .meta { font-size: 0.8rem; color: var(--grey); }
table.tbl a.dl { color: var(--gold-deep); font-weight: 600; white-space: nowrap; text-decoration: none; }
table.tbl a.dl:hover { text-decoration: underline; }
table.tbl .col-doc { width: 44%; }
table.tbl .col-action { text-align: right; white-space: nowrap; }
table.tbl .nowrap { white-space: nowrap; }
.en-ligne { display: inline; margin-left: 8px; }

/* ---------- Étiquettes ----------
   .pill existe sur le site comme puce de navigation : ici, dans le portail
   seul, elle sert d'étiquette d'état. */
.portal-body .pill,
.portal-plain .pill {
  display: inline-block; border: 0; background: none; padding: 3px 9px; border-radius: 100px;
  font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500;
}
.portal-body .pill.cabinet { background: rgba(11,29,58,0.09); color: var(--navy); }
.portal-body .pill.client  { background: rgba(212,160,58,0.16); color: var(--gold-deep); }
.portal-body .pill.neuf    { background: rgba(30,122,76,0.12); color: var(--success); }
.portal-body .pill.off     { background: rgba(180,71,42,0.12); color: var(--warn); }

/* ---------- Compteurs ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; margin-bottom: 24px; }
.stat-box { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.stat-box .v { font-family: var(--font-display); font-size: 1.9rem; color: var(--navy); line-height: 1; margin-bottom: 5px; }
.stat-box .l { font-size: 0.78rem; color: var(--grey); letter-spacing: 0.02em; }

/* ---------- Messages ---------- */
.alert { padding: 13px 16px; border-radius: var(--radius); font-size: 0.9rem; margin-bottom: 20px; }
.alert.ko   { background: #FCF0ED; color: var(--warn);    border: 1px solid #F0D2C9; }
.alert.ok   { background: #EEF6F1; color: var(--success); border: 1px solid #C9E3D5; }
.alert.info { background: var(--paper-alt); color: var(--navy); border: 1px solid var(--line); }
.alert-espace { margin-bottom: 24px; }

.empty { text-align: center; padding: 56px 24px; color: var(--grey); }
.empty .big { font-family: var(--font-display); font-size: 1.25rem; color: var(--navy); margin-bottom: 8px; }
.muted { color: var(--grey); }
.fiche-note { margin: 18px 0 0; }

/* ---------- Pages de connexion ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) { .login-wrap { grid-template-columns: 1fr 1fr; } }

.login-side {
  background:
    radial-gradient(760px 420px at 80% 10%, rgba(212,160,58,0.18), transparent 60%),
    linear-gradient(155deg, var(--navy-deep), var(--navy-soft));
  color: rgba(251,250,245,0.78);
  padding: 56px 44px; display: flex; flex-direction: column; justify-content: center;
}
.login-side .portal-brand { margin-bottom: 40px; }
.login-side h1 { color: var(--white); font-size: clamp(1.8rem, 1.3rem + 2vw, 2.5rem); }
.login-side .lede { color: rgba(251,250,245,0.72); font-size: 1.05rem; }

.login-points { list-style: none; padding: 0; margin: 26px 0 0; }
.login-points li { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; font-size: 0.94rem; color: rgba(251,250,245,0.86); }
.login-points svg { color: var(--gold); flex: none; margin-top: 4px; }

.login-aide { margin-top: 34px; color: rgba(251,250,245,0.55); }
.login-aide a { color: var(--gold-light); }

.login-form { display: flex; align-items: center; justify-content: center; padding: 56px 32px; background: var(--white); }
.login-card { width: 100%; max-width: 400px; }
.login-card h2 { font-size: 1.5rem; }
.login-sous { color: var(--grey); font-size: 0.92rem; margin-bottom: 24px; }
.login-liens { margin-top: 20px; }
.login-liens a { color: var(--gold-deep); font-weight: 600; }
.btn-block { display: flex; width: 100%; justify-content: center; margin-top: 8px; }

@media (max-width: 760px) {
  .portal-head .container { min-height: 0; }
  .portal-user { padding-left: 0; border-left: 0; width: 100%; justify-content: space-between; }
  table.tbl th, table.tbl td { padding-left: 16px; padding-right: 16px; }
  .panel { padding: 22px 18px; }
  .panel-flush { padding: 0; }
  .panel-annee, .panel-flush > h2 { padding: 20px 18px 12px; }
  .panel-flush > .sub { padding: 0 18px; }
  .groupe-mois { padding: 10px 18px 8px; }
  .login-side { padding: 40px 26px; }
}
