* {
  box-sizing: border-box;
}

:root {
  --bg: #eef3f9;
  --panel: #ffffff;
  --text: #1b1e24;
  --muted: #667085;
  --primary: #2f5f9b;
  --primary-soft: #eef4fb;
  --danger: #d9534f;
  --border: #dbe2ea;
  --grid: #2b2b2b;
  --cell: #d9d9d9;
  --weekend: #b0b0b0;
  --shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

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

.auth-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #dbe8f7, #f8fbff);
}

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

.auth-card,
.panel {
  background: var(--panel);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(980px, 100%);
  padding: 28px;
}

.auth-card h1,
.topbar h1,
.sheet-header h2 {
  margin: 0;
}

.subtitle {
  color: var(--muted);
  margin: 8px 0 20px;
}

.auth-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.auth-form {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}

.auth-form h2 {
  margin-top: 0;
  margin-bottom: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 14px;
  font-weight: 700;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px 14px;
  background: white;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
}

.btn.primary {
  background: var(--primary);
  color: white;
}

.btn.secondary {
  background: var(--primary-soft);
  color: var(--primary);
}

.btn.light {
  background: #f3f4f6;
  color: #374151;
}

.btn.danger {
  background: var(--danger);
  color: white;
}

.alert {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert.error {
  background: #fee2e2;
  color: #991b1b;
}

.alert.success {
  background: #dcfce7;
  color: #166534;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 24px;
  background: white;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.page {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px;
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
  padding: 18px;
}

.info-box {
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  background: #f8fbff;
}

.info-box strong {
  font-size: 24px;
  color: var(--primary);
}

.panel {
  padding: 18px;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

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

.table-wrap {
  overflow: auto;
  border: 1px solid var(--grid);
  border-radius: 12px;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
  background: #efefef;
}

thead th {
  background: #4f81bd;
  color: #000;
  border: 1px solid var(--grid);
  padding: 10px 8px;
  text-align: center;
}

tbody td,
tfoot td {
  border: 1px solid var(--grid);
  background: var(--cell);
  text-align: center;
  padding: 0;
  height: 38px;
}

tbody tr.weekend-row td {
  background: var(--weekend);
}

tbody td.date-cell {
  background: #ececec;
  padding: 8px;
  font-weight: 700;
}

tbody tr.weekend-row td.date-cell {
  background: #c5c5c5;
}

td input {
  width: 100%;
  height: 37px;
  border: none;
  background: transparent;
  text-align: center;
  outline: none;
  padding: 6px;
}

td.output {
  background: #e6e6e6;
  font-weight: 700;
  padding: 8px;
}

.total-label {
  background: #f5f5f5;
  text-align: right;
  padding-right: 12px;
  font-weight: 700;
  font-size: 20px;
}

@media (max-width: 760px) {
  .page {
    padding: 14px;
  }

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

  .auth-card,
  .panel {
    padding: 14px;
  }
}
