:root {
  --ink: #1c2430;
  --muted: #667085;
  --line: #d9dee7;
  --paper: #f5f2ec;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --blue: #255f85;
  --blue-dark: #194762;
  --green: #2f6f55;
  --red: #a33b3b;
  --gold: #9a6a18;
  --shadow: 0 18px 45px rgba(28, 36, 48, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  direction: rtl;
}

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

button {
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  min-height: 38px;
  padding: 8px 14px;
}

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

input,
select,
textarea {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 36px;
  padding: 7px 9px;
  width: 100%;
}

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

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

h1 {
  font-size: 30px;
  line-height: 1.18;
  margin-bottom: 0;
}

h2 {
  font-size: 21px;
  margin-bottom: 6px;
}

h3 {
  font-size: 19px;
  margin-bottom: 0;
}

h4 {
  font-size: 17px;
  margin-bottom: 8px;
}

label {
  color: #445064;
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
  line-height: 1.5;
}

.eyebrow {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.primary {
  background: var(--blue);
  color: #ffffff;
}

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

.secondary {
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink);
}

.google-login {
  background: #ffffff;
  border-color: var(--line);
  color: #26323f;
  font-weight: 700;
}

.google-login:hover {
  border-color: #b9c2d0;
  background: #f8fafc;
}

.danger {
  background: #fff6f4;
  border-color: #f1c5be;
  color: var(--red);
}

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

.full {
  width: 100%;
}

.login-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  max-width: 440px;
  padding: 28px;
  width: 100%;
}

.form-error,
.config-warning {
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.45;
  margin: 0;
  padding: 10px 12px;
}

.form-error:empty {
  display: none;
}

.form-error,
.config-warning {
  background: #fff6f4;
  color: var(--red);
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 22px 32px;
  position: sticky;
  top: 0;
  z-index: 5;
}

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

.user-pill {
  background: #eef6fa;
  border: 1px solid #cce2ee;
  border-radius: 8px;
  color: var(--blue-dark);
  font-size: 14px;
  font-weight: 700;
  padding: 9px 12px;
}

.layout {
  padding: 24px 32px 36px;
}

.summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.metric span {
  display: block;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
}

.metric p,
.board-head p,
.product-meta,
.subject-status {
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 0;
}

.board-head {
  align-items: end;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.controls label {
  font-size: 12px;
  min-width: 138px;
  text-transform: uppercase;
}

.empty-state {
  background: #fffdf7;
  border: 1px solid #ead9ac;
  border-radius: 8px;
  color: #6f5216;
  margin: 14px 0;
  padding: 14px 16px;
}

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

.subject {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.subject summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  list-style: none;
  padding: 18px;
}

.subject summary::-webkit-details-marker {
  display: none;
}

.subject-title {
  display: grid;
  gap: 4px;
}

.subject-count {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #445064;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 11px;
}

.products {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
  padding: 14px;
}

.product {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.product-head {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1fr) 170px 170px;
  margin-bottom: 12px;
}

.product-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
}

.product-meta {
  margin-top: 8px;
}

.tasks-table-wrap {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
}

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

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

th {
  background: #eef2f7;
  color: #3a4658;
  font-size: 12px;
  text-transform: uppercase;
  white-space: nowrap;
}

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

.empty-product {
  color: var(--muted);
  margin: 0;
  padding: 12px;
}

.status-done {
  opacity: 0.7;
}

.priority-high {
  border-right: 4px solid var(--red);
}

.priority-medium {
  border-right: 4px solid var(--gold);
}

.priority-low {
  border-right: 4px solid var(--green);
}

@media (max-width: 980px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

@media (max-width: 640px) {
  .layout,
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }

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

  h1 {
    font-size: 24px;
  }
}
