:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e3e6ea;
  --ink: #1a1d24;
  --ink-muted: #6b7280;
  --brand-blue: #00519e;
  --brand-blue-dark: #003b76;
  --brand-yellow: #ffd400;
  --danger: #c23b3b;
  --success: #1e7e4c;
  --radius: 10px;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand-blue);
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

/* Brand mark */

.brand-mark {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0 12px;
}

.lidl-mark {
  display: block;
  border-radius: 8px;
  object-fit: contain;
}

/* Flash messages */

.flash-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flash {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand-blue);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 0.875rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 8px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  border-color: var(--brand-blue);
}

.btn--primary {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
}

.btn--primary:hover {
  background: var(--brand-blue-dark);
  border-color: var(--brand-blue-dark);
}

.btn--ghost {
  background: transparent;
}

.btn--small {
  padding: 5px 12px;
  font-size: 0.8rem;
}

/* Layout shell */

.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav__item {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.nav__item:hover {
  background: var(--bg);
}

.nav__item--active {
  background: #eaf1fa;
  color: var(--brand-blue-dark);
  font-weight: 700;
}

.main {
  flex: 1;
  padding: 28px 36px 60px;
  max-width: 1100px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-header h1 {
  margin: 0 0 4px;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.page-header__subtitle {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.page-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* User menu */

.user-menu {
  position: relative;
}

.user-menu__trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px 5px 5px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.user-menu__trigger:hover {
  border-color: var(--brand-blue);
}

.user-menu__avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.chevron {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--ink-muted);
  transition: transform 0.15s ease;
}

.user-menu--open .chevron {
  transform: rotate(180deg);
}

.user-menu__panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  z-index: 10;
}

.user-menu--open .user-menu__panel {
  display: block;
}

.user-menu__item {
  display: block;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--ink);
}

.user-menu__item:hover {
  background: var(--bg);
}

/* Row actions (view / download / more) */

.row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--bg);
  color: var(--brand-blue);
}

.row-menu {
  position: relative;
}

.row-menu__panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 140px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  z-index: 10;
}

.row-menu--open .row-menu__panel {
  display: block;
}

.row-menu__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 14px;
  font-size: 0.85rem;
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--ink);
}

.row-menu__item:hover {
  background: var(--bg);
}

.row-menu__item--danger {
  color: var(--danger);
}

/* Dropzone */

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 40px 24px;
  text-align: center;
  margin-bottom: 20px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.dropzone--dragover {
  border-color: var(--brand-blue);
  background: #eaf1fa;
}

.dropzone__icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #eaf1fa;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.dropzone__label {
  margin: 0 0 6px;
  font-weight: 600;
}

.dropzone__browse {
  color: var(--brand-blue);
  text-decoration: underline;
  cursor: pointer;
}

.dropzone__caption {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

/* Filter bar */

.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-bar__search,
.filter-bar__select {
  font-family: inherit;
  font-size: 0.875rem;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.filter-bar__search {
  flex: 1;
  min-width: 180px;
}

/* Table */

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

.file-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.file-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--border);
}

.file-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.file-row:last-child td {
  border-bottom: none;
}

.file-name {
  font-weight: 600;
}

.file-id {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.empty-state {
  text-align: center;
  color: var(--ink-muted);
  padding: 32px 16px;
}

/* Category badges — accent color carried on the left border only,
   keeps the table quiet since the dropzone is the one bold element */

.badge {
  display: inline-block;
  padding: 3px 10px 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg);
  border-left: 3px solid var(--ink-muted);
}

.badge--tv {
  border-left-color: var(--brand-blue);
  color: var(--brand-blue-dark);
}

.badge--radio {
  border-left-color: #7a4fc4;
  color: #5b3899;
}

.badge--digital_video {
  border-left-color: #1e7e4c;
  color: #1e7e4c;
}

.badge--image_print {
  border-left-color: var(--brand-yellow);
  color: #8a6d00;
}

/* Login page */

.login-body {
  background: var(--brand-blue-dark);
  min-height: 100vh;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 36px 32px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.login-title {
  font-size: 1.15rem;
  margin: 0 0 4px;
}

.login-subtitle {
  margin: 0 0 20px;
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.btn--login {
  align-self: center;
  width: auto;
  min-width: 140px;
  padding: 10px 24px;
  margin-top: 4px;
}

.login-form input {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* Responsive */

@media (max-width: 720px) {
  .shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .nav {
    flex-direction: row;
  }

  .main {
    padding: 20px;
  }

  .page-header {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
