:root {
  --bg: #ffffff;
  --bg-soft: #f5f5f5;
  --bg-softer: #fafafa;
  --panel: #ffffff;
  --text: #333333;
  --text-soft: #555a61;
  --muted: #7a7f86;
  --primary: #ffc000;
  --primary-dark: #dba500;
  --primary-darker: #b38600;
  --primary-light: #ffd557;
  --primary-softer: #ffe699;
  --secondary: #ff9b00;
  --secondary-dark: #db8500;
  --border: #e4e6ea;
  --border-soft: #eceef2;
  --danger: #d24d4d;
  --success: #3aa365;
}

* {
  box-sizing: border-box;
}

html,
body {
  background: var(--bg);
}

body {
  margin: 0;
  font-family: "Source Sans Pro", "Poppins", "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background: var(--bg-soft);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.5;
}

h1,
h2,
h3 {
  font-family: "Source Sans Pro", "Poppins", "Segoe UI", sans-serif;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

h1 {
  font-size: 1.6rem;
}

h2 {
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.container {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.topbar {
  background: #fff;
  border-bottom: 3px solid var(--primary);
  box-shadow: 0 1px 3px #00000010;
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(162deg, #ffc000 0%, #ffca29 24%, #ffd966 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 0 var(--primary-darker);
  font-family: "Source Sans Pro", sans-serif;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  height: 48px;
  width: auto;
  display: block;
  object-fit: contain;
}

.auth-logo {
  height: 72px;
  margin-bottom: 0.6rem;
}

.topbar h1 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--text);
  font-weight: 700;
}

.topbar h1 .accent {
  color: rgba(255, 192, 0, 0.75);
}

.topbar .muted {
  font-size: 0.85rem;
  margin-top: 0.1rem;
}

.muted {
  color: var(--muted);
  margin-top: 0.3rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  padding: 1.5rem 0 2.5rem;
}

.full {
  grid-column: 1 / -1;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.4rem 1.4rem 1.2rem;
  box-shadow: 0 1px 2px #00000008, 0 2px 6px #00000006;
}

.card h2 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  color: var(--text);
  padding-bottom: 0.6rem;
  position: relative;
}

.card h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 3px;
  background: rgba(255, 192, 0, 0.7);
  border-radius: 2px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}

.card-header h2 {
  margin-bottom: 0;
}

.stack {
  display: grid;
  gap: 0.85rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.86rem;
  color: var(--text-soft);
  font-weight: 600;
}

input,
select,
textarea,
button,
.button {
  font: inherit;
  font-family: "Source Sans Pro", "Poppins", "Segoe UI", sans-serif;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.6rem 0.75rem;
  background: #fff;
  color: var(--text);
  transition: border-color 120ms ease, box-shadow 120ms ease;
  font-size: 0.95rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px #ffc00033;
}

::placeholder {
  color: #a8adb5;
}

button,
.button {
  border: none;
  background: rgba(116, 192, 252, 0.85);
  color: #0f3a5a;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 4px;
  padding: 0.65rem 1.2rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 2px 0 rgba(54, 136, 204, 0.55);
  transition: background 120ms ease, box-shadow 120ms ease, transform 60ms ease;
  font-size: 0.95rem;
}

button:hover,
.button:hover {
  background: rgba(116, 192, 252, 1);
  color: #0a2c47;
  box-shadow: 0 2px 6px rgba(54, 136, 204, 0.35), 0 2px 0 rgba(54, 136, 204, 0.7);
}

button:active,
.button:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(54, 136, 204, 0.55);
}

button.secondary,
.button.secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 1px 0 #00000008;
}

button.secondary:hover,
.button.secondary:hover {
  background: #eaf4fc;
  border-color: rgba(116, 192, 252, 0.85);
  color: #0f3a5a;
}

button.danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 2px 0 #8a3030;
}

button.danger:hover {
  background: #b83e3e;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.8rem 1rem 1rem;
  background: var(--bg-softer);
}

legend {
  padding: 0 0.5rem;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.filter-row label {
  min-width: 160px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}

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

th,
td {
  text-align: left;
  padding: 0.7rem 0.85rem;
  vertical-align: top;
  font-size: 0.93rem;
}

th {
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-soft);
  background: var(--bg-soft);
  border-bottom: 2px solid var(--primary);
  font-weight: 700;
}

tbody tr {
  border-bottom: 1px solid var(--border-soft);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: #fffaea;
}

.row-action {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.icon-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.25rem 0.55rem;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  border-radius: 4px;
  box-shadow: none;
  cursor: pointer;
  letter-spacing: 0;
}

.icon-btn:hover {
  background: #fdeaea;
  color: var(--danger);
  border-color: #f3c2c2;
  box-shadow: none;
}

.alert {
  border: 1px solid #f3c2c2;
  background: #fdeaea;
  color: #8d2a2a;
  border-radius: 4px;
  padding: 0.75rem 0.9rem;
  font-size: 0.93rem;
}

.alert.success {
  border-color: #b9e2c7;
  background: #e7f6ed;
  color: #1f6b3a;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(900px 500px at 80% -10%, #ffd96644, transparent 65%),
    radial-gradient(700px 400px at -10% 110%, #ffc00022, transparent 70%),
    var(--bg-soft);
}

.auth-card {
  width: min(460px, 100%);
  padding: 2rem 1.8rem 1.6rem;
}

.auth-card h1 {
  margin: 0;
  font-size: 1.4rem;
  color: var(--text);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.2rem;
}

.small-text {
  margin-top: 1rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.small-text a {
  color: rgba(219, 165, 0, 0.85);
  text-decoration: none;
  font-weight: 700;
  border-bottom: 2px solid rgba(255, 192, 0, 0.35);
  transition: border-color 120ms ease, color 120ms ease;
}

.small-text a:hover {
  color: var(--primary-dark);
  border-color: rgba(255, 192, 0, 0.7);
}

.radio-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.radio-chip {
  flex: 1 1 auto;
  min-width: 130px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 4px;
  font-size: 0.86rem;
  color: var(--text-soft);
  cursor: pointer;
  font-weight: 600;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.radio-chip input {
  width: auto;
  accent-color: var(--primary);
}

.radio-chip:hover {
  border-color: var(--primary);
}

.radio-chip.active {
  border-color: rgba(255, 192, 0, 0.7);
  color: rgba(179, 134, 0, 0.95);
  background: rgba(255, 192, 0, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 192, 0, 0.6);
}

.timer-panel {
  display: grid;
  gap: 0.85rem;
  padding: 1.4rem 1rem;
  background: linear-gradient(162deg, #fffdf4 0%, #fff6d6 100%);
  border: 1px solid var(--primary-softer);
  border-radius: 6px;
  text-align: center;
}

.timer-display {
  font-family: "Source Sans Pro", "Courier New", monospace;
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  line-height: 1;
}

.timer-sub {
  font-size: 0.82rem;
  color: var(--text-soft);
  font-weight: 600;
}

.timer-sub strong {
  color: var(--text);
  font-weight: 700;
}

.timer-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}

.timer-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c5c8cd;
  margin-right: 0.4rem;
  vertical-align: middle;
}

.timer-panel.running .timer-dot {
  background: var(--primary);
  box-shadow: 0 0 0 3px #ffc00033;
  animation: pulse 1.1s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

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

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .timer-display {
    font-size: 2.2rem;
  }
}
