/* =====================================================================
   MADEN ARAMA · GÖREVLENDİRME SİSTEMİ
   Tema: Endüstriyel / Mineral
   Yazı: Archivo (başlık) · IBM Plex Sans (gövde) · IBM Plex Mono (kod)
   ===================================================================== */

:root {
  /* Yüzeyler */
  --ink:        #1c2027;   /* ana metin */
  --ink-soft:   #5b6470;
  --ink-faint:  #8a93a0;
  --paper:      #f3efe7;   /* sıcak kâğıt/kaya zemin */
  --paper-2:    #ece7dc;
  --surface:    #ffffff;
  --line:       #e2dccf;   /* ince çizgiler */
  --line-2:     #d3ccbd;

  /* Koyu menü (slate/charcoal) */
  --slate:      #14181f;
  --slate-2:    #1c222c;
  --slate-3:    #283040;
  --slate-line: #2c333f;

  /* Bakır vurgu (copper / ore) */
  --copper:     #c06a35;
  --copper-2:   #a8551f;
  --copper-soft:#f4e6da;

  /* İkincil – patina/oksitlenmiş bakır */
  --patina:     #2f7d75;
  --patina-soft:#dcefec;

  /* Durum renkleri */
  --green:      #2f8f5b;
  --amber:      #c98a1e;
  --red:        #c2452f;
  --green-soft: #dcefe2;
  --amber-soft: #f6ecd6;
  --red-soft:   #f6dfda;

  --radius:     10px;
  --radius-sm:  7px;
  --shadow:     0 1px 2px rgba(20,24,31,.04), 0 8px 24px -12px rgba(20,24,31,.18);
  --shadow-lg:  0 18px 48px -18px rgba(20,24,31,.35);

  --sidebar-w:  256px;
  --font-body:  'IBM Plex Sans', system-ui, sans-serif;
  --font-head:  'Archivo', system-ui, sans-serif;
  --font-mono:  'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Hafif kâğıt dokusu */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: .4;
  z-index: 0;
  background-image: radial-gradient(rgba(20,24,31,.025) 1px, transparent 1px);
  background-size: 4px 4px;
}

h1,h2,h3,h4,h5,h6 { font-family: var(--font-head); letter-spacing: -.01em; color: var(--ink); }
a { color: var(--copper-2); text-decoration: none; }
a:hover { color: var(--copper); }
.mono { font-family: var(--font-mono); }

/* =====================================================================
   YERLEŞİM
   ===================================================================== */
.layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--slate);
  color: #c9d0db;
  display: flex; flex-direction: column;
  position: fixed; inset: 0 auto 0 0;
  z-index: 1040;
  border-right: 1px solid var(--slate-line);
}
.sidebar-brand {
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--slate-line);
  display: flex; align-items: center; gap: 12px;
}
.brand-mark {
  width: 38px; height: 38px; flex-shrink: 0;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--copper), var(--copper-2));
  color: #fff; border-radius: 9px;
  font-family: var(--font-head); font-weight: 800; font-size: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}
.brand-text strong {
  display: block; color: #fff; font-family: var(--font-head);
  font-weight: 700; font-size: 14px; letter-spacing: .02em; line-height: 1.1;
}
.brand-text span { font-size: 11px; color: var(--ink-faint); letter-spacing: .14em; text-transform: uppercase; }

.nav-section {
  padding: 16px 14px 4px;
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: #6b7585;
}
.sidebar-nav { padding: 6px 12px; overflow-y: auto; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin: 2px 0;
  border-radius: 8px;
  color: #b3bcc9; font-weight: 500; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.nav-link:hover { background: var(--slate-2); color: #fff; }
.nav-link.active {
  background: linear-gradient(90deg, rgba(192,106,53,.18), rgba(192,106,53,.04));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--copper);
}
.nav-link.active svg { opacity: 1; color: var(--copper); }

.sidebar-foot {
  border-top: 1px solid var(--slate-line);
  padding: 14px;
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 8px; background: var(--slate-2);
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center; font-family: var(--font-head);
  font-weight: 700; color: var(--slate); background: var(--copper-soft);
}
.user-chip .uname { color: #fff; font-size: 12.5px; font-weight: 600; line-height: 1.1; }
.user-chip .urole { color: var(--ink-faint); font-size: 11px; text-transform: capitalize; }

/* ---- İçerik ---- */
.content {
  margin-left: var(--sidebar-w);
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
}
.topbar {
  height: 64px;
  background: rgba(243,239,231,.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px;
  padding: 0 26px;
  position: sticky; top: 0; z-index: 1030;
}
.topbar .page-title { font-size: 19px; font-weight: 700; margin: 0; }
.topbar .page-sub { font-size: 12px; color: var(--ink-soft); margin: 0; }
.topbar-spacer { flex: 1; }
.hamburger { display: none; background: none; border: 0; color: var(--ink); padding: 6px; cursor: pointer; }

.page { padding: 26px; flex: 1; }

/* =====================================================================
   KARTLAR
   ===================================================================== */
.card-ore {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-ore .card-ore-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
.card-ore .card-ore-head h2,
.card-ore .card-ore-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.card-ore .card-ore-body { padding: 20px; }

/* İstatistik kartları */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: ""; position: absolute; right: -20px; top: -20px;
  width: 90px; height: 90px; border-radius: 50%;
  background: var(--copper-soft); opacity: .55;
}
.stat-card .stat-ico {
  width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center;
  background: var(--slate); color: var(--copper); margin-bottom: 14px; position: relative; z-index: 1;
}
.stat-card .stat-ico svg { width: 20px; height: 20px; }
.stat-card .stat-val { font-family: var(--font-head); font-size: 30px; font-weight: 800; line-height: 1; position: relative; z-index: 1; }
.stat-card .stat-lbl { color: var(--ink-soft); font-size: 12.5px; margin-top: 6px; position: relative; z-index: 1; }

/* =====================================================================
   ROZETLER
   ===================================================================== */
.badge-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 100px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
}
.badge-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-active  { background: var(--green-soft); color: var(--green); }
.badge-passive { background: var(--paper-2); color: var(--ink-soft); }
.badge-leave   { background: var(--amber-soft); color: var(--amber); }

.code-chip {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  background: var(--slate); color: #e7c9b1;
  padding: 3px 8px; border-radius: 6px; white-space: nowrap;
}
.tag-pill {
  display: inline-block; padding: 2px 9px; border-radius: 100px;
  background: var(--patina-soft); color: var(--patina);
  font-size: 11.5px; font-weight: 600;
}

/* =====================================================================
   BUTONLAR (Bootstrap override)
   ===================================================================== */
.btn { font-weight: 600; border-radius: var(--radius-sm); font-size: 13.5px; padding: 8px 15px; }
.btn-copper { background: var(--copper); border-color: var(--copper); color: #fff; }
.btn-copper:hover { background: var(--copper-2); border-color: var(--copper-2); color: #fff; }
.btn-slate { background: var(--slate); border-color: var(--slate); color: #fff; }
.btn-slate:hover { background: var(--slate-3); border-color: var(--slate-3); color: #fff; }
.btn-outline-slate { border: 1px solid var(--line-2); color: var(--ink); background: var(--surface); }
.btn-outline-slate:hover { background: var(--paper-2); color: var(--ink); }
.btn-ghost-danger { color: var(--red); background: transparent; border: 1px solid transparent; }
.btn-ghost-danger:hover { background: var(--red-soft); color: var(--red); }
.btn-icon { padding: 6px 9px; line-height: 1; }
.btn-icon svg { width: 16px; height: 16px; vertical-align: -3px; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }

/* =====================================================================
   FORMLAR
   ===================================================================== */
.form-label { font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.form-control, .form-select {
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  font-size: 13.5px; padding: 9px 12px; background: var(--surface); color: var(--ink);
}
.form-control:focus, .form-select:focus {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(192,106,53,.15);
}
.form-control::placeholder { color: var(--ink-faint); }
.form-text { font-size: 11.5px; color: var(--ink-soft); }

/* =====================================================================
   TABLOLAR + DATATABLES
   ===================================================================== */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table.dataTable { width: 100% !important; border-collapse: collapse; margin: 0 !important; }
table.dataTable thead th {
  background: var(--paper-2);
  font-family: var(--font-head);
  font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line-2) !important;
  padding: 12px 16px; white-space: nowrap;
}
table.dataTable tbody td {
  padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13.5px;
}
table.dataTable tbody tr:hover { background: var(--paper); }
table.dataTable tbody tr:last-child td { border-bottom: 0; }

/* DataTables üst/alt kontrolleri */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 7px 11px; font-size: 13px; background: var(--surface);
}
.dataTables_wrapper .dataTables_filter input:focus { outline: none; border-color: var(--copper); box-shadow: 0 0 0 3px rgba(192,106,53,.15); }
.dataTables_wrapper .dataTables_info { font-size: 12.5px; color: var(--ink-soft); padding-top: 14px; }
.dataTables_wrapper .dataTables_paginate { padding-top: 10px; }
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--slate) !important; color: #fff !important; border: 0 !important; border-radius: 6px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border: 0 !important; border-radius: 6px; font-size: 13px; padding: 5px 11px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover { background: var(--paper-2) !important; color: var(--ink) !important; }

/* DataTables üst araç çubuğu (length + filter + buttons) */
.dt-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.dt-toolbar .spacer { flex: 1; }
div.dt-buttons { display: inline-flex; gap: 8px; }
button.dt-button, div.dt-button {
  background: var(--patina) !important; color: #fff !important;
  border: 0 !important; border-radius: var(--radius-sm) !important;
  font-family: var(--font-body) !important; font-weight: 600 !important;
  font-size: 13px !important; padding: 8px 14px !important; margin: 0 !important;
}
button.dt-button:hover { background: #266860 !important; }

/* ColReorder taşıma göstergesi */
table.dataTable thead th { cursor: move; }
.DTCR_pointer { background: var(--copper) !important; }

/* Satır eylem butonları */
.row-actions { display: inline-flex; gap: 4px; }

/* =====================================================================
   MODAL
   ===================================================================== */
.modal-content { border: 0; border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-header { background: var(--slate); color: #fff; border: 0; padding: 16px 22px; }
.modal-header .modal-title { font-size: 16px; font-weight: 700; }
.modal-header .btn-close { filter: invert(1) grayscale(1) brightness(2); opacity: .7; }
.modal-body { padding: 22px; }
.modal-footer { border-top: 1px solid var(--line); padding: 14px 22px; }

/* =====================================================================
   GİRİŞ SAYFASI
   ===================================================================== */
.login-screen {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
  background: var(--paper);
}
.login-aside {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 80% at 80% -10%, rgba(192,106,53,.35), transparent 60%),
    linear-gradient(160deg, var(--slate-2), var(--slate));
  color: #fff; padding: 56px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.login-aside::after {
  content: ""; position: absolute; inset: 0; opacity: .12;
  background-image:
    repeating-linear-gradient(45deg, #fff 0 1px, transparent 1px 22px);
}
.login-aside .la-top, .login-aside .la-bottom { position: relative; z-index: 1; }
.login-aside h1 { color: #fff; font-size: 40px; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.login-aside p { color: #aeb7c4; max-width: 36ch; }
.login-aside .strata {
  display: flex; flex-direction: column; gap: 6px; margin-top: 28px;
}
.login-aside .strata span { height: 10px; border-radius: 3px; }
.login-main { display: grid; place-items: center; padding: 40px; }
.login-card { width: 100%; max-width: 380px; }
.login-card .brand-mark { width: 52px; height: 52px; font-size: 24px; border-radius: 12px; margin-bottom: 22px; }
.login-card h2 { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.login-card .sub { color: var(--ink-soft); margin-bottom: 26px; }

/* =====================================================================
   PUANTAJ (Gantt + liste)
   ===================================================================== */
.puantaj-shell { display: grid; grid-template-columns: 250px 1fr; gap: 0; }
.puantaj-names { border-right: 1px solid var(--line); background: var(--surface); }
.puantaj-names .pn-head { height: 46px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; padding: 0 16px; background: var(--paper-2); font-family: var(--font-head); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.puantaj-names .pn-row { height: 44px; display: flex; align-items: center; padding: 0 16px; border-bottom: 1px solid var(--line); gap: 10px; }
.puantaj-names .pn-row:hover { background: var(--paper); }
.pn-row .pn-name { font-weight: 600; font-size: 13px; }
.pn-row .pn-unit { font-size: 11px; color: var(--ink-faint); }

.puantaj-grid-wrap { overflow-x: auto; }
.puantaj-grid { position: relative; }
.pg-head { display: flex; height: 46px; background: var(--paper-2); border-bottom: 1px solid var(--line-2); }
.pg-day {
  width: 34px; flex-shrink: 0; border-right: 1px solid var(--line);
  display: grid; place-items: center; text-align: center;
  font-size: 11px; font-family: var(--font-mono); color: var(--ink-soft);
}
.pg-day.weekend { background: rgba(192,106,53,.06); }
.pg-day small { display: block; font-size: 9px; color: var(--ink-faint); text-transform: uppercase; }
.pg-row { display: flex; height: 44px; border-bottom: 1px solid var(--line); position: relative; }
.pg-cell { width: 34px; flex-shrink: 0; border-right: 1px solid var(--line); }
.pg-cell.weekend { background: rgba(192,106,53,.05); }
.pg-bar {
  position: absolute; height: 26px; top: 9px;
  border-radius: 6px; display: flex; align-items: center;
  padding: 0 10px; color: #fff; font-size: 11.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2); cursor: default;
}
/* Proje renk paleti (mod ile döner) */
.pg-bar.c0 { background: linear-gradient(135deg,#c06a35,#a8551f); }
.pg-bar.c1 { background: linear-gradient(135deg,#2f7d75,#266860); }
.pg-bar.c2 { background: linear-gradient(135deg,#46618f,#33496e); }
.pg-bar.c3 { background: linear-gradient(135deg,#8a6d3b,#6f5527); }
.pg-bar.c4 { background: linear-gradient(135deg,#8f4a63,#6f3a4e); }
.pg-bar.c5 { background: linear-gradient(135deg,#5d7c3a,#47602b); }

.puantaj-legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--line); }
.puantaj-legend .lg { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-soft); }
.puantaj-legend .lg i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.puantaj-legend .lg i.lg-c0 { background: #c06a35; }
.puantaj-legend .lg i.lg-c1 { background: #2f7d75; }
.puantaj-legend .lg i.lg-c2 { background: #46618f; }
.puantaj-legend .lg i.lg-c3 { background: #8a6d3b; }
.puantaj-legend .lg i.lg-c4 { background: #8f4a63; }
.puantaj-legend .lg i.lg-c5 { background: #5d7c3a; }

/* Liste görünümü tarih çubuğu */
.range-pill { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 12px; background: var(--paper-2); border: 1px solid var(--line); padding: 3px 10px; border-radius: 100px; }

/* =====================================================================
   YARDIMCI
   ===================================================================== */
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.fw-7 { font-weight: 700; }
.toolbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }
.section-divider { height: 1px; background: var(--line); margin: 24px 0; border: 0; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--ink-soft); }
.empty-state svg { width: 46px; height: 46px; opacity: .35; margin-bottom: 12px; }

/* Form alanı geçersizken */
.is-invalid, .form-control.is-invalid, .form-select.is-invalid { border-color: var(--red) !important; }
.invalid-feedback { color: var(--red); font-size: 12px; }

/* Toast / flash */
.flash-area { position: fixed; top: 18px; right: 18px; z-index: 1080; display: flex; flex-direction: column; gap: 10px; }
.flash {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--copper);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  padding: 12px 16px; min-width: 260px; font-size: 13.5px; animation: flashin .25s ease;
}
.flash.ok { border-left-color: var(--green); }
.flash.err { border-left-color: var(--red); }
@keyframes flashin { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: none; }
  .content { margin-left: 0; }
  .hamburger { display: inline-flex; }
  .login-screen { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .puantaj-shell { grid-template-columns: 150px 1fr; }
}
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(20,24,31,.45); z-index: 1039; }
.sidebar-backdrop.show { display: block; }
