/* ==========================================================================
   Portal cloud — foaie de stil unică.
   Fără dependențe externe: totul trebuie să funcționeze pe găzduire partajată,
   inclusiv fără acces la internet din browserul clientului.
   ========================================================================== */

:root {
  --ink:        #16202e;
  --ink-soft:   #5a6a7d;
  --ink-faint:  #8a99ab;
  --line:       #e3e8ef;
  --bg:         #f5f7fa;
  --panel:      #ffffff;

  --brand:      #1f4fd8;
  --brand-dark: #16204a;
  --brand-deep: #0e1630;
  --brand-soft: #eef3ff;

  --ok:         #0f7b4f;
  --ok-soft:    #e7f6ee;
  --danger:     #c0392b;
  --danger-soft:#fdeceb;

  --radius:     14px;
  --radius-sm:  9px;
  --shadow:     0 1px 2px rgba(16,24,40,.05), 0 8px 24px rgba(16,24,40,.06);
  --shadow-lift:0 4px 10px rgba(16,24,40,.08), 0 18px 40px rgba(16,24,40,.12);

  --font: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.uicon { width: 20px; height: 20px; flex: 0 0 auto; }

/* ============================================================ autentificare */

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 15% 10%, #1b2a5e 0%, transparent 60%),
    linear-gradient(140deg, #0e1630 0%, #1a2450 55%, #24306b 100%);
}

.login-shell {
  width: min(940px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--panel);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(4, 10, 30, .45);
}

.login-brand {
  padding: 46px 40px;
  color: #eaf0ff;
  background: linear-gradient(160deg, var(--brand-deep), #1d2a63);
  display: flex;
  flex-direction: column;
  justify-content: center;   /* fara text de subsol, blocul sta centrat */
}

.brand-mark {
  width: 54px; height: 54px;
  display: grid; place-items: center;
  border-radius: 15px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  margin-bottom: 22px;
}
.brand-mark .uicon { width: 28px; height: 28px; stroke: #fff; }
.brand-mark.small { width: 38px; height: 38px; border-radius: 11px; margin: 0; }
.brand-mark.small .uicon { width: 21px; height: 21px; }

.login-brand h1 { margin: 0; font-size: 25px; line-height: 1.25; letter-spacing: -.2px; }
.brand-sub { margin: 6px 0 32px; color: #a9b8e6; font-size: 14px; }

.brand-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.brand-points li { display: flex; align-items: center; gap: 12px; font-size: 14px; color: #d7e0fb; }
.brand-points .uicon { stroke: #7e93e0; }

.login-form { display: grid; place-items: center; padding: 46px 40px; }
.form-inner { width: 100%; max-width: 330px; }
.login-form h2 { margin: 0 0 24px; font-size: 22px; letter-spacing: -.2px; }
.form-help { margin: 22px 0 0; font-size: 12.5px; color: var(--ink-faint); text-align: center; }

/* ------------------------------------------------------------------ câmpuri */

.field { display: block; margin-bottom: 16px; }
.field-label {
  display: block; margin-bottom: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
}
.field-input {
  display: flex; align-items: center; gap: 9px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.field-input:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31,79,216,.13);
}
.field-input .uicon { stroke: var(--ink-faint); width: 18px; height: 18px; }
.field-input input {
  flex: 1; min-width: 0;
  padding: 11px 0;
  border: 0; outline: 0;
  font: inherit; color: inherit;
  background: transparent;
}

/* ------------------------------------------------------------------ butoane */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px;
  font: inherit; font-size: 14px; font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .06s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn .uicon { width: 17px; height: 17px; }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: #1a44bd; }

.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: #f7f9fc; border-color: #cfd7e3; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a83224; }

.btn-block { width: 100%; margin-top: 6px; padding: 12px; }

/* ------------------------------------------------------------------ alerte */

.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert-error { background: var(--danger-soft); color: #96271b; border-color: #f5cfcb; }
.alert-ok    { background: var(--ok-soft);     color: #0b5c3b; border-color: #c6e8d6; }

/* ================================================================= aspectul */

.layout {
  display: grid;
  grid-template-columns: 262px 1fr;
  min-height: 100vh;
}

/* --------------------------------------------------------------- bara laterală */

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  color: #c9d4ee;
  background: linear-gradient(180deg, var(--brand-deep), #17224d);
  position: sticky; top: 0;
  height: 100vh;
}

.side-brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px 22px; }
.side-brand-text { display: flex; flex-direction: column; min-width: 0; }
.side-brand-text strong {
  color: #fff; font-size: 14.5px; letter-spacing: -.1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.side-brand-text em { font-style: normal; font-size: 12px; color: #8090c4; }

.side-nav { flex: 1; }
.side-title {
  margin: 6px 8px 10px;
  font-size: 11px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  color: #6d7cae;
}

.side-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 11px;
  border-radius: 10px;
  margin-bottom: 3px;
  transition: background .15s, color .15s;
}
.side-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-item.is-active { background: rgba(255,255,255,.13); color: #fff; }
.side-item .uicon { stroke: currentColor; opacity: .85; }

.side-item-text { display: flex; flex-direction: column; min-width: 0; }
.side-item-label {
  font-size: 13.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.side-item-note { font-size: 11px; color: #7d8cbe; }
.side-item.is-active .side-item-note { color: #a9b6e0; }

.side-foot {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.side-user, .side-exit {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; padding: 0 6px;
}
.side-user { color: #93a1d0; }
.side-exit { color: #c9d4ee; }
.side-exit:hover { color: #fff; }
.side-user .uicon, .side-exit .uicon { width: 17px; height: 17px; }

/* ------------------------------------------------------------------ conținut */

.content { padding: 22px 30px 44px; min-width: 0; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
  padding-bottom: 16px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.crumbs { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-width: 0; font-size: 14px; }
.crumbs a { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); }
.crumbs a:hover { color: var(--brand); }
.crumbs a:last-child { color: var(--ink); font-weight: 600; }
.crumbs .uicon { width: 17px; height: 17px; }
.crumb-sep { color: var(--ink-faint); }

.topbar-actions { display: flex; align-items: center; gap: 9px; }
.upload-form { margin: 0; }
.upload-form .btn { cursor: pointer; }

.badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px;
  font-size: 12.5px; font-weight: 600;
  border-radius: 999px;
}
.badge-ro { background: var(--brand-soft); color: #24409c; }
.badge .uicon { width: 15px; height: 15px; }

.listing-meta { margin: 14px 0 16px; font-size: 13px; color: var(--ink-faint); }

/* ------------------------------------------------------------------- grilă */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 14px;
}

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .13s, box-shadow .13s, border-color .13s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: #d3dcea;
}

.card-open {
  display: flex; flex-direction: column; align-items: center;
  padding: 22px 12px 16px;
  text-align: center;
}

.ficon { width: 52px; height: 52px; margin-bottom: 12px; }

.card-name {
  font-size: 13px; font-weight: 600; line-height: 1.35;
  word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta { margin-top: 5px; font-size: 11.5px; color: var(--ink-faint); }

/* unelte pe card (apar la hover) */
.card-tools {
  position: absolute; top: 7px; right: 7px;
  display: flex; gap: 3px;
  opacity: 0; transition: opacity .13s;
}
.card:hover .card-tools, .card-tools:focus-within { opacity: 1; }

.tool {
  display: grid; place-items: center;
  width: 27px; height: 27px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0;
}
.tool:hover { background: var(--brand-soft); color: var(--brand); border-color: #c3d3f7; }
.tool-danger:hover { background: var(--danger-soft); color: var(--danger); border-color: #f2c9c4; }
.tool .uicon { width: 15px; height: 15px; }

/* ------------------------------------------------- iconuri de fișier (culori) */

.ficon .sheet { fill: #ccd5e2; }
.ficon .fold  { fill: #aab8cc; }
.ficon .mark  { fill: #fff; stroke: #fff; }
.ficon .tag   { fill: #fff; font: 700 11px var(--font); letter-spacing: .3px; }

.kind-folder .sheet { fill: #7fa8f0; }
.kind-folder .fold  { fill: #4d7fdc; }

.kind-image  .sheet { fill: #46b98a; } .kind-image  .fold { fill: #2f9a70; }
.kind-pdf    .sheet { fill: #e05c4b; } .kind-pdf    .fold { fill: #bf4133; }
.kind-doc    .sheet { fill: #3f76e0; } .kind-doc    .fold { fill: #2a58b8; }
.kind-sheet  .sheet { fill: #1f9e64; } .kind-sheet  .fold { fill: #157a4c; }
.kind-slides .sheet { fill: #e2903a; } .kind-slides .fold { fill: #bf7226; }
.kind-archive.sheet, .kind-archive .sheet { fill: #9b7cd4; } .kind-archive .fold { fill: #7a5cb5; }
.kind-code   .sheet { fill: #3b4a63; } .kind-code   .fold { fill: #25314a; }
.kind-video  .sheet { fill: #c74fa0; } .kind-video  .fold { fill: #a33682; }
.kind-audio  .sheet { fill: #d6a017; } .kind-audio  .fold { fill: #b0810c; }
.kind-file   .tag   { fill: #55637a; }
.kind-file   .sheet { fill: #dde3ec; } .kind-file .fold { fill: #c1cbda; }

.ficon .mark[stroke-width] { fill: none; stroke: #fff; }

/* -------------------------------------------------------------- folder gol */

.empty {
  display: grid; place-items: center;
  padding: 70px 20px;
  text-align: center;
  background: var(--panel);
  border: 1px dashed #d6deea;
  border-radius: var(--radius);
}
.empty .ficon { width: 62px; height: 62px; opacity: .5; }
.empty-title { margin: 14px 0 4px; font-weight: 600; }
.empty-sub { margin: 0; font-size: 13.5px; color: var(--ink-faint); }

/* ----------------------------------------------------------------- ferestre */

.dialog-backdrop {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(12, 18, 34, .5);
  z-index: 50;
}
.dialog-backdrop[hidden] { display: none; }

.dialog {
  width: min(420px, 100%);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 24px 60px rgba(8, 14, 30, .35);
}
.dialog h3 { margin: 0 0 16px; font-size: 17px; }
.dialog-text { margin: 0 0 20px; font-size: 14px; color: var(--ink-soft); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 4px; }

/* ------------------------------------------------------------------ ecrane mici */

@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { padding: 34px 28px; }
  .brand-points { display: none; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .side-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 4px; }
  .side-title { grid-column: 1 / -1; }
  .content { padding: 18px 16px 36px; }
}
