/* ============================================================
   GeoSaha — Tasarım sistemi (temel)
   Kaynak: docs/design-handoff/geosaha/styles.css, birebir kopya (app/src/stiller/temel.css ile aynı). Elle düzenlenmez; paket güncellenince yeniden kopyalanır.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans+Condensed:wght@500;600;700&display=swap');

/* ---------- TOKENS: LIGHT (default) ---------- */
:root,
[data-theme="light"] {
  --bg:            #EEF0F2;
  --bg-grid:       #E4E7EA;
  --surface:       #FFFFFF;
  --surface-2:     #F6F7F8;
  --surface-3:     #EDEFF1;
  --inset:         #F1F3F5;
  --border:        #D9DDE1;
  --border-strong: #C2C8CE;
  --text:          #14181C;
  --text-2:        #4B535B;
  --text-3:        #828B93;

  --accent:        #E0531F;
  --accent-press:  #BD3F12;
  --accent-soft:   #FBE7DD;
  --accent-ink:    #8A2E0C;

  --ok:            #1F8A4C;
  --ok-soft:       #E0F0E6;
  --warn:          #C77A0A;
  --warn-soft:     #F8ECD6;
  --danger:        #C5341F;
  --danger-soft:   #F7E2DE;
  --info:          #1E63B8;
  --info-soft:     #E1ECF8;

  /* makine grupları */
  --grp-delici:    #5B6770;
  --grp-rock:      #E0531F;
  --grp-beton:     #1E63B8;
  --grp-fore:      #1F8A4C;
  --grp-delici-soft: #E7EAEC;
  --grp-rock-soft:   #FBE7DD;
  --grp-beton-soft:  #E1ECF8;
  --grp-fore-soft:   #E0F0E6;

  --shadow-sm: 0 1px 2px rgba(20,24,28,.06);
  --shadow:    0 2px 8px rgba(20,24,28,.08), 0 1px 2px rgba(20,24,28,.06);
  --shadow-lg: 0 12px 40px rgba(20,24,28,.16);
  --overlay:   rgba(20,24,28,.42);
}

/* ---------- TOKENS: DARK ---------- */
[data-theme="dark"] {
  --bg:            #0C0F12;
  --bg-grid:       #14181D;
  --surface:       #15191E;
  --surface-2:     #1B2026;
  --surface-3:     #222931;
  --inset:         #0F1317;
  --border:        #2A313A;
  --border-strong: #3A434E;
  --text:          #EEF1F4;
  --text-2:        #A7B0B9;
  --text-3:        #6C757F;

  --accent:        #FF6A35;
  --accent-press:  #E0531F;
  --accent-soft:   #3A1F12;
  --accent-ink:    #FFB494;

  --ok:            #3BC272;
  --ok-soft:       #16291E;
  --warn:          #E2A33B;
  --warn-soft:     #2C2412;
  --danger:        #F26350;
  --danger-soft:   #2E1714;
  --info:          #4D94EC;
  --info-soft:     #122334;

  --grp-delici:    #8A949D;
  --grp-rock:      #FF6A35;
  --grp-beton:     #4D94EC;
  --grp-fore:      #3BC272;
  --grp-delici-soft: #1E242B;
  --grp-rock-soft:   #2E1A11;
  --grp-beton-soft:  #122334;
  --grp-fore-soft:   #11241A;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow:    0 2px 10px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.4);
  --shadow-lg: 0 16px 50px rgba(0,0,0,.6);
  --overlay:   rgba(0,0,0,.6);
}

/* ---------- RESET ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
#root { height: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; appearance: none; -webkit-appearance: none; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }

/* scrollbars */
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; border: 3px solid var(--bg); }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- TYPE HELPERS ---------- */
.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.cond { font-family: 'IBM Plex Sans Condensed', 'IBM Plex Sans', sans-serif; }
.kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-3);
}
.label {
  font-size: 11.5px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-2);
}
.u { text-transform: uppercase; letter-spacing: .02em; }

/* ---------- LAYOUT PRIMITIVES ---------- */
.app { height: 100%; display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.gap-6 { gap: 6px; } .gap-10 { gap: 10px; } .gap-14 { gap: 14px; } .gap-18 { gap: 18px; }
.gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.grow { flex: 1; } .wrap { flex-wrap: wrap; }

/* ============================================================
   COMPONENTS
   ============================================================ */

/* ---- Card ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: 13px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text);
  display: flex; align-items: center; gap: 9px;
}

/* ---- Buttons ---- */
.btn {
  appearance: none; -webkit-appearance: none;
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border-radius: 6px;
  font-size: 13px; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  transition: background .12s, border-color .12s, transform .05s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--accent); border-color: var(--accent);
  color: #fff; box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--accent-press); border-color: var(--accent-press); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12px; }
.btn-icon { width: 40px; height: 40px; padding: 0; justify-content: center; }
.btn-icon.btn-sm { width: 32px; height: 32px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---- Badge / chip ---- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase;
  font-family: 'IBM Plex Mono', monospace;
}
.badge-dot::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.badge-ok     { background: var(--ok-soft); color: var(--ok); }
.badge-warn   { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info   { background: var(--info-soft); color: var(--info); }
.badge-accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge-mute   { background: var(--surface-3); color: var(--text-2); }

/* ---- Inputs ---- */
.field { display: flex; flex-direction: column; gap: 6px; }
.input, .select, textarea.input {
  height: 42px; padding: 0 13px;
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text); font-size: 15px;
  transition: border-color .12s, box-shadow .12s, background .12s;
  width: 100%;
}
textarea.input { height: auto; padding: 11px 13px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface);
}
.input.auto { background: var(--surface-3); color: var(--text-2); border-style: dashed; }
.input.err { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' stroke='%23828B93' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 32px;
}
.input-hint { font-size: 12px; color: var(--text-3); }
.input-hint.err { color: var(--danger); }

/* ---- Table ---- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; padding: 11px 14px;
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-3);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap; user-select: none;
}
.tbl th.sortable { cursor: pointer; }
.tbl th.sortable:hover { color: var(--text); }
.tbl th .sort-ar { opacity: .4; margin-left: 5px; }
.tbl th.active .sort-ar { opacity: 1; color: var(--accent); }
.tbl td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text); vertical-align: middle;
}
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr.clk { cursor: pointer; }
.tbl .num { font-family: 'IBM Plex Mono', monospace; text-align: right; }
.tbl-wrap { overflow: auto; border-radius: 8px; }

/* ---- Progress ---- */
.bar { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); }
.tab {
  padding: 11px 16px; font-size: 12.5px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-3); border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: color .12s, border-color .12s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- Toast ---- */
.toast-wrap {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.toast {
  display: flex; align-items: center; gap: 11px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: 7px; padding: 13px 17px; box-shadow: var(--shadow-lg);
  font-size: 13.5px; min-width: 280px; max-width: 460px;
  animation: toastIn .26s cubic-bezier(.2,.7,.3,1);
}
.toast.ok { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--warn); }
.toast.danger { border-left-color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }

/* ---- Modal ---- */
.modal-bg {
  position: fixed; inset: 0; background: var(--overlay);
  z-index: 150; display: flex; align-items: center; justify-content: center;
  padding: 28px; animation: fade .18s;
}
.modal {
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: 88vh; overflow: hidden;
  display: flex; flex-direction: column;
  animation: modalIn .22s cubic-bezier(.2,.7,.3,1);
}
@keyframes fade { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* ---- misc ---- */
.divider { height: 1px; background: var(--border); }
.vdivider { width: 1px; background: var(--border); align-self: stretch; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fade-in { animation: fadeUp .34s cubic-bezier(.2,.7,.3,1); }
@keyframes fadeUp { from { transform: translateY(10px); } }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
