@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bg: #f3f5fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --ok-bg: #ecfdf3;
  --ok-border: #bbf7d0;
  --ok-text: #15803d;
  --err-bg: #fef2f2;
  --err-border: #fecaca;
  --err-text: #b91c1c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.04);
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top right, #eef4ff 0, #f3f5fb 45%, #f7f9fc 100%);
  line-height: 1.45;
}

a {
  color: #1d4ed8;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

header.bg-white {
  backdrop-filter: saturate(160%) blur(6px);
  background: rgba(255, 255, 255, 0.85);
}

nav a {
  color: #334155;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  white-space: nowrap;
}

nav a:hover {
  background: #eef2ff;
  text-decoration: none;
}

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

thead th {
  color: #475569;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.72rem;
}

td,
th {
  vertical-align: top;
}

tbody tr:hover {
  background: #f8fafc;
}

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

input[type="email"],
input[type="password"],
input[type="text"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select[multiple] {
  min-height: 104px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

button,
input[type="submit"] {
  cursor: pointer;
  border: 0;
  border-radius: 10px;
  padding: 0.5rem 0.9rem;
}

button:hover,
input[type="submit"]:hover {
  transform: translateY(-0.5px);
}

/* Utility classes used in views */
.rounded,
.rounded-lg {
  border-radius: var(--radius);
}

.border {
  border: 1px solid var(--border);
}

.border-t {
  border-top: 1px solid var(--border);
}

.bg-white {
  background: var(--surface);
}

.bg-slate-50 {
  background: var(--surface-soft);
}

.bg-slate-100 {
  background: #f1f5f9;
}

.bg-slate-200 {
  background: #e5e7eb;
}

.bg-slate-900 {
  background: var(--primary);
}

.hover\:bg-slate-700:hover {
  background: var(--primary-hover);
}

.text-white {
  color: #fff;
}

.text-slate-900 {
  color: var(--text);
}

.text-slate-600 {
  color: #4b5563;
}

.text-slate-500 {
  color: var(--muted);
}

.text-red-600 {
  color: var(--danger);
}

.text-green-700 {
  color: var(--ok-text);
}

.text-red-700 {
  color: var(--err-text);
}

.text-blue-700 {
  color: #1d4ed8;
}

.hover\:underline:hover {
  text-decoration: underline;
}

.min-h-screen {
  min-height: 100vh;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.max-w-7xl {
  max-width: 1200px;
}

.max-w-md {
  max-width: 440px;
}

.mt-12 {
  margin-top: 3rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-3 {
  margin-top: 0.75rem;
}

.mb-1 {
  margin-bottom: 0.25rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-3 {
  margin-bottom: 0.75rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-6 {
  margin-bottom: 1.5rem;
}

.px-2 {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.px-3 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.py-1 {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.py-3 {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.py-6 {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.pb-3 {
  padding-bottom: 0.75rem;
}

.p-2 {
  padding: 0.5rem;
}

.p-3 {
  padding: 0.75rem;
}

.p-4 {
  padding: 1rem;
}

.p-6 {
  padding: 1.5rem;
}

.space-y-1 > * + * {
  margin-top: 0.25rem;
}

.space-y-2 > * + * {
  margin-top: 0.5rem;
}

.space-y-4 > * + * {
  margin-top: 1rem;
}

.space-y-6 > * + * {
  margin-top: 1.5rem;
}

.inline {
  display: inline;
}

.block {
  display: block;
}

.flex {
  display: flex;
}

.grid {
  display: grid;
}

.items-center {
  align-items: center;
}

.items-end {
  align-items: flex-end;
}

.justify-between {
  justify-content: space-between;
}

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

.overflow-hidden {
  overflow: hidden;
}

.gap-1 {
  gap: 0.25rem;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

.w-full {
  width: 100%;
}

.min-w-0 {
  min-width: 0;
}

.min-w-full {
  min-width: 100%;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.text-xs {
  font-size: 0.75rem;
}

.text-sm {
  font-size: 0.875rem;
}

.text-lg {
  font-size: 1.125rem;
}

.text-xl {
  font-size: 1.25rem;
}

.text-2xl {
  font-size: 1.45rem;
}

.text-3xl {
  font-size: 1.8rem;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.shadow-sm {
  box-shadow: var(--shadow);
}

.form-inline {
  display: inline;
}

.border-green-200 {
  border-color: var(--ok-border);
}

.bg-green-50 {
  background: var(--ok-bg);
}

.border-red-200 {
  border-color: var(--err-border);
}

.bg-red-50 {
  background: var(--err-bg);
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-success {
  background: #ecfdf3;
  color: #15803d;
  border-color: #bbf7d0;
}

.status-warning {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.status-info {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.status-danger {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.status-neutral {
  background: #f3f4f6;
  color: #374151;
  border-color: #d1d5db;
}

/* Give cards / panels depth without extra class changes */
.rounded.border.bg-white {
  box-shadow: var(--shadow);
}

/* Better defaults for dense data sections */
.overflow-hidden {
  overflow: auto;
}

/* Modern responsive behavior */
@media (max-width: 1024px) {
  .max-w-7xl {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  .text-3xl {
    font-size: 1.35rem;
  }

  .text-2xl {
    font-size: 1.2rem;
  }

  .p-6 {
    padding: 1rem;
  }

  .p-4 {
    padding: 0.8rem;
  }

  .px-4 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .py-6 {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  header .max-w-7xl {
    gap: 0.6rem;
  }

  nav.mx-auto {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    padding-bottom: 0.6rem;
  }

  nav a {
    display: block;
    text-align: center;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    padding: 0.4rem 0.5rem;
    border-radius: 8px;
    font-size: 0.78rem;
  }

  .grid {
    gap: 0.55rem;
  }

  .rounded.border.bg-white {
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 4px 14px rgba(16, 24, 40, 0.03);
  }

  .overflow-hidden {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 720px;
  }

  thead th {
    font-size: 0.68rem;
  }

  td,
  th {
    padding: 0.45rem 0.45rem !important;
  }

  input[type="email"],
  input[type="password"],
  input[type="text"],
  input[type="date"],
  input[type="number"],
  select,
  textarea {
    padding: 0.5rem 0.6rem;
    font-size: 0.92rem;
  }

  button,
  input[type="submit"] {
    padding: 0.48rem 0.72rem;
    font-size: 0.86rem;
  }
}

@media (max-width: 480px) {
  nav.mx-auto {
    grid-template-columns: 1fr 1fr;
  }

  .text-xl {
    font-size: 1.02rem;
  }

  .text-lg {
    font-size: 1rem;
  }

  .text-sm {
    font-size: 0.8rem;
  }

  .text-xs {
    font-size: 0.72rem;
  }

  table {
    min-width: 680px;
  }
}

/* Responsive utilities referenced in templates */
.sm\:grid-cols-2,
.md\:grid-cols-2,
.md\:grid-cols-3,
.md\:col-span-2,
.lg\:grid-cols-2,
.lg\:grid-cols-3,
.lg\:grid-cols-4,
.lg\:grid-cols-6 {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .sm\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .md\:col-span-2 {
    grid-column: span 2 / span 2;
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lg\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .lg\:grid-cols-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
