:root {
  --ink: #2d3132;
  --muted: #667071;
  --line: #d9e2e2;
  --paper: #f8fbfa;
  --panel: #ffffff;
  --field: #f1f7f6;
  --brand: #08b3ac;
  --brand-dark: #07847f;
  --accent: #ff5b52;
  --lime: #43d61f;
  --sky: #10bce8;
  --ok: #218c50;
  --wait: #8a5b13;
  --danger: #9f2f28;
  --shadow: 0 18px 42px rgba(3, 67, 69, 0.16);
}

* {
  box-sizing: border-box;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  background: #273032;
  color: #f7faf6;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.mark {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  object-fit: cover;
  flex: 0 0 auto;
}

.sidebar .mark {
  width: 48px;
  height: 48px;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
}

.brand span,
.user-panel span,
.small {
  color: #c9d4ce;
  font-size: 12px;
}

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

.nav button,
.ghost-button,
.icon-button {
  min-height: 40px;
  border-radius: 8px;
  color: inherit;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav button {
  padding: 0 12px;
  text-align: left;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.user-panel {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar h2,
.auth h1,
.section-title h3 {
  margin: 0;
}

.topbar h2 {
  font-size: 25px;
}

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

.language-toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(8, 179, 172, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.22);
}

.language-toggle button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  color: inherit;
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.language-toggle button.active {
  color: #fff;
  background: var(--brand);
}

.sidebar .language-toggle {
  width: fit-content;
  color: #f7faf6;
  border-color: rgba(255, 255, 255, 0.18);
}

.primary,
.secondary,
.danger {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
}

.primary {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 2px 0 rgba(7, 132, 127, 0.24);
}

.primary:hover {
  background: var(--brand-dark);
}

.secondary {
  color: var(--ink);
  background: #e5f5f3;
}

.danger {
  color: #fff;
  background: var(--danger);
}

.grid {
  display: grid;
  gap: 14px;
}

.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.project-page {
  display: grid;
  grid-template-columns: minmax(320px, 0.42fr) minmax(0, 0.58fr);
  gap: 18px;
  align-items: start;
}

.project-workspace {
  display: grid;
  gap: 18px;
}

.document-workspace {
  grid-template-columns: 320px minmax(0, 1fr);
}

.document-list {
  display: grid;
  gap: 6px;
}

.document-editor {
  min-width: 0;
}

.document-lines {
  display: grid;
  gap: 10px;
}

.document-line {
  display: grid;
  grid-template-columns: 78px minmax(190px, 1fr) 105px 130px 130px 42px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.document-line .compact {
  min-width: 34px;
  padding: 0;
}

.document-totals {
  width: min(340px, 100%);
  margin-left: auto;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
}

.document-totals div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.document-totals div:last-child {
  color: var(--brand-dark);
  font-size: 18px;
}

.project-detail {
  min-width: 0;
}

.project-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.project-column {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.file-loader {
  display: grid;
  gap: 10px;
}

.panel,
.auth,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(31, 39, 38, 0.04);
}

.panel {
  padding: 18px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.dashboard-list {
  display: grid;
  gap: 12px;
}

.customer-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.customer-list-item {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.customer-list-item:hover,
.customer-list-item.active {
  border-color: rgba(8, 179, 172, 0.36);
  background: #e9fbfa;
}

.search-field {
  margin-bottom: 4px;
}

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

.activity-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: #e9fbfa;
  color: var(--ink);
}

.activity-line strong {
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
}

.activity-line span {
  overflow-wrap: anywhere;
}

.activity-line em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.card {
  padding: 15px;
  display: grid;
  gap: 9px;
}

.card h3,
.card p {
  margin: 0;
}

.card h3 {
  font-size: 17px;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

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

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--ink);
  background: var(--field);
}

.field textarea {
  min-height: 94px;
  resize: vertical;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

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

.table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.pill {
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
}

.approved {
  color: #12592f;
  background: #dbf7d4;
}

.pending {
  color: #704711;
  background: #f6e8c7;
}

.admin {
  color: #77351f;
  background: #f3d8ce;
}

.status-initial-customer-request {
  color: #6c4b0f;
  background: #fff0c7;
}

.status-development {
  color: #075d5b;
  background: #d8fbf7;
}

.status-development-completed {
  color: #176016;
  background: #dcf8d6;
}

.status-delivered-pending-payment {
  color: #793a23;
  background: #ffe0d9;
}

.status-delivered-completed {
  color: #324044;
  background: #e4e9ea;
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 47% 28%, rgba(255, 255, 255, 0.24), transparent 20rem),
    linear-gradient(135deg, #05aaa5, #09b7b2 54%, #078d89);
}

.auth {
  width: min(960px, 100%);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  box-shadow: var(--shadow);
}

.auth-copy {
  padding: 34px;
  color: #fff;
  background: rgba(45, 49, 50, 0.88);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.auth-copy h1 {
  font-size: 36px;
  line-height: 1.02;
}

.auth-copy p {
  color: #d9e2dd;
  line-height: 1.5;
}

.auth-form {
  padding: 30px;
  display: grid;
  gap: 14px;
}

.divider {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.google-button {
  min-height: 44px;
  display: flex;
  align-items: center;
}

.notice {
  padding: 12px;
  border-radius: 8px;
  background: #e7fbfa;
  color: #075d5b;
  border: 1px solid #aae6e3;
}

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

.status-field {
  min-width: 240px;
}

.messages {
  max-height: 420px;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding-right: 4px;
}

.message {
  border-left: 3px solid var(--accent);
  background: #fff4f2;
  padding: 10px;
  border-radius: 0 8px 8px 0;
}

.message strong {
  display: block;
  font-size: 13px;
}

.message p {
  margin: 5px 0 0;
  line-height: 1.35;
}

.files {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.file-tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fbfdfc;
}

.file-summary {
  min-height: 76px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
}

.file-summary span {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
  padding: 16px;
}

.clickable {
  cursor: pointer;
}

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

.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(8, 179, 172, 0.16);
}

.file-icon {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand);
  font-size: 11px;
  font-weight: 900;
}

.file-summary small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.file-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0 8px 8px;
}

.file-actions .wide {
  grid-column: 1 / -1;
}

.file-actions .compact {
  min-height: 32px;
  font-size: 12px;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
  }

  .nav {
    grid-template-columns: repeat(4, 1fr);
  }

  .workspace,
  .document-workspace,
  .project-page,
  .project-columns,
  .activity-line,
  .document-line,
  .two,
  .three,
  .auth {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .main,
  .auth-form,
  .auth-copy {
    padding: 18px;
  }

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

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

  .toolbar {
    width: 100%;
  }

.primary,
.secondary,
.danger {
    width: 100%;
  }
}

.compact {
  min-height: 34px;
  padding: 0 10px;
}
