:root {
  color: #14213d;
  background: #f3f8fb;
  --blue: #00468f;
  --blue-strong: #0078c8;
  --blue-deep: #06305f;
  --blue-soft: #eaf4fb;
  --teal-soft: #e9f8f7;
  --border: #d8e4ee;
  --text-soft: #5f7388;
  --success: #0d7a61;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

button,
input,
select {
  outline-color: var(--blue-strong);
}

.hidden {
  display: none !important;
}

.shell {
  min-height: 100vh;
  padding: 28px 24px 42px;
  background:
    linear-gradient(135deg, rgba(0, 70, 143, 0.11), transparent 34%),
    linear-gradient(315deg, rgba(13, 122, 97, 0.09), transparent 42%),
    linear-gradient(180deg, #fbfdff 0%, #edf6fb 100%);
}

.workspace {
  max-width: 1080px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 10px 4px 0;
}

body:has(#loginPanel:not(.hidden)) .workspace {
  min-height: calc(100vh - 60px);
  display: grid;
  align-content: center;
}

body:has(#loginPanel:not(.hidden)) .topbar {
  display: none;
}

.brandBlock {
  display: flex;
  align-items: center;
  gap: 12px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  color: var(--blue);
  font-size: clamp(2.25rem, 4.4vw, 3.85rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  color: #102f55;
  font-size: 1.3rem;
}

.grid {
  display: grid;
  grid-template-columns: minmax(390px, 0.95fr) minmax(430px, 1.05fr);
  gap: 22px;
  align-items: start;
}

.panel,
.loginPanel {
  border: 1px solid rgba(183, 204, 219, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow:
    0 22px 50px rgba(13, 49, 86, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.panel {
  padding: 22px;
}

.loginPanel {
  position: relative;
  overflow: hidden;
  display: grid;
  align-items: center;
  justify-items: center;
  gap: 18px;
  width: min(430px, 100%);
  max-width: 430px;
  margin: 0 auto;
  padding: 42px 42px 34px;
  text-align: center;
}

.loginPanel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  height: 7px;
  border-radius: 0;
  background: linear-gradient(90deg, var(--blue), var(--blue-strong), #16a085);
}

body:has(#adminPanel) .loginPanel::before {
  display: none;
}

.loginTitle {
  margin: 0;
  color: var(--blue);
  font-size: clamp(2.55rem, 5.2vw, 3.35rem);
  line-height: 0.98;
}

.clipboardIcon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: #fff;
  background: var(--blue-strong);
  font-size: 0.78rem;
  font-weight: 900;
}

.emptyState p {
  color: #5a6f87;
  line-height: 1.5;
}

.loginNote {
  max-width: 330px;
  margin: 2px 0 0;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.accountLine {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: -2px -2px 18px;
  padding: 0 0 16px;
  border-bottom: 1px solid #e3edf4;
}

.accountLine span,
.field span,
.field small,
.fileSummary span,
.linkItem span {
  color: #62758a;
  font-size: 0.88rem;
}

.field small {
  display: block;
  margin-top: -2px;
  line-height: 1.35;
}

.accountLine strong {
  overflow-wrap: anywhere;
  color: #071f3f;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 15px;
}

.field input,
.field select {
  width: 100%;
  height: 44px;
  border: 1px solid #c4d5e2;
  border-radius: 6px;
  padding: 0 12px;
  color: #18283d;
  background: #fff;
}

.field input:focus,
.field select:focus {
  border-color: var(--blue-strong);
  box-shadow: 0 0 0 3px rgba(0, 116, 191, 0.14);
}

.field input:disabled {
  color: #53697d;
  background: #f4f7fa;
}

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 168px;
  margin-bottom: 12px;
  border: 1px dashed #6fa5c7;
  border-radius: 8px;
  padding: 24px;
  color: #24435f;
  background:
    linear-gradient(180deg, rgba(234, 244, 251, 0.74), rgba(255, 255, 255, 0.92));
  text-align: center;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.dropzone strong {
  color: #0f3159;
}

.dropzone span {
  color: var(--text-soft);
  font-size: 0.93rem;
}

.dropzone.isDragging {
  border-color: var(--blue-strong);
  background: #edf7fc;
  box-shadow: inset 0 0 0 1px rgba(0, 111, 186, 0.24);
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.folderPicker {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  margin: -2px 0 14px;
  border: 1px solid #c9d8e5;
  border-radius: 6px;
  color: #18415f;
  background: #f9fcfe;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.folderPicker:hover {
  border-color: #8aa3b8;
  background: #eef6fb;
}

.folderPicker input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.primaryButton,
.dangerButton,
.ghostButton,
.copyButton,
.iconButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 6px;
  font-weight: 700;
}

.primaryButton {
  width: 100%;
  min-height: 46px;
  padding: 0 18px;
  color: #fff;
  background: linear-gradient(180deg, var(--blue-strong), #0066ad);
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.primaryButton:hover {
  background: linear-gradient(180deg, #006eb8, #005a99);
  box-shadow: 0 12px 26px rgba(0, 91, 150, 0.22);
  transform: translateY(-1px);
}

.dangerButton {
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  padding: 0 18px;
  color: #fff;
  background: #b42318;
}

.dangerButton:hover {
  background: #971b13;
}

.loginButton {
  width: 100%;
  max-width: 240px;
  min-height: 46px;
  margin-top: 2px;
}

.ghostButton {
  min-height: 40px;
  padding: 0 16px;
  color: var(--blue-deep);
  background: #e7f2f9;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.copyButton {
  min-width: 102px;
  min-height: 38px;
  padding: 0 12px;
  color: #fff;
  background: var(--success);
}

.renewButton {
  min-width: 86px;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  color: #18415f;
  background: #e8f1f8;
  font-weight: 700;
}

.renewSelect {
  min-height: 36px;
  border: 1px solid #cbd8e4;
  border-radius: 6px;
  padding: 0 8px;
  color: #18415f;
  background: #fff;
}

.iconButton {
  width: 36px;
  height: 36px;
  color: #566b82;
  background: #e8eef3;
}

.fileSummary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue-soft), var(--teal-soft));
}

.fileList {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  max-height: 290px;
  overflow: auto;
  padding-right: 2px;
}

.fileItem {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #dfe8ef;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.fileItem div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.fileItem strong {
  overflow-wrap: anywhere;
  color: #10233f;
  font-size: 0.92rem;
}

.fileItem span {
  color: #62758a;
  font-size: 0.82rem;
}

.removeFileButton {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  color: #41566c;
  background: #eef4f8;
  font-weight: 700;
}

.removeFileButton:hover {
  color: #9f1f18;
  background: #fdeceb;
}

.fileSummary div,
.linkItem div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.status {
  margin: 12px 0 0;
  color: #48637c;
  line-height: 1.45;
}

.status:empty {
  display: none;
}

.status.done {
  color: #0e7c61;
}

.status.error {
  color: #b42318;
}

.uploadProgress {
  display: grid;
  gap: 8px;
  margin: 8px 0 14px;
  border: 1px solid #cfe0eb;
  border-radius: 8px;
  padding: 12px;
  background: #f7fbfd;
}

.progressHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #214866;
  font-size: 0.9rem;
}

.progressHeader strong {
  color: var(--blue);
}

.progressTrack {
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: #dbe8f1;
}

.progressBar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-strong), #16a085);
  transition: width 0.22s ease;
}

.panelHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panelHeader h2 {
  margin: 0;
}

.panelHeader span {
  display: grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  border-radius: 999px;
  color: #fff;
  background: var(--blue-deep);
  font-weight: 800;
}

.resultsPanel {
  min-height: 480px;
}

.searchField {
  margin-bottom: 14px;
}

.searchField input {
  background: #f9fcfe;
}

.emptyState {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 360px;
  border: 1px dashed #d6e4ef;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(248, 251, 253, 0.9), rgba(239, 247, 251, 0.72));
  color: #6d8196;
  text-align: center;
}

.linkList {
  display: grid;
  gap: 10px;
}

.linkItem {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #dde7ee;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.linkItem strong {
  overflow-wrap: anywhere;
}

.linkActions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 820px) {
  .shell {
    padding: 18px;
  }

  .topbar,
  .loginPanel {
    align-items: stretch;
    flex-direction: column;
  }

  .loginPanel {
    justify-items: stretch;
  }

  .brandBlock {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.2rem;
  }

  .loginButton {
    max-width: none;
  }
}
