:root {
  color-scheme: light;
  --bg-main: #eef5ff;
  --bg-secondary: #f7fbff;
  --card: rgba(255, 255, 255, 0.86);
  --card-strong: rgba(255, 255, 255, 0.96);
  --border: rgba(74, 103, 168, 0.14);
  --border-strong: rgba(74, 103, 168, 0.28);
  --text: #112140;
  --muted: #627393;
  --primary: #275df5;
  --primary-deep: #153eaa;
  --accent: #2eb49a;
  --danger: #d64f5f;
  --shadow-soft: 0 24px 70px rgba(17, 33, 64, 0.12);
  --shadow-button: 0 18px 32px rgba(39, 93, 245, 0.18);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --sidebar-width: 290px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Bahnschrift, "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 0 0, rgba(91, 148, 255, 0.3), transparent 32%),
    radial-gradient(circle at 100% 100%, rgba(46, 180, 154, 0.18), transparent 24%),
    linear-gradient(160deg, var(--bg-main), var(--bg-secondary) 72%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.page-shell {
  min-height: 100vh;
  padding: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #4966a8;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.muted,
.form-hint,
.toolbar-note,
.card-label {
  color: var(--muted);
}

.auth-shell {
  min-height: calc(100vh - 48px);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: stretch;
}

.auth-hero,
.auth-panel,
.sidebar,
.workspace,
.modal-card {
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.auth-hero {
  border-radius: 34px;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  position: relative;
  overflow: hidden;
}

.auth-hero::after {
  content: "";
  position: absolute;
  inset: auto -120px -120px auto;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(39, 93, 245, 0.18), transparent 70%);
}

.auth-hero h1 {
  margin: 0;
  font-size: clamp(42px, 5vw, 74px);
  line-height: 0.95;
}

.hero-copy {
  margin: 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.hero-card,
.overview-card,
.storage-card,
.brand-card,
.panel-toolbar,
.details-panel,
.main-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(245, 249, 255, 0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.hero-card {
  padding: 22px;
}

.hero-card h3 {
  margin: 0 0 10px;
  font-size: 19px;
}

.hero-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-panel {
  border-radius: 34px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.auth-header h2 {
  margin: 0;
  font-size: 34px;
}

.tab-switch {
  display: inline-flex;
  padding: 6px;
  border-radius: 999px;
  background: rgba(222, 233, 255, 0.88);
}

.tab-button,
.nav-item,
.secondary-button,
.ghost-button,
.primary-button {
  border: none;
  border-radius: 999px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.tab-button {
  background: transparent;
  color: var(--muted);
  padding: 12px 18px;
}

.tab-button.active {
  background: white;
  color: var(--text);
  box-shadow: 0 12px 20px rgba(17, 33, 64, 0.08);
}

.auth-form {
  display: none;
  gap: 18px;
}

.auth-form.active {
  display: grid;
}

label {
  display: grid;
  gap: 9px;
}

label span {
  font-weight: 600;
  font-size: 14px;
}

input {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(74, 103, 168, 0.18);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  padding: 15px 16px;
  outline: none;
}

input:focus {
  border-color: rgba(39, 93, 245, 0.42);
  box-shadow: 0 0 0 4px rgba(39, 93, 245, 0.08);
}

.primary-button,
.secondary-button,
.ghost-button {
  padding: 14px 18px;
  font-weight: 700;
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, var(--primary), #4a86ff);
  box-shadow: var(--shadow-button);
}

.secondary-button {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  border: 1px solid rgba(74, 103, 168, 0.12);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.tab-button:hover,
.nav-item:hover {
  transform: translateY(-1px);
}

.toast {
  min-height: 24px;
  margin-top: 14px;
  color: var(--muted);
}

.toast.error {
  color: #b62e43;
}

.app-shell {
  min-height: calc(100vh - 48px);
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 22px;
}

.sidebar {
  border-radius: 30px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand-card,
.storage-card {
  padding: 22px;
}

.brand-card h2 {
  margin: 0 0 8px;
}

.nav-list {
  display: grid;
  gap: 10px;
}

.nav-item {
  background: rgba(255, 255, 255, 0.58);
  color: var(--text);
  text-align: left;
  padding: 15px 16px;
  border: 1px solid transparent;
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(39, 93, 245, 0.18), rgba(74, 134, 255, 0.08));
  border-color: rgba(39, 93, 245, 0.18);
}

.storage-bar {
  margin-top: 14px;
  height: 12px;
  border-radius: 999px;
  background: rgba(211, 222, 245, 0.7);
  overflow: hidden;
}

.storage-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  border-radius: 999px;
}

.workspace {
  border-radius: 30px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.topbar h1 {
  margin: 0;
  font-size: 34px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.search-field {
  width: min(380px, 100%);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.overview-card {
  padding: 20px 22px;
}

.overview-card strong {
  font-size: 34px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  min-height: 0;
  flex: 1;
}

.main-panel {
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-toolbar {
  padding: 16px 18px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.breadcrumb button {
  border: none;
  background: rgba(39, 93, 245, 0.08);
  color: var(--primary-deep);
  border-radius: 999px;
  padding: 9px 13px;
}

.drop-zone {
  flex: 1;
  min-height: 420px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 251, 255, 0.92));
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.drop-zone.dragging {
  border-color: rgba(39, 93, 245, 0.5);
  box-shadow: inset 0 0 0 2px rgba(39, 93, 245, 0.2);
}

.table-header,
.table-row {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) 120px 170px 240px;
  gap: 16px;
  align-items: center;
}

.table-header {
  padding: 16px 20px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5871a3;
  border-bottom: 1px solid rgba(74, 103, 168, 0.12);
}

.table-body {
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.table-row {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(74, 103, 168, 0.08);
}

.table-row:hover,
.table-row.selected {
  background: rgba(39, 93, 245, 0.06);
}

.item-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.item-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--primary-deep);
  background: linear-gradient(135deg, rgba(39, 93, 245, 0.12), rgba(46, 180, 154, 0.12));
}

.item-main button {
  border: none;
  background: transparent;
  text-align: left;
  padding: 0;
}

.item-name {
  display: block;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-subtitle {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-button {
  border: none;
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(39, 93, 245, 0.08);
  color: var(--primary-deep);
}

.chip-button.danger {
  background: rgba(214, 79, 95, 0.12);
  color: var(--danger);
}

.empty-state {
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
}

.details-panel {
  padding: 24px;
}

.details-panel h3 {
  margin: 0 0 10px;
  font-size: 26px;
}

.detail-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.detail-row {
  display: grid;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(74, 103, 168, 0.12);
}

.detail-preview {
  margin-top: 18px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(74, 103, 168, 0.12);
  background: rgba(241, 247, 255, 0.86);
}

.detail-preview img {
  width: 100%;
  display: block;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 18, 38, 0.28);
}

.modal-card {
  width: min(520px, 100%);
  border-radius: 28px;
  padding: 26px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

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

  .hero-grid,
  .overview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .page-shell {
    padding: 14px;
  }

  .auth-hero,
  .auth-panel,
  .sidebar,
  .workspace {
    padding: 20px;
    border-radius: 24px;
  }

  .hero-grid,
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .panel-toolbar,
  .auth-header {
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .table-header {
    display: none;
  }

  .table-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}
