:root {
  /* Charte Oricom */
  --navy: #272639;        /* bleu marine Oricom */
  --navy-2: #322f47;
  --green: #65bc7b;       /* vert Oricom */
  --green-2: #4ad575;     /* vert vif (highlights) */
  --green-dark: #51a567;  /* survol boutons */
  --amber: #f59e0b;
  --red: #dc2626;

  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-2: #f6f7f9;
  --border: #e4e6eb;
  --text: #272639;
  --muted: #6b7280;
  --radius: 12px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 920px; margin: 0 auto; padding: 32px 20px 64px; }

/* En-tête marine avec logo blanc */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; background: var(--navy); border-bottom: 3px solid var(--green);
}
.topbar .logo { height: 26px; display: block; }
.topbar .brand-link { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 600; }
.topbar .brand-link:hover { text-decoration: none; opacity: .85; }
.topbar .sep { color: rgba(255,255,255,.4); }
.topbar .tag { color: rgba(255,255,255,.7); font-weight: 400; font-size: 14px; }

h1 { font-size: 26px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 28px 0 12px; }
.subtitle { color: var(--muted); margin: 0 0 28px; }

.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  box-shadow: 0 1px 2px rgba(39,38,57,.04);
}
.card + .card { margin-top: 18px; }

label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; font-weight: 500; }
input[type=text], input[type=password], input[type=file], textarea, select {
  width: 100%; padding: 11px 12px; background: #fff;
  border: 1px solid var(--border); border-radius: 9px; color: var(--text);
  font-size: 14px; font-family: inherit;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(101,188,123,.18); }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--green); color: #fff; border: none; padding: 11px 18px;
  border-radius: 9px; font-size: 14px; font-weight: 600;
}
.btn:hover { background: var(--green-dark); text-decoration: none; }
.btn.secondary { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); }
.btn.secondary:hover { background: #eceef1; }
.btn.green { background: var(--green); }
.btn.amber { background: var(--amber); color: #2a1d02; }
.btn.amber:hover { background: #e08e06; }
.btn.danger { background: transparent; color: var(--red); border: 1px solid #f0c6c6; }
.btn.danger:hover { background: #fdf0f0; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* Bouton sur fond marine */
.navbtn { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 8px; padding: 7px 12px; cursor: pointer; font-size: 13px; }
.navbtn:hover { background: rgba(255,255,255,.22); }

.badge { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; display: inline-block; }
.badge.pending { background: rgba(245,158,11,.15); color: #b6770a; }
.badge.validated { background: rgba(101,188,123,.18); color: var(--green-dark); }
.badge.changes { background: rgba(220,38,38,.12); color: var(--red); }

.project-list { display: grid; gap: 12px; }
.project-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px;
}
.project-item .meta { color: var(--muted); font-size: 13px; margin-top: 3px; }
.project-item .title { font-weight: 600; font-size: 15px; }
.project-item .title a { color: var(--text); }

.empty { text-align: center; color: var(--muted); padding: 48px 20px; background: var(--panel); border: 1px dashed var(--border); border-radius: var(--radius); }

.alert { padding: 12px 14px; border-radius: 9px; font-size: 14px; margin-bottom: 16px; }
.alert.error { background: #fdecec; color: #b42323; border: 1px solid #f3c6c6; }
.alert.success { background: rgba(101,188,123,.12); color: var(--green-dark); border: 1px solid rgba(101,188,123,.35); }

.linkbox {
  display: flex; gap: 8px; align-items: center; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
}
.linkbox input { background: transparent; border: none; padding: 0; color: var(--text); }

.comment { border: 1px solid var(--border); border-radius: 9px; padding: 12px 14px; margin-bottom: 10px; background: var(--panel-2); }
.comment .who { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.comment .who.client { color: var(--green-dark); }
.comment .who.admin { color: var(--navy); }
.comment .when { color: var(--muted); font-weight: 400; margin-left: 8px; }

/* Pages centrées (connexion, portail client) */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.auth-header { background: var(--navy); border-bottom: 3px solid var(--green); padding: 16px 22px; text-align: center; }
.auth-header .logo { height: 28px; }
.auth-body { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 64px 20px; }
.auth-card { width: 100%; max-width: 420px; }

/* Aperçu client */
.preview-shell { height: 100vh; display: flex; flex-direction: column; }
.preview-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 16px; background: var(--navy); border-bottom: 3px solid var(--green);
}
.preview-bar .brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.preview-bar .logo { height: 24px; }
.preview-bar .title { font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frame-area { flex: 1; position: relative; min-height: 0; }
.preview-frame { position: absolute; inset: 0; border: none; width: 100%; height: 100%; background: #fff; }
.frame-area.picking .preview-frame { cursor: crosshair; }

/* Bandeau d'aide en mode pointage */
.pin-hint {
  display: none; position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 8px 16px; border-radius: 999px;
  font-size: 13px; z-index: 30; box-shadow: 0 4px 14px rgba(39,38,57,.25);
}
.frame-area.picking .pin-hint { display: block; }
.navbtn.active { background: var(--green); border-color: var(--green); color: #fff; }

/* Fenêtre de saisie au clic */
.pin-composer {
  display: none; position: fixed; z-index: 60; width: 320px; max-width: 90vw;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; box-shadow: 0 12px 32px rgba(39,38,57,.25);
}
.pin-composer.open { display: block; }
.pin-composer-title { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.pin-composer textarea { width: 100%; min-height: 70px; }

/* Numéro de pastille dans la liste */
.pin-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 999px; background: var(--green);
  color: #fff; font-size: 12px; font-weight: 700; margin-right: 6px; vertical-align: middle;
}
.comment.is-pin { border-color: rgba(101,188,123,.5); }
.comment-body { margin-bottom: 4px; }
.comment-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 6px; }
.link-btn { background: none; border: none; padding: 0; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--green-dark); }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--red); }
.link-btn.confirming { background: var(--red); color: #fff; padding: 2px 8px; border-radius: 6px; }
.edit-form { margin-top: 10px; }
.edit-form textarea { width: 100%; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 380px; max-width: 90vw;
  background: var(--panel); border-left: 1px solid var(--border); transform: translateX(100%);
  transition: transform .25s ease; z-index: 50; display: flex; flex-direction: column;
  box-shadow: -8px 0 24px rgba(39,38,57,.12);
}
.drawer.open { transform: translateX(0); }
.drawer .drawer-head { display:flex; justify-content: space-between; align-items:center; padding: 16px; border-bottom: 1px solid var(--border); }
.drawer .drawer-body { padding: 16px; overflow-y: auto; flex: 1; }
.iconbtn { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-size: 13px; }
.iconbtn:hover { background: #eceef1; }
