:root {
  --bg: #05060b;
  --surface: #0f1221;
  --surface-2: #161b30;
  --border: #252b48;
  --text: #f5f7ff;
  --muted: #9ea8c6;
  --amber: #e879f9;
  --cyan: #22d3ee;
  --violet: #8b5cf6;
  --green: #22c55e;
  --red: #ef4444;
  --radius: 14px;
}

.brand-logo-img {
  height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.container {
  width: min(1240px, 94%);
  margin: 0 auto;
}

.topbar {
  background: rgba(11, 15, 24, 0.92);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.nav-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  gap: 14px;
  flex-wrap: wrap;
}

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

.brand-title {
  display: block;
  font-family: "Syne", ui-sans-serif, "Segoe UI Variable Display", sans-serif;
  font-weight: 800;
  letter-spacing: 0.16em;
  font-size: 1.12rem;
  background: linear-gradient(95deg, #ffffff 0%, #e4e8f5 55%, #c4b5fd 82%, #67e8f9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-sub {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--amber);
}

.top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--text);
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--violet), var(--amber));
  color: #05060b;
  font-weight: 700;
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--cyan);
}

.btn-sm {
  padding: 5px 9px;
  font-size: 0.78rem;
}

.btn-danger {
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.main-content {
  padding: 28px 0 56px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

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

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.kpi-highlight {
  border-color: rgba(34, 197, 94, 0.45);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.08), var(--surface));
}

.kpi-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.kpi-card strong {
  display: block;
  font-size: 1.65rem;
  margin-bottom: 4px;
}

.kpi-card small {
  color: var(--muted);
  font-size: 0.8rem;
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar input {
  flex: 1;
  min-width: 220px;
}

input, select {
  background: #0a0e17;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  padding: 9px 12px;
  font: inherit;
  font-size: 0.88rem;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--cyan);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

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

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.order-project {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.profit-pos {
  color: var(--green);
  font-weight: 700;
}

.profit-neg {
  color: var(--red);
  font-weight: 700;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.8);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 40;
}

.modal[hidden] {
  display: none;
}

.modal-card {
  width: min(760px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.6rem;
  cursor: pointer;
}

.order-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--muted);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.cost-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(10, 14, 23, 0.55);
}

.cost-box legend {
  padding: 0 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--amber);
}

.calc-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.86rem;
}

.calc-summary span {
  color: var(--muted);
}

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

@media (max-width: 900px) {
  .kpi-grid, .grid-4, .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 580px) {
  .kpi-grid, .grid-4, .grid-3, .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Auth Gate */
.login-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 20% 20%, rgba(34, 211, 238, 0.08), transparent 45%),
              radial-gradient(circle at 80% 80%, rgba(232, 121, 249, 0.08), transparent 45%),
              var(--bg);
}

.login-gate[hidden] {
  display: none;
}

.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

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

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

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--muted);
}

.login-btn {
  width: 100%;
  padding: 11px 16px;
  margin-top: 4px;
}

.form-error {
  color: #fca5a5;
  font-size: 0.84rem;
  min-height: 1.2em;
}

.panel-notice {
  color: var(--cyan);
  font-size: 0.84rem;
  margin-bottom: 10px;
  min-height: 1.2em;
}

textarea {
  background: #0a0e17;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  padding: 9px 12px;
  font: inherit;
  font-size: 0.88rem;
  resize: vertical;
}

textarea:focus {
  outline: none;
  border-color: var(--cyan);
}

.badge-source {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}

.badge-showcase {
  background: rgba(34, 211, 238, 0.14);
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.35);
}

.badge-panel {
  background: rgba(139, 92, 246, 0.14);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.file-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.file-chip:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.attach-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attach-box[hidden] {
  display: none;
}

.attach-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--cyan);
}

.attach-meta {
  font-weight: 500;
  color: var(--muted);
}

.attach-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ref-preview-wrap {
  margin-top: 4px;
}

.ref-preview-wrap[hidden] {
  display: none;
}

.attach-thumb {
  max-width: 100%;
  max-height: 220px;
  border-radius: 10px;
  border: 1px solid var(--border);
  object-fit: contain;
  background: #070910;
}

/* Vitrin Bakım Modu Kontrol Çubuğu */
.maint-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
}

.maint-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.maint-title {
  font-weight: 700;
  font-size: 0.92rem;
}

.maint-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.maint-off {
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.maint-on {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.maint-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 260px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.maint-controls input {
  flex: 1;
  min-width: 200px;
  max-width: 440px;
}
