/* ==========================================================================
   VIVMED Drive - feuille de style
   Charte reprise de VIV MED ONE. La STRUCTURE est celle de Google Drive :
   l'utilisateur qui arrive ne doit pas avoir a reapprendre ou cliquer.
   ========================================================================== */

@font-face { font-family:'Degular'; src:url('/fonts/degulardisplay-regular-webfont.woff2') format('woff2'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'Degular'; src:url('/fonts/degulardisplay-light-webfont.woff2') format('woff2'); font-weight:300; font-style:normal; font-display:swap; }
@font-face { font-family:'Degular'; src:url('/fonts/degulardisplay-bold-webfont.woff2') format('woff2'); font-weight:700; font-style:normal; font-display:swap; }
@font-face { font-family:'Degular'; src:url('/fonts/degulardisplay-regularitalic-webfont.woff2') format('woff2'); font-weight:400; font-style:italic; font-display:swap; }

:root{
  /* Charte VIV MED ONE */
  --indigo:#252550;
  --indigo-d:#1f1b3c;
  --mauve:#b8a2ce;
  --rose:#f7cdd4;
  --rose-l:#f7e6f0;
  --teal:#82c0c7;
  --ink:#333;
  --muted:#666;
  --bg:#f5f5f5;

  --surface:#fff;
  --line:#e6e4ee;
  --line-soft:#f0eff5;
  --hover:#faf9fc;
  --select:#f7e6f0;
  --select-line:#e9c9d8;

  /* Couleurs de type de fichier : volontairement conventionnelles.
     C'est le repere que l'utilisateur a deja, on ne le deplace pas. */
  --doc:#2a5b9e;
  --sheet:#1e7e34;
  --slide:#a15c00;
  --pdf:#b3261e;
  --img:#7a4fa3;
  --zip:#5a5a6a;

  --radius:12px;
  --radius-s:8px;
  --shadow:0 1px 2px rgba(37,37,80,.08), 0 4px 16px rgba(37,37,80,.06);
  --shadow-l:0 8px 32px rgba(37,37,80,.16);
  --sans:'Degular', system-ui, 'Segoe UI', Arial, sans-serif;

  --header-h:64px;
  --side-w:256px;
}

*,*::before,*::after{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0; font-family:var(--sans); font-size:14px; color:var(--ink);
  background:var(--bg); -webkit-font-smoothing:antialiased;
}
button,input,select{ font:inherit; color:inherit; }
button{ cursor:pointer; border:none; background:none; }
a{ color:var(--indigo); }

/* ---------------------------------------------------------------- en-tete */
.header{
  position:fixed; inset:0 0 auto 0; height:var(--header-h); z-index:30;
  display:flex; align-items:center; gap:16px; padding:0 16px;
  background:var(--surface); border-bottom:1px solid var(--line);
}
.brand{ display:flex; align-items:center; gap:10px; width:calc(var(--side-w) - 16px); flex:none; }
.brand img{ height:30px; width:auto; display:block; }
.brand .sep{ width:1px; height:24px; background:var(--line); }
.brand .name{ font-size:19px; font-weight:400; color:var(--indigo); letter-spacing:.2px; white-space:nowrap; }
.brand .name b{ font-weight:700; }

.search{ position:relative; flex:1; max-width:720px; }
.search input{
  width:100%; height:44px; padding:0 44px 0 46px; border:1px solid transparent;
  border-radius:999px; background:var(--bg); outline:none; transition:.15s;
}
.search input:focus{ background:var(--surface); border-color:var(--line); box-shadow:var(--shadow); }
.search .ico{ position:absolute; left:16px; top:50%; transform:translateY(-50%); color:var(--muted); pointer-events:none; }
.search .clear{ position:absolute; right:12px; top:50%; transform:translateY(-50%); color:var(--muted); display:none; padding:4px; border-radius:50%; }
.search.filled .clear{ display:block; }
.search .clear:hover{ background:var(--line-soft); }

.header .spacer{ flex:1; }
.avatar{
  width:36px; height:36px; border-radius:50%; flex:none;
  background:var(--indigo); color:#fff; font-weight:700; font-size:14px;
  display:flex; align-items:center; justify-content:center; letter-spacing:.5px;
}
.usermenu{ position:relative; }
.usercard{
  position:absolute; right:0; top:46px; width:280px; padding:18px;
  background:var(--surface); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow-l); display:none; text-align:center;
}
.usercard.open{ display:block; }
.usercard .big{ width:64px; height:64px; font-size:24px; margin:0 auto 10px; }
.usercard .nom{ font-weight:700; font-size:16px; }
.usercard .mail{ color:var(--muted); font-size:13px; margin-bottom:14px; word-break:break-all; }

/* --------------------------------------------------------------- barre laterale */
.side{
  position:fixed; top:var(--header-h); left:0; bottom:0; width:var(--side-w);
  padding:16px 12px; display:flex; flex-direction:column; gap:4px;
  background:var(--bg); z-index:20;
}
.newbtn{
  display:flex; align-items:center; gap:12px; height:52px; padding:0 22px 0 18px;
  margin-bottom:14px; border-radius:16px; align-self:flex-start;
  background:var(--indigo); color:#fff; font-size:15px; font-weight:400;
  box-shadow:var(--shadow); transition:.15s;
}
.newbtn:hover{ background:var(--indigo-d); box-shadow:var(--shadow-l); }
.newbtn svg{ flex:none; }

.navitem{
  display:flex; align-items:center; gap:14px; height:40px; padding:0 14px;
  border-radius:0 999px 999px 0; margin-right:8px; color:var(--ink);
  font-size:14px; text-align:left; width:100%;
}
.navitem:hover{ background:#ecebf2; }
.navitem.active{ background:var(--select); color:var(--indigo); font-weight:700; }
.navitem svg{ flex:none; color:var(--muted); }
.navitem.active svg{ color:var(--indigo); }

.side .grow{ flex:1; }
.quota{ padding:14px 14px 6px; border-top:1px solid var(--line); margin:8px 8px 0; }
.quota .bar{ height:6px; border-radius:3px; background:#e3e1ea; overflow:hidden; margin:8px 0 6px; }
.quota .fill{ height:100%; background:linear-gradient(90deg,var(--teal),var(--mauve)); width:0; transition:width .4s; }
.quota .txt{ font-size:12px; color:var(--muted); }

/* ------------------------------------------------------------------ contenu */
.main{
  position:fixed; top:var(--header-h); left:var(--side-w); right:0; bottom:0;
  background:var(--surface); border-radius:var(--radius) 0 0 0;
  border-top:1px solid var(--line); border-left:1px solid var(--line);
  display:flex; flex-direction:column; overflow:hidden;
}
.toolbar{
  display:flex; align-items:center; gap:10px; padding:14px 22px 10px; flex:none;
}
.crumbs{ display:flex; align-items:center; gap:2px; flex:1; min-width:0; flex-wrap:wrap; }
.crumbs button{
  font-size:21px; font-weight:400; color:var(--ink); padding:5px 10px; border-radius:var(--radius-s);
  max-width:320px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.crumbs button:hover{ background:var(--hover); }
.crumbs button:last-child{ font-weight:700; }
.crumbs .chev{ color:var(--muted); flex:none; }

.iconbtn{ width:38px; height:38px; border-radius:50%; display:flex; align-items:center; justify-content:center; color:var(--muted); flex:none; }
.iconbtn:hover{ background:var(--hover); color:var(--ink); }
.iconbtn.on{ background:var(--select); color:var(--indigo); }

/* barre d'actions sur selection */
.selbar{
  display:none; align-items:center; gap:8px; padding:8px 22px;
  background:var(--select); border-top:1px solid var(--select-line);
  border-bottom:1px solid var(--select-line); flex:none;
}
.selbar.on{ display:flex; }
.selbar .count{ font-weight:700; color:var(--indigo); margin-right:6px; }
.selbar button.act{
  display:flex; align-items:center; gap:7px; height:34px; padding:0 14px;
  border-radius:999px; color:var(--indigo); font-size:13px;
}
.selbar button.act:hover{ background:rgba(37,37,80,.08); }

/* en-tetes de colonnes */
.cols{
  display:grid; grid-template-columns:1fr 190px 190px 110px 44px; gap:12px;
  padding:8px 22px; border-bottom:1px solid var(--line);
  font-size:12px; color:var(--muted); flex:none; text-transform:none;
}
.cols span{ user-select:none; }
.cols .r{ text-align:right; }

.list{ flex:1; overflow:auto; padding:4px 0 40px; }

.row{
  display:grid; grid-template-columns:1fr 190px 190px 110px 44px; gap:12px;
  align-items:center; padding:0 22px; height:46px; cursor:default;
  border-bottom:1px solid var(--line-soft);
  /* Le double-clic ouvre un dossier : sans ceci, il surligne aussi le texte
     de la ligne, ce qui salit l'affichage a chaque ouverture. */
  user-select:none; -webkit-user-select:none;
}
.selbar,.cols,.crumbs,.side,.quota{ user-select:none; }
.row:hover{ background:var(--hover); }
.row.sel{ background:var(--select); }
.row .nm{ display:flex; align-items:center; gap:14px; min-width:0; }
.row .nm .lbl{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.row .meta{ color:var(--muted); font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.row .r{ text-align:right; }
.row .more{ opacity:0; }
.row:hover .more, .row.sel .more{ opacity:1; }

/* pastille de type */
.ficon{ width:28px; height:28px; border-radius:6px; flex:none; display:flex; align-items:center; justify-content:center; color:#fff; font-size:9px; font-weight:700; letter-spacing:.3px; }
.ficon.folder{ background:none; color:var(--mauve); }
.ficon.doc{ background:var(--doc); }
.ficon.sheet{ background:var(--sheet); }
.ficon.slide{ background:var(--slide); }
.ficon.pdf{ background:var(--pdf); }
.ficon.img{ background:var(--img); }
.ficon.zip{ background:var(--zip); }
.ficon.other{ background:#9a9aa5; }

/* vue grille */
.list.grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(186px,1fr)); gap:14px; padding:18px 22px 40px; align-content:start; }
.list.grid .cols{ display:none; }
.list.grid .row{
  display:block; height:auto; padding:0; border:1px solid var(--line);
  border-radius:var(--radius); overflow:hidden; background:var(--surface);
}
.list.grid .row:hover{ box-shadow:var(--shadow); background:var(--surface); }
.list.grid .row.sel{ border-color:var(--select-line); background:var(--select); }
.list.grid .nm{ padding:12px 14px; gap:10px; }
.list.grid .meta,.list.grid .more{ display:none; }
.list.grid .vign{ height:112px; background:var(--bg); display:flex; align-items:center; justify-content:center; border-top:1px solid var(--line-soft); }
.list.grid .vign .ficon{ width:46px; height:46px; border-radius:10px; font-size:12px; }

/* etats vides */
.empty{ padding:80px 20px; text-align:center; color:var(--muted); }
.empty .t{ font-size:19px; color:var(--ink); margin:16px 0 6px; }
.empty svg{ color:var(--mauve); }

/* ------------------------------------------------------------ menu contextuel */
.ctx{
  position:fixed; z-index:80; min-width:224px; padding:8px 0;
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius-s); box-shadow:var(--shadow-l); display:none;
}
.ctx.open{ display:block; }
.ctx button{
  display:flex; align-items:center; gap:14px; width:100%; padding:9px 18px;
  font-size:14px; text-align:left; color:var(--ink);
}
.ctx button:hover{ background:var(--hover); }
.ctx button.danger{ color:var(--pdf); }
.ctx button svg{ flex:none; color:var(--muted); }
.ctx button.danger svg{ color:var(--pdf); }
.ctx .sep{ height:1px; background:var(--line); margin:6px 0; }

/* ------------------------------------------------------------------- fenetres */
.veil{ position:fixed; inset:0; background:rgba(31,27,60,.42); z-index:90; display:none; align-items:center; justify-content:center; padding:20px; }
.veil.open{ display:flex; }
.dlg{ width:100%; max-width:440px; background:var(--surface); border-radius:var(--radius); box-shadow:var(--shadow-l); overflow:hidden; }
.dlg h3{ margin:0; padding:22px 24px 6px; font-size:20px; font-weight:400; }
.dlg .body{ padding:8px 24px 4px; color:var(--muted); }
.dlg input[type=text]{ width:100%; height:44px; padding:0 14px; margin:12px 0 4px; border:1px solid var(--line); border-radius:var(--radius-s); outline:none; color:var(--ink); }
.dlg input[type=text]:focus{ border-color:var(--indigo); }
.dlg .foot{ display:flex; justify-content:flex-end; gap:8px; padding:16px 20px 20px; }
.btn{ height:40px; padding:0 22px; border-radius:999px; font-size:14px; font-weight:400; }
.btn.ghost{ color:var(--indigo); }
.btn.ghost:hover{ background:var(--select); }
.btn.primary{ background:var(--indigo); color:#fff; }
.btn.primary:hover{ background:var(--indigo-d); }
.btn.primary:disabled{ background:#b9b8c8; cursor:default; }
.btn.danger{ background:var(--pdf); color:#fff; }

/* --------------------------------------------------------------- depot fichiers */
.drop{
  position:fixed; inset:var(--header-h) 0 0 var(--side-w); z-index:70;
  background:rgba(247,230,240,.94); border:3px dashed var(--mauve);
  border-radius:var(--radius) 0 0 0; display:none;
  align-items:center; justify-content:center; flex-direction:column; gap:14px;
  color:var(--indigo); font-size:20px; pointer-events:none;
}
.drop.on{ display:flex; }

/* --------------------------------------------------------------- transferts */
.uploads{
  position:fixed; right:22px; bottom:22px; width:352px; z-index:60;
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius); box-shadow:var(--shadow-l); overflow:hidden; display:none;
}
.uploads.on{ display:block; }
.uploads .hd{ display:flex; align-items:center; gap:10px; padding:13px 16px; background:var(--indigo); color:#fff; font-size:14px; }
.uploads .hd .grow{ flex:1; }
.uploads .hd button{ color:#fff; opacity:.85; padding:2px; }
.uploads .hd button:hover{ opacity:1; }
.uploads .items{ max-height:280px; overflow:auto; }
.uploads .it{ display:flex; align-items:center; gap:12px; padding:11px 16px; border-bottom:1px solid var(--line-soft); }
.uploads .it .nm{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; }
.uploads .it .st{ font-size:12px; color:var(--muted); flex:none; }
.uploads .it .st.ok{ color:var(--sheet); }
.uploads .it .st.ko{ color:var(--pdf); }
.uploads .pg{ height:3px; background:var(--line-soft); }
.uploads .pg i{ display:block; height:100%; background:var(--teal); width:0; transition:width .2s; }

/* ------------------------------------------------------------------- messages */
.toasts{ position:fixed; left:50%; bottom:26px; transform:translateX(-50%); z-index:100; display:flex; flex-direction:column; gap:8px; align-items:center; }
.toast{
  background:var(--indigo-d); color:#fff; padding:13px 22px; border-radius:var(--radius-s);
  box-shadow:var(--shadow-l); font-size:14px; max-width:520px;
  animation:pop .2s ease-out;
}
.toast.err{ background:var(--pdf); }
@keyframes pop{ from{ opacity:0; transform:translateY(10px); } to{ opacity:1; transform:none; } }

/* ------------------------------------------------------------------ connexion */
.loginpage{
  min-height:100%; display:flex; align-items:center; justify-content:center; padding:24px;
  background:
    radial-gradient(900px 500px at 12% -10%, var(--rose-l), transparent 60%),
    radial-gradient(800px 500px at 88% 110%, #e8f2f3, transparent 60%),
    var(--bg);
}
.loginbox{ width:100%; max-width:404px; background:var(--surface); border-radius:18px; box-shadow:var(--shadow-l); padding:38px 36px 30px; }
.loginbox img{ height:44px; display:block; margin:0 auto 22px; }
.loginbox h1{ margin:0 0 4px; font-size:24px; font-weight:400; text-align:center; }
.loginbox h1 b{ font-weight:700; }
.loginbox p.sub{ margin:0 0 26px; text-align:center; color:var(--muted); font-size:14px; }
.field{ margin-bottom:14px; }
.field label{ display:block; font-size:13px; color:var(--muted); margin-bottom:6px; }
.field input{ width:100%; height:46px; padding:0 14px; border:1px solid var(--line); border-radius:var(--radius-s); outline:none; }
.field input:focus{ border-color:var(--indigo); box-shadow:0 0 0 3px var(--rose-l); }
.loginbox .btn{ width:100%; height:46px; margin-top:10px; }
.msg{ display:none; margin-top:14px; padding:11px 14px; border-radius:var(--radius-s); background:#fdeaea; color:var(--pdf); font-size:13px; }
.msg.on{ display:block; }
.legal{ margin-top:24px; text-align:center; font-size:12px; color:var(--muted); line-height:1.5; }

/* --------------------------------------------------------------------- ecrans */
@media (max-width:900px){
  :root{ --side-w:0px; }
  .side{ display:none; }
  .brand{ width:auto; }
  .brand .name{ display:none; }
  .cols,.row{ grid-template-columns:1fr 110px 44px; }
  .cols span:nth-child(2),.row .meta:nth-child(2){ display:none; }
  .main{ border-radius:0; border-left:none; }
  .drop{ left:0; }
}
