:root {
    --ink: #241c14;
    --paper: #f3ecdf;
    --panel: #fffaf3;
    --line: #d7cbb8;
    --muted: #6f6456;
    --open: #e06a16;
    --open-dark: #c45a10;
    --closed: #3a86b4;
    --closed-dark: #2f6f96;
    --navy: #1f2a36;
    --accent: #c45a10;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", "Trebuchet MS", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, #fff7ea 0, transparent 42%),
        linear-gradient(180deg, #efe4d2, var(--paper));
}

a { color: inherit; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 28px;
    background: var(--navy);
    color: #f7f1e6;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand strong { display: block; font-size: 17px; letter-spacing: .02em; }
.brand small { display: block; color: #c9b79a; font-size: 12px; }

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    background: var(--open);
    color: #fff;
    font-weight: 700;
    border-radius: 8px;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
}

.topnav a { text-decoration: none; color: #f7f1e6; }
.who { color: #c9b79a; padding-left: 8px; border-left: 1px solid #4a5563; }

.wrap {
    width: min(980px, calc(100% - 32px));
    margin: 28px auto 48px;
}

.wrap-login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    margin: 0 auto;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 18px;
}

h1 { margin: 0 0 6px; font-size: 28px; }
h2 { margin: 0 0 12px; font-size: 18px; }
.muted { margin: 0; color: var(--muted); }
.eyebrow { margin: 0 0 8px; text-transform: uppercase; letter-spacing: .12em; font-size: 11px; color: var(--open-dark); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border: 0;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
}

.btn-primary { background: var(--navy); color: #fff; }
.btn-accent { background: var(--open); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn-block { width: 100%; margin-top: 8px; }

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tabs a {
    text-decoration: none;
    padding: 7px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    font-size: 13px;
}

.tabs a.active {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
}

.job-list { display: grid; gap: 12px; }

.job-card, .ticket {
    display: block;
    text-decoration: none;
    border-radius: 12px;
    padding: 16px 18px;
    color: #fff;
    box-shadow: 0 8px 22px rgba(36, 28, 20, .12);
}

.job-card.is-open, .ticket.is-open { background: linear-gradient(135deg, var(--open), var(--open-dark)); }
.job-card.is-closed, .ticket.is-closed { background: linear-gradient(135deg, var(--closed), var(--closed-dark)); }

.job-meta, .ticket-top, .job-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    font-size: 13px;
}

.job-no { font-weight: 700; letter-spacing: .04em; }
.badge {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.2);
    font-size: 12px;
}

.job-text {
    margin: 10px 0;
    white-space: pre-wrap;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.45;
}

.job-foot { opacity: .92; }

.ticket { margin-bottom: 16px; }
.ticket-body {
    margin-top: 12px;
    font-size: 16px;
    line-height: 1.55;
    white-space: pre-wrap;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 16px;
}

label { display: block; font-weight: 600; margin: 12px 0 6px; }
label small { font-weight: 400; color: var(--muted); }

input[type="text"],
input[type="password"],
input[type="date"],
input[type="file"],
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}

textarea { resize: vertical; }
.hint { color: var(--muted); font-size: 13px; }

.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}
.file-list a { color: var(--closed-dark); font-weight: 600; }
.file-list .muted { margin-left: 8px; }
.files-title { font-size: 16px; margin: 20px 0 8px; }

.file-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin: 0 0 16px;
}
.file-shot {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.file-shot img {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    background: #f4f1ec;
}
.file-shot figcaption {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 13px;
}
.file-shot figcaption span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-gallery-edit .file-shot img { max-height: 180px; }

.file-drop {
    margin: 4px 0 12px;
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: 10px;
    background: #faf8f5;
    transition: border-color .15s ease, background .15s ease;
}
.file-drop.is-over,
.file-drop.is-pasted {
    border-color: var(--closed-dark);
    background: #eef6fb;
}
.file-drop-text { margin: 8px 0 4px; color: var(--muted); font-size: 14px; }
.file-drop kbd {
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid var(--line);
    border-bottom-width: 2px;
    border-radius: 4px;
    background: #fff;
    font-size: 12px;
}
.file-pending { list-style: none; margin: 10px 0 0; padding: 0; }
.file-pending li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-top: 1px solid var(--line);
    font-size: 14px;
}
.file-pending img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: #fff;
}
.file-pending .btn { margin-left: auto; }
.file-drop-msg { margin: 8px 0 0; font-size: 13px; color: #215c2a; }
.file-drop-msg.is-error { color: #8a2b16; }

.flash {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
}
.flash-ok { background: #dcefdc; color: #215c2a; }
.flash-err { background: #f8d8d0; color: #8a2b16; }

.empty {
    padding: 32px;
    text-align: center;
    background: var(--panel);
    border: 1px dashed var(--line);
    border-radius: 12px;
    color: var(--muted);
}

.login-card {
    display: grid;
    grid-template-columns: 12px 1fr;
    width: min(440px, calc(100% - 32px));
    background: var(--panel);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(36, 28, 20, .16);
}

.login-side { background: linear-gradient(180deg, var(--open), var(--closed)); }
.login-body { padding: 32px 28px 28px; }
.login-body h1 { margin-bottom: 8px; }

body.is-login { background: #1f2a36; }

@media (max-width: 720px) {
    .topbar, .page-head { flex-direction: column; align-items: flex-start; }
    .wrap { margin-top: 18px; }
}

.wrap { width: min(1180px, calc(100% - 32px)); }

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 16px;
}
.toolbar-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 140px;
}
.toolbar-field span {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}
.toolbar-search { flex: 1.4; min-width: 180px; }
.toolbar-durum { flex: 1.6; min-width: 220px; }
.toolbar-checks {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    min-height: 38px;
}
.check-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}
.check-inline input { width: auto; margin: 0; }
.assignee-progress { list-style: none; margin: 10px 0 0; padding: 0; }
.assignee-progress li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}
.assignee-progress .is-done strong { color: #215c2a; }
.assignee-box {
    display: grid;
    gap: 8px;
    max-height: 180px;
    overflow: auto;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.readonly-field {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f3eee6;
    color: var(--muted);
    font-weight: 600;
}
.toolbar-actions { padding-bottom: 1px; }
.toolbar select, .toolbar input[type="search"] {
    width: 100%;
    min-width: 0;
}

.table-wrap {
    overflow: auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
}
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
table.data th, table.data td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
table.data th { background: #f7efe3; font-size: 12px; color: var(--muted); }
table.data a { color: inherit; font-weight: 600; }
.nowrap { white-space: nowrap; }

.row-open td:first-child { box-shadow: inset 4px 0 0 var(--open); }
.row-closed td:first-child { box-shadow: inset 4px 0 0 var(--closed); }
.row-deleted td:first-child { box-shadow: inset 4px 0 0 #8a8175; }
.row-open { background: #fff6ee; }
.row-closed { background: #eef6fb; }
.row-deleted { background: #f3f1ee; color: #6a6258; }

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 14px;
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
form.inline { display: inline; }
button.linkish {
    background: none;
    border: 0;
    color: var(--closed-dark);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}
.ticket.is-deleted { background: linear-gradient(135deg, #8a8175, #6f675c); }
.msg-list { display: grid; gap: 10px; margin-bottom: 16px; }
.msg {
    padding: 12px 14px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--line);
}
.msg.mine { border-color: #e6c8a8; background: #fff8f0; }
.msg.other { background: #f4f8fb; }
.msg-meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 14px 0; }
label.check input { width: auto; }

@media (max-width: 720px) {
    .grid-2 { grid-template-columns: 1fr; }
}
