:root {
  --ubuntu-orange: #e95420;
  --ubuntu-aubergine: #77216f;
  --ink: #1f1f1f;
  --muted: #6f6f78;
  --panel-bg: #ffffff;
  --surface: #f8f5f1;
  --line: #ded4cc;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Ubuntu, "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #fff6ea 0%, var(--surface) 45%, #f2ece7 100%);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.page-frame {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

a {
  color: var(--ubuntu-aubergine);
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  transition: grid-template-columns 180ms ease;
}

.app-shell.is-collapsed {
  grid-template-columns: 88px 1fr;
}

.icon-logout {
  background: transparent;
  color: #f0f0f5;
  border: 1px solid #6a6c73;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.icon-logout:hover {
  background: #2f3238;
}

.side-nav {
  background: linear-gradient(170deg, #2f2f35, #1f1f24);
  color: #ffffff;
  padding: 1rem 0.8rem;
  border-right: 4px solid var(--ubuntu-orange);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.9rem;
}

.workspace-pane {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #efe7dd;
}

.utility-topbar {
  height: 40px;
  background: #1d1f23;
  border-bottom: 1px solid #101115;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0 0.9rem;
}

.utility-topbar__left,
.utility-topbar__right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.topbar-path-form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.topbar-upload-form {
  display: flex;
  align-items: center;
  gap: 0;
}

.topbar-upload-hidden {
  display: none;
}

.topbar-path-input {
  width: min(360px, 42vw);
  height: 30px;
  padding: 0.38rem 0.55rem;
  border-radius: 7px;
  border: 1px solid #5f6168;
  background: rgba(255, 255, 255, 0.12);
  color: #f4f5f8;
}

.topbar-path-input:focus {
  outline: none;
  border-color: rgba(233, 84, 32, 0.9);
}

.topbar-icon-button {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid #6a6c73;
  background: rgba(255, 255, 255, 0.1);
  color: #f4f5f8;
  display: inline-grid;
  place-items: center;
  padding: 0;
  line-height: 1;
}

.topbar-icon-button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.utility-topbar__user {
  color: #d8d8de;
  font-size: 0.82rem;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-nav__top {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.7rem;
}

.side-nav__toggle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.05rem;
}

.side-nav__toggle:hover {
  background: rgba(255, 255, 255, 0.15);
}

.side-nav__user {
  color: #efe9f2;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-nav__menu {
  display: grid;
  gap: 0.6rem;
  align-content: start;
}

.side-nav .nav-link {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: #f6f3f8;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.45rem 0.65rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 500;
  min-height: 42px;
}

.side-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.14);
}

.side-nav .nav-link.is-active {
  background: linear-gradient(145deg, rgba(233, 84, 32, 0.95), rgba(193, 67, 21, 0.95));
  border-color: rgba(233, 84, 32, 1);
  color: #fff;
}

.nav-icon {
  width: 1.2rem;
  height: 1.2rem;
  display: inline-grid;
  place-items: center;
  font-size: 1rem;
  line-height: 1;
  font-family: "Segoe UI Symbol", "Noto Sans Symbols2", Ubuntu, sans-serif;
}

.nav-text {
  white-space: nowrap;
}

.app-shell.is-collapsed .side-nav__user,
.app-shell.is-collapsed .nav-text {
  display: none;
}

.app-shell.is-collapsed .side-nav__top {
  grid-template-columns: 1fr;
  justify-items: center;
}

.app-shell.is-collapsed .side-nav .nav-link {
  grid-template-columns: 1fr;
  justify-items: center;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  justify-self: center;
}

.main-content {
  flex: 1;
  padding: 1.25rem;
  min-height: 0;
  max-height: calc(100vh - 4rem);
  overflow: auto;
  background: radial-gradient(circle at 10% 10%, rgba(255, 248, 236, 0.9), rgba(255, 248, 236, 0) 28%), linear-gradient(180deg, #fbf7f2 0%, #f4ede3 100%);
}

.files-explorer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  gap: 0.9rem;
}

.file-tile {
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(22, 23, 27, 0.74);
  padding: 0.55rem;
}

.file-tile--folder {
  text-decoration: none;
  border-color: rgba(233, 84, 32, 0.35);
  background: rgba(46, 33, 28, 0.72);
}

.file-tile--folder:hover {
  background: rgba(66, 43, 33, 0.82);
}

.file-tile .file-thumb {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

.file-thumb--folder {
  display: grid;
  place-items: center;
  font-size: 2.2rem;
}

.file-name {
  margin-top: 0.5rem;
  color: #eef0f5;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.login-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background-image: linear-gradient(rgba(18, 18, 22, 0.72), rgba(18, 18, 22, 0.72)), url('/ProdStorage/00000000-0000-0000-0000-000000000000/.settings/background.jpeg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ── Auth card (replaces old .login-card) ─────────────────────────────────── */

.auth-card {
  width: min(400px, 94vw);
  background: rgba(22, 22, 27, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  color: #f4f5f7;
}

.auth-card__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 1.6rem 1.6rem 0.6rem;
}

.auth-card__logo {
  font-size: 1.6rem;
  color: var(--ubuntu-orange);
  line-height: 1;
}

.auth-card__title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #f4f5f7;
}

/* ── Tab navigation ──────────────────────────────────────────────────────── */

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin: 0 1.6rem;
}

.auth-tab {
  padding: 0.6rem 0;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 140ms, border-color 140ms;
}

.auth-tab:hover {
  color: rgba(255, 255, 255, 0.85);
}

.auth-tab--active {
  color: #f4f5f7;
  border-bottom-color: var(--ubuntu-orange);
}

/* ── Form host inside auth card ──────────────────────────────────────────── */

.login-form-host {
  padding: 1.4rem 1.6rem 1.6rem;
}

/* Hide the redundant h1 that Identity pages inject (card brand provides context) */
.login-form-host > h1:first-child,
.login-form-host > h2:first-child {
  display: none;
}

/* Suppress "Use another service" external auth section */
.login-form-host section[aria-labelledby] {
  display: none;
}

.login-form-host,
.login-form-host h1,
.login-form-host h2,
.login-form-host h3,
.login-form-host h4 {
  color: #f4f5f7;
}

.login-form-host p,
.login-form-host .text-muted,
.login-form-host .text-body-secondary,
.login-form-host .text-secondary {
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: 0.88rem;
}

.login-form-host label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.83rem;
  font-weight: 500;
}

.login-form-host input[type="email"],
.login-form-host input[type="password"],
.login-form-host input[type="text"],
.login-form-host .os-input {
  width: 100%;
  padding: 0.6rem 0.72rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: #f4f5f7;
  font-size: 0.93rem;
  outline: none;
  transition: border-color 140ms, box-shadow 140ms;
}

.login-form-host input[type="email"]:focus,
.login-form-host input[type="password"]:focus,
.login-form-host input[type="text"]:focus,
.login-form-host .os-input:focus {
  border-color: var(--ubuntu-orange);
  box-shadow: 0 0 0 3px rgba(233, 84, 32, 0.22);
}

.login-form-host input[type="email"]::placeholder,
.login-form-host input[type="password"]::placeholder,
.login-form-host input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.login-form-host button[type="submit"],
.login-form-host input[type="submit"] {
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  border: 0;
  background: var(--ubuntu-orange);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms;
}

.login-form-host button[type="submit"]:hover,
.login-form-host input[type="submit"]:hover {
  background: #d44816;
}

.login-form-host hr {
  border-color: rgba(255, 255, 255, 0.1);
  margin: 0.8rem 0;
}

.login-form-host a {
  color: #ffb89e;
  text-decoration: none;
}

.login-form-host a:hover {
  text-decoration: underline;
}

/* Identity checkbox (remember me / 2FA) */
.login-form-host input[type="checkbox"] {
  accent-color: var(--ubuntu-orange);
}

/* Validation messages */
.login-form-host .text-danger,
.login-form-host .validation-summary-errors {
  color: #ff8575 !important;
  font-size: 0.82rem;
}

/* ── Keep old .login-card for any stale refs ─────────────────────────────── */
.login-card { display: contents; }

/* ── Auth form components (used by custom Login/Register/ForgotPassword) ─── */

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.9rem;
}

.auth-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  width: 100%;
}

.auth-input {
  padding: 0.62rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.07);
  color: #f4f5f7;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 140ms, box-shadow 140ms;
  width: 100%;
}

.auth-input::placeholder { color: rgba(255, 255, 255, 0.25); }

.auth-input:focus {
  border-color: var(--ubuntu-orange);
  box-shadow: 0 0 0 3px rgba(233, 84, 32, 0.22);
}

.auth-field-error {
  font-size: 0.8rem;
  color: #ff8575;
}

.auth-validation-error {
  background: rgba(255, 80, 60, 0.12);
  border: 1px solid rgba(255, 80, 60, 0.3);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: #ff9b8c;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.auth-validation-error:empty { display: none; }

.auth-remember {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
  font-size: 0.87rem;
  color: rgba(255, 255, 255, 0.6);
}

.auth-remember input[type="checkbox"] {
  accent-color: var(--ubuntu-orange);
  width: 16px;
  height: 16px;
}

.auth-submit {
  width: 100%;
  padding: 0.68rem 1rem;
  border-radius: 8px;
  border: 0;
  background: var(--ubuntu-orange);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms;
}

.auth-submit:hover { background: #d44816; }




.os-login-form {
  display: grid;
  gap: 0.85rem;
  width: 100%;
}

.os-field {
  display: grid;
  gap: 0.35rem;
  text-align: left;
}

.os-field label {
  font-size: 0.85rem;
  color: var(--os-label-text, #e2e5ec);
  font-weight: 500;
}

.os-input {
  width: 100%;
  padding: 0.62rem 0.72rem;
  border-radius: 7px;
  border: 1px solid #bfb5a8;
  background: #f9f7f4;
  outline: none;
}

.os-input:focus {
  border-color: var(--ubuntu-orange);
  box-shadow: 0 0 0 2px rgba(233, 84, 32, 0.2);
}

.os-remember {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  justify-self: center;
  font-size: 0.87rem;
  color: var(--os-aux-text, #d7dae2);
}

.os-login-form {
  color: var(--os-card-text, #f4f5f7);
}

.os-login-links {
  display: grid;
  gap: 0.3rem;
  justify-items: center;
  margin-top: -0.1rem;
}

.os-login-links a {
  color: var(--os-link-text, #ffc9b7);
  text-decoration: none;
  font-size: 0.9rem;
}

.os-login-links a:hover {
  text-decoration: underline;
}

.os-account-chip {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.65rem 0.7rem;
  text-align: left;
  display: grid;
  gap: 0.2rem;
}

.os-account-chip__label {
  font-size: 0.75rem;
  color: var(--os-aux-text, #d7dae2);
}

.os-account-chip__value {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--os-card-text, #f4f5f7);
}

.os-account-chip a {
  color: var(--os-link-text, #ffd6c6);
  text-decoration: none;
  font-size: 0.85rem;
}

.os-account-chip a:hover {
  text-decoration: underline;
}

.os-login-button {
  justify-self: center;
  min-width: 140px;
  padding: 0.58rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--ubuntu-orange);
  background: var(--ubuntu-orange);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.os-login-button:hover {
  filter: brightness(0.95);
}

.os-error {
  background: #ffece7;
  color: #8d2205;
  border: 1px solid #f4b7a4;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  text-align: left;
  font-size: 0.9rem;
}

.login-form-host .row,
.login-form-host .col-md-4,
.login-form-host .col-md-6,
.login-form-host .col-lg-4 {
  width: 100%;
  max-width: none;
  margin: 0;
}

.login-cta {
  display: inline-block;
  justify-self: center;
  margin-top: 0.2rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  background: var(--ubuntu-orange);
  color: #fff;
}

.page-header h1 {
  margin: 0;
  font-size: 1.8rem;
}

.page-header p {
  margin-top: 0.5rem;
  color: var(--muted);
}

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
}

.filter-row {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0;
}

.stack {
  display: grid;
  gap: 0.9rem;
}

.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.file-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem;
}

.file-card h3 {
  margin-top: 0.8rem;
  margin-bottom: 0.5rem;
  word-break: break-word;
  font-size: 1rem;
}

.file-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f2ece7;
}

.compact-form,
.settings-form {
  display: grid;
  gap: 0.45rem;
}

label {
  font-size: 0.88rem;
  color: #4d4d55;
  font-weight: 500;
}

input,
textarea,
select,
button {
  border-radius: 8px;
  border: 1px solid #c8bdaf;
  padding: 0.55rem 0.7rem;
  font-family: inherit;
}

button {
  background: var(--ubuntu-orange);
  border-color: var(--ubuntu-orange);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

button.danger {
  background: #9b1c31;
  border-color: #9b1c31;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.footer {
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer--thin {
  padding: 0.35rem 0.8rem;
  background: #26292f;
  color: #d8d8df;
  border-top: 0;
  margin-top: auto;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
}

.mobile-nav-toggle {
  display: none;
}

@media (max-width: 880px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-shell.is-collapsed {
    grid-template-columns: 1fr;
  }

  /* On mobile the side-nav is hidden by default and becomes a full-screen overlay */
  .side-nav {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 5000;
    border-right: 0;
    border-bottom: 0;
    grid-template-rows: auto 1fr;
    padding: 1.25rem;
  }

  .side-nav.is-mobile-open {
    display: grid;
  }

  .side-nav__menu {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 0.8rem;
  }

  .side-nav .nav-link {
    grid-template-columns: 32px 1fr;
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
    min-height: 56px;
  }

  .nav-icon {
    font-size: 1.3rem;
  }

  .side-nav__user {
    display: block;
    font-size: 0.9rem;
  }

  .nav-text {
    display: block;
  }

  .app-shell.is-collapsed .nav-text,
  .app-shell.is-collapsed .side-nav__user {
    display: block;
  }

  /* Hamburger shows in topbar on mobile */
  .mobile-nav-toggle {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    font-size: 1.25rem;
    z-index: 1000;
  }

  .utility-topbar__user {
    display: none;
  }

  .topbar-path-input {
    width: min(200px, 48vw);
  }

  .status-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }
}


/* ── remove the stale duplicate media query added previously ── */
@media (max-width: 560px) {
  .topbar-path-input {
    width: min(140px, 38vw);
  }
}