:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17212b;
  background: #f2f5f9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  background: radial-gradient(circle at top left, #e6f4ff 0%, #f2f5f9 35%, #ffffff 100%);
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}

.hidden {
  display: none !important;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 80px;
}

.hero {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 32px;
}

.eyebrow {
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #0f4f8b;
  font-size: 0.85rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 1.8rem + 2vw, 3.6rem);
  line-height: 1.05;
}

.hero h1 span {
  display: inline-block;
  margin-left: 10px;
}

.subtitle {
  max-width: 540px;
  margin: 20px 0 0;
  line-height: 1.8;
  color: #4b5b6d;
  font-size: 1rem;
}

.hero-card,
.table-card {
  background: #ffffff;
  border: 1px solid rgba(16, 56, 93, 0.08);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(15, 52, 88, 0.08);
  padding: 28px;
}

.hero-card {
  max-width: 360px;
  width: 100%;
  margin: 0 auto;
}

.hero-card h2,
.table-card h2 {
  margin: 0 0 18px;
  font-size: 1.2rem;
  color: #112a42;
}

.login-form {
  display: grid;
  gap: 14px;
}

input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #d7dde6;
  border-radius: 14px;
  background: #f8fafc;
  font-size: 1rem;
  color: #17212b;
}

input:focus {
  outline: none;
  border-color: #0f4f8b;
  box-shadow: 0 0 0 4px rgba(15, 79, 164, 0.12);
}

button,
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

button:hover,
.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(15, 56, 107, 0.12);
}

button {
  background: linear-gradient(135deg, #0f4f8b 0%, #2c81ff 100%);
  color: white;
}

.controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 24px;
}

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

.table-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

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

.table-actions label {
  font-size: 0.95rem;
  color: #4b5b6d;
}

.table-actions select {
  border: 1px solid #d7dde6;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  color: #17212b;
}

.new-movement-card {
  background: #f8fbff;
  border: 1px solid rgba(15, 79, 164, 0.12);
  border-radius: 22px;
  padding: 22px;
  margin: 20px 0;
}

.new-movement-card h3 {
  margin: 0 0 18px;
  color: #112a42;
  font-size: 1.1rem;
}

.new-movement-card summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(90deg,#f6fbff,#ffffff);
  color: #0f4f8b;
  margin-bottom: 12px;
}

.new-movement-card[open] {
  background: #f8fbff;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.primary-btn {
  min-width: 180px;
}

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

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

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 600px;
}

.movements-cards {
  display: none;
}

th,
td {
  padding: 16px 18px;
  text-align: left;
}

th {
  background: #eff5fd;
  color: #112a42;
  font-weight: 700;
  border-bottom: 1px solid #d7dde6;
}

td {
  background: #ffffff;
  color: #4b5b6d;
  border-bottom: 1px solid #f0f3f7;
}

tbody tr:hover td {
  background: #f4f8ff;
}

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

  .hero h1,
  .subtitle {
    text-align: center;
  }

  .controls {
    justify-content: stretch;
  }
}

@media (max-width: 600px) {
  .page-shell {
    width: auto;
    padding: 24px 16px 60px;
  }

  table {
    min-width: auto;
  }

  th,
  td {
    padding: 12px 14px;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 15px;
  }

  .page-shell {
    width: 100%;
    padding: calc(20px + env(safe-area-inset-top)) 16px calc(54px + env(safe-area-inset-bottom));
  }

  .hero {
    gap: 18px;
  }

  .hero h1 {
    font-size: 2.3rem;
  }

  .subtitle {
    font-size: 0.95rem;
  }

  .hero-card,
  .table-card {
    padding: 20px;
    border-radius: 22px;
  }

  .hero-card {
    box-shadow: 0 18px 40px rgba(15, 52, 88, 0.08);
    padding: 18px;
  }

  .login-form {
    gap: 12px;
  }

  input,
  button,
  .primary-btn,
  .table-actions select {
    width: 100%;
    font-size: 1rem;
    padding: 14px 16px;
  }

  button,
  .primary-btn {
    border-radius: 16px;
  }

  button {
    min-height: 48px;
  }

  .logout-card {
    padding: 18px;
    border-radius: 20px;
  }

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

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

  table {
    display: none;
  }

  #movements-cards {
    display: grid;
    gap: 14px;
  }

  .movement-card {
    background: #f8fbff;
    border: 1px solid rgba(15, 79, 164, 0.12);
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 10px 24px rgba(15, 52, 88, 0.08);
  }

  .movement-card summary {
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    list-style: none;
  }

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

  .movement-card p {
    margin: 10px 0 0;
    color: #4b5b6d;
    line-height: 1.6;
    font-size: 0.95rem;
  }

  .movement-card .movement-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
    color: #5a7184;
    font-size: 0.9rem;
  }

  th,
  td {
    padding: 12px 10px;
  }

  .hero-card {
    min-height: auto;
  }
}
