/* Roboto — self-hosted (bkz. softawarestandarts.md > "Font Standardı", CDN kullanılmaz) */
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../vendor/roboto/roboto-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../vendor/roboto/roboto-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #101828;
  --ink-muted: #667085;
  --ink-faint: #98a2b3;
  --border: #e4e7ec;
  --border-soft: #eef1f5;
  --surface: #ffffff;
  --canvas: #f9f8f6;
  --primary: #4338ca;
  --primary-hover: #3730a3;
  --primary-soft: #eef2ff;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 4px 10px -2px rgba(16, 24, 40, .08), 0 2px 4px -2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 10px 24px -6px rgba(16, 24, 40, .1), 0 4px 8px -4px rgba(16, 24, 40, .06);
  --radius-sm: .6rem;
  --radius-md: .85rem;
  --radius-lg: 1rem;

  /* Global Renk Paleti alias'ları (bkz. softawarestandarts.md) — bu projenin
     kendi marka renklerini (indigo --primary vb.) korur, sadece standarttaki
     ortak değişken adlarına eşler. */
  --surface-page: var(--canvas);
  --surface-card: var(--surface);
  --surface-hover: var(--border-soft);
  --text-primary: var(--ink);
  --text-secondary: var(--ink-muted);
  --text-muted: var(--ink-faint);
  --border-strong: #d0d5dd;
  --primary-subtle: var(--primary-soft);
  --status-good: #067647;
  --status-warning: #b54708;
  --status-serious: #b54708;
  --status-critical: #b42318;
}

:root[data-theme="dark"] {
  --ink: #f5f5f4;
  --ink-muted: #a3a5ab;
  --ink-faint: #71727a;
  --border: #2c2c2e;
  --border-soft: #232326;
  --border-strong: #3a3a3d;
  --surface: #1a1a1c;
  --canvas: #0d0d0e;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-soft: #23233a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f5f5f4;
    --ink-muted: #a3a5ab;
    --ink-faint: #71727a;
    --border: #2c2c2e;
    --border-soft: #232326;
    --border-strong: #3a3a3d;
    --surface: #1a1a1c;
    --canvas: #0d0d0e;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --primary-soft: #23233a;
  }
}

body {
  background: var(--surface-page);
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--text-primary);
  overflow-x: hidden;
  font-size: .945rem;
}

a { text-decoration: none; color: var(--text-primary); }
a:hover { text-decoration: underline; }

/* Bootstrap bileşenlerinin dark modda da doğru renklerle görünmesi
   (bkz. softawarestandarts.md > "Dark Mode Standardı") */
.dropdown-menu {
  background-color: var(--surface-card);
  border-color: var(--border);
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
}
.dropdown-item { color: var(--text-primary); }
.dropdown-item:hover, .dropdown-item:focus { background-color: var(--surface-hover); color: var(--text-primary); }
.dropdown-divider { border-color: var(--border); }
.btn-link { color: var(--primary); }
.bg-light { background-color: var(--surface-hover) !important; }

/* Centered, max-width page column — keeps content from stretching edge-to-edge
   on wide screens while staying fully fluid (with side padding) on phones. */
.page-shell {
  max-width: 1000px;
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}
@media (max-width: 575.98px) {
  .page-shell { padding-left: 1rem; padding-right: 1rem; }
}

h1, h2, h3, .fw-bold { letter-spacing: -.015em; }
h1.h4, .h4 { font-weight: 700; }
.text-muted { color: var(--ink-muted) !important; }

::selection { background: var(--primary-soft); color: var(--primary-hover); }

/* ---- App Shell Fixed Layout Standardı (navbar + sidebar sabit) --------- */

:root {
  --topbar-height: 56px;
  --sidebar-width: 220px;
  --sidebar-width-collapsed: 64px;
}

.brand-badge {
  width: 32px; height: 32px; border-radius: .6rem;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
  box-shadow: var(--shadow-xs);
  flex: none;
}

.app-navbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-height);
  z-index: 1030;
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: stretch;
}
.navbar-brand-slot {
  width: var(--sidebar-width);
  display: flex; align-items: center; gap: .5rem; padding: 0 1rem;
  border-right: 1px solid var(--border);
  flex: none;
  transition: width .2s ease;
  overflow: hidden; white-space: nowrap;
}
.app-shell.sidebar-collapsed .navbar-brand-slot { width: var(--sidebar-width-collapsed); padding: 0 .6rem; }
.navbar-brand-slot .brand-mini { display: none; }
.app-shell.sidebar-collapsed .navbar-brand-slot .brand-full { display: none; }
.app-shell.sidebar-collapsed .navbar-brand-slot .brand-mini { display: inline-flex; }
.navbar-right { margin-left: auto; display: flex; align-items: center; gap: .6rem; padding: 0 1.25rem; }
.navbar-hamburger { display: none; border: none; background: none; font-size: 1.2rem; color: var(--ink); padding: 0 1rem; }

.app-sidebar {
  position: fixed; top: var(--topbar-height); left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--surface); border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 1025;
  transition: width .2s ease;
  display: flex; flex-direction: column;
}
.app-shell.sidebar-collapsed .app-sidebar { width: var(--sidebar-width-collapsed); }

.sidebar-nav { flex: 1 1 auto; padding: .75rem 0; list-style: none; margin: 0; }
.sidebar-nav .nav-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem 1.1rem; color: var(--ink-muted); font-size: .87rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; border-radius: 0;
}
.sidebar-nav .nav-link i { width: 1.1rem; text-align: center; flex: none; font-size: .95rem; }
.sidebar-nav .nav-link:hover { background: var(--border-soft); color: var(--ink); text-decoration: none; }
.sidebar-nav .nav-link.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.app-shell.sidebar-collapsed .sidebar-nav .nav-link .label { display: none; }
.app-shell.sidebar-collapsed .sidebar-nav .nav-link { justify-content: center; padding: .6rem; }

.sidebar-version {
  margin-top: auto; border-top: 1px solid var(--border-soft);
  padding: .6rem 1.1rem; font-size: .72rem; color: var(--ink-faint);
}
.app-shell.sidebar-collapsed .sidebar-version { padding: .6rem; text-align: center; font-size: .65rem; }

.sidebar-toggle-btn {
  position: fixed; top: calc(var(--topbar-height) / 2); left: var(--sidebar-width);
  transform: translate(-50%, -50%);
  width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-muted);
  align-items: center; justify-content: center; font-size: .7rem;
  z-index: 1035; cursor: pointer; transition: left .2s ease; padding: 0;
}
.app-shell.sidebar-collapsed .sidebar-toggle-btn { left: var(--sidebar-width-collapsed); }

.app-content { margin-left: var(--sidebar-width); padding-top: var(--topbar-height); transition: margin-left .2s ease; }
.app-shell.sidebar-collapsed .app-content { margin-left: var(--sidebar-width-collapsed); }

@media (max-width: 991.98px) {
  .app-sidebar { display: none; }
  .app-content { margin-left: 0 !important; }
  .navbar-brand-slot { width: auto; border-right: none; }
  .sidebar-toggle-btn { display: none !important; }
  .app-shell.sidebar-mobile-open .app-sidebar { display: flex; width: 240px; z-index: 1040; }
  .app-shell.sidebar-mobile-open .sidebar-nav .nav-link { justify-content: flex-start; padding: .6rem 1.1rem; }
  .app-shell.sidebar-mobile-open .sidebar-nav .nav-link .label { display: inline; }
  .app-shell.sidebar-mobile-open .sidebar-version { text-align: left; font-size: .72rem; padding: .6rem 1.1rem; }
  .navbar-hamburger { display: inline-flex !important; align-items: center; }
}

/* ---- Auth shell ---------------------------------------------------------- */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--canvas);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-lg);
}

/* ---- Cards ---------------------------------------------------------------- */

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  box-shadow: none;
  height: 100%;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.kpi-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); border-color: var(--border); }
.kpi-value { font-size: 1.65rem; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.kpi-label {
  font-size: .68rem; font-weight: 700; letter-spacing: .05em;
  color: var(--ink-faint); text-transform: uppercase;
}
.kpi-icon-corner {
  width: 30px; height: 30px; border-radius: .5rem;
  background: var(--border-soft); color: var(--ink-faint);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; flex: none;
}

.card-block {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: none;
}

/* Plain section: groups related content by spacing/label only, no card
   chrome — use instead of .card-block when nesting inside another card
   would just double up borders. */
.section-plain { padding: 0; }

/* Nested bordered box used for empty-states / list wells inside a card-block */
.well-box {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--canvas);
  padding: 1rem;
}

/* ---- Badges ---------------------------------------------------------------- */

.badge {
  font-weight: 600;
  font-size: .74rem;
  letter-spacing: .01em;
  padding: .32rem .6rem;
  border-radius: .4rem;
}
.badge-soft-green { background: #ecfdf3; color: #067647; }
.badge-soft-gray { background: #f2f4f7; color: #344054; }
.badge-soft-blue { background: #eef4ff; color: #3538cd; }
.badge-soft-orange { background: #fffaeb; color: #b54708; }
.badge-soft-red { background: #fef3f2; color: #b42318; }

/* Small colored icon badge used before metric labels (Geciken bakım, Yaklaşan, ...) */
.icon-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: .55rem;
  font-size: .9rem; flex: none;
}
.icon-badge-orange { background: #fffaeb; color: #b54708; }
.icon-badge-blue { background: #eef4ff; color: #3538cd; }
.icon-badge-green { background: #ecfdf3; color: #067647; }
.icon-badge-gray { background: var(--border-soft); color: var(--ink-muted); }
.icon-badge-red { background: #fef3f2; color: #b42318; }

.hygiene-label {
  font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  color: var(--ink-faint); text-transform: uppercase;
}
.hygiene-chip {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .4rem .8rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--ink-muted); font-size: .82rem; font-weight: 500;
  text-decoration: none; transition: box-shadow .12s ease, border-color .12s ease, color .12s ease;
}
.hygiene-chip i { font-size: .85rem; }
.hygiene-chip:hover { box-shadow: var(--shadow-xs); color: var(--ink); border-color: #d0d5dd; }
.hygiene-chip.is-active { background: #fffaeb; border-color: #fedf89; color: #b54708; }
.hygiene-chip.is-active:hover { color: #93370d; border-color: #fec84b; }

.metric-box {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: .9rem 1rem;
  background: var(--surface);
}
.metric-box .label { display: flex; align-items: center; gap: .5rem; color: var(--ink-muted); font-size: .84rem; margin-bottom: .4rem; }
.metric-box .value { font-size: 1.4rem; font-weight: 700; color: var(--ink); }

/* ---- Buttons ---------------------------------------------------------------- */

.btn {
  border-radius: .6rem;
  font-weight: 500;
  font-size: .88rem;
  padding: .5rem 1rem;
  transition: box-shadow .12s ease, transform .05s ease, background-color .12s ease, border-color .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-lg { border-radius: .75rem; padding: .8rem 1.4rem; font-weight: 600; font-size: .95rem; }
.btn-sm { border-radius: .5rem; font-size: .82rem; }
.btn-primary { background: var(--primary); border-color: var(--primary); box-shadow: var(--shadow-xs); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-primary:focus, .btn-primary:focus-visible { box-shadow: 0 0 0 3px rgba(67, 56, 202, .18); }
.btn-outline-secondary { color: var(--ink-muted); border-color: var(--border); }
.btn-outline-secondary:hover { color: var(--ink); background: var(--border-soft); border-color: var(--border); }
.btn-outline-danger { font-weight: 500; }

/* Plain-text cancel action in modal footers (no border/background) */
.btn-cancel-link {
  background: none; border: none; color: var(--ink);
  font-weight: 500; font-size: .88rem; padding: .5rem .25rem;
}
.btn-cancel-link:hover { color: var(--ink-muted); }

.action-link {
  display: inline-flex; align-items: center; gap: .55rem;
  color: var(--ink-muted); text-decoration: none; font-size: .89rem; font-weight: 500;
}
.action-link .icon-badge { background: var(--border-soft); color: var(--ink-muted); }
.action-link:hover { color: var(--ink); }

/* ---- Modals ---------------------------------------------------------------- */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(16, 24, 40, .55);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1050;
  padding: 1rem;
}
.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}
.modal-box.wide { max-width: 680px; }

/* ---- Empty states ---------------------------------------------------------- */

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--ink-muted);
}
.empty-state .icon {
  width: 56px; height: 56px; line-height: 56px;
  border-radius: 50%; background: var(--border-soft);
  font-size: 1.4rem; margin: 0 auto .75rem;
  display: flex; align-items: center; justify-content: center;
}
.empty-state h2, .empty-state h3 { color: var(--ink); font-weight: 700; }

/* ---- Misc ---------------------------------------------------------------- */

code.token-code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  background: var(--border-soft);
  color: var(--ink);
  padding: .15rem .4rem;
  border-radius: .35rem;
  font-size: .85em;
}

.progress { height: 8px; border-radius: 999px; background: var(--border-soft); }
.progress-bar { background-color: var(--primary); }
.bg-success { background-color: #17b26a !important; }

.tab-bar { border-bottom: 1px solid var(--border); }
.tab-bar .nav-link { color: var(--ink-muted); font-weight: 500; padding-bottom: .6rem; border-bottom: 2px solid transparent; }
.tab-bar .nav-link.active { color: var(--ink); font-weight: 700; border-bottom: 2px solid var(--primary); }

/* Search + filter pills (list toolbars) */
.search-pill { position: relative; }
.search-pill .search-icon {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  color: var(--ink-faint); pointer-events: none; font-size: .95rem;
}
.search-pill input {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .7rem 1rem .7rem 2.6rem;
  width: 100%;
  background: var(--surface);
  font-size: .9rem;
}
.search-pill input:focus { border-color: #a5b4fc; box-shadow: 0 0 0 3px var(--primary-soft); outline: none; }

.filter-select {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .5rem 2rem .5rem 1rem;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E") no-repeat right 1rem center;
  appearance: none; -webkit-appearance: none;
  font-size: .86rem;
  color: var(--ink);
  width: 100%;
}
.filter-select:focus { border-color: #a5b4fc; box-shadow: 0 0 0 3px var(--primary-soft); outline: none; }

/* List rows (Demirbaşlar, etc.) */
.list-row {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}
.list-row:hover { box-shadow: var(--shadow-md); border-color: var(--border); color: inherit; transform: translateY(-1px); }
.list-row .icon-box {
  width: 40px; height: 40px; border-radius: .7rem;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; flex: none;
}
.list-row .title { font-weight: 600; color: var(--ink); }
.list-row .subtitle { color: var(--ink-faint); font-size: .84rem; }

/* Tablo üstü filtre/araç çubuğu (bkz. softawarestandarts.md > "Tablo Üstü Filtre/Araç Çubuğu") */
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.table-toolbar .filters { display: flex; gap: 8px; flex-wrap: nowrap; flex: 1; min-width: 220px; max-width: 420px; }
.table-toolbar .filters .form-control { flex: 1 1 auto; min-width: 0; }

/* Table polish */
.table { color: var(--ink); font-size: .89rem; }
.table > thead > tr > th {
  color: var(--ink-faint); font-weight: 600; font-size: .75rem;
  text-transform: uppercase; letter-spacing: .04em;
  border-bottom-width: 1px; border-color: var(--border);
  padding-bottom: .65rem;
}
.table > tbody > tr > td { border-color: var(--border-soft); vertical-align: middle; }

/* Form controls */
.form-control, .form-select {
  border-color: var(--border);
  border-radius: .55rem;
  font-size: .89rem;
  background-color: var(--surface);
  color: var(--ink);
}
.form-control:focus, .form-select:focus {
  border-color: #a5b4fc;
  box-shadow: 0 0 0 3px var(--primary-soft);
  background-color: var(--surface);
  color: var(--ink);
}
.form-label { font-weight: 500; font-size: .87rem; color: var(--ink); margin-bottom: .35rem; }
.form-text { color: var(--ink-faint); font-size: .8rem; }
