/**
 * Mes Fichiers — Professional front-office theme
 * Served through vfm-admin/css/runtime-theme.php
 */

:root {
  --mf-bg: #f6f8fc;
  --mf-surface: rgba(255,255,255,.94);
  --mf-surface-strong: #ffffff;
  --mf-surface-soft: #eef4ff;
  --mf-text: #0f172a;
  --mf-muted: #64748b;
  --mf-border: #e2e8f0;
  --mf-border-strong: #cbd5e1;
  --mf-primary: #2563eb;
  --mf-primary-dark: #1d4ed8;
  --mf-primary-soft: rgba(37,99,235,.10);
  --mf-success: #16a34a;
  --mf-warning: #d97706;
  --mf-danger: #dc2626;
  --mf-shadow-sm: 0 8px 24px rgba(15, 23, 42, .06);
  --mf-shadow: 0 20px 50px rgba(15, 23, 42, .10);
  --mf-radius-xl: 28px;
  --mf-radius-lg: 22px;
  --mf-radius-md: 16px;
  --mf-radius-sm: 12px;
}

html, body { min-height: 100%; }
body {
  background:
    radial-gradient(circle at top right, rgba(37,99,235,.08), transparent 26rem),
    linear-gradient(180deg, #f8fafc 0%, #f4f7fb 42%, #eef2f8 100%);
  color: var(--mf-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -.012em;
}
body:before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at top left, rgba(14,165,233,.05), transparent 24rem);
  z-index: -1;
}
.container { max-width: 1260px; }
a { text-decoration: none; }

/* Top navbar */
.navbar.bg-dark,
.navbar.bg-white {
  background: rgba(15, 23, 42, .94) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 10px 30px rgba(2, 8, 23, .16);
  min-height: 72px;
}
.navbar .container { gap: .9rem; }
.navbar-brand {
  color: #fff !important;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -.03em;
}
.navbar-brand img { max-height: 38px; width: auto; }
.navbar .nav-link,
.navbar .navbar-toggler,
.navbar .dropdown-toggle {
  color: rgba(255,255,255,.92) !important;
}
.navbar .nav-link {
  font-weight: 650;
  border-radius: 999px;
  padding: .55rem .82rem !important;
  transition: background-color .18s ease, color .18s ease, transform .18s ease;
}
.navbar .nav-link:hover,
.navbar .nav-link:focus {
  background: rgba(255,255,255,.08);
  color: #fff !important;
}
.navbar .nav-item.active .nav-link {
  background: rgba(37,99,235,.22);
  color: #fff !important;
}
.navbar-toggler {
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
}
.navbar .badge,
.navbar .notread {
  box-shadow: 0 4px 14px rgba(220,38,38,.32);
}

/* Generic blocks */
.main-content { align-items: flex-start; padding-bottom: 3rem; }
.breadcrumbs,
.vfmblock.tableblock,
.vfmblock.bg-light-lighter,
.card,
#login-form,
.download-page .vfmblock,
.modal-content,
.tn-mega-stat,
.tn-mega-miniinfo,
.tn-dropzone,
.tn-secondary-action,
.plan-card,
.pf-card,
.legal-card {
  background: var(--mf-surface) !important;
  border: 1px solid var(--mf-border) !important;
  border-radius: var(--mf-radius-lg) !important;
  box-shadow: var(--mf-shadow-sm) !important;
}
.breadcrumbs {
  padding: .9rem 1.1rem !important;
  margin-bottom: 1rem !important;
}
.breadcrumbs a,
.breadcrumbs .active { color: var(--mf-text) !important; }
.breadcrumbs .bi { color: var(--mf-muted); }

/* Upload page */
.main-content > .breadcrumbs { order: -10; }
.tn-upload-section { padding: .15rem 0 1.25rem !important; }
.tn-upload-card { max-width: 1160px; margin: 0 auto; }
.tn-upload-card__intro {
  padding: .75rem .25rem 1rem;
  text-align: left;
  max-width: 920px;
}
.tn-kicker {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .48rem .82rem;
  border-radius: 999px;
  background: var(--mf-primary-soft);
  color: var(--mf-primary-dark);
  font-weight: 760;
  font-size: .82rem;
  margin-bottom: .85rem;
}
.tn-upload-card__intro h1 {
  margin: 0 0 .6rem;
  color: var(--mf-text);
  font-weight: 840;
  font-size: clamp(1.95rem, 3vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -.05em;
}
.tn-upload-card__intro p {
  color: var(--mf-muted);
  max-width: 720px;
  margin: 0;
  font-size: 1.03rem;
  line-height: 1.65;
}
.tn-mega-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 1.15rem;
  align-items: start;
}
.tn-mega-side {
  display: flex;
  flex-direction: column;
  gap: .95rem;
}
.tn-mega-stat {
  display: flex;
  align-items: center;
  gap: .95rem;
  padding: 1rem;
  min-height: 104px;
  background: linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(249,251,255,.96) 100%) !important;
}
.tn-mega-stat--primary {
  border-color: rgba(37,99,235,.18) !important;
  background: linear-gradient(180deg, rgba(239,246,255,.96), rgba(255,255,255,.98)) !important;
}
.tn-mega-stat__icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(14,165,233,.12));
  color: var(--mf-primary);
  font-size: 1.28rem;
}
.tn-mega-label {
  display: block;
  font-size: .79rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--mf-muted);
  margin-bottom: .15rem;
}
.tn-mega-stat strong {
  display: block;
  color: var(--mf-text);
  font-size: 1.03rem;
  font-weight: 780;
  overflow-wrap: anywhere;
}
.tn-mega-stat .small {
  color: var(--mf-muted) !important;
  font-size: .84rem;
}
.tn-mega-stat .progress {
  height: 8px;
  background: #e9eff7;
  border-radius: 999px;
}
.tn-mega-miniinfo {
  padding: 1rem 1.05rem;
  display: grid;
  gap: .85rem;
}
.tn-mega-miniinfo > div {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  color: var(--mf-muted);
  line-height: 1.5;
}
.tn-mega-miniinfo i { color: var(--mf-primary); margin-top: .12rem; }

.tn-dropzone {
  position: relative;
  overflow: hidden;
  padding: clamp(1.8rem, 3vw, 2.75rem) clamp(1rem, 2.8vw, 2.2rem);
  box-shadow: var(--mf-shadow) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(249,251,255,.96) 100%) !important;
}
.tn-dropzone:before,
.tn-dropzone:after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.tn-dropzone:before {
  width: 220px;
  height: 220px;
  right: -110px;
  bottom: -120px;
  background: rgba(37,99,235,.06);
}
.tn-dropzone:after {
  width: 140px;
  height: 140px;
  left: -55px;
  top: -55px;
  background: rgba(14,165,233,.05);
}
.tn-dropzone__icon {
  position: relative;
  z-index: 1;
  width: 82px;
  height: 82px;
  margin: 0 auto 1.1rem;
  border-radius: 24px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--mf-primary) 0%, #0ea5e9 100%);
  box-shadow: 0 18px 34px rgba(37,99,235,.25);
  font-size: 2rem;
}
.tn-dropzone__content { position: relative; z-index: 1; text-align: center; }
.tn-dropzone__content h2 {
  margin: 0 0 .45rem;
  color: var(--mf-text);
  font-weight: 810;
  font-size: clamp(1.45rem, 2.6vw, 2.15rem);
  letter-spacing: -.04em;
}
.tn-dropzone__content p {
  max-width: 580px;
  margin: 0 auto 1.2rem;
  color: var(--mf-muted);
  font-size: 1rem;
  line-height: 1.65;
}
.tn-upload-form {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: 0 auto;
}
.tn-upload-controls {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: .8rem;
  align-items: stretch;
}
.tn-file-input {
  min-height: 58px;
  border-radius: 16px !important;
  border: 1px solid var(--mf-border) !important;
  background: #f8fafc !important;
  color: var(--mf-muted) !important;
  padding: 0 1rem !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}
.tn-mega-buttons {
  display: flex;
  gap: .7rem;
  align-items: stretch;
  justify-content: center;
}
.btn,
.btn-primary,
.btn-outline-primary,
.upload_sumbit,
.tn-start-btn {
  border-radius: 14px !important;
  font-weight: 730;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover,
.btn:focus { transform: translateY(-1px); }
.btn-primary,
.tn-start-btn,
.upload_sumbit {
  border: 0 !important;
  background: linear-gradient(135deg, var(--mf-primary) 0%, var(--mf-primary-dark) 100%) !important;
  box-shadow: 0 14px 24px rgba(37,99,235,.18);
  color: #fff !important;
}
.btn-outline-primary {
  border: 1px solid rgba(37,99,235,.24) !important;
  background: #fff !important;
  color: var(--mf-primary) !important;
}
.btn-outline-primary:hover {
  background: rgba(37,99,235,.06) !important;
}
.tn-start-btn,
.upload_sumbit { min-height: 58px; padding: 0 1.4rem !important; }
#upload_error_box {
  max-width: 760px;
  margin: 1rem auto 0;
  border-radius: 16px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.tn-dropzone__meta {
  display: flex;
  justify-content: center;
  gap: .75rem 1rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  color: #768395;
  font-size: .84rem;
}
.tn-dropzone__meta span {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .38rem .7rem;
  background: rgba(248,250,252,.85);
  border: 1px solid var(--mf-border);
  border-radius: 999px;
}
.tn-secondary-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1160px;
  margin: 1rem auto 0;
  padding: 1.1rem 1.2rem;
}
.tn-secondary-action > div { display: flex; flex-direction: column; gap: .2rem; }
.tn-secondary-action strong {
  color: var(--mf-text);
  font-size: 1rem;
  font-weight: 760;
}
.tn-secondary-action span { color: var(--mf-muted); font-size: .9rem; }
.tn-new-folder-form { min-width: min(430px, 100%); }
.tn-new-folder-form .input-group {
  background: #fff;
  border: 1px solid var(--mf-border);
  border-radius: 16px;
  overflow: hidden;
}
.tn-new-folder-form .form-control { border: 0 !important; background: #fff !important; }
.tn-new-folder-form .btn {
  border-radius: 0 !important;
  border-left: 1px solid var(--mf-border) !important;
  min-width: 112px;
}
.tn-progress-wrap { max-width: 1160px; margin: .85rem auto 0; }
.tn-progress-wrap .progress {
  height: 10px;
  background: #e9eff7;
  border-radius: 999px;
  overflow: hidden;
}

/* File list */
.vfmblock.tableblock {
  overflow: hidden;
  padding: 1rem !important;
}
.action-group {
  gap: .65rem;
  align-items: center;
}
.switchview {
  border: 1px solid var(--mf-border);
  border-radius: 14px;
  background: #fff;
  min-height: 44px;
  min-width: 44px;
}
.table {
  --bs-table-bg: transparent;
  color: var(--mf-text);
  margin-bottom: 0;
}
.table > :not(caption) > * > * {
  border-bottom-color: #edf2f7;
  padding-top: 1rem;
  padding-bottom: 1rem;
  vertical-align: middle;
}
.table-hover > tbody > tr:hover > * { background: rgba(37,99,235,.035); }
.table thead td,
.table thead th {
  color: var(--mf-muted);
  font-size: .78rem;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.gridview .fileblock,
.gridview .dirblock {
  border: 1px solid var(--mf-border);
  border-radius: 18px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--mf-shadow-sm);
}
.hidetable section {
  border: 1px dashed var(--mf-border-strong);
  border-radius: var(--mf-radius-lg);
  background: rgba(255,255,255,.72);
}

/* Forms, dropdowns, modals */
.form-control,
.form-select,
.input-group-text {
  border-radius: 12px;
  border-color: var(--mf-border);
}
.form-control:focus,
.form-select:focus {
  border-color: rgba(37,99,235,.45) !important;
  box-shadow: 0 0 0 .22rem rgba(37,99,235,.12) !important;
}
.dropdown-menu {
  border: 1px solid var(--mf-border) !important;
  border-radius: 16px !important;
  box-shadow: var(--mf-shadow) !important;
  padding: .5rem;
}
.dropdown-item {
  border-radius: 10px;
  font-weight: 560;
}
.dropdown-item:hover,
.dropdown-item:focus {
  background: rgba(37,99,235,.06);
  color: var(--mf-primary-dark);
}
.modal-content {
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(15,23,42,.16);
}
.modal-header,
.modal-footer { border-color: var(--mf-border); }

/* Alerts */
.alert {
  border-radius: 16px;
  border-width: 1px;
  box-shadow: var(--mf-shadow-sm);
}
.alert-danger {
  color: #7f1d1d;
  background: #fef2f2;
  border-color: #fecaca;
}
.alert-success {
  color: #14532d;
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.alert-warning {
  color: #78350f;
  background: #fffbeb;
  border-color: #fde68a;
}
.alert-info {
  color: #1e3a8a;
  background: #eff6ff;
  border-color: #bfdbfe;
}

/* Footer */
.footer.bg-dark-lighter {
  margin-top: 2.25rem;
  background: transparent !important;
  color: var(--mf-muted) !important;
  border-top: 1px solid rgba(15,23,42,.08);
}
.footer a { color: var(--mf-text) !important; font-weight: 650; }
.to-top {
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mf-primary), var(--mf-primary-dark)) !important;
  box-shadow: 0 8px 24px rgba(37,99,235,.28);
}

/* Theme switcher */
.theme-switcher .dropdown-menu { min-width: 200px; }
.theme-switcher .dropdown-item { display: flex; align-items: center; gap: .65rem; }
.theme-switcher .dropdown-item.active,
.theme-switcher .dropdown-item:active { background: var(--mf-primary); color: #fff; }
.theme-switcher .theme-label { margin-left: .25rem; }

/* Announcement bar */
.product-announcement,
.site-announcement,
.alert-global,
body > .announcement {
  border-radius: 0;
  border: 0;
  box-shadow: none;
}

/* Dark mode */
html[data-bs-theme="dark"] body,
body.dark-mode {
  --mf-bg: #0b1120;
  --mf-surface: rgba(17, 24, 39, .94);
  --mf-surface-strong: #111827;
  --mf-surface-soft: #14213a;
  --mf-text: #f8fafc;
  --mf-muted: #94a3b8;
  --mf-border: #243047;
  --mf-border-strong: #334155;
  background:
    radial-gradient(circle at top right, rgba(37,99,235,.12), transparent 26rem),
    linear-gradient(180deg, #08101d 0%, #0b1220 100%) !important;
  color: var(--mf-text) !important;
}
html[data-bs-theme="dark"] body:before { background: radial-gradient(circle at top left, rgba(14,165,233,.08), transparent 24rem); }
html[data-bs-theme="dark"] .navbar.bg-dark,
html[data-bs-theme="dark"] .navbar.bg-white {
  background: rgba(7, 12, 24, .88) !important;
  border-color: rgba(255,255,255,.05) !important;
}
html[data-bs-theme="dark"] .breadcrumbs,
html[data-bs-theme="dark"] .vfmblock.tableblock,
html[data-bs-theme="dark"] .vfmblock.bg-light-lighter,
html[data-bs-theme="dark"] .card,
html[data-bs-theme="dark"] #login-form,
html[data-bs-theme="dark"] .download-page .vfmblock,
html[data-bs-theme="dark"] .modal-content,
html[data-bs-theme="dark"] .tn-mega-stat,
html[data-bs-theme="dark"] .tn-mega-miniinfo,
html[data-bs-theme="dark"] .tn-dropzone,
html[data-bs-theme="dark"] .tn-secondary-action,
html[data-bs-theme="dark"] .plan-card,
html[data-bs-theme="dark"] .pf-card,
html[data-bs-theme="dark"] .legal-card {
  background: var(--mf-surface) !important;
  border-color: var(--mf-border) !important;
  color: var(--mf-text) !important;
  box-shadow: 0 20px 50px rgba(0,0,0,.26) !important;
}
html[data-bs-theme="dark"] .tn-mega-stat,
html[data-bs-theme="dark"] .tn-dropzone {
  background: linear-gradient(180deg, rgba(17,24,39,.96) 0%, rgba(12,19,32,.94) 100%) !important;
}
html[data-bs-theme="dark"] .tn-mega-stat__icon {
  background: linear-gradient(135deg, rgba(37,99,235,.20), rgba(14,165,233,.16));
  color: #7dd3fc;
}
html[data-bs-theme="dark"] .tn-file-input,
html[data-bs-theme="dark"] .tn-new-folder-form .form-control,
html[data-bs-theme="dark"] .tn-new-folder-form .input-group,
html[data-bs-theme="dark"] .form-control,
html[data-bs-theme="dark"] .form-select,
html[data-bs-theme="dark"] .input-group-text {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: var(--mf-text) !important;
}
html[data-bs-theme="dark"] .form-control::placeholder { color: #7b8ca5 !important; }
html[data-bs-theme="dark"] .dropdown-menu {
  background: #101827 !important;
  border-color: #334155 !important;
}
html[data-bs-theme="dark"] .dropdown-item { color: #e2e8f0 !important; }
html[data-bs-theme="dark"] .dropdown-item:hover,
html[data-bs-theme="dark"] .dropdown-item:focus { background: rgba(37,99,235,.18); color: #fff !important; }
html[data-bs-theme="dark"] .table { color: #e5edf7 !important; }
html[data-bs-theme="dark"] .table > :not(caption) > * > * { border-bottom-color: rgba(255,255,255,.07); }
html[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * { background: rgba(37,99,235,.10); }
html[data-bs-theme="dark"] .table thead td,
html[data-bs-theme="dark"] .table thead th,
html[data-bs-theme="dark"] .tn-mega-label,
html[data-bs-theme="dark"] .tn-upload-card__intro p,
html[data-bs-theme="dark"] .tn-mega-miniinfo > div,
html[data-bs-theme="dark"] .tn-dropzone__content p,
html[data-bs-theme="dark"] .small,
html[data-bs-theme="dark"] .text-secondary { color: var(--mf-muted) !important; }
html[data-bs-theme="dark"] .tn-dropzone__meta span {
  background: rgba(15,23,42,.62);
  border-color: rgba(255,255,255,.08);
  color: #cbd5e1;
}
html[data-bs-theme="dark"] .footer.bg-dark-lighter { border-color: rgba(255,255,255,.08) !important; }
html[data-bs-theme="dark"] .footer a { color: #e2e8f0 !important; }
html[data-bs-theme="dark"] .btn-outline-primary {
  background: rgba(37,99,235,.08) !important;
  color: #93c5fd !important;
  border-color: rgba(147,197,253,.25) !important;
}
html[data-bs-theme="dark"] .btn-outline-primary:hover { background: rgba(37,99,235,.18) !important; }
html[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
html[data-bs-theme="dark"] .alert-danger { background: rgba(127,29,29,.32); color: #fecaca; border-color: rgba(220,38,38,.25); }
html[data-bs-theme="dark"] .alert-success { background: rgba(20,83,45,.30); color: #bbf7d0; border-color: rgba(34,197,94,.22); }
html[data-bs-theme="dark"] .alert-warning { background: rgba(120,53,15,.32); color: #fde68a; border-color: rgba(217,119,6,.22); }
html[data-bs-theme="dark"] .alert-info { background: rgba(30,58,138,.30); color: #bfdbfe; border-color: rgba(59,130,246,.22); }

@media (max-width: 991.98px) {
  .tn-mega-layout { grid-template-columns: 1fr; }
  .tn-mega-side {
    order: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .tn-mega-miniinfo { grid-column: 1 / -1; }
}

@media (max-width: 767.98px) {
  .navbar.bg-dark,
  .navbar.bg-white { min-height: 64px; }
  .tn-upload-card__intro { padding-top: .35rem; }
  .tn-upload-card__intro h1 { font-size: 1.95rem; }
  .tn-upload-controls { grid-template-columns: 1fr; }
  .tn-mega-buttons { width: 100%; display: grid; grid-template-columns: 1fr; }
  .tn-file-input,
  .tn-start-btn,
  .upload_sumbit { width: 100%; }
  .tn-secondary-action { flex-direction: column; align-items: stretch; }
  .tn-new-folder-form { min-width: 0; width: 100%; }
  .tn-dropzone__meta { flex-direction: column; align-items: center; }
  .tn-mega-side { grid-template-columns: 1fr; }
  .tn-mega-miniinfo { grid-column: auto; }
}
