/* Henzo Cloud : même apparence que la Super App (thème "Aurora Forest", police Inter). */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --grad-a:var(--accent-2); --grad-b:var(--accent);
  --bg:#030b0a; --bg-2:#061412; --card:#0a1c1a; --card2:#0f2523; --card3:#143230;
  --text:#ffffff; --text-2:#d7efeb; --muted:#8fb3ad;
  --accent:#48A89A; --accent-2:#6cc7b8; --accent-dk:#00524D;
  --green:#6fe0c7; --red:#ff7b7b;
  --border:rgba(203,239,235,.07); --border-2:rgba(203,239,235,.13);
  --pri-bg:#ffffff; --pri-fg:#00524D;
  --hero-1:#00524D; --hero-2:#053931; --hero-3:#021614;
}
* { box-sizing:border-box; }
html { background:var(--bg); }
body {
  margin:0; color:var(--text); font:15px/1.5 Inter, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1100px 520px at 85% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%),
    radial-gradient(800px 420px at -10% 10%, color-mix(in srgb, var(--accent-dk) 25%, transparent), transparent 60%),
    var(--bg);
  min-height:100vh; -webkit-font-smoothing:antialiased; display:flow-root;
}
#app { max-width:760px; margin:0 auto; padding:16px 16px 48px; }
.hidden { display:none !important; }

/* ---------- En-tête ---------- */
header { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:6px 0 16px; }
header h1 { margin:0; font-size:1.35rem; font-weight:800; letter-spacing:-.02em; flex:1; display:flex; align-items:center; gap:10px; }
header h1::before, .narrow h1::before {
  content:""; width:30px; height:30px; border-radius:10px; flex:0 0 30px;
  background:linear-gradient(135deg, var(--accent-2), var(--accent-dk)) center/cover;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17.5 19a4.5 4.5 0 1 0-1.4-8.8A6 6 0 0 0 4.3 12.6 3.5 3.5 0 0 0 6.5 19z' fill='black'/%3E%3C/svg%3E") center/80% no-repeat;
          mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17.5 19a4.5 4.5 0 1 0-1.4-8.8A6 6 0 0 0 4.3 12.6 3.5 3.5 0 0 0 6.5 19z' fill='black'/%3E%3C/svg%3E") center/80% no-repeat;
}
#who { color:var(--muted); font-size:.85rem; margin-right:4px; }
header button.link { border:1px solid var(--border-2); background:var(--card); border-radius:999px; padding:7px 14px; color:var(--text-2); }

/* ---------- Cartes ---------- */
.card {
  background:linear-gradient(180deg, var(--card2), var(--card));
  border:1px solid var(--border-2); border-radius:20px; padding:18px; margin-bottom:16px;
  box-shadow:0 8px 24px color-mix(in srgb, #000 25%, transparent);
}
.card > p:first-child { margin:0 0 12px; }
.card > p:first-child strong { font-size:1.05rem; font-weight:700; }
.narrow { max-width:380px; margin:14vh auto 0; }
.narrow h1 { margin:0 0 16px; font-weight:800; letter-spacing:-.02em; display:flex; align-items:center; gap:10px; font-size:1.5rem; }
#login-form button { width:100%; margin-top:6px; }
.narrow { margin-left:auto; margin-right:auto; }
@media (max-width:520px) { .narrow { margin:10vh 16px 0; } }

/* ---------- Champs ---------- */
label { display:block; margin-bottom:12px; color:var(--text-2); font-size:.9rem; font-weight:500; }
input, select {
  width:100%; padding:12px 14px; margin-top:6px; border:1px solid var(--border-2); border-radius:14px;
  background:var(--bg-2); color:var(--text); font:inherit; outline:none; transition:border-color .2s;
}
textarea {
  width:100%; padding:12px 14px; margin-top:10px; border:1px solid var(--border-2); border-radius:14px; resize:vertical;
  background:var(--bg-2); color:var(--text); font:inherit; outline:none; transition:border-color .2s; min-height:96px;
}
input:focus, select:focus, textarea:focus { border-color:var(--accent); }
.note-actions { display:flex; gap:8px; margin:12px 0 0; }
.dropzone { border:2px dashed var(--border-2); border-radius:14px; padding:18px 14px; margin:6px 0 10px; text-align:center; color:var(--muted); font-size:.9rem; }
.dropzone.on { border-color:var(--accent); color:var(--text); }
.dragover { position:fixed; inset:0; z-index:60; display:flex; align-items:center; justify-content:center; background:rgba(0,0,0,.6); pointer-events:none; }
.dragover.hidden { display:none; }
.dragover div { padding:28px 36px; border:3px dashed #fff; border-radius:24px; color:#fff; font-size:1.2rem; font-weight:700; background:rgba(0,0,0,.4); }
input[type=file] { border-style:dashed; padding:14px; cursor:pointer; color:var(--muted); }
input[type=file]::file-selector-button {
  border:0; border-radius:999px; padding:9px 16px; margin-right:12px; cursor:pointer;
  background:var(--pri-bg); color:var(--pri-fg); font:600 .9rem Inter, sans-serif;
}
form input + input, form input + button { margin-top:10px; }

/* ---------- Boutons ---------- */
button {
  padding:12px 18px; border:0; border-radius:999px; background:var(--pri-bg); color:var(--pri-fg);
  font:600 .95rem Inter, sans-serif; cursor:pointer; transition:transform .15s, opacity .15s;
}
button:active { transform:scale(.97); }
button:disabled { opacity:.35; cursor:not-allowed; }
button.link { background:none; color:var(--accent-2); padding:6px 10px; font-weight:600; }
button.danger { background:none; color:var(--red); padding:6px 10px; }
.ibtn {
  display:inline-flex; align-items:center; justify-content:center; width:38px; height:38px; padding:0;
  background:none; border:1px solid var(--border-2); border-radius:12px; color:var(--text);
}
.ibtn.del { color:var(--red); }
.ibtn svg { width:17px; height:17px; }
.chip {
  display:inline-flex; align-items:center; gap:6px; background:var(--card); border:1px solid var(--border-2);
  color:var(--text); padding:8px 14px; font-size:.85rem;
}
.chip.del { color:var(--red); }

/* ---------- Textes ---------- */
.hint { color:var(--muted); font-size:.85rem; margin:10px 0 0; }
.error { color:var(--red); min-height:1.2em; margin:8px 0 0; }

/* ---------- Liste des fichiers ---------- */
.files { margin-top:4px; }
.f { display:flex; align-items:center; gap:12px; padding:10px 6px; border-top:1px solid var(--border); }
.f:first-child { border-top:0; }
.th {
  flex:0 0 52px; width:52px; height:52px; border-radius:12px; background:var(--card3); overflow:hidden;
  display:flex; align-items:center; justify-content:center; font-size:.65rem; font-weight:800; color:var(--muted);
}
.th { position:relative; flex-direction:column; gap:1px; color:var(--accent-2);
  background:linear-gradient(145deg, color-mix(in srgb, var(--accent) 22%, var(--card3)), var(--card3)); }
.th small { font-size:.58rem; font-weight:800; color:var(--muted); letter-spacing:.04em; text-transform:uppercase; }
.th.k-video { color:#ff9b7a; background:linear-gradient(145deg, color-mix(in srgb, #ff7a59 22%, var(--card3)), var(--card3)); }
.th.k-audio { color:#c49bff; background:linear-gradient(145deg, color-mix(in srgb, #a77bff 24%, var(--card3)), var(--card3)); }
.th.k-pdf { color:#ff7b7b; background:linear-gradient(145deg, color-mix(in srgb, #ff5c5c 22%, var(--card3)), var(--card3)); }
.th.k-image { color:var(--grad-b); }
.th img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; cursor:pointer; display:block; opacity:0; transition:opacity .3s; }
.th.has-img img { opacity:1; }
.in { flex:1; min-width:0; }
.n { word-break:break-word; font-weight:500; line-height:1.3; }
.d { color:var(--muted); font-size:.78rem; margin-top:3px; }
.d .off { color:var(--red); }
.d .wait { color:var(--accent-2); }
.a { display:flex; gap:6px; flex:0 0 auto; }

/* ---------- Envois en cours ---------- */
ul { list-style:none; padding:0; margin:12px 0 0; }
li.up { padding:10px 0; border-top:1px solid var(--border); font-size:.9rem; }
li.up .bar { height:10px; background:color-mix(in srgb, var(--muted) 25%, transparent); border-radius:999px; margin-top:8px; }
li.up .bar i { display:block; height:100%; width:0; border-radius:999px; background:linear-gradient(90deg, var(--grad-a), var(--grad-b)); box-shadow:0 0 14px color-mix(in srgb, var(--grad-b) 50%, transparent); transition:width .4s; }
li.up .msg { color:var(--muted); font-size:.8rem; margin-top:4px; }
li.up.fail .msg { color:var(--red); }

/* ---------- Comptes (administrateur) ---------- */
table { width:100%; border-collapse:collapse; }
td { padding:10px 6px; border-top:1px solid var(--border); vertical-align:middle; }
tr:first-child td { border-top:0; }
td.size { color:var(--muted); white-space:nowrap; font-size:.85rem; }
td.name { word-break:break-word; }
td.act { text-align:right; white-space:nowrap; }

@media (max-width:520px) {
  .f { flex-wrap:wrap; }
  .a { width:100%; justify-content:flex-end; padding-left:64px; margin-top:-4px; }
  header h1 { flex-basis:100%; }
}

/* ---------- Choix du thème ---------- */
.themes { display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:10px; }
.theme {
  display:flex; flex-direction:column; align-items:flex-start; gap:8px; text-align:left; border-radius:16px; padding:12px;
  background:var(--card); color:var(--text); border:1px solid var(--border-2); font-weight:500;
}
.theme.on { border-color:var(--accent); box-shadow:0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }
.theme .sw { display:flex; gap:4px; }
.theme .sw i { width:20px; height:20px; border-radius:6px; border:1px solid var(--border-2); display:block; }
.theme b { font-size:.9rem; }
.theme small { color:var(--muted); font-size:.75rem; line-height:1.3; }

/* ---------- Carte "Stockage en ligne" ---------- */
.store {
  border-radius:26px; padding:20px 20px 18px; margin-bottom:16px;
  background:linear-gradient(165deg, var(--card3), var(--card)); border:1px solid var(--border-2);
  box-shadow:0 24px 44px -24px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,255,255,.06);
}
.store:empty { display:none; }
.store-h { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.store-h b { font-size:1.1rem; font-weight:600; }
.chip2 {
  display:inline-flex; align-items:center; gap:6px; padding:4px 12px; border-radius:999px; font-size:.8rem;
  border:1px solid var(--border-2); background:color-mix(in srgb, var(--card) 70%, transparent); color:var(--text-2);
}
.chip2 .dot { width:7px; height:7px; border-radius:50%; background:var(--grad-b); box-shadow:0 0 8px var(--grad-b); }
.chip2.off { color:var(--red); }
.chip2.off .dot { background:var(--red); box-shadow:none; }
.store-pct { font-size:3rem; font-weight:500; letter-spacing:-.04em; line-height:1; margin:14px 0 16px; }
.store-pct span { color:var(--muted); font-weight:400; }
.store-bar { position:relative; height:46px; border-radius:999px; background:color-mix(in srgb, var(--muted) 30%, transparent); }
.store-bar i {
  position:absolute; left:0; top:0; bottom:0; border-radius:999px;
  background:linear-gradient(90deg, var(--grad-a), var(--grad-b));
  box-shadow:0 0 26px color-mix(in srgb, var(--grad-b) 55%, transparent); transition:width .8s cubic-bezier(.16,1,.3,1);
}
.store-bar span { position:absolute; right:18px; top:50%; transform:translateY(-50%); font-weight:600; color:var(--text-2); text-shadow:0 1px 2px rgba(0,0,0,.25); }
.store-sub { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-top:14px; color:var(--muted); font-size:.82rem; }

/* ---------- Appareil d'origine ---------- */
.dev { display:inline-flex; align-items:center; gap:4px; color:var(--accent-2); }
.dev svg { width:12px; height:12px; }
#device { width:100%; margin-top:6px; }
.th, .in { cursor:pointer; }

/* ---------- Lecteur intégré ---------- */
.viewer { position:fixed; inset:0; z-index:50; display:flex; flex-direction:column; background:color-mix(in srgb, #000 88%, var(--bg, #000)); color:#fff; }
.viewer.hidden { display:none; }
.v-bar { display:flex; align-items:center; gap:8px; padding:10px 12px; background:rgba(0,0,0,.45); }
.v-title { flex:1; min-width:0; display:flex; flex-direction:column; }
.v-title b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.v-title small { color:#cfd3dc; font-size:.75rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.viewer .ibtn { color:#fff; border-color:rgba(255,255,255,.3); font-size:1.2rem; }
.viewer .ibtn:disabled { opacity:.3; }
.v-body { flex:1; min-height:0; display:flex; align-items:center; justify-content:center; overflow:auto; padding:10px; }
.v-body img, .v-body video { max-width:100%; max-height:100%; object-fit:contain; }
.v-body video { width:100%; height:100%; background:#000; }
.v-body audio { width:min(560px, 100%); }
.v-audio { display:flex; flex-direction:column; align-items:center; gap:16px; width:100%; }
.v-audio img { width:min(260px, 70vw); border-radius:16px; }
.v-pdf { align-self:flex-start; width:100%; display:flex; flex-direction:column; align-items:center; gap:10px; }
.v-pdf canvas { max-width:100%; height:auto; background:#fff; box-shadow:0 2px 14px rgba(0,0,0,.5); }
.v-text { align-self:stretch; width:100%; margin:0; padding:14px; background:rgba(255,255,255,.07); border-radius:12px; white-space:pre-wrap; word-break:break-word; overflow:auto; font:13px/1.5 ui-monospace, Menlo, Consolas, monospace; text-align:left; }
.v-office { align-self:stretch; width:100%; min-height:0; display:flex; flex-direction:column; }
.v-office > .ho-doc { flex:1; }
.v-note { text-align:center; max-width:420px; color:#cfd3dc; display:flex; flex-direction:column; align-items:center; gap:12px; }
.v-note svg { width:56px; height:56px; }
.v-note button { background:var(--accent, #6c5ce7); color:#fff; border:0; border-radius:12px; padding:10px 18px; font:inherit; cursor:pointer; }
