:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #65717f;
  --line: #dce2e8;
  --brand: #1d6f8f;
  --brand-dark: #15536b;
  --danger-bg: #ffe9e9;
  --danger-line: #efb1b1;
  --danger-text: #9f1d1d;
  --success-bg: #e7f6ed;
  --success-text: #1e6b3b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 Arial, Helvetica, sans-serif;
}

a {
  color: var(--brand);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-box,
.box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(21, 37, 52, 0.08);
}

.login-box {
  width: min(420px, 100%);
  padding: 28px;
}

.login-logo {
  display: block;
  width: min(180px, 100%);
  height: auto;
  margin: 0 auto 18px;
}

h1,
h2 {
  margin: 0 0 18px;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 19px;
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--text);
  font: inherit;
  background: #fff;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 9px 15px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button-link:hover {
  background: var(--brand-dark);
}

.small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
}

.danger {
  background: #b42318;
}

.danger:hover {
  background: #8f1c13;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cancel {
  background: #65717f;
}

.cancel:hover {
  background: #4f5a66;
}

.notice {
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 6px;
  font-weight: 700;
}

.notice.error {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-line);
}

.notice.success {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid #a9dfbf;
}

.topbar {
  min-height: 64px;
  padding: 14px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.topbar .brand {
  flex-wrap: nowrap;
}

.topbar .brand > div {
  display: grid;
  gap: 2px;
}

.topbar-logo {
  width: 88px;
  height: auto;
}

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

.layout {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto;
}

.quick-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.quick-nav a {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--brand-dark);
  font-weight: 700;
  text-decoration: none;
}

.quick-nav a.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 18px;
  margin-bottom: 18px;
}

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

.box {
  padding: 18px;
}

.clients,
.orders {
  margin-top: 18px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.sort-form {
  display: block;
  min-width: 230px;
}

.sort-form label {
  font-size: 13px;
}

.sort-form select {
  min-height: 34px;
  padding: 5px 8px;
}

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

fieldset {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

legend {
  padding: 0 5px;
  color: var(--brand-dark);
  font-weight: 700;
}

.filter-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  align-items: end;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px;
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.filter-form .button-link {
  align-self: end;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--danger-text);
}

.check input {
  width: 18px;
  min-height: 18px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

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

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

tr.urgent {
  background: var(--danger-bg);
}

tr.urgent td {
  border-bottom-color: var(--danger-line);
}

.order-no {
  font-weight: 800;
}

.bang {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-left: 6px;
  border-radius: 50%;
  background: #d92d20;
  color: #fff;
  font-weight: 900;
}

small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.inline {
  display: inline;
}

.empty {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 760px) {
  .grid,
  .row,
  .filter-form {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading {
    display: block;
  }

  .sort-form {
    margin-bottom: 16px;
  }
}
