:root {
  color-scheme: dark;
  --bg: #090b0d;
  --surface: #121619;
  --surface-2: #181e22;
  --surface-3: #20272c;
  --line: #2b3338;
  --text: #f3f0e8;
  --muted: #9da7a5;
  --soft: #c5bda9;
  --accent: #c9a961;
  --accent-2: #8fb9ad;
  --danger: #d99286;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.page {
  min-height: 100vh;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(340px, 0.88fr) minmax(420px, 1.12fr);
}

.login-visual {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(9, 11, 13, 0.06), rgba(9, 11, 13, 0.74)),
    url("https://images.unsplash.com/photo-1500534314209-a25ddb2bd429?auto=format&fit=crop&w=1800&q=82") center / cover;
}

.login-card {
  align-self: center;
  width: min(430px, calc(100% - 56px));
  margin: 0 auto;
  display: grid;
  gap: 22px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 22, 25, 0.92);
  box-shadow: var(--shadow);
}

.identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.identity.compact {
  align-items: flex-start;
}

.mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(201, 169, 97, 0.62);
  border-radius: 50%;
  color: var(--accent);
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 1.2rem;
}

h2 {
  font-size: clamp(1.45rem, 2vw, 2rem);
}

h3 {
  font-size: 1rem;
}

.identity p,
.view-head p,
.message,
.empty,
.mail-state,
label span {
  color: var(--muted);
}

label span {
  display: block;
  margin-bottom: 8px;
  font-size: 0.86rem;
}

input[type="email"],
input[type="password"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 13px;
  background: #0d1012;
  color: var(--text);
  outline: none;
}

input:focus {
  border-color: var(--accent);
}

.primary,
.ghost,
.nav-item,
.file-actions a,
.file-actions button {
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0 15px;
  font-weight: 700;
}

.primary {
  background: var(--accent);
  color: #15110a;
}

.ghost,
.nav-item,
.file-actions a,
.file-actions button {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hidden {
  display: none !important;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px 1fr;
  background: var(--bg);
}

.sidebar {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 26px 20px;
  border-right: 1px solid var(--line);
  background: #0d1012;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  justify-content: flex-start;
}

.nav-item.active {
  background: var(--surface-3);
  border-color: #3b464d;
}

#logoutButton {
  margin-top: auto;
}

.workspace {
  padding: 30px;
}

.view {
  display: grid;
  gap: 18px;
}

.view-head,
.section-head,
.upload-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.view-head {
  padding-bottom: 8px;
}

.notice {
  border: 1px solid rgba(217, 146, 134, 0.42);
  border-radius: 8px;
  padding: 13px 15px;
  color: #f1c2ba;
  background: rgba(217, 146, 134, 0.12);
}

.tool-panel,
.list-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.tool-panel {
  padding: 18px;
}

.drop-zone {
  width: min(360px, 100%);
  min-height: 92px;
  display: grid;
  place-items: center;
  border: 1px dashed #536067;
  border-radius: 8px;
  background: var(--surface-2);
}

.drop-zone input {
  display: none;
}

.drop-zone span {
  color: var(--soft);
  font-weight: 700;
}

.scope-control {
  min-width: 260px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.scope-control label {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--soft);
}

.file-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.list-panel {
  min-height: 300px;
  padding: 18px;
}

.section-head span {
  color: var(--muted);
}

.files {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.file {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.file strong {
  display: block;
  overflow-wrap: anywhere;
}

.file small {
  color: var(--muted);
}

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

.danger {
  color: #ffc8c0 !important;
}

.mail-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 18px;
}

.mail-connect {
  display: grid;
  gap: 16px;
  align-content: start;
}

.inbox-panel {
  min-height: 520px;
}

.mail-state {
  display: grid;
  place-items: center;
  min-height: 400px;
  text-align: center;
  line-height: 1.7;
}

.mail-list {
  width: 100%;
  display: grid;
  gap: 10px;
  text-align: left;
}

.mail-item {
  display: grid;
  gap: 5px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.mail-item span,
.mail-item small {
  color: var(--muted);
}

@media (max-width: 860px) {
  .login-screen,
  .app,
  .file-columns,
  .mail-layout {
    grid-template-columns: 1fr;
  }

  .login-visual {
    display: none;
  }

  .login-card {
    width: min(430px, calc(100% - 28px));
  }

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .upload-row,
  .view-head {
    align-items: stretch;
    flex-direction: column;
  }

  .scope-control {
    min-width: 0;
  }
}
