:root {
  --bg: #f5f7fb;
  --sidebar: #ffffff;
  --panel: #ffffff;
  --line: #dbe3ef;
  --text: #1f2937;
  --muted: #6b7280;
  --link: #2563eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background: var(--bg);
}

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

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

.app-layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  padding: 18px 0;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px 18px;
  font-size: 18px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}

.sidebar-brand-icon {
  color: var(--primary);
  font-size: 20px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #4b5563;
}

.sidebar-link strong {
  color: #37527f;
  font-size: 14px;
  font-weight: 600;
}

.sidebar-link.is-active {
  color: var(--primary);
  background: #e9f0ff;
}

.main-area {
  padding: 24px;
}

.flashes {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.flash {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.flash-success {
  color: #166534;
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.flash-error {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

.toolbar {
  margin-bottom: 16px;
}

.toolbar-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px auto auto;
  gap: 10px;
  align-items: center;
}

.toolbar-search,
.toolbar-select,
textarea,
input[type="file"] {
  width: 100%;
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  color: var(--text);
  background: #fff;
}

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

.toolbar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  cursor: pointer;
}

.toolbar-button-primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.toolbar-button-primary:hover {
  background: var(--primary-dark);
}

.content-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.table-card {
  overflow: hidden;
}

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

.table th,
.table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.table th {
  color: #5a6880;
  font-weight: 600;
  background: #fff;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.domain-link {
  color: var(--link);
  font-weight: 500;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}

.status-watching,
.status-new {
  color: #d97706;
  background: #fff7ed;
}

.status-free,
.status-renewed {
  color: #059669;
  background: #ecfdf5;
}

.status-drops_today {
  color: #dc2626;
  background: #fef2f2;
}

.status-archived {
  color: #6b7280;
  background: #f3f4f6;
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.table-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  color: #475569;
  background: #fff;
}

.table-link-primary {
  color: var(--primary);
}

.pagination-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.page-counter {
  color: var(--muted);
  font-size: 14px;
}

.page-head {
  margin-bottom: 16px;
}

.page-head h1 {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 600;
}

.page-head p {
  margin: 0;
  color: var(--muted);
}

.page-head-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.head-actions,
.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.form-card {
  padding: 18px;
}

.compact-card {
  max-width: 760px;
}

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

.details-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.detail-box {
  padding: 16px;
}

.detail-box span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.detail-box strong {
  font-size: 16px;
  font-weight: 600;
}

code {
  padding: 2px 6px;
  border-radius: 6px;
  background: #eff4fb;
}

@media (max-width: 1100px) {
  .toolbar-filters {
    grid-template-columns: minmax(0, 1fr) 180px;
  }

  .details-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .main-area {
    padding: 16px;
  }

  .toolbar-filters,
  .page-head-inline {
    grid-template-columns: 1fr;
    display: grid;
  }

  .details-grid {
    grid-template-columns: 1fr;
  }

  .table,
  .table thead,
  .table tbody,
  .table tr,
  .table th,
  .table td {
    display: block;
  }

  .table thead {
    display: none;
  }

  .table td {
    padding: 10px 14px;
    border-bottom: 0;
  }

  .table tbody tr {
    border-bottom: 1px solid var(--line);
  }
}
