@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;600;700&display=swap');

:root {
  --primary: #650097;
  --primary-700: #4b0070;
  --primary-900: #0a1a41;
  --accent: #f8b1e8;
  --danger: #f52020;
  --success: #15803d;
  --warning: #b45309;
  
  --info: #4673f0;
  --bg: #f7f7fb;
  --card: #ffffff;
  --text: #0a1a41;
  --muted: #5b6475;
  --border: #e5e7eb;
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 20px 50px rgba(15, 23, 42, 0.14);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 84px;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Plus Jakarta Sans", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: radial-gradient(circle at top left, #ffffff 0%, #f6f3ff 45%, #f8f7ff 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: -20% -10% auto auto;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle at center, rgba(101, 0, 151, 0.2), rgba(101, 0, 151, 0));
  filter: blur(0.5px);
  opacity: 0.7;
  pointer-events: none;
  z-index: -1;
}

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

.app-body {
  min-height: 100vh;
}

.app-shell {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  position: relative;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #650097 0%, #0a1a41 100%);
  color: #fff;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 30;
}

body.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
  padding: 18px 10px;
}


/* Hover expand effect when collapsed */
body.sidebar-collapsed .sidebar:hover {
  width: var(--sidebar-width);
  box-shadow: var(--shadow-md);
}

body.sidebar-collapsed .sidebar:hover .nav-title,
body.sidebar-collapsed .sidebar:hover .nav-text,
body.sidebar-collapsed .sidebar:hover .nav-tag,
body.sidebar-collapsed .sidebar:hover .sidebar-footer {
  display: flex;
}

body.sidebar-collapsed .sidebar:hover .nav-link {
  justify-content: flex-start;
  padding: 10px 12px;
}

body.sidebar-collapsed .sidebar:hover .sidebar-brand {
  align-items: flex-start;
}

body.sidebar-collapsed .sidebar:hover .sidebar-brand .brand-title,
body.sidebar-collapsed .sidebar:hover .sidebar-brand .brand-sub {
  display: block;
}

body.sidebar-collapsed .sidebar:hover .sidebar-brand::before {
  display: none;
}

body.sidebar-collapsed .nav-title,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .nav-tag,
body.sidebar-collapsed .sidebar-footer {
  display: none;
}

body.sidebar-collapsed .nav-link {
  justify-content: center;
  padding: 10px;
}

body.sidebar-collapsed .sidebar-brand {
  align-items: center;
}

body.sidebar-collapsed .sidebar-brand .brand-title,
body.sidebar-collapsed .sidebar-brand .brand-sub {
  display: none;
}

body.sidebar-collapsed .sidebar-brand::before {
  content: "OPS";
  font-weight: 700;
  letter-spacing: 0.2em;
  font-size: 14px;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 6px;
}

.sidebar-brand .brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.sidebar-brand .brand-sub {
  font-size: 12px;
  opacity: 0.8;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
  padding: 6px 6px 0;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #fff;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.16);
}

.nav-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-link.active .nav-icon-wrap {
  background: rgba(255, 255, 255, 0.22);
}

.nav-icon {
  width: 16px;
  height: 16px;
}

.nav-text {
  flex: 1;
}

.nav-link.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.nav-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  margin-left: auto;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.sidebar-user-label {
  opacity: 0.7;
}

.sidebar-user-name {
  font-weight: 600;
}

.sidebar-user-role {
  opacity: 0.75;
}

.app-main {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-brand-control {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 10px;
  border-right: 1px solid var(--border);
}

.sidebar-toggle {
  border-color: rgba(15, 118, 110, 0.15);
  flex-shrink: 0;
}

.sidebar-toggle:hover {
  background: rgba(101, 0, 151, 0.08);
}

.sidebar-brand-mini {
  display: none;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--primary);
}

body.sidebar-collapsed .sidebar-brand-mini {
  display: flex;
}

.brand-mini-title {
  white-space: nowrap;
}

.topbar-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btn-icon {
  padding: 8px;
  width: 38px;
  height: 38px;
  justify-content: center;
}

.sidebar-toggle {
  border-color: rgba(15, 118, 110, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 52px;
  height: 52px;
  padding: 8px;
}

.sidebar-toggle:hover {
  background: rgba(101, 0, 151, 0.1);
  border-color: rgba(101, 0, 151, 0.3);
  transform: scale(1.1);
}

.sidebar-toggle:active {
  transform: scale(0.92);
}

.sidebar-toggle svg {
  transition: transform 0.3s ease;
  width: 28px;
  height: 28px;
}

body.sidebar-collapsed .sidebar-toggle {
  color: var(--primary);
}

body.sidebar-collapsed .sidebar-toggle:hover {
  background: rgba(91, 33, 182, 0.12);
}

.topbar-menu {
  border-color: rgba(15, 118, 110, 0.15);
}

.topbar-title {
  font-size: 22px;
  font-weight: 600;
}

.topbar-subtitle {
  font-size: 14px;
  color: var(--muted);
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.net-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(21, 128, 61, 0.12);
  color: #166534;
}

.net-status.is-offline {
  background: rgba(180, 35, 36, 0.12);
  color: #991b1b;
}

.net-status.queue-status {
  background: rgba(91, 33, 182, 0.12);
  color: var(--primary);
}

.topbar-search {
  position: relative;
  flex: 1 1 320px;
  max-width: 460px;
}

.search-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(91, 33, 182, 0.2);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfa 100%);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(91, 33, 182, 0.08);
}

.search-input svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.search-input input {
  border: none;
  outline: none;
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: transparent;
}

.search-input input::placeholder {
  color: rgba(100, 116, 139, 0.9);
}

.search-input:focus-within {
  border-color: rgba(91, 33, 182, 0.7);
  box-shadow: 0 0 0 3px rgba(91, 33, 182, 0.18), 0 10px 20px rgba(15, 23, 42, 0.12);
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
  max-height: 360px;
  overflow: auto;
  z-index: 50;
  padding: 12px;
}

.search-section + .search-section {
  border-top: 1px dashed rgba(91, 33, 182, 0.2);
  margin-top: 10px;
  padding-top: 10px;
}

.search-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.search-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  color: inherit;
  border: 1px solid transparent;
}

.search-row:hover {
  background: rgba(91, 33, 182, 0.08);
  border-color: rgba(91, 33, 182, 0.18);
}

.search-main {
  font-weight: 600;
  font-size: 13px;
}

.search-meta {
  font-size: 12px;
  color: var(--muted);
}

.search-empty {
  padding: 12px;
  color: var(--muted);
  text-align: center;
}

.topbar-user {
  font-weight: 600;
  color: var(--text);
}

.badge-role {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(91, 33, 182, 0.12);
  color: var(--primary);
}

.app-content {
  padding: 24px 30px 40px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-soft {
  0% {
    box-shadow: 0 0 0 0 rgba(91, 33, 182, 0.18);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(91, 33, 182, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(91, 33, 182, 0);
  }
}

@keyframes modal-pop {
  from {
    transform: translateY(6px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.app-content > * {
  animation: fade-up 0.45s ease both;
}

.app-content > *:nth-child(1) { animation-delay: 0.04s; }
.app-content > *:nth-child(2) { animation-delay: 0.08s; }
.app-content > *:nth-child(3) { animation-delay: 0.12s; }
.app-content > *:nth-child(4) { animation-delay: 0.16s; }
.app-content > *:nth-child(5) { animation-delay: 0.2s; }

.page-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}

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

.page-filters {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.details-card {
  padding: 0;
  overflow: hidden;
}

.details-card > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
}

.details-card > summary::-webkit-details-marker {
  display: none;
}

.details-card > :not(summary) {
  padding: 0 18px 18px;
}

.details-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-weight: 600;
}

.card-header .muted {
  font-weight: 400;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

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

.kpi-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kpi-icon {
  width: 22px;
  height: 22px;
  padding: 4px;
  color: var(--primary);
  background: rgba(91, 33, 182, 0.12);
  border-radius: 8px;
}

.kpi-label {
  color: var(--muted);
  font-size: 12px;
}

.kpi-value {
  font-size: 20px;
  font-weight: 700;
}

.kpi-meta {
  font-size: 12px;
  color: var(--muted);
}

.chart-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chart-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(28px, 1fr));
  align-items: end;
  gap: 10px;
  height: 150px;
  padding: 6px 2px 0;
}

.line-chart {
  width: 100%;
  padding: 10px 6px 0;
}

.line-chart-svg {
  width: 100%;
  height: 140px;
}

.line-path {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-bar {
  position: relative;
  height: 100%;
  border-radius: 10px;
  background: rgba(91, 33, 182, 0.08);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.chart-bar-fill {
  width: 100%;
  height: var(--bar-height, 20%);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(91, 33, 182, 0.85), rgba(91, 33, 182, 0.45));
  box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.08);
}

.chart-labels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(28px, 1fr));
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

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

.chart-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chart-name {
  width: 120px;
  font-size: 12px;
  color: var(--muted);
}

.chart-track {
  flex: 1;
  height: 10px;
  background: #f0f2f8;
  border-radius: 999px;
  overflow: hidden;
}

.chart-fill {
  height: 100%;
  width: var(--bar-width, 0%);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(91, 33, 182, 0.85), rgba(91, 33, 182, 0.45));
}

.chart-fill.success {
  background: linear-gradient(90deg, rgba(22, 163, 74, 0.85), rgba(22, 163, 74, 0.45));
}

.chart-fill.warning {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.9), rgba(245, 158, 11, 0.45));
}

.chart-fill.danger {
  background: linear-gradient(90deg, rgba(229, 37, 37, 0.9), rgba(229, 37, 37, 0.45));
}

.chart-value {
  min-width: 90px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
}

.table-wrap {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.data-table,
.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 13px;
}

.data-table th,
.data-table td,
.table th,
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.data-table th,
.table th {
  background: #f7f8fd;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

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

.data-table tbody tr:hover,
.table tbody tr:hover {
  background: #f3f1fb;
}

.data-table tbody tr,
.table tbody tr {
  transition: background 0.2s ease;
}

.data-table tr:last-child td,
.table tr:last-child td {
  border-bottom: none;
}

.table-sticky thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

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

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

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

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

.text-success {
  color: var(--success);
}

.input,
.select,
.textarea,
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
}

.input:focus,
.select:focus,
.textarea:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(91, 33, 182, 0.6);
  box-shadow: 0 0 0 3px rgba(91, 33, 182, 0.15);
}

.input:disabled,
.select:disabled,
.textarea:disabled,
.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  background: #f3f4f6;
  color: var(--muted);
  cursor: not-allowed;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.field-error {
  font-size: 11px;
  color: var(--danger);
  margin-top: 4px;
  min-height: 14px;
}

.input.is-error,
.select.is-error,
.textarea.is-error {
  border-color: var(--danger);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  align-items: end;
}

.inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-message {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.form-message.error {
  color: var(--danger);
}

.btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-primary,
.btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-danger,
.btn.danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-secondary {
  background: #f3f4f6;
  color: var(--text);
  border-color: #e5e7eb;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--primary);
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

.btn-lg {
  padding: 12px 18px;
  font-size: 14px;
}

.chip-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.chip-success {
  background: rgba(22, 163, 74, 0.12);
  color: var(--success);
}

.chip-danger {
  background: rgba(229, 37, 37, 0.12);
  color: var(--danger);
}

.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-status.draft {
  background: #eaf2ff;
  color: #1d4ed8;
}

.badge-status.submitted {
  background: #ede9fe;
  color: #6d28d9;
}

.badge-status.validated {
  background: #dcfce7;
  color: #15803d;
}

.badge-status.locked {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-status.pending {
  background: #fdf4ff;
  color: #a21caf;
}

.absence-only {
  display: none;
  margin-bottom: 6px;
}

.is-absent .absence-only {
  display: block;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.badge.info {
  background: rgba(37, 99, 235, 0.12);
  color: var(--info);
}

.badge.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.badge.danger {
  background: rgba(229, 37, 37, 0.12);
  color: var(--danger);
}

.badge.success {
  background: rgba(22, 163, 74, 0.12);
  color: var(--success);
}

.alert {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.alert-info {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.3);
  color: #1e40af;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #92400e;
}

.alert-danger {
  background: rgba(229, 37, 37, 0.1);
  border-color: rgba(229, 37, 37, 0.3);
  color: #b91c1c;
}

.alert-success {
  background: rgba(22, 163, 74, 0.1);
  border-color: rgba(22, 163, 74, 0.3);
  color: #15803d;
}

.status-flow {
  display: flex;
  gap: 12px;
  align-items: center;
}

.status-step {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: #fff;
}

.status-step.is-complete {
  border-color: rgba(22, 163, 74, 0.3);
  color: var(--success);
  background: rgba(22, 163, 74, 0.08);
}

.status-step.is-active {
  border-color: rgba(91, 33, 182, 0.35);
  color: var(--primary);
  background: rgba(91, 33, 182, 0.08);
  animation: pulse-soft 1.8s ease-in-out infinite;
}

.row-errors {
  color: var(--danger);
  font-size: 11px;
}

.row-error {
  background: rgba(229, 37, 37, 0.05);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 40;
}

.modal.is-open {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.modal.is-open .modal-card {
  animation: modal-pop 0.2s ease;
}

.modal-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  width: min(420px, 90vw);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.empty-state {
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty-illustration {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  margin: 0 auto;
  background: rgba(91, 33, 182, 0.12);
}

.code-block {
  margin: 0;
  padding: 10px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 11px;
  white-space: pre-wrap;
  max-height: 220px;
  overflow: auto;
}

.dropzone {
  border: 2px dashed #d7dbe7;
  border-radius: 12px;
  padding: 22px;
  text-align: center;
  background: #f8fafc;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  position: relative;
}

.dropzone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.notice-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(circle at top, #f7f4ff 0%, #efe7fb 45%, #f8f2ff 100%);
}

.login-card {
  background: #fff;
  padding: 32px;
  border-radius: 20px;
  width: 360px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.login-brand {
  margin-bottom: 18px;
}

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

@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 980px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    z-index: 30;
  }

  .app-main {
    margin-left: 0;
  }

  body.sidebar-collapsed .sidebar {
    width: 100%;
    padding: 18px;
  }

  body.sidebar-collapsed .app-main {
    margin-left: 0;
  }

  body.sidebar-collapsed .nav-title,
  body.sidebar-collapsed .nav-text,
  body.sidebar-collapsed .nav-tag,
  body.sidebar-collapsed .sidebar-footer {
    display: block;
  }

  body.sidebar-collapsed .nav-text {
    display: inline;
  }

  body.sidebar-collapsed .nav-tag {
    display: inline-flex;
  }

  body.sidebar-collapsed .sidebar-footer {
    display: flex;
  }

  body.sidebar-collapsed .sidebar-brand::before {
    display: none;
  }

  body.sidebar-collapsed .sidebar-brand .brand-title,
  body.sidebar-collapsed .sidebar-brand .brand-sub {
    display: block;
  }

  body.sidebar-collapsed .nav-link {
    justify-content: flex-start;
    padding: 10px 12px;
  }

  .sidebar-brand {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .sidebar-nav {
    flex: 1;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .nav-section {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .nav-title {
    display: none;
  }

  .sidebar-footer {
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    border-top: none;
    padding: 8px 0 0;
  }

  body.sidebar-collapsed .sidebar-nav,
  body.sidebar-collapsed .sidebar-footer {
    display: none;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-filters {
    width: 100%;
  }

  .topbar-search {
    width: 100%;
    max-width: none;
  }
}

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

  .app-content {
    padding: 20px;
  }

  .topbar {
    padding: 16px 20px;
  }

  .topbar-meta {
    flex-wrap: wrap;
  }

  .login-card {
    width: 92%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-content > * {
    animation: none;
  }
}
