:root {
  --bg: #0d0e10;
  --surface: #15171a;
  --surface-2: #1d2025;
  --line: #31353d;
  --text: #f5f5f2;
  --muted: #a7abb3;
  --yellow: #ffc414;
  --danger: #ff8d72;
  --ok: #49c17f;
  --radius: 8px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
}

button,
input { font: inherit; }

button { cursor: pointer; }

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.is-hidden { display: none !important; }

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: url("../assets/login/portal-komak-login-background-pl.png") center / cover no-repeat;
  position: relative;
}

.login-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
}

.login-panel {
  width: min(420px, 100%);
  position: relative;
  padding: 30px;
  background: rgba(12, 13, 15, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand-mark {
  color: var(--yellow);
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 30px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--yellow);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.12em;
}

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

h1 {
  margin-bottom: 10px;
  font-size: 38px;
}

h2 {
  margin: 0;
  font-size: 30px;
}

h3 { margin-bottom: 8px; }

.login-copy {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 15px;
}

input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #0f1114;
}

input:focus {
  outline: 2px solid rgba(255, 196, 20, 0.25);
  border-color: var(--yellow);
}

.primary-action,
.ghost-action,
.logout-action {
  min-height: 42px;
  border-radius: 6px;
  padding: 0 16px;
  border: 1px solid transparent;
  color: #121212;
  background: var(--yellow);
  font-weight: 700;
}

.ghost-action {
  color: var(--text);
  background: transparent;
  border-color: var(--line);
}

.full {
  width: 100%;
  margin-top: 10px;
}

.form-error,
.error-state {
  color: var(--danger);
}

.form-error {
  margin: 4px 0 12px;
  line-height: 1.4;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px;
  background: #0a0b0d;
  border-right: 1px solid var(--line);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}

.sidebar-logo small,
.partner-card small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.logo-icon,
.empty-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--yellow);
  color: var(--yellow);
  font-weight: 800;
}

.nav-item {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 6px;
  text-align: left;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface-2);
}

.partner-card {
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.partner-card strong {
  display: block;
  margin: 7px 0 12px;
}

.logout-action {
  min-height: 34px;
  width: 100%;
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
}

.workspace {
  min-width: 0;
  padding: 30px;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.loading-state,
.error-state,
.empty-state {
  padding: 56px 28px;
  text-align: center;
  color: var(--muted);
}

.error-state p { margin-bottom: 16px; }

.empty-state {
  display: grid;
  justify-items: center;
}

.empty-state .empty-icon { margin-bottom: 18px; }
.empty-state p { margin-bottom: 20px; }

.table-wrap { overflow-x: auto; }

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

th,
td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  background: #101215;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td {
  font-size: 14px;
}

tbody tr:last-child td { border-bottom: 0; }

.offer-name {
  display: block;
  max-width: 290px;
  font-weight: 700;
}

.offer-id,
.cell-note {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.number {
  text-align: right;
  white-space: nowrap;
}

.actions {
  text-align: right;
}

.edit-button {
  min-height: 34px;
  padding: 0 13px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(73, 193, 127, 0.35);
  border-radius: 999px;
  color: var(--ok);
  background: rgba(73, 193, 127, 0.08);
  font-size: 12px;
  white-space: nowrap;
}

.status-badge.review {
  border-color: rgba(255, 196, 20, 0.42);
  color: var(--yellow);
  background: rgba(255, 196, 20, 0.08);
}

.quote-cards { display: none; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }
  .sidebar-logo { margin: 0; }
  .sidebar nav { display: none; }
  .partner-card {
    margin: 0 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
  }
  .partner-card small { display: none; }
  .partner-card strong { margin: 0; }
  .logout-action { width: auto; }
}

@media (max-width: 760px) {
  .login-screen { padding: 18px; }
  .workspace { padding: 20px 16px; }
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .topbar .primary-action { width: 100%; }
  .table-wrap { display: none; }
  .quote-cards {
    display: grid;
    gap: 12px;
    padding: 12px;
  }
  .quote-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #101215;
  }
  .quote-card-head,
  .quote-card-row,
  .quote-card-actions {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
  }
  .quote-card-head { align-items: flex-start; }
  .quote-card-row {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
  }
  .quote-card-row strong { color: var(--text); }
  .quote-card-actions { padding-top: 14px; }
  .quote-card-actions button { width: 100%; }
  .sidebar-logo small,
  .partner-card strong { display: none; }
}
