/* My Seedbox V3 — loaded after the legacy SB Admin styles. */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --msb-navy-950: #08111f;
  --msb-navy-900: #0f1b2d;
  --msb-navy-800: #16263c;
  --msb-text: #132033;
  --msb-muted: #617186;
  --msb-green: #76c043;
  --msb-green-dark: #5fa52e;
  --msb-blue: #2f80ed;
  --msb-surface: #f6f8fb;
  --msb-border: #dce4ed;
  --msb-radius: 12px;
}

.msb-v3 {
  color: var(--msb-text);
  background: var(--msb-surface);
  font-family: Inter, "Open Sans", "Segoe UI", Arial, sans-serif;
}

.msb-v3 a { color: #3f7d20; }
.msb-v3 a:hover { color: #2e6117; text-decoration: none; }
.msb-v3 h1, .msb-v3 h2, .msb-v3 h3, .msb-v3 h4, .msb-v3 h5, .msb-v3 h6 { color: var(--msb-text); font-weight: 650; }
.msb-v3 .text-gray-600, .msb-v3 .text-gray-900 { color: var(--msb-text) !important; }

.msb-v3 :focus-visible {
  outline: 3px solid var(--msb-blue) !important;
  outline-offset: 2px;
  box-shadow: none !important;
}

.msb-v3 .btn,
.msb-v3 .form-control,
.msb-v3 .custom-select,
.msb-v3 .navbar .nav-link,
.msb-v3 .dropdown-item {
  min-height: 44px;
}

.msb-v3 .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  border-radius: 9px;
  padding: .55rem 1rem;
  font-weight: 650;
  line-height: 1.25;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.msb-v3 .btn:active { transform: translateY(1px); }
.msb-v3 .btn-primary,
.msb-v3 .btn-success {
  color: var(--msb-navy-950);
  background: var(--msb-green);
  border-color: var(--msb-green);
}
.msb-v3 .btn-primary:hover,
.msb-v3 .btn-success:hover,
.msb-v3 .btn-primary:focus,
.msb-v3 .btn-success:focus {
  color: var(--msb-navy-950);
  background: var(--msb-green-dark);
  border-color: var(--msb-green-dark);
}
.msb-v3 .btn-info { color: var(--msb-navy-950); background: #fff; border-color: var(--msb-border); }
.msb-v3 .btn-info:hover, .msb-v3 .btn-info:focus { color: var(--msb-navy-950); background: #eef2f6; border-color: #b8c5d3; }
.msb-v3 .btn-secondary { color: var(--msb-text); background: #eef2f6; border-color: var(--msb-border); }
.msb-v3 .btn-secondary:hover, .msb-v3 .btn-secondary:focus { color: var(--msb-text); background: #e2e8ef; border-color: #b8c5d3; }
.msb-v3 .btn-danger { color: #fff; background: #b93636; border-color: #b93636; }
.msb-v3 .btn-danger:hover, .msb-v3 .btn-danger:focus { color: #fff; background: #962b2b; border-color: #962b2b; }

/* File manager shell */
.msb-app #wrapper { min-height: 100vh; }
.msb-app .sidebar {
  width: 276px !important;
  min-height: 100vh;
  flex: 0 0 276px;
  background: var(--msb-navy-900) !important;
  box-shadow: none;
  transition: width .2s ease, flex-basis .2s ease;
}
.msb-app .sidebar .sidebar-brand {
  height: 96px;
  padding: 24px 26px;
  justify-content: flex-start !important;
}
.msb-app .sidebar .sidebar-brand img { width: 224px; height: auto !important; max-height: 40px; object-fit: contain; object-position: left center; }
.msb-app .sidebar-divider { border-color: rgba(255, 255, 255, .13); margin: 0 18px !important; }
.msb-app .filetree { padding: 18px 14px; margin: 0; }
.msb-app .filetree li { margin: 2px 0; line-height: 1.35; }
.msb-app .filetree a {
  width: calc(100% - 21px);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 7px 8px 7px 0;
  color: rgba(255, 255, 255, .82);
  border-radius: 8px;
}
.msb-app .filetree a::before { width: 30px; padding: 0 7px; color: var(--msb-green); }
.msb-app .filetree li > label { min-width: 21px; min-height: 44px; vertical-align: middle; }
.msb-app .filetree li > label::before { color: rgba(255,255,255,.62); line-height: 44px; }
.msb-app .filetree li.active > a,
.msb-app .filetree li > a.hover {
  color: #fff;
  background: var(--msb-navy-800);
  padding: 7px 8px 7px 0;
}
.msb-app .filetree li.active > a::before,
.msb-app .filetree li > a.hover::before { color: var(--msb-green); }
.msb-app .filetree li.tree-status { color: rgba(255,255,255,.62); }

.msb-app #content-wrapper { min-width: 0; background: var(--msb-surface); }
.msb-app #content { min-height: 100vh; }
.msb-app .topbar {
  min-height: 76px;
  margin-bottom: 0 !important;
  padding: 0 32px;
  background: #fff !important;
  border-bottom: 1px solid var(--msb-border);
  box-shadow: none !important;
}
.msb-app .topbar .navbar-search { width: min(100%, 440px); }
.msb-app .topbar .input-group { align-items: stretch; }
.msb-app .topbar .form-control {
  height: 44px;
  border: 1px solid var(--msb-border) !important;
  border-right: 0 !important;
  border-radius: 9px 0 0 9px;
  background: #fff !important;
  color: var(--msb-text);
}
.msb-app .topbar .input-group-append .btn { min-width: 48px; border-radius: 0 9px 9px 0; }
.msb-app .topbar .nav-item .nav-link { color: var(--msb-text); display: inline-flex; align-items: center; padding: .5rem .75rem; }
.msb-app #sidebarToggleTop { width: 44px; height: 44px; padding: 0; color: var(--msb-navy-900); }
.msb-app .container-fluid { padding: 32px; }
.msb-app .container-fluid > h6 { margin: 0 0 24px; font-size: .94rem; font-weight: 600; color: var(--msb-muted); }
.msb-app .msb-file-browser { width: 100%; }
.msb-app .msb-file-browser__header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.msb-app .msb-file-browser__header h1 { margin: 0; font-size: 36px; letter-spacing: -.025em; }
.msb-app .msb-file-browser__header > * { min-width: 0; }
.msb-app .msb-breadcrumb { min-width: 0; max-width: 100%; }
.msb-app .msb-breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0; max-width: 100%; padding: 0; margin: 0; list-style: none; color: var(--msb-muted); font-size: .9rem; }
.msb-app .msb-breadcrumb li { display: flex; align-items: center; max-width: 100%; overflow-wrap: anywhere; }
.msb-app .msb-breadcrumb li + li::before { content: "/"; margin: 0 8px; color: #9aa7b7; }
.msb-app .msb-breadcrumb li:last-child { color: var(--msb-text); font-weight: 650; }
.msb-app .msb-action-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 20px; }
.msb-app .msb-action-toolbar #newDirBtn, .msb-app .msb-action-toolbar #uploadBtn { margin: 0; }

.msb-app #newDirBtn, .msb-app #uploadBtn { margin: 0 8px 8px 0; }
.msb-app #uploadBtn { min-height: 44px; margin-top: 0; }
.msb-app .parent_dir { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: .55rem .8rem; border-radius: 9px; color: var(--msb-text); background: #fff; border: 1px solid var(--msb-border); }
.msb-app #files { width: 100% !important; max-width: 100%; margin: 0; border: 0; border-radius: 0; background: #fff; table-layout: fixed; }
.msb-app #files th:first-child, .msb-app #files td:first-child { width: auto !important; }
.msb-app #files th:nth-child(2), .msb-app #files td:nth-child(2) { width: 120px !important; min-width: 120px !important; }
.msb-app #files th:nth-child(3), .msb-app #files td:nth-child(3) { width: 240px !important; min-width: 240px !important; }
.msb-app #files td:first-child a { display: block; min-height: 52px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.msb-app #files td:first-child a .fas { display: inline-block; }
.msb-app .msb-file-table { margin-top: 16px; overflow-x: auto; border: 1px solid var(--msb-border); border-radius: var(--msb-radius); background: #fff; }
.msb-app .msb-file-table .dataTables_wrapper { min-width: 650px; }
.msb-app .msb-file-table .dataTables_wrapper > .row { margin-right: 0; margin-left: 0; }
.msb-app .msb-file-table .dataTables_wrapper > .row > [class*="col-"] { padding-right: 0; padding-left: 0; }
.msb-app .msb-file-table .dataTables_info { padding: 12px 16px; color: var(--msb-muted); font-size: .875rem; }
.msb-app #files thead th {
  padding: 14px 16px;
  color: #fff;
  background: var(--msb-navy-900);
  border: 0;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.msb-app #files td { padding: 0; color: var(--msb-text); vertical-align: middle; border-color: var(--msb-border); }
.msb-app #files td:not(:first-child) { padding: 14px 16px; color: var(--msb-muted); font-size: .9rem; }
.msb-app #files tbody tr { background: #fff; transition: background-color .14s ease; }
.msb-app #files tbody tr:hover { background: #f1f7ed; }
.msb-app #files tbody tr:nth-of-type(odd) { background: #fafbfd; }
.msb-app #files tbody tr:nth-of-type(odd):hover { background: #f1f7ed; }
.msb-app #files a { display: flex; align-items: center; min-height: 52px; padding: 12px 16px; color: var(--msb-text); font-weight: 600; }
.msb-app #files a .fas { color: var(--msb-green-dark); }
.msb-app #files a.hover, .msb-app .parent_dir.hover { color: var(--msb-navy-950); background: #dff0d3; }
.msb-app #files a.file .fas { color: var(--msb-muted); }

.msb-app .upload_overlay { color: rgba(19, 32, 51, .42); background: rgba(246,248,251,.92); font-size: clamp(64px, 10vw, 128px); }
.msb-app .progress { height: 24px; border-radius: 999px; background: #e7edf3; }
.msb-app .progress-bar { color: var(--msb-navy-950); background-color: var(--msb-green); font-weight: 600; }
.msb-app #contextmenu { overflow: hidden; border: 1px solid var(--msb-border); border-radius: 10px; box-shadow: 0 12px 30px rgba(8,17,31,.16); }
.msb-app #contextmenu li { min-height: 44px; display: flex; align-items: center; gap: .5rem; padding: 10px 14px; border-color: var(--msb-border); }
.msb-app #contextmenu li:hover { background: #f1f7ed; }

/* Forms and overlays shared by all V3 views. */
.msb-v3 .form-control {
  height: 44px;
  border: 1px solid var(--msb-border);
  border-radius: 9px;
  color: var(--msb-text);
  background: #fff;
}
.msb-v3 .form-control:focus { border-color: var(--msb-blue); }
.msb-v3 .modal-content { overflow: hidden; border: 1px solid var(--msb-border); border-radius: 18px; box-shadow: 0 20px 50px rgba(8,17,31,.2); }
.msb-v3 .modal-header, .msb-v3 .modal-footer { padding: 18px 22px; border-color: var(--msb-border); }
.msb-v3 .modal-body { padding: 22px; color: var(--msb-text); }
.msb-v3 .modal-title { font-weight: 700; }
.msb-v3 .modal .close { width: 44px; height: 44px; margin: -10px -10px -10px auto; border-radius: 8px; color: var(--msb-text); }
.msb-v3 .modal .close:hover { background: #eef2f6; }
.msb-v3 .list-group-item { border-color: var(--msb-border); color: var(--msb-text); }

/* Authentication and protected-share screens. */
.msb-auth, .msb-share { min-height: 100vh; background: var(--msb-navy-950); }
.msb-auth::before, .msb-share::before { content: ""; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle at 12% 10%, rgba(118,192,67,.16), transparent 34rem); }
.msb-auth .container, .msb-share .container { position: relative; z-index: 1; }
.msb-auth-shell { position: relative; z-index: 1; width: min(100%, 480px); margin: 0 auto; padding: clamp(28px, 7vh, 72px) 16px 32px; }
.msb-share .msb-auth-shell { width: min(100%, 520px); }
.msb-auth-header { margin-bottom: 28px; text-align: center; }
.msb-auth-logo { display: inline-block; width: 224px; max-width: 78vw; }
.msb-auth-logo img { display: block; width: 100%; height: auto; }
.msb-auth-card { overflow: hidden; padding: clamp(28px, 5vw, 42px); border: 1px solid rgba(220,228,237,.96); border-radius: 16px; background: #fff; box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.msb-auth-intro { margin-bottom: 28px; text-align: center; }
.msb-auth-intro h1 { margin-bottom: 8px; font-size: clamp(1.45rem, 3vw, 1.8rem); }
.msb-auth-intro p { margin: 0; color: var(--msb-muted); }
.msb-auth-form { display: grid; gap: 18px; }
.msb-field { display: grid; gap: 7px; }
.msb-label { margin: 0; color: var(--msb-text); font-size: .92rem; font-weight: 650; }
.msb-input { width: 100%; min-height: 48px; padding: .75rem 1rem; border: 1px solid var(--msb-border); border-radius: 9px; color: var(--msb-text); background: #fff; }
.msb-input::placeholder { color: #7b899b; }
.msb-input:focus { border-color: var(--msb-blue); outline: 3px solid rgba(47,128,237,.2); outline-offset: 0; }
.msb-primary-action { width: 100%; min-height: 48px; color: var(--msb-navy-950); background: var(--msb-green); border: 1px solid var(--msb-green); border-radius: 9px; font-weight: 700; }
.msb-primary-action:hover, .msb-primary-action:focus { color: var(--msb-navy-950); background: var(--msb-green-dark); border-color: var(--msb-green-dark); }
.msb-auth-footer { margin: 26px 0 0; color: rgba(255,255,255,.76); font-size: .92rem; text-align: center; }
.msb-auth-footer a { color: #3f7d20; text-decoration: underline; text-underline-offset: 3px; }
.msb-share-file, .msb-auth-intro .msb-share-file { margin: 0 0 24px; padding: 12px 14px; border: 1px solid var(--msb-border); border-radius: 9px; color: var(--msb-text); background: var(--msb-surface); overflow-wrap: anywhere; }
@media (max-width: 767.98px) {
  .msb-app .sidebar {
    position: fixed;
    z-index: 1024;
    top: 64px;
    left: 0;
    width: 276px !important;
    max-width: 86vw;
    min-height: 0;
    height: calc(100vh - 64px);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform .2s ease, visibility 0s linear .2s;
  }
  .msb-app .sidebar.toggled { width: 276px !important; flex: 0 0 276px; visibility: visible; transform: translateX(0); transition-delay: 0s; }
  .msb-app .topbar { position: relative; z-index: 1025; height: 64px; min-height: 64px; padding: 0 14px; }
  .msb-app .msb-sidebar-backdrop { display: none; }
  .msb-app.sidebar-toggled .msb-sidebar-backdrop { display: block; position: fixed; z-index: 1023; inset: 64px 0 0; width: 100%; height: calc(100vh - 64px); padding: 0; border: 0; background: rgba(8,17,31,.45); }
  .msb-app .container-fluid { padding: 20px 16px; }
  .msb-app .topbar .dropdown-menu { min-width: min(300px, calc(100vw - 32px)); }
  .msb-app .msb-file-browser__header { align-items: flex-start; flex-direction: column; gap: 8px; margin-bottom: 20px; }
  .msb-app .msb-file-browser__header h1 { font-size: 30px; }
  .msb-app .msb-file-table .dataTables_wrapper { min-width: 600px; }
  .msb-app #files a { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .msb-v3 *, .msb-v3 *::before, .msb-v3 *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

.msb-app .topbar .nav-link .fa, .msb-app .topbar .nav-link .fas { color: var(--msb-muted); }

.msb-app #files td.dataTables_empty { padding: 24px 16px; color: var(--msb-muted); text-align: center; }

/* Back-to-top control: keep the arrow legible on its dark surface. */
.msb-v3 .scroll-to-top {
  color: #fff;
  background: var(--msb-navy-900);
  border: 1px solid var(--msb-navy-800);
  border-radius: 10px !important;
}
.msb-v3 .scroll-to-top:hover,
.msb-v3 .scroll-to-top:focus {
  color: #fff;
  background: var(--msb-navy-800);
}

/* Account identity and direct logout action. */
.msb-app .topbar .msb-account {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}
.msb-app .msb-account-name {
  align-items: center;
  gap: 8px;
  color: var(--msb-muted);
  font-size: 14px;
}
.msb-app .topbar .msb-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 20px;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--msb-border);
  background: #fff;
  color: var(--msb-text);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.msb-app .topbar .msb-logout:hover,
.msb-app .topbar .msb-logout:focus {
  background: var(--msb-surface);
  border-color: #b8c5d3;
  color: var(--msb-text);
}
.msb-app .topbar .msb-logout-icon {
  display: block;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  color: var(--msb-muted);
}
.msb-app .topbar .msb-logout > span { display: block; line-height: 20px; }
.msb-app .topbar .navbar-search { min-width: 0; }
