* { box-sizing: border-box; }

:root {
    --brand: #c8102e;
    --brand-dark: #96141f;
    --brand-soft: #fdeef0;
    --ink: #1f2937;
    --ink-soft: #374151;
    --text: #23272f;
    --text-light: #6b7280;
    --border: #e3e5e9;
    --bg: #f3f4f6;
    --ok: #059669;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 18px; }

/* ===== GİRİŞ EKRANI ===== */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        repeating-linear-gradient(120deg, rgba(255,255,255,0.04) 0 2px, transparent 2px 22px),
        linear-gradient(115deg, #6d0f14 0%, #a3121f 45%, #c8102e 75%, #8e1418 100%);
}

.login-card {
    background: white;
    border-radius: 18px;
    padding: 32px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.35);
}

.login-card .l-logo { text-align: center; margin-bottom: 18px; }

.login-card .l-logo img { height: 62px; }

.login-card h2 { margin: 0 0 4px; font-size: 20px; text-align: center; color: var(--ink); }

.login-card .l-sub { text-align: center; color: var(--text-light); font-size: 13px; margin: 0 0 22px; }

.fld { margin-bottom: 13px; }

.fld label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 5px; }

.fld input {
    width: 100%;
    padding: 12px 13px;
    border: 1.5px solid var(--border);
    border-radius: 9px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
}

.fld input:focus { border-color: var(--brand); }

.btn-login {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 10px;
    background: var(--brand);
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    margin-top: 6px;
}

.btn-login:hover { background: var(--brand-dark); }

.login-err { background: #fdeef0; border: 1px solid #f3b6bc; color: var(--brand-dark); font-size: 13px; padding: 10px 13px; border-radius: 8px; margin-bottom: 13px; display: none; }

.demo-box { margin-top: 20px; border-top: 1px dashed var(--border); padding-top: 14px; }

.demo-box h5 { margin: 0 0 8px; font-size: 12px; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.6px; }

.demo-user {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid transparent;
}

.demo-user:hover { background: var(--brand-soft); border-color: rgba(200,16,46,0.2); }

.demo-user b { color: var(--ink); }

.demo-user span { color: var(--text-light); font-size: 12px; }

.back-link { display: block; text-align: center; margin-top: 16px; font-size: 12.5px; color: var(--text-light); text-decoration: none; }

.back-link:hover { color: var(--brand); }

/* ===== UST BAR ===== */
.topbar {
    background: white;
    border-bottom: 1px solid var(--border);
    border-top: 4px solid var(--brand);
}

.topbar .container { display: flex; align-items: center; gap: 16px; padding-top: 10px; padding-bottom: 10px; }

.topbar .logo { height: 46px; }

.topbar .who { margin-left: auto; text-align: right; }

.topbar .who b { display: block; font-size: 14.5px; color: var(--ink); }

.dept-badge {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    color: white;
    margin-top: 2px;
}

.btn-logout {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 9px;
    padding: 8px 15px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-light);
    cursor: pointer;
    font-family: inherit;
}

.btn-logout:hover { border-color: var(--brand); color: var(--brand); }

/* ===== İSTATİSTİK ===== */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 22px 0; }

.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
}

.stat-card b { display: block; font-size: 24px; color: var(--ink); letter-spacing: -0.5px; }

.stat-card span { font-size: 12.5px; color: var(--text-light); }

.stat-card.accent { border-left: 4px solid var(--brand); }
.stat-card.green { border-left: 4px solid var(--ok); }
.stat-card.red { border-left: 4px solid var(--brand-dark); }
.stat-card.dark { border-left: 4px solid var(--ink); }

/* ===== KARTLAR / FORMLAR ===== */
.panel-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 6px 18px rgba(31,41,55,0.05);
}

.panel-card h3 { margin: 0 0 4px; font-size: 18px; color: var(--ink); }

.panel-card h3::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--brand);
    border-radius: 2px;
    margin-top: 8px;
}

.panel-card .p-sub { margin: 10px 0 18px; font-size: 13px; color: var(--text-light); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }

select {
    width: 100%;
    padding: 11px 12px;
    border: 1.5px solid var(--border);
    border-radius: 9px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background: white;
}

select:focus { border-color: var(--brand); }

.check-line { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-soft); }

.check-line input { accent-color: var(--brand); width: 16px; height: 16px; }

/* Yükleme */
.upload-zone {
    border: 2px dashed #cfd4db;
    border-radius: 12px;
    padding: 26px 18px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafbfc;
    margin-bottom: 12px;
}

.upload-zone:hover, .upload-zone.dragover { border-color: var(--brand); background: var(--brand-soft); }

.upload-zone b { display: block; font-size: 15px; color: var(--ink); margin-bottom: 4px; }

.upload-zone span { font-size: 12.5px; color: var(--text-light); }

.file-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }

.file-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #f5f6f8;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 12.5px;
    color: var(--ink-soft);
}

.file-chip button { background: none; border: none; color: var(--brand); cursor: pointer; font-weight: 800; font-size: 13px; padding: 0; }

/* Fiyat kutusu */
.price-box {
    background: var(--ink);
    border-top: 4px solid var(--brand);
    border-radius: 12px;
    padding: 18px 20px;
    color: white;
    margin: 16px 0;
}

.price-box .pb-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 5px 0; color: #c7ccd4; }

.price-box .pb-row b { color: white; }

.price-box .pb-total { border-top: 1px solid #38404c; margin-top: 8px; padding-top: 12px; font-size: 16px; font-weight: 800; display: flex; justify-content: space-between; }

.price-box .pb-total b { color: #ff8f99; font-size: 22px; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    border: none;
    transition: all 0.2s;
}

.btn-red { background: var(--brand); color: white; }
.btn-red:hover { background: var(--brand-dark); }
.btn-green { background: var(--ok); color: white; }
.btn-green:hover { background: #047857; }
.btn-ghost { background: white; border: 1.5px solid var(--border); color: var(--text-light); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }

/* ===== FİLTRELER + TABLO ===== */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }

.fbtn {
    padding: 8px 15px;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    background: white;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-light);
    cursor: pointer;
    font-family: inherit;
}

.fbtn.active { background: var(--ink); border-color: var(--ink); color: white; }

.filters select { width: auto; padding: 8px 12px; font-size: 12.5px; margin-left: auto; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }

table { width: 100%; border-collapse: collapse; background: white; min-width: 900px; }

th {
    text-align: left;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    padding: 12px 14px;
    background: #fafafa;
    border-bottom: 1px solid var(--border);
}

td { padding: 12px 14px; border-bottom: 1px solid #f0f1f3; font-size: 13.5px; vertical-align: middle; }

tr:last-child td { border-bottom: none; }

td .muted { color: var(--text-light); font-size: 12px; }

.status-badge { font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; display: inline-block; }

.st-pending { background: #fff8e6; color: #8a6116; border: 1px solid #f3d487; }
.st-approved { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.st-rejected { background: #fdeef0; color: var(--brand-dark); border: 1px solid #f3b6bc; }
.st-translating { background: #e8effd; color: #1d4ed8; border: 1px solid #b9cdf5; }
.st-done { background: #eef0f3; color: var(--ink); border: 1px solid #d7dae0; }

.tbl-actions { display: flex; gap: 6px; }

.btn-tbl {
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    border: none;
}

.btn-tbl.approve { background: var(--ok); color: white; }
.btn-tbl.approve:hover { background: #047857; }
.btn-tbl.reject { background: white; border: 1.5px solid var(--brand); color: var(--brand); }
.btn-tbl.reject:hover { background: var(--brand-soft); }
.btn-tbl.start { background: #1d4ed8; color: white; }
.btn-tbl.finish { background: var(--ok); color: white; }
.btn-tbl.ghost { background: #f5f6f8; border: 1.5px solid var(--border); color: var(--ink-soft); }
.btn-tbl.ghost:hover { border-color: var(--ink); }
.file-dl { color: inherit; cursor: pointer; text-decoration: none; }
.file-dl:hover { border-color: var(--brand); color: var(--brand) !important; }

.empty-row { text-align: center; color: var(--text-light); padding: 30px !important; }

.dept-mini { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; color: white; white-space: nowrap; display: inline-block; }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(23, 28, 36, 0.6);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 16px;
    z-index: 200;
    overflow-y: auto;
}

.modal-overlay.open { display: flex; }

.modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 460px;
    padding: 26px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.35);
}

.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }

.modal-head h3 { margin: 0; font-size: 18px; color: var(--ink); }

.modal-close { background: none; border: none; font-size: 22px; color: #9aa1ab; cursor: pointer; line-height: 1; }

.modal-close:hover { color: var(--brand); }

.reason-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-soft);
}

.reason-opt:hover { border-color: #c3c8d0; }

.reason-opt input { accent-color: var(--brand); }

textarea {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 9px;
    padding: 10px 12px;
    font-size: 13.5px;
    font-family: inherit;
    resize: vertical;
    min-height: 64px;
    outline: none;
    margin-top: 6px;
}

textarea:focus { border-color: var(--brand); }

.hidden { display: none !important; }

.cust-grid { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 800px) {
    .stat-row { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
    .filters select { margin-left: 0; }
    .topbar .container { flex-wrap: wrap; }
    .tbl { font-size: 12.5px; }
    .tbl th, .tbl td { padding: 10px 8px; }
    .btn-tbl { padding: 9px 10px; font-size: 11.5px; }
    .login-wrap { padding: 16px; }
}

@media (max-width: 600px) {
    .cust-grid { grid-template-columns: 1fr; }
    .tbl-actions { flex-direction: column; gap: 4px; }
    .filters select { width: 100%; }
    .modal { padding: 20px 16px; }
    .stat-card b { font-size: 26px; }
}
