:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #68738a;
  --primary: #1f6feb;
  --primary-dark: #174ea6;
  --border: #dfe5ef;
  --shadow: 0 20px 45px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #e6f0ff, transparent 32rem), var(--bg);
  color: var(--text);
}

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

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem clamp(1rem, 4vw, 4rem);
}

.brand {
  font-weight: 800;
  letter-spacing: -0.03em;
}

.nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav a,
.nav-form button {
  padding: 0.6rem 0.9rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}

.nav a.active,
.nav a:hover,
.nav-form button:hover {
  background: var(--card);
  color: var(--primary);
  box-shadow: 0 8px 20px rgba(31, 111, 235, 0.08);
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  flex: 1;
  padding: 3rem 0;
}

.hero,
.card,
.stat-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero {
  padding: clamp(2rem, 6vw, 5rem);
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.2rem, 7vw, 4.75rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

h2 {
  margin-top: 0;
}

p {
  line-height: 1.7;
}

.eyebrow {
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.muted {
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 0;
  border-radius: 14px;
  padding: 0.85rem 1.2rem;
  font-weight: 700;
  cursor: pointer;
}

.button.primary {
  background: var(--primary);
  color: white;
}

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

.button.secondary {
  background: #eaf1ff;
  color: var(--primary);
}

.auth-card {
  max-width: 480px;
  margin: 0 auto;
  padding: 2rem;
}

.form {
  display: grid;
  gap: 0.8rem;
}

.form input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  font: inherit;
}

.page-title {
  margin-bottom: 2rem;
}

.stats-grid,
.module-grid {
  display: grid;
  gap: 1rem;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 1rem;
}

.stat-card,
.card {
  padding: 1.5rem;
}

.stat-card span,
.module-path {
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin-top: 0.5rem;
  font-size: 2.4rem;
}

.module-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.module-card {
  min-height: 190px;
}

.module-path {
  display: inline-block;
  margin-top: 1rem;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.9rem;
}

.site-footer {
  justify-content: center;
  color: var(--muted);
}

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

.page-title-row,
.panel-header,
.sort-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.page-title-row,
.panel-header {
  align-items: flex-start;
}

.inbox-panel,
.rules-card {
  margin-bottom: 1rem;
}

.badge,
.type-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge,
.type-pill {
  background: #eaf1ff;
  color: var(--primary);
}

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

.documents-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.documents-table th,
.documents-table td {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.documents-table th {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.documents-table code {
  color: var(--primary-dark);
  font-size: 0.88rem;
}

.check-label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.status-novo {
  background: #eef6ff;
  color: #174ea6;
}

.status-razvrstano {
  background: #e8f7ef;
  color: #137333;
}

.status-za-proveru {
  background: #fff7e6;
  color: #9a6700;
}

.status-spremno-za-Aktiv {
  background: #f1e8ff;
  color: #5f2eea;
}

.sort-actions {
  align-items: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.rules-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding-left: 1.2rem;
}

@media (max-width: 640px) {
  .page-title-row,
  .panel-header {
    flex-direction: column;
  }
}

.notice.error {
  border-color: #f2b8b5;
  background: #fce8e6;
  color: #b3261e;
}

.notice {
  margin-bottom: 1rem;
  border: 1px solid #b7e4c7;
  border-radius: 18px;
  padding: 1rem 1.25rem;
  background: #e8f7ef;
  color: #137333;
  font-weight: 700;
}
