:root {
  --red: #d8141c; --red-dark: #a90f15; --red-soft: #fdecec;
  --ink: #17181b; --muted: #6a6e76; --line: #e4e5e9; --bg: #f5f5f7; --card: #fff;
  --ok: #17744a; --radius: 12px; --shadow: 0 1px 2px rgba(20,20,30,.05), 0 8px 24px rgba(20,20,30,.05);
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; line-height: 1.25; letter-spacing: -.01em; }
h2 { font-size: 17px; }
small { display: block; color: var(--muted); font-size: 12.5px; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 18px; letter-spacing: .04em; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

input, select, button { font: inherit; color: inherit; }
textarea { width: 100%; font: inherit; color: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; }
input:not([type=checkbox]), select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
input:disabled, select:disabled { background: var(--bg); color: var(--muted); }
input[type=checkbox] { accent-color: var(--red); width: 17px; height: 17px; flex: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-weight: 550; white-space: nowrap; }
.btn:hover { border-color: #c4c6cc; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); }
.btn.danger { color: var(--red); margin-right: auto; }
.btn.link { border: 0; background: none; color: var(--muted); margin-top: 12px; }
.btn.icon { padding: 8px; }
.ico { display: block; width: 26px; height: 26px; object-fit: contain; flex: none; user-select: none; }
.line-ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.form-error { color: var(--red); font-weight: 600; min-height: 4px; margin: 4px 0; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* Doküman üstbilgisindeki bilgi kutusu */
.docbox { margin: 0; border: 1px solid var(--line); border-top: 3px solid var(--red); border-radius: 8px; background: #fff; min-width: 270px; font-size: 13px; }
.docbox div { display: grid; grid-template-columns: 112px 1fr; border-bottom: 1px solid var(--line); }
.docbox div:last-child { border: 0; }
.docbox dt { padding: 6px 10px; color: var(--muted); border-right: 1px solid var(--line); }
.docbox dd { margin: 0; padding: 6px 10px; font-weight: 600; }

/* Giriş */
.auth { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; min-height: 100dvh; }
.auth-brand { background: var(--ink) linear-gradient(150deg, #17181b 60%, #3a1013); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: center; gap: 22px; border-right: 5px solid var(--red); }
.auth-brand h1 { font-size: 34px; }
.auth-brand p { color: #c9cbd0; max-width: 42ch; font-size: 17px; }
.logo-card { background: #fff; border-radius: var(--radius); padding: 18px 22px; align-self: flex-start; }
.logo-card img { display: block; width: min(320px, 62vw); height: auto; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-form > div { width: 100%; max-width: 360px; }
.auth-form .muted { margin: 4px 0 22px; }
.auth-form .actions .btn { width: 100%; padding: 11px; }

/* Kabuk */
.app { display: grid; grid-template-columns: 262px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--ink); color: #d6d8dd; padding: 0 10px 24px; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #3a3d44 var(--ink); }
.side .brand { display: block; background: #fff; margin: 0 -10px 12px; padding: 17px 20px; border-bottom: 4px solid var(--red); }
.side .brand:hover { background: #fff; }
.side .brand img { display: block; width: 100%; height: auto; }
.side h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: #858993; margin: 18px 10px 6px; }
.side a { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 8px; font-size: 14px; }
.side a:hover { background: #26282d; }
.side a.on { background: var(--red); color: #fff; }
.side a span { flex: 1; }
.side a b { display: grid; place-items: center; width: 32px; height: 32px; flex: none; background: #fff; border-radius: 9px; }
.side em { font-style: normal; font-size: 10.5px; color: #858993; }
.side a.on em { color: #fff; }
.top { display: flex; align-items: center; gap: 10px; padding: 10px 28px; background: #fff; border-bottom: 1px solid var(--line); }
.app-title { font-size: 19px; letter-spacing: -.01em; line-height: 1.25; min-width: 0; padding-left: 10px; border-left: 4px solid var(--red); }
.who { margin-left: auto; text-align: right; min-width: 0; }
.who small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.burger { display: none; }
.scrim { display: none; }
.page { padding: 28px; max-width: 1240px; margin: 0 auto; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; padding-bottom: 20px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; gap: 8px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--red); transform: translateY(-2px); }
.card p { font-size: 13.5px; color: var(--muted); flex: 1; }
.card-top { display: flex; justify-content: space-between; align-items: center; min-height: 24px; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); font-size: 12px; font-weight: 550; margin: 2px 4px 2px 0; }
.chip.live { background: #e7f5ee; border-color: #bfe3d0; color: var(--ok); }
.empty { text-align: center; padding: 56px 20px; background: #fff; border: 1px dashed #cfd1d7; border-radius: var(--radius); }
.empty .ico { width: 112px; height: 112px; margin: 0 auto 10px; }
.empty p { color: var(--muted); max-width: 52ch; margin: 6px auto 0; }

.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 9px 14px; border-bottom: 2px solid transparent; font-weight: 550; color: var(--muted); white-space: nowrap; }
.tabs a.on { color: var(--ink); border-color: var(--red); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stats div { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: 8px; padding: 12px 16px; }
.stats strong { display: block; font-size: 26px; line-height: 1.2; }
.stats span { font-size: 13px; color: var(--muted); }
.toolbar { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input { max-width: 340px; }

.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); }
table.list { width: 100%; border-collapse: collapse; }
.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 11px 14px; border-bottom: 2px solid var(--red); }
.list td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.list tr:last-child td { border: 0; }
.list tr.passive { color: var(--muted); background: #fafafa; }

.modal { width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); border: 0; border-top: 4px solid var(--red); border-radius: var(--radius); padding: 0 22px 20px; box-shadow: 0 24px 80px rgba(0,0,0,.3); }
.modal.wide { width: min(720px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(15,16,20,.5); }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; position: sticky; top: 0; background: #fff; }
.x { border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; padding: 4px 8px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; }
.roles { border: 1px solid var(--line); border-radius: 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; padding: 12px; margin: 0 0 12px; }
.roles legend { font-size: 13px; font-weight: 600; }
.roles label, .check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; font-size: 13.5px; }
.check { margin-bottom: 10px; }
table.perms { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.perms th { text-align: left; font-weight: 500; padding: 5px 0; border-bottom: 1px solid var(--line); }
.perms td { width: 190px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.perms select { padding: 6px 8px; }
.slip dl { display: grid; grid-template-columns: 110px 1fr; gap: 8px; background: var(--red-soft); padding: 14px; border-radius: 8px; }
.slip dt { color: var(--muted); }
.slip dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; user-select: all; }

#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 50; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 8px; max-width: 360px; box-shadow: var(--shadow); }
.toast.err { background: var(--red-dark); }

/* Bildirimler */
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #fff; font-style: normal; font-size: 11.5px; font-weight: 700; }
.count:empty { display: none; }
.side a .count { flex: none; border: 1px solid #fff; }
.tile-head .count { margin-left: auto; }
.report-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 20px; }
.report-type { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--red); border-radius: var(--radius); box-shadow: var(--shadow); }
.report-type:hover { border-color: var(--red); }
.report-type .ico { width: 46px; height: 46px; }
.report-type span { font-size: 13px; color: var(--muted); flex: 1; }
.chip.hot { background: var(--red-soft); border-color: #f6c4c6; color: var(--red-dark); }
.chip.warn, .chip.sev-1 { background: #fff6dc; border-color: #f5d77a; color: #7a5000; }
.chip.sev-0 { background: #e7f5ee; border-color: #bfe3d0; color: var(--ok); }
.chip.sev-2 { background: #ffe8d6; border-color: #ffc59a; color: #9a3d00; }
.chip.sev-3 { background: var(--red); border-color: var(--red); color: #fff; }
.badge { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; }
.list tr.unread td { background: #fff8f8; }
a.link { color: var(--red-dark); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
small.late { color: var(--red); font-weight: 600; }
.export { display: flex; gap: 8px; align-items: center; }
.export select { width: auto; }
.toolbar .check { margin: 0 auto 0 0; }
.foot { font-size: 13px; margin: 12px 0; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); max-width: 900px; margin-bottom: 16px; }
.panel h2 { margin-bottom: 12px; }
.panel h3 { font-size: 14px; margin: 6px 0 8px; }
.panel form > button.btn { margin-bottom: 16px; }
.note { background: #fffaeb; border: 1px solid #f5d77a; border-left: 5px solid #ffb300; border-radius: 8px; padding: 11px 14px; margin-bottom: 16px; font-size: 14px; }
.checks { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px 12px; }
.checks legend { font-size: 13px; font-weight: 600; }
.checks label { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; padding: 20px; background: var(--bg); border: 2px dashed #cfd1d7; border-radius: 18px; cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--red); background: var(--red-soft); }
.drop .ico { width: 44px; height: 44px; }
.drop:hover .ico, .drop.over .ico { animation: bounce 1.8s ease-in-out infinite; }
.thumbs { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.thumbs li { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; animation: tile-in .45s cubic-bezier(.2,1.25,.4,1) both; }
.thumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.thumbs span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.facts { margin: 0; }
.facts div { display: grid; grid-template-columns: 190px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.photos { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.photos img { width: 160px; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.deadlines { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.deadlines li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 9px 12px; border: 1px solid var(--line); border-left: 4px solid #ffb300; border-radius: 8px; }
.deadlines li.done { border-left-color: var(--ok); }
.deadlines li.late { border-left-color: var(--red); background: var(--red-soft); }
.action-row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1.4fr) 150px 140px 32px; gap: 6px; margin-bottom: 8px; align-items: center; }
.matrix td:not(:first-child), .matrix th:not(:first-child) { text-align: center; }

@media (max-width: 900px) {
  .facts div { grid-template-columns: 1fr; gap: 2px; }
  .action-row { grid-template-columns: 1fr 1fr; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .matrix td:not(:first-child) { text-align: left; }
  .matrix td:not(:first-child) input { margin-top: 4px; }
  .auth { grid-template-columns: 1fr; align-content: start; }
  .auth-brand { padding: 28px 20px; gap: 12px; border-right: 0; border-bottom: 5px solid var(--red); }
  .auth-brand h1 { font-size: 24px; }
  .auth-brand p { font-size: 14px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 20; width: 272px; left: 0; transform: translateX(-100%); visibility: hidden; transition: transform .2s, visibility .2s; }
  .menu-open .side { transform: none; visibility: visible; }
  .menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 15; }
  .burger { display: inline-flex; }
  .top { padding: 10px 16px; position: sticky; top: 0; z-index: 10; }
  .who { display: none; }
  .app-title { font-size: 13px; margin-right: auto; padding-left: 8px; border-left-width: 3px; }
  .page { padding: 18px 16px; }
  .docbox { width: 100%; min-width: 0; }
  .stats { grid-template-columns: 1fr; }
  .grid, .roles { grid-template-columns: 1fr; }
  .list thead { display: none; }
  .list tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .list td { display: block; border: 0; padding: 4px 14px; }
  .list td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; text-transform: uppercase; color: var(--muted); }
}

/* Günün Görevi */
.head > div:first-child { flex: 1 1 320px; min-width: 0; }
.task { display: flex; align-items: center; gap: 16px; max-width: 620px; margin-top: 16px; padding: 14px 18px; background: #fffaeb; border: 1px solid #f5d77a; border-left: 5px solid #ffb300; border-radius: var(--radius); box-shadow: var(--shadow); }
.task .ico { width: 56px; height: 56px; }
.task h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #8a5a00; }
.task p { font-size: 16px; font-weight: 650; margin: 2px 0 7px; }

/* Ana sayfa kutucukları */
.tiles { isolation: isolate; }
.tile-wrap { position: relative; display: grid; animation: tile-in .55s cubic-bezier(.2,1.25,.4,1) var(--d, 0ms) both; }
.tile-wrap::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 22px; background: conic-gradient(from 40deg, var(--red), #ff9bc0, #8b8fa3, var(--red)); filter: blur(16px); opacity: .14; animation: aura 6s ease-in-out infinite; }
.tile { --rx: 0deg; --ry: 0deg; position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 30px 50px -34px rgba(216,20,28,.55); transform: perspective(1100px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .25s ease-out, scale .3s cubic-bezier(.3,1.8,.5,1), border-color .15s; }
.tile:hover { border-color: var(--red); scale: 1.02; }
.tile:active { scale: .97; }
.tile-head { display: flex; align-items: center; gap: 12px; }
.tile p { font-size: 13.5px; color: var(--muted); flex: 1; }
.tile-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.doc-tags { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.doc-tags span { background: var(--red); color: #fff; border-radius: 5px; padding: 2px 6px; font-size: 10.5px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.tile-foot .chip { margin: 0; white-space: nowrap; }
.tile-ico { position: relative; display: grid; place-items: center; width: 54px; height: 54px; flex: none; }
.tile-ico .ico { position: relative; width: 54px; height: 54px; filter: drop-shadow(0 9px 9px rgba(120,10,15,.28)); }
.tile-ico i { position: absolute; width: 46px; height: 46px; border-radius: 50%; border: 2px solid rgba(216,20,28,.75); opacity: 0; pointer-events: none; }
.tile:hover .tile-ico i { animation: ring 3.6s ease-out infinite; }
.tile:hover .tile-ico i:nth-child(2) { animation-delay: 1.2s; }
.tile:hover .tile-ico i:nth-child(3) { animation-delay: 2.4s; }
.tile:hover .tile-ico .ico { animation: bounce 1.8s ease-in-out infinite; }
@keyframes tile-in { from { opacity: 0; translate: 0 24px; } to { opacity: 1; translate: 0 0; } }
@keyframes aura { 0%, 100% { opacity: .1; } 50% { opacity: .26; } }
@keyframes bounce { 0%, 100% { translate: 0 0; scale: 1; } 50% { translate: 0 -6px; scale: 1.08; } }
@keyframes ring { from { transform: scale(.6); opacity: .85; } to { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .tile-wrap, .tile-wrap::before, .tile:hover .tile-ico i, .tile:hover .tile-ico .ico { animation: none; }
  .tile { transform: none; transition: border-color .15s; }
  .tile:hover, .tile:active { scale: 1; }
}

@media print {
  body > #app, #toasts, .modal header, .modal .actions { display: none; }
  .modal { box-shadow: none; border: 1px solid #000; }
  .modal::backdrop { background: none; }
}
