/* ════════════════════════════════════════════════
   assets/app.css
   Styles de l'application — guide.vpg.digital
   Version : build 20260523 1745
   ════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --blue:   #1a73e8;
  --blue-h: #1557b0;
  --blue-bg:#e8f0fe;
  --dark:   #202124;
  --mid:    #5f6368;
  --muted:  #80868b;
  --bg:     #fff;
  --card:   #fff;
  --border: #e0e0e0;
  --hover:  #f8f9fa;
  --r:      8px;
  --red:    #d93025;
  --green:  #188038;
  --orange: #e8710a;
  --shadow: 0 1px 3px rgba(60,64,67,.15), 0 2px 6px rgba(60,64,67,.1);
  --shadow-h:0 2px 8px rgba(60,64,67,.2), 0 4px 16px rgba(60,64,67,.12);
}
body { font-family: 'Lato', -apple-system, sans-serif; background: var(--bg); color: var(--dark); min-height: 100vh; font-size: 14px; }

/* SVG ICONS */
.icon { width: 18px; height: 18px; display: inline-block; vertical-align: middle; fill: currentColor; flex-shrink: 0; }

/* ADMIN BAR — style Google (fond gris clair) */
.admin-bar {
  background: #f8f9fa; color: var(--dark);
  border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 48px;
  display: flex; align-items: center; gap: 8px;
  flex-wrap: nowrap; overflow: hidden;
  font-size: 12px; position: sticky; top: 0; z-index: 20;
  white-space: nowrap;
}
.ab-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 14px;
  border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; flex-shrink: 0;
  font-family: 'Lato', sans-serif; border: none; transition: all .15s; letter-spacing: .01em;
}
.ab-pill.blue  { background: var(--blue);  color: #fff; }
.ab-pill.blue:hover  { background: var(--blue-h); box-shadow: 0 1px 4px rgba(26,115,232,.4); }
.ab-pill.red   { background: var(--red); color: #fff; }
.ab-pill.red:hover   { background: #b52a20; box-shadow: 0 1px 4px rgba(217,48,37,.4); }
.ab-pill.green { background: var(--green); color: #fff; }
.ab-pill.green:hover { background: #146c30; box-shadow: 0 1px 4px rgba(24,128,56,.4); }
.ab-pill.ghost { background: transparent; color: var(--mid); border: 1px solid var(--border); }
.ab-pill.ghost:hover { background: var(--hover); }
.ab-status { font-size: 12px; font-weight: 600; flex-shrink: 0; display: flex; align-items: center; gap: 5px; }
.ab-status.open   { color: var(--green); }
.ab-status.closed { color: var(--red); }
.ab-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.ab-expiry { color: var(--muted); font-size: 11px; flex-shrink: 0; }
.ab-sep    { color: var(--border); flex-shrink: 0; }
.ab-space  { flex: 1; }
.ab-logout { background: none; border: none; color: var(--muted); font-size: 12px; cursor: pointer; font-family: 'Lato', sans-serif; flex-shrink: 0; }
.ab-logout:hover { color: var(--dark); }

/* BURGER */
.ab-burger { display: none; background: none; border: none; color: var(--mid); font-size: 22px; cursor: pointer; padding: 4px 6px; flex-shrink: 0; line-height: 1; }
.ab-desktop { display: inline-flex; align-items: center; gap: 6px; }
.ab-drawer {
  display: none; position: fixed; top: 48px; left: 0; right: 0;
  background: #f8f9fa; border-bottom: 1px solid var(--border); z-index: 19;
  padding: 14px 20px 18px; flex-direction: column; gap: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.ab-drawer.open { display: flex; }
.ab-drawer form { display: flex; gap: 8px; flex-wrap: wrap; }
.ab-drawer-sep { height: 1px; background: var(--border); }

/* HEADER */
.site-header {
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 56px; display: flex; align-items: center;
  position: sticky; top: 0; z-index: 10;
}
/* Quand la barre admin est visible, le header descend en dessous */
.has-admin-bar .site-header { top: 48px; }

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark {
  width: 32px; height: 32px; background: var(--blue); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.logo-text { font-size: 16px; font-weight: 700; color: var(--dark); letter-spacing: -.2px; }
.header-right { margin-left: auto; }
.login-link { font-size: 11px; color: transparent; text-decoration: none; }
.site-header:hover .login-link { color: var(--border); }

/* MAIN */
.wrap { max-width: 1000px; margin: 0 auto; padding: 28px 20px 80px; }

/* BREADCRUMB */
.bc { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; font-size: 13px; color: var(--muted); }
.bc a { color: var(--blue); text-decoration: none; }
.bc a:hover { text-decoration: underline; }
.bc .sep { color: var(--border); }
.bc .cur { color: var(--dark); font-weight: 700; }

/* TITLE */
h1 { font-size: 22px; font-weight: 700; color: var(--dark); margin-bottom: 4px; line-height: 1.3; }
.sub { color: var(--muted); font-size: 14px; font-weight: 400; margin-bottom: 20px; }
.divider { height: 1px; background: var(--border); margin-bottom: 24px; }
.slabel { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 12px; margin-top: 28px; display: block; }
.slabel:first-child { margin-top: 0; }

/* FOLDER GRID */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 32px; }
.folder-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r);
  overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow .2s, border-color .2s;
  box-shadow: var(--shadow); cursor: pointer;
}
.folder-card:hover { box-shadow: var(--shadow-h); border-color: #c5cae9; }
.f-thumb {
  height: 120px; position: relative; overflow: hidden;
  background: #f1f3f4;
  display: flex; align-items: center; justify-content: center;
}
.f-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.f-thumb .ov { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.45) 0%, transparent 55%); }
.f-thumb .badge {
  position: absolute; top: 8px; right: 8px;
  background: rgba(255,255,255,.92);
  border-radius: 4px; padding: 2px 7px; font-size: 11px; color: var(--mid);
  font-weight: 600;
}
.f-body { padding: 10px 12px 12px; display: flex; align-items: flex-start; justify-content: space-between; min-height: 58px; }
.f-name { font-size: 13px; font-weight: 600; color: var(--dark); line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.f-arr  { color: var(--muted); flex-shrink: 0; margin-left: 6px; }

/* FILE GRID */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(188px, 1fr)); gap: 12px; }
.file-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r);
  overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow .2s, border-color .2s;
  box-shadow: var(--shadow);
}
.file-card:hover { box-shadow: var(--shadow-h); border-color: #c5cae9; }
.t-pdf  { background: #fce8e6; }
.t-docx { background: #e8f0fe; }
.t-zip  { background: #fef3e2; }
.t-other{ background: #f1f3f4; }
.img-thumb { background: #f1f3f4; overflow: hidden; }
.file-thumb {
  height: 88px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; position: relative; overflow: hidden;
}
.f-label { font-size: 10px; font-weight: 700; letter-spacing: .06em; z-index: 1; }
.c-pdf   { color: var(--red); }
.c-docx  { color: var(--blue); }
.c-zip   { color: var(--orange); }
.c-other { color: var(--mid); }
.file-body { padding: 8px 12px 10px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.file-name { font-size: 12px; font-weight: 600; color: var(--dark); line-height: 1.4; margin-bottom: 6px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.file-meta { display: flex; justify-content: space-between; align-items: center; }
.file-size { font-size: 11px; color: var(--muted); }
.fa { display: flex; gap: 4px; align-items: center; }
.btn-f { font-size: 11px; padding: 4px 10px; border-radius: 4px; cursor: pointer; font-family: 'Lato', sans-serif; text-decoration: none; transition: all .15s; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; min-width: 28px; }
.bv-pdf  { background: #fce8e6; color: var(--red); border: none; }
.bv-pdf:hover  { background: #f4c6c2; }
.bv-docx { background: var(--blue-bg); color: var(--blue); border: none; }
.bv-docx:hover { background: #c5d9fd; }
.bv-zip  { background: #fef3e2; color: var(--orange); border: none; }
.bv-zip:hover  { background: #fde7c0; }
.bv-other{ background: #f1f3f4; color: var(--mid); border: none; }
.bv-other:hover{ background: #e2e5e9; }
.bd-pdf  { background: var(--red);    color: #fff; border: none; }
.bd-pdf:hover  { background: #b52a20; }
.bd-docx { background: var(--blue);   color: #fff; border: none; }
.bd-docx:hover { background: var(--blue-h); }
.bd-zip  { background: var(--orange); color: #fff; border: none; }
.bd-zip:hover  { background: #c55f08; }
.bd-other{ background: var(--mid);    color: #fff; border: none; }
.bd-other:hover{ background: #4a4f54; }

/* FOLDER ACCESS CONTROLS */
.folder-card.f-closed { opacity: .65; filter: grayscale(100%); }
.folder-card.f-closed:hover { opacity: .80; filter: grayscale(100%); }
.file-card.f-closed   { opacity: .65; filter: grayscale(100%); }
.file-card.f-closed:hover   { opacity: .80; filter: grayscale(100%); }
.f-access {
  display: flex; gap: 4px; padding: 6px 10px;
  border-top: 1px solid var(--border); background: var(--hover);
  flex-wrap: wrap; align-items: center; justify-content: space-between;
}
.f-access-expiry { font-size: 10px; color: var(--green); font-weight: 600; }
.f-access-btns { display: flex; gap: 4px; }
.btn-fopen { font-size: 10px; padding: 3px 8px; border-radius: 4px; border: none; cursor: pointer; font-family: 'Lato', sans-serif; font-weight: 600; transition: all .15s; }
.btn-fopen.open-btn  { background: var(--blue-bg); color: var(--blue); }
.btn-fopen.open-btn:hover  { background: var(--blue); color: #fff; }
.btn-fopen.close-btn { background: #fce8e6; color: var(--red); }
.btn-fopen.close-btn:hover { background: var(--red); color: #fff; }
.card-actions { display: flex; gap: 4px; padding: 6px 10px; border-top: 1px solid var(--border); background: var(--hover); justify-content: flex-end; }
.btn-act { font-size: 11px; padding: 4px 10px; border-radius: 4px; cursor: pointer; font-family: 'Lato', sans-serif; border: none; transition: all .15s; font-weight: 600; }
.btn-rename { background: transparent; color: var(--mid); }
.btn-rename:hover { background: #e8f0fe; color: var(--blue); }
.btn-delete { background: transparent; color: var(--muted); }
.btn-delete:hover { background: #fce8e6; color: var(--red); }

/* Bouton ZIP admin */
.btn-zip         { font-size: 11px; padding: 4px 10px; border-radius: 4px; cursor: pointer; font-family: 'Lato', sans-serif; border: none; transition: all .15s; font-weight: 600; }
.btn-zip-idle    { background: #e6f4ea; color: #137333; }
.btn-zip-idle:hover { background: #c6e8cf; }
.btn-zip-running { background: #fef7e0; color: #b06000; cursor: wait; }
.btn-zip-running:hover { background: #fef7e0; }
.btn-zip-error   { background: #fce8e6; color: var(--red); }
.btn-zip-error:hover { background: #f5c6c2; }
.zip-status-info { font-size: 9px; color: var(--muted); margin-top: 2px; display: block; }

/* CLOSED */
.closed { text-align: center; padding: 80px 20px; }
.closed-icon  { margin-bottom: 16px; opacity: .4; }
.closed-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.closed-sub   { color: var(--muted); font-size: 14px; }

/* LOGIN OVERLAY */
.login-overlay { position: fixed; inset: 0; background: rgba(255,255,255,.97); display: flex; align-items: center; justify-content: center; z-index: 200; }
.login-box { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 36px 32px; width: 360px; max-width: 90vw; box-shadow: var(--shadow-h); }
.login-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; color: var(--dark); }
.login-sub   { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.login-input { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; font-family: 'Lato', sans-serif; outline: none; transition: border-color .15s, box-shadow .15s; color: var(--dark); }
.login-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,115,232,.15); }
.login-btn { width: 100%; margin-top: 12px; padding: 11px; background: var(--blue); color: #fff; border: none; border-radius: 6px; font-size: 14px; font-family: 'Lato', sans-serif; font-weight: 700; cursor: pointer; transition: background .15s; }
.login-btn:hover { background: var(--blue-h); }

/* MODALS */
.modal-bg { display: none; position: fixed; inset: 0; background: rgba(32,33,36,.5); z-index: 200; align-items: center; justify-content: center; }
.modal-bg.on { display: flex; }
.modal-box { background: var(--card); border-radius: 12px; padding: 28px; width: 400px; max-width: 92vw; box-shadow: 0 8px 40px rgba(0,0,0,.2); }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; color: var(--dark); }
.modal-lbl { font-size: 12px; color: var(--mid); font-weight: 600; margin-bottom: 5px; }
.modal-input { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; font-family: 'Lato', sans-serif; margin-bottom: 14px; color: var(--dark); outline: none; }
.modal-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,115,232,.15); }
.modal-row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.btn-cancel { padding: 8px 20px; border-radius: 6px; border: 1px solid var(--border); background: transparent; color: var(--mid); cursor: pointer; font-family: 'Lato', sans-serif; font-size: 13px; font-weight: 600; }
.btn-cancel:hover { background: var(--hover); }
.btn-send   { padding: 8px 20px; border-radius: 6px; border: none; background: var(--blue); color: #fff; cursor: pointer; font-family: 'Lato', sans-serif; font-size: 13px; font-weight: 700; }
.btn-send:hover { background: var(--blue-h); }

/* LIGHTBOX */
.lb-bg { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 300; align-items: center; justify-content: center; flex-direction: column; }
.lb-bg.on { display: flex; }
.lb-img { max-width: 92vw; max-height: 80vh; object-fit: contain; border-radius: 4px; box-shadow: 0 8px 40px rgba(0,0,0,.6); transition: opacity .2s; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.1); border: none; color: #fff; font-size: 26px; padding: 12px 16px; cursor: pointer; border-radius: 6px; transition: background .15s; user-select: none; }
.lb-nav:hover { background: rgba(255,255,255,.22); }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
.lb-close { position: absolute; top: 16px; right: 20px; background: none; border: none; color: #fff; font-size: 26px; cursor: pointer; opacity: .7; line-height: 1; }
.lb-close:hover { opacity: 1; }
.lb-caption { color: rgba(255,255,255,.6); font-size: 12px; margin-top: 14px; letter-spacing: .03em; text-align: center; max-width: 80vw; }
.lb-counter { color: rgba(255,255,255,.35); font-size: 11px; margin-top: 4px; }

/* FOOTER */
.site-footer { text-align: center; padding: 24px; border-top: 1px solid var(--border); margin-top: 40px; font-size: 11px; color: var(--muted); letter-spacing: .05em; }

/* MOBILE */
@media (max-width: 600px) {
  .site-header { padding: 0 16px; }
  .logo-text { font-size: 15px; }
  .wrap { padding: 16px 12px 60px; }
  h1 { font-size: 18px; }
  .folder-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .file-grid   { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 10px; }
  .ab-burger  { display: block; }
  .ab-desktop { display: none; }
  .ab-status  { font-size: 11px; }
}
