:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #3b82f6;
  --primary-700: #2563eb;
  --sidebar: #1f2430;
  --sidebarText: #d6dbe8;
  --sidebarMuted: #98a2b3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  color: var(--sidebarText);
  padding: 18px 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
}

.sidebar__brand {
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 18px;
}

.sidebar__brandLink {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar__logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
}

.sidebar__brandText {
  flex: 1 1 auto;
  text-align: center;
  font-weight: 900;
  letter-spacing: 0.12em;
  font-size: 18px;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
}

.sidebar__footer {
  padding: 18px 0 6px;
  display: flex;
  justify-content: center;
}

.sidebar__eeaLogo {
  width: 62%;
  height: auto;
  display: block;
  object-fit: contain;
}

.sidebar__link {
  padding: 10px 10px;
  border-radius: 10px;
  color: var(--sidebarText);
}

.sidebar__link:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar__section {
  margin-top: 16px;
  margin-bottom: 6px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--sidebarMuted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar__title {
  font-weight: 700;
}

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

.langToggle {
  display: flex;
  gap: 8px;
}

.langToggle form {
  margin: 0;
}

.filePicker {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 6px;
}

.filePicker__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.filePicker__name {
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filePicker__item {
  line-height: 1.35;
}

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

.filePicker__remove {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}

.filePicker__remove:hover {
  color: var(--text);
  text-decoration: underline;
}

.filePicker__error {
  color: #b91c1c;
  font-weight: 700;
}

.filePicker__name--error {
  color: #b91c1c;
  font-weight: 700;
}

.card--mt {
  margin-top: 14px;
}

.tableActions form,
.inlineForm {
  margin: 0;
}

.input--small {
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 10px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.topbar__userName {
  font-weight: 600;
  font-size: 13px;
}

.topbar__userMeta {
  font-size: 12px;
  color: var(--muted);
}

.content {
  padding: 20px 18px 40px;
  max-width: 1200px;
  width: 100%;
}

.pageHeader {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.pageHeader__title {
  font-size: 20px;
  font-weight: 800;
}

.pageHeader__subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.card__title {
  font-size: 16px;
  font-weight: 800;
  padding: 16px 16px 0;
}

.card__body {
  padding: 16px;
}

.card__actions {
  display: flex;
  gap: 10px;
  padding: 0 16px 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease,
    transform 60ms ease;
}

.btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
  border-color: var(--primary);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

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

.btn--primary:hover {
  background: var(--primary-700);
  border-color: var(--primary-700);
}

.btn--ghost {
  background: transparent;
  border-color: var(--border);
}

.btn--ghost:hover {
  background: #f3f4f6;
  border-color: #e5e7eb;
}

.btn--small {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form__label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  background: #fff;
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.textarea {
  resize: vertical;
}

.form__actions {
  display: flex;
  gap: 10px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.alert {
  border-radius: 12px;
  padding: 12px 12px;
  border: 1px solid var(--border);
  font-size: 13px;
}

.alert--error {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}

.alert--info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.tableTools {
  margin-bottom: 12px;
}

.tableTools__row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.tableTools__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
  flex: 1 1 220px;
}

.tableTools__label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.tableTools__actions {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex: 0 0 auto;
}

.thLink {
  color: inherit;
  text-decoration: none;
}

.sortMark {
  margin-left: 6px;
  font-size: 12px;
  color: var(--muted);
}

.tableWrap {
  overflow: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th,
.table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.table thead th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.table__actionCol {
  width: 1%;
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
}

.btn--disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
}

.tableActions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.link {
  color: var(--primary-700);
  font-weight: 700;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.attachmentList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attachmentRow {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.attachmentRow__name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.attachmentRow__actions {
  flex: 0 0 auto;
}

.sectionTitle {
  font-weight: 800;
  margin-bottom: 8px;
}

.prose {
  white-space: pre-wrap;
  line-height: 1.5;
}

.projectTitle {
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 2px;
}

.metaGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.meta__label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.meta__value {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
}

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth__card {
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 18px;
}

.auth__brandRow {
  margin-bottom: 10px;
}

.auth__brandLink {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 12px;
  border-radius: 12px;
  background: var(--sidebar);
  color: var(--sidebarText);
}

.auth__logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
}

.auth__brandText {
  flex: 1 1 auto;
  text-align: center;
  font-weight: 900;
  letter-spacing: 0.12em;
  font-size: 18px;
}

.auth__subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .metaGrid,
  .grid2 {
    grid-template-columns: 1fr;
  }
}
