/* EKAP Asistan design system — loaded outside Tailwind pipeline so styles cannot be stripped */
:root {
  --ek-bg: #f8fafc;
  --ek-surface: #ffffff;
  --ek-ink: #0f172a;
  --ek-muted: #64748b;
  --ek-border: #e2e8f0;
  --ek-primary: #2a5874;
  --ek-primary-hover: #1f455c;
  --ek-primary-soft: #e7f0f5;
  --ek-success: #059669;
  --ek-success-soft: #ecfdf5;
  --ek-warning: #d97706;
  --ek-warning-soft: #fffbeb;
  --ek-danger: #dc2626;
  --ek-danger-soft: #fef2f2;
  --ek-line: #e2e8f0;
  --ek-accent: #2a5874;
  --ek-accent-soft: #e7f0f5;
  --ek-sidebar-w: 15.5rem;
  --ek-sidebar-collapsed-w: 4.25rem;
  --ek-header-h: 3.5rem;
  --ek-radius: 0.625rem;
  --ek-radius-sm: 0.375rem;
  --ek-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  --ek-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
  --ek-ease: 180ms ease;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ek-bg);
  color: var(--ek-ink);
  font-size: 0.9375rem;
  line-height: 1.5;
}

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

img,
svg,
canvas,
video {
  max-width: 100%;
  height: auto;
}

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

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

:focus-visible {
  outline: 2px solid var(--ek-primary);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  input,
  select,
  textarea {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.ek-shell {
  display: flex;
  min-height: 100vh;
  background: var(--ek-bg);
  color: var(--ek-ink);
}

.ek-sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: none;
  width: var(--ek-sidebar-w);
  height: 100vh;
  flex-shrink: 0;
  flex-direction: column;
  border-right: 1px solid var(--ek-border);
  background: var(--ek-surface);
}

.ek-sidebar.is-collapsed {
  width: var(--ek-sidebar-collapsed-w);
}

@media (min-width: 1024px) {
  .ek-sidebar.is-desktop {
    display: flex;
  }
}

.ek-sidebar-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  width: min(var(--ek-sidebar-w), 88vw);
  height: 100vh;
  flex-direction: column;
  border-right: 1px solid var(--ek-border);
  background: var(--ek-surface);
  box-shadow: var(--ek-shadow-md);
  transform: translateX(-105%);
  transition: transform var(--ek-ease);
}

.ek-sidebar-drawer.is-open {
  transform: translateX(0);
}

.ek-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  border: 0;
  background: rgba(15, 23, 42, 0.4);
}

.ek-main {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.ek-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  height: var(--ek-header-h);
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid var(--ek-border);
  background: rgba(255, 255, 255, 0.94);
  padding: 0 1rem;
  backdrop-filter: blur(8px);
}

@media (min-width: 640px) {
  .ek-header {
    padding: 0 1.5rem;
  }
}

.ek-content {
  width: 100%;
  min-width: 0;
  flex: 1;
  padding: 1.25rem 1rem 2.5rem;
}

@media (min-width: 640px) {
  .ek-content {
    padding: 1.5rem 1.5rem 3rem;
  }
}

@media (min-width: 1024px) {
  .ek-content {
    padding: 1.75rem 2rem 3rem;
  }
}

.ek-content-inner {
  width: 100%;
  max-width: 80rem;
  margin-inline: auto;
}

.ek-content-inner.is-wide {
  max-width: 90rem;
}

.ek-page {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
}

.ek-page-wide {
  width: 100%;
  max-width: 80rem;
  margin-inline: auto;
}

.ek-h1 {
  margin: 0;
  font-size: clamp(1.25rem, 1.1rem + 0.55vw, 1.625rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ek-ink);
}

.ek-h2 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ek-ink);
}

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

.ek-label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ek-ink);
}

.ek-card,
.ek-section {
  border: 1px solid var(--ek-border);
  background: var(--ek-surface);
  border-radius: var(--ek-radius);
  box-shadow: var(--ek-shadow);
  padding: 1.25rem;
}

.ek-section + .ek-section {
  margin-top: 1rem;
}

.ek-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--ek-border);
  border-radius: var(--ek-radius);
  background: var(--ek-surface);
}

.ek-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.ek-table-wrap th,
.ek-table-wrap td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--ek-border);
  text-align: left;
  vertical-align: top;
  font-size: 0.875rem;
}

.ek-table-wrap th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--ek-bg);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ek-muted);
}

.ek-table-wrap td.num,
.ek-table-wrap th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ek-input {
  width: 100%;
  border: 1px solid var(--ek-border);
  background: var(--ek-surface);
  border-radius: var(--ek-radius-sm);
  padding: 0.625rem 0.85rem;
  color: var(--ek-ink);
}

.ek-input:focus {
  border-color: var(--ek-primary);
  box-shadow: 0 0 0 3px var(--ek-primary-soft);
  outline: none;
}

.ek-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  border: 1px solid transparent;
  border-radius: var(--ek-radius-sm);
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.ek-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

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

.ek-btn-primary:hover:not(:disabled) {
  background: var(--ek-primary-hover);
}

.ek-btn-secondary {
  border-color: var(--ek-border);
  background: var(--ek-surface);
  color: var(--ek-ink);
}

.ek-btn-secondary:hover:not(:disabled) {
  background: var(--ek-bg);
}

.ek-btn-ghost {
  background: transparent;
  color: var(--ek-muted);
}

.ek-btn-ghost:hover:not(:disabled) {
  background: var(--ek-bg);
  color: var(--ek-ink);
}

.ek-btn-icon {
  width: 2.5rem;
  min-height: 2.5rem;
  padding: 0;
}

.ek-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.3;
}

.ek-badge-neutral {
  background: var(--ek-bg);
  color: var(--ek-muted);
}

.ek-badge-primary {
  background: var(--ek-primary-soft);
  color: var(--ek-primary);
}

.ek-badge-success {
  background: var(--ek-success-soft);
  color: var(--ek-success);
}

.ek-badge-warning {
  background: var(--ek-warning-soft);
  color: var(--ek-warning);
}

.ek-badge-danger {
  background: var(--ek-danger-soft);
  color: var(--ek-danger);
}

.ek-nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border-radius: var(--ek-radius-sm);
  padding: 0.55rem 0.7rem;
  color: var(--ek-muted);
}

.ek-nav-link:hover {
  background: var(--ek-bg);
  color: var(--ek-ink);
}

.ek-nav-link.is-active {
  background: var(--ek-primary-soft);
  color: var(--ek-primary);
  font-weight: 600;
}

.ek-nav-icon {
  display: inline-flex;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  background: var(--ek-bg);
  color: inherit;
}

.ek-nav-link.is-active .ek-nav-icon {
  background: var(--ek-primary);
  color: #fff;
}

.ek-skeleton {
  border-radius: var(--ek-radius-sm);
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: ek-skeleton 1.2s ease-in-out infinite;
}

@keyframes ek-skeleton {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%) skewX(-12deg);
  }
  100% {
    transform: translateX(200%) skewX(-12deg);
  }
}

.animate-shimmer {
  animation: shimmer 3s infinite;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ek-only-desktop { display: none !important; }
.ek-only-mobile { display: inline-flex !important; }
@media (min-width: 1024px) {
  .ek-only-desktop { display: inline-flex !important; }
  .ek-only-mobile { display: none !important; }
}
