/* MedikalStok - temel tasarim (development/style.css V1+V2 birlesimi) */
:root {
  --yesil: #17685d;
  --yesil-koyu: #125e55;
  --yesil-acik: #168773;
  --yesil-marka: #239a83;
  --murekkep: #143d38;
  --metin: #193c38;
  --soluk: #64736d;
  --soluk-2: #68796f;
  --krem: #f7f3e9;
  --krem-acik: #faf8f3;
  --kart: #fffdfa;
  --kenar: #e8e5dc;
  --kenar-2: #eae5d9;
  --girdi-kenar: #d6ddd5;
  --hata: #c0392b;
  --hata-zemin: #fdecea;
  --basari: #1e8a5a;
  --uyari-zemin: #fff1d9;
  --odak: #d09a42;
  --gol-kart: 0 3px 8px #66583b12;
  --yazi: system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(ellipse at 85% 0, #fff0d2 0, transparent 40%), var(--krem);
  color: var(--murekkep);
  font: 16px/1.45 var(--yazi);
}

h1, h2, h3, p { margin: 0 0 12px; }
a { color: inherit; text-decoration: none; }
.muted, small { color: var(--soluk); }
.demo { font-size: 12px; color: var(--soluk-2); }
[hidden] { display: none !important; }

/* ---------- Yan menu ---------- */
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  background: linear-gradient(150deg, #fffdf7, #f2eee4);
  padding: 24px 15px;
  border-right: 1px solid #e4e3da;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
aside h2 { font-size: 24px; letter-spacing: -1px; color: #132c29; white-space: nowrap; margin: 0; }
.brandmark { color: var(--yesil-marka); font-size: 35px; vertical-align: middle; }
aside > small { font-size: 11px; margin-left: 8px; }

nav { margin-top: 24px; }
nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 16px;
  font-weight: 550;
  min-height: 49px;
  padding: 12px 14px;
  margin: 5px 0;
  border-radius: 12px;
}
nav a:hover { background: var(--yesil); color: #fff; }
nav a.active {
  background: linear-gradient(110deg, var(--yesil-acik), var(--yesil-koyu));
  color: #fff;
  box-shadow: 0 3px 8px #17685d22;
}
nav svg, .support svg { width: 25px; height: 25px; flex-shrink: 0; }

.support {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #e5ebe4;
  border-radius: 16px;
}
.support small { display: block; }

/* ---------- Ana alan ve ust cubuk ---------- */
main { margin-left: 248px; padding: 20px 26px; max-width: 1900px; }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  min-height: 48px;
}
.company, .profile {
  background: var(--kart);
  border: 1px solid #e8e4da;
  padding: 10px 16px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.profile svg, .date-label svg { width: 20px; height: 20px; }
.avatar {
  border-radius: 50%;
  background: var(--yesil);
  color: #fff;
  padding: 12px;
  font-weight: 700;
}

/* ---------- Karsilama alani ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, #f9f4e8 30%, #f9f4e800 75%),
    url('../img/landscape.svg') right center / auto 100% no-repeat,
    #f9f4e8;
  padding: 22px 24px;
  border-radius: 20px;
  margin-bottom: 18px;
}
.hero h1 { font-size: 32px; letter-spacing: -.8px; margin-bottom: 5px; }
.hero p { font-size: 16px; margin-bottom: 12px; }
.hero input {
  background: #fffefa;
  border-radius: 30px;
  padding: 16px 22px;
  box-shadow: 0 3px 10px #775d2414;
}
.date-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  background: #fffdf5e8;
  border-radius: 24px;
  padding: 7px 12px;
  width: max-content;
  margin-top: 5px;
}

/* ---------- Izgara ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dashboard-grid .card { min-width: 0; }

/* ---------- Buyuk islem kartlari ---------- */
.actions { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 12px; margin-bottom: 16px; }
.action-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 90px;
  padding: 15px 18px;
  border-radius: 17px;
  color: #fff;
  text-align: left;
  font-weight: 700;
  border: 1px solid #ffffff45;
  box-shadow: inset 0 1px 0 #ffffff50, 0 4px 9px #23453515;
  cursor: pointer;
}
.action-tile.green  { background: linear-gradient(155deg, #59b87d, #137854); }
.action-tile.blue   { background: linear-gradient(155deg, #4da6ef, #075bbd); }
.action-tile.purple { background: linear-gradient(155deg, #c17ae7, #7628b5); }
.action-tile.orange { background: linear-gradient(155deg, #ffb24d, #d86b10); }
.action-tile svg { width: 42px; height: 42px; flex-shrink: 0; }
.action-tile span { flex: 1; }
.action-tile b { font-size: 19px; display: block; line-height: 1.2; }
.action-tile small { display: block; color: #fff; font-size: 13px; font-weight: 400; margin-top: 5px; }
.action-tile i { font-size: 29px; font-style: normal; }

/* ---------- Kart ve ozet kutulari ---------- */
.card {
  background: var(--kart);
  border: 1px solid var(--kenar-2);
  border-radius: 19px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--gol-kart);
}
.metrics { grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 12px; margin-bottom: 16px; }
.metrics .card {
  background: radial-gradient(ellipse at bottom right, #e0efe0 0, transparent 55%), var(--kart);
  padding: 17px 20px;
  margin-bottom: 0;
}
.metrics h2 { font-size: 26px; margin: 6px 0 0; }

.more-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.more-links a, .links a {
  display: inline-block;
  padding: 12px 16px;
  min-height: 44px;
  background: #e8eee5;
  border: 1px solid #dce4d9;
  border-radius: 12px;
  font-weight: 600;
}
.links a { margin: 4px; }

/* ---------- Cubuk grafik, halka, ilerleme ---------- */
.bars { display: flex; align-items: end; height: 150px; gap: 16px; }
.bars div {
  flex: 1;
  background: linear-gradient(#71c7b2, #2b9c8e);
  border-radius: 8px 8px 0 0;
  text-align: center;
  padding-top: 8px;
  color: #123e36;
  font-weight: 600;
  font-size: 13px;
  transform-origin: bottom;
}
.bars.expiry div:first-child { background: linear-gradient(#ffcc85, #ed9d45); }
.distribution { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut {
  width: 150px; height: 150px; border-radius: 50%;
  background: conic-gradient(#269d8a 0 80%, #47a5e8 80%);
  display: grid; place-items: center;
}
.donut b {
  display: grid; place-content: center; text-align: center;
  background: var(--kart); width: 100px; height: 100px; border-radius: 50%; font-size: 25px;
}
.donut small { font-size: 13px; }
progress { width: 100%; accent-color: #399b88; }

/* ---------- Dugme ---------- */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 13px;
  background: var(--yesil);
  color: #fff;
  padding: 12px 18px;
  min-height: 46px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
button.secondary, .btn.secondary { background: #e9eee6; color: #24534b; }
button.danger, .btn.danger { background: var(--hata); }
button:disabled, .btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }

/* ---------- Form ---------- */
input, select, textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--girdi-kenar);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  font: inherit;
  color: inherit;
}
textarea { min-height: 96px; resize: vertical; }
label { display: block; font-weight: 600; }
label input, label select, label textarea { margin-top: 6px; font-weight: 400; }
.field { margin-bottom: 14px; }
.field-error, .alan-hata { display: none; color: var(--hata); font-size: 13px; font-weight: 500; margin-top: 5px; }
.has-error input, .has-error select, .has-error textarea, input.is-invalid, select.is-invalid, textarea.is-invalid {
  border-color: var(--hata);
  box-shadow: 0 0 0 1px var(--hata);
}
.has-error .field-error, .has-error .alan-hata { display: block; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; margin: 0 8px 0 0; accent-color: var(--yesil); }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--odak);
  outline-offset: 2px;
}

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 15px; }
.toolbar input { flex: 1; min-width: 180px; border-radius: 26px; min-height: 48px; }

.notice { padding: 12px; background: var(--uyari-zemin); border-radius: 10px; margin: 12px 0; }
.notice.hata { background: var(--hata-zemin); color: #7d241a; }
.notice.basari { background: #e3f4ea; color: #145a3a; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; background: #e5f1e9; color: #14584a; font-size: 13px; font-weight: 600; }
.badge.uyari { background: #fff0d4; color: #8a5a10; }
.badge.hata { background: var(--hata-zemin); color: #8d2a1e; }

/* ---------- Tablo ---------- */
.tablewrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th, td { border-bottom: 1px solid #ebece5; }
th { padding: 13px 10px; font-size: 14px; background: #f0ede4; color: #40584e; }
td { padding: 15px 12px; }
tbody tr:nth-child(even) { background: #faf8f2; }
tbody tr:hover { background: #eef5eb; }

/* ---------- Dialog ---------- */
dialog {
  border: 1px solid #ddd;
  border-radius: 20px;
  width: min(760px, 94vw);
  max-height: 90vh;
  overflow: auto;
  padding: 24px;
  color: inherit;
  background: var(--kart);
}
dialog::backdrop { background: #203d3866; }

footer { padding: 10px 0; }

/* ---------- Bildirim (toast) ---------- */
.toast-kap {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--kart);
  border: 1px solid var(--kenar);
  border-left: 5px solid var(--yesil);
  border-radius: 14px;
  box-shadow: 0 8px 22px #2a3f3524;
  font-weight: 550;
}
.toast.hata { border-left-color: var(--hata); }
.toast.uyari { border-left-color: var(--odak); }

/* ---------- Dugme gostergesi ve onay isareti ---------- */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid #ffffff66;
  border-top-color: #fff;
  border-radius: 50%;
}
.secondary .spinner { border-color: #24534b44; border-top-color: #24534b; }
.onay-isareti { width: 56px; height: 56px; display: block; }
.onay-isareti circle { fill: #e3f4ea; stroke: none; }
.onay-isareti path { fill: none; stroke: var(--basari); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
button .onay-isareti { width: 20px; height: 20px; }
button .onay-isareti circle { fill: none; }
button .onay-isareti path { stroke: #fff; stroke-width: 5; }

.gorunmez-metin { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Duyarli ---------- */
@media (max-width: 1000px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .actions { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}
@media (max-width: 760px) {
  aside { position: static; width: auto; display: block; padding: 12px; }
  nav { display: flex; overflow: auto; margin-top: 8px; }
  nav a { white-space: nowrap; }
  .support { display: none; }
  main { margin: 0; padding: 14px; }
  header { flex-wrap: wrap; }
  .hero h1 { font-size: 25px; }
  .actions { grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); }
  .action-tile { padding: 12px; gap: 8px; }
  .action-tile svg { width: 30px; height: 30px; }
  .action-tile b { font-size: 16px; }
}
