﻿:root {
  color-scheme: dark light;
  --bg: #f4f7fc;
  --panel: #ffffff;
  --panel-soft: #eef4ff;
  --text: #102a43;
  --muted: #52606d;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #10b981;
  --danger: #ef4444;
  --border: rgba(148, 163, 184, 0.24);
  --shadow: 0 32px 80px rgba(15, 23, 42, 0.08);
  --radius: 24px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f3f7ff 0%, #fdfdff 55%, #ffffff 100%);
  color: var(--text);
}

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

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 24px 16px 48px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 28px 28px 26px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.page-subtitle {
  margin: 0 0 6px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.6rem);
  line-height: 1.05;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.9rem 1.3rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.18);
}

.button-secondary {
  background: #ffffff;
  color: var(--text);
  border-color: var(--border);
}

.button-tertiary {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
}

main {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

.toolbar {
  display: flex;
  justify-content: flex-end;
}

.filter-card,
.table-card,
.message {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.filter-card h2 {
  margin: 0 0 18px;
  font-size: 1.15rem;
  color: var(--text);
}

.filter-form {
  display: grid;
  gap: 16px;
}

.filter-form label {
  display: grid;
  gap: 0.5rem;
  color: var(--muted);
  font-weight: 700;
}

input[type="date"] {
  width: 100%;
  min-width: 180px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #dbeafe;
  background: #f8fbff;
  color: var(--text);
}

button,
input[type="submit"] {
  cursor: pointer;
  width: max-content;
  min-width: 150px;
  padding: 14px 18px;
  border-radius: 16px;
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
}

button:hover,
input[type="submit"]:hover {
  background: var(--primary-hover);
}

.table-card {
  overflow: hidden;
}

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

.table-title {
  margin: 0;
  font-size: 1rem;
  color: var(--muted);
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 700;
}

.badge-danger {
  background: #fee2e2;
  color: var(--danger);
}

.badge-success {
  background: #dcfce7;
  color: var(--success);
}

.table-scroll {
  width: 100%;
  overflow-x: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  table-layout: fixed;
}

th,
td {
  padding: 16px 18px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
  word-wrap: break-word;
  white-space: normal;
}

thead tr {
  background: #f8fbff;
}

th,
td {
  padding: 16px 18px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

th {
  color: #52606d;
  font-size: 0.95rem;
  font-weight: 700;
}

tbody tr {
  transition: background-color 0.18s ease, transform 0.18s ease;
}

tbody tr:hover {
  background: #f2f7ff;
  transform: translateY(-1px);
}

.action-link {
  color: var(--primary);
  font-weight: 700;
}

.action-link.delete-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 2px solid rgba(239, 68, 68, 0.22);
  border-radius: 0.85rem;
  color: var(--danger);
  background: rgba(254, 226, 226, 0.65);
  font-size: 1.4rem;
  line-height: 1;
  font-weight: 900;
  text-decoration: none;
}

.action-link.delete-icon:hover {
  background: rgba(239, 68, 68, 0.12);
}

.action-link:hover {
  text-decoration: underline;
}

.message {
  font-size: 0.98rem;
  line-height: 1.6;
}

.message-error {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

.message-empty {
  color: #334155;
  background: #f8fafc;
  border-color: #cbd5e1;
}

@media (max-width: 900px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .table-card {
    padding: 22px;
  }

  table {
    min-width: 720px;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100%, calc(100% - 24px));
    padding: 16px 0 32px;
  }

  .page-header,
  .filter-card,
  .table-card,
  .message {
    padding: 20px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .button {
    width: 100%;
    justify-content: center;
  }

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

  table {
    min-width: 640px;
  }

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