/**
 * SCOP — Reusable component styles (theme token’larını kullanır)
 */

/* ── App shell ───────────────────────────────────────────── */

.app {
  height: 100%;
  overflow: hidden;
  background: var(--color-workspace);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: var(--font-normal);
  line-height: var(--line-height-body);
}

/* ── Typography utilities ────────────────────────────────── */

.mono,
.gtip-code,
.ref-code,
.mono-value {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: -0.01em;
}

.declaration-preview {
  font-family: var(--font-document);
  font-size: 8px;
  line-height: var(--line-height-document);
  color: #111111;
}

.label {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
}

.card-title {
  font-size: var(--text-md);
  font-weight: var(--font-weight-semibold);
}

h1,
.page-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.02em;
}

h2,
.section-title {
  font-size: 18px;
  font-weight: var(--font-weight-semibold);
}

/* ── Buttons ─────────────────────────────────────────────── */

.btn {
  height: var(--btn-height);
  padding: 0 var(--btn-padding-x);
  border-radius: var(--radius-sm);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
  font-family: inherit;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.btn-primary {
  background: var(--color-brand-primary);
  color: var(--color-on-brand);
  box-shadow: var(--shadow-blue-glow);
}

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

.btn-primary:active:not(:disabled) {
  background: var(--color-brand-deep);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text-primary);
  border-color: var(--color-border-light);
  box-shadow: none;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-surface-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  box-shadow: none;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--color-surface-muted);
  color: var(--color-text-primary);
}

.btn:disabled,
.btn-disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
  border-color: transparent;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* ── Sidebar items ───────────────────────────────────────── */

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text-dark-secondary);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-decoration: none;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  border-left: 3px solid transparent;
  transition: background 160ms ease, color 160ms ease;
}

.sidebar-item:hover:not(.is-disabled) {
  background: var(--color-sidebar-item-hover);
  color: var(--color-text-dark-primary);
}

.sidebar-item.active,
.sidebar-item.is-active {
  color: var(--color-text-dark-primary);
  background: var(--color-sidebar-item-active-bg);
  border-left-color: var(--color-brand-primary);
}

.sidebar-item.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.sidebar-section-label,
.nav-group-label {
  color: var(--color-sidebar-section-label);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Status badges ───────────────────────────────────────── */

.badge,
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--badge-height);
  padding: 0 10px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1;
}

.badge--processing,
.badge-status--processing {
  color: var(--badge-processing-color);
  background: var(--badge-processing-bg);
  border-color: var(--badge-processing-border);
}

.badge--waiting-docs,
.badge-status--waiting-docs {
  color: var(--badge-waiting-docs-color);
  background: var(--badge-waiting-docs-bg);
  border-color: var(--badge-waiting-docs-border);
}

.badge--review,
.badge-status--review {
  color: var(--badge-review-color);
  background: var(--badge-review-bg);
  border-color: var(--badge-review-border);
}

.badge--completed,
.badge-status--success,
.badge-status--completed {
  color: var(--badge-completed-color);
  background: var(--badge-completed-bg);
  border-color: var(--badge-completed-border);
}

.badge--draft,
.badge-status--draft {
  color: var(--badge-draft-color);
  background: var(--badge-draft-bg);
  border-color: var(--badge-draft-border);
}

.badge--gtip-vergi,
.badge-status--gtip-vergi,
.badge-status--purple {
  color: var(--badge-gtip-vergi-color);
  background: var(--badge-gtip-vergi-bg);
  border-color: var(--badge-gtip-vergi-border);
}

.badge--declaration-ready,
.badge-status--declaration-ready {
  color: var(--badge-declaration-ready-color);
  background: var(--badge-declaration-ready-bg);
  border-color: var(--badge-declaration-ready-border);
}

.badge--error,
.badge-status--error {
  color: var(--color-error);
  background: var(--color-red-soft);
  border-color: #fecaca;
}

/* ── Cards ───────────────────────────────────────────────── */

.card,
.table-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

/* ── Tables ──────────────────────────────────────────────── */

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

.table thead,
.cases-table thead {
  background: var(--color-surface-muted);
}

.table th,
.cases-table th {
  height: var(--table-header-height);
  padding: 0 14px;
  text-align: left;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border-light);
}

.table td,
.cases-table td {
  height: var(--table-row-height);
  padding: 0 14px;
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}

.table tbody tr:hover td,
.cases-table tbody tr:hover td {
  background: var(--color-surface-muted);
}

.table tbody tr.selected td,
.cases-table tbody tr.selected td {
  background: var(--color-selected-row);
}

.table tbody tr.empty-row:hover td,
.cases-table tbody tr.empty-row:hover td {
  background: transparent;
}

/* ── Inputs ──────────────────────────────────────────────── */

.input,
.search-input {
  height: var(--input-height);
  padding: 0 12px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-base);
  font-family: inherit;
  background: var(--color-surface);
  color: var(--color-text-primary);
}

.input::placeholder,
.search-input::placeholder {
  color: var(--color-text-muted);
}

.input:focus,
.search-input:focus {
  outline: none;
  border-color: var(--color-brand-primary);
  box-shadow: var(--focus-ring);
}

/* ── Detail panel ────────────────────────────────────────── */

.detail-panel {
  width: var(--panel-width);
  background: var(--color-surface);
  border-left: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-panel);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.detail-panel-header {
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--color-border-light);
}

.detail-panel-content {
  padding: 16px 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.detail-panel-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--color-border-light);
  background: var(--color-surface);
}

/* ── Dark modal / glass (menşe, AI odak ekranları) ───────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: 100;
}

.dark-modal {
  background: linear-gradient(180deg, var(--color-dark-panel) 0%, var(--color-sidebar-end) 100%);
  color: var(--color-text-dark-primary);
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
}

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

.dark-input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--color-border-dark);
  color: var(--color-text-dark-primary);
  border-radius: var(--radius-sm);
  height: var(--input-height);
  padding: 0 12px;
  font-family: inherit;
}

.dark-glass-panel {
  background: var(--color-dark-glass);
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-md);
  color: var(--color-text-dark-primary);
  backdrop-filter: blur(12px);
}
