*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg-body: #f5f5f7;
  --bg-card: #ffffff;
  --border-subtle: #e2e2e6;
  --text-main: #111111;
  --text-muted: #777783;
  --accent: #111111;
  --accent-soft: rgba(0, 0, 0, 0.04);
  --accent-focus: rgba(0, 0, 0, 0.12);
  --radius-card: 24px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 45px rgba(15, 15, 35, 0.08);
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-main);
  background: radial-gradient(circle at top, #fdfdfd 0, #f5f5f7 45%, #ececf0 100%);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

/* Layout shell */

.app-shell {
  min-height: 100vh;
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 4px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(135deg, #111111, #4a4a52);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.1rem;
  color: #f5f5f7;
}

.brand-text h1 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.03em;
}

.brand-text p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* Main layout */

.app-main-single {
  display: flex;
}

/* Cards */

.card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: 22px 22px 20px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  width: 100%;
}

.card-header {
  margin-bottom: 16px;
}

.card-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.card-subtitle {
  margin: 4px 0 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* Buttons */

.btn {
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  font-size: 0.92rem;
  padding: 9px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.16s ease, transform 0.08s ease,
    box-shadow 0.16s ease, color 0.16s ease;
  white-space: nowrap;
}

.btn-primary {
  background: #111111;
  color: #f7f7fa;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.btn-ghost {
  background: var(--accent-soft);
  color: var(--text-main);
}

.btn-ghost:hover {
  background: var(--accent-focus);
}

.btn-ghost:active {
  transform: translateY(1px);
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.82rem;
}

.btn-danger {
  background: #f7e3e3;
  color: #9b1c1c;
}

.btn-danger:hover {
  background: #f4d4d4;
}

.btn-icon {
  border-radius: 999px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 8px;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-icon:hover {
  background: var(--accent-soft);
  color: var(--text-main);
}

/* Feedback */

.feedback {
  min-height: 20px;
  font-size: 0.86rem;
  margin-bottom: 8px;
}

.feedback--success {
  color: #166534;
}

.feedback--error {
  color: #b91c1c;
}

/* Table */

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table thead {
  border-bottom: 1px solid var(--border-subtle);
}

.table th,
.table td {
  text-align: left;
  padding: 8px 8px;
}

.table th {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.table tbody tr:nth-child(even) {
  background: #fafafb;
}

.table tbody tr:hover {
  background: #f3f3f7;
}

.table td.actions {
  display: flex;
  gap: 6px;
}

/* Form */

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.modal-grid {
  grid-template-columns: 2fr 1fr 1fr;
}

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

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

.field label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.field input {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 10px 14px;
  font-size: 0.95rem;
  outline: none;
  background: #fdfdff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field input::placeholder {
  color: #b3b3bd;
}

.field input:focus {
  border-color: #111111;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
  background: #ffffff;
}

/* Modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 20, 0.28);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 16px;
}

.modal-backdrop.is-visible {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border-radius: 24px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(10, 10, 30, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.85);
  padding: 18px 20px 16px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.modal-subtitle {
  margin: 4px 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.modal-form {
  margin-top: 6px;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  gap: 12px;
}

.modal-actions-right,
.modal-actions-left {
  display: flex;
  gap: 8px;
}

/* Code tag */

code {
  font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 0.8rem;
  padding: 2px 6px;
  border-radius: 999px;
  background: #f1f1f5;
}
