:root {
    --bg: #0A0C0E;
    --bg-soft: #0E1215;
    --card: #141A1D;
    --card-2: #1A2125;
    --line: #232C31;
    --text: #F5F7F8;
    --muted: #9DAAB0;
    --accent: #F26A1B;
    --accent-dark: #D2560F;
    --danger: #E5534B;
    --ok: #35C46B;
    --radius: 12px;
    --sidebar: 248px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    font-size: 14.5px;
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ------------------------------------------------------------- yerleşim -- */

.shell {
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    min-height: 100vh;
}

.workspace {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 26px 26px 48px;
    flex: 1;
}

/* -------------------------------------------------------------- sidebar -- */

.sidebar {
    background: var(--bg-soft);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.side-brand {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px 10px 18px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 14px;
    text-decoration: none;
}

.side-brand img { height: 34px; width: auto; align-self: flex-start; }
.side-brand span { font-size: 10px; letter-spacing: 2.2px; color: var(--muted); }

.side-nav { display: flex; flex-direction: column; gap: 4px; }

.side-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 9px;
    color: var(--muted);
    font-weight: 600;
    font-size: 14px;
    border-left: 3px solid transparent;
    text-decoration: none;
}

.side-item svg { width: 18px; height: 18px; fill: currentColor; opacity: .85; }
.side-item:hover { background: #131A1E; color: var(--text); text-decoration: none; }

.side-item.is-active {
    background: linear-gradient(90deg, rgba(242, 106, 27, .16), rgba(242, 106, 27, .03));
    color: var(--text);
    border-left-color: var(--accent);
}

.side-item.is-active svg { fill: var(--accent); opacity: 1; }

.side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 10px; }

.side-user { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; padding: 0 4px; }

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #202A2F;
    color: var(--text);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .3px;
}

/* --------------------------------------------------------- mobil üst bar -- */

.mobile-bar { display: none; }

/* ------------------------------------------------------------------ başlık -- */

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

.h1 { font-size: 25px; line-height: 1.2; margin: 0 0 4px; font-weight: 700; }
.h2 { font-size: 17px; margin: 0 0 12px; }
.muted { color: var(--muted); margin: 0; }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.mono { font-family: "Cascadia Mono", Consolas, monospace; }
.crumb { font-size: 12px; color: var(--muted); margin: 0 0 6px; }

/* -------------------------------------------------------------- özet kart -- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(180deg, var(--card-2), var(--card));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(242, 106, 27, .13);
    color: var(--accent);
    flex: none;
}

.stat-icon svg { width: 22px; height: 22px; fill: currentColor; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.1; }
.stat-hint { color: var(--muted); font-size: 11.5px; }

/* ------------------------------------------------------------------ card -- */

.card {
    background: linear-gradient(180deg, var(--card-2), var(--card));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

/* ----------------------------------------------------------------- table -- */

.table-wrap { overflow-x: auto; margin: -4px; padding: 4px; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 820px; }

.table th {
    text-align: left;
    font-size: 11px;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.table td { padding: 12px; border-bottom: 1px solid rgba(35, 44, 49, .7); vertical-align: middle; }
.table tbody tr:hover { background: rgba(242, 106, 27, .04); }
.table tbody tr:last-child td { border-bottom: none; }

.col-actions { width: 1%; white-space: nowrap; }
.row-actions { display: flex; gap: 6px; align-items: center; }
.row-actions form { margin: 0; }

.cell-media { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-text { min-width: 0; }
.ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.thumb {
    width: 54px;
    height: 42px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #0F1417;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.thumb-placeholder { color: var(--accent); font-size: 11px; font-weight: 700; }
.thumb-lg { width: 168px; height: 112px; font-size: 12px; }

.table-foot { color: var(--muted); font-size: 12px; margin: 12px 0 0; }

/* ------------------------------------------------------------- rozetler -- */

.pill {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.pill-live { color: #BDF5D2; background: rgba(53, 196, 107, .14); border-color: rgba(53, 196, 107, .35); }
.pill-draft { color: var(--muted); background: rgba(157, 170, 176, .1); border-color: rgba(157, 170, 176, .28); }
.pill-cat { color: #FFD79A; background: rgba(242, 106, 27, .12); border-color: rgba(242, 106, 27, .35); }

.count-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.count-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 600;
    border: 1px solid var(--line);
    background: #10161A;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
}

.count-chip b { color: var(--text); font-size: 12.5px; }
.count-chip:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }
.count-chip.is-zero { opacity: .5; }
.count-chip .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot-installation { background: #F26A1B; }
.dot-maintenance { background: #2F7FD1; }
.dot-repair { background: #E0534F; }

/* ---------------------------------------------------------------- button -- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    min-height: 40px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: #10161A;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease;
}

.btn:hover { background: #162026; text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #140A03; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: rgba(229, 83, 75, .55); color: #FFB3AE; }
.btn-danger:hover { background: rgba(229, 83, 75, .16); }

.btn-small { padding: 5px 10px; min-height: 32px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------------ form -- */

.form { display: flex; flex-direction: column; gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 13px; font-weight: 600; color: #DDE8EA; }
.label em { color: var(--accent); font-style: normal; }
.hint { font-size: 12px; color: var(--muted); }
.field-error { font-size: 12.5px; color: #FFB3AE; }

.input {
    width: 100%;
    padding: 10px 12px;
    min-height: 44px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: #0F1417;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
}

.input::placeholder { color: #74868C; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242, 106, 27, .15); }
textarea.input { min-height: 108px; resize: vertical; }

select.input {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 36px;
}

.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); padding-top: 18px; }

.upload { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.upload-input { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 220px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.toolbar .input { max-width: 300px; }
.toolbar select.input { max-width: 260px; }

/* ----------------------------------------------------------------- flash -- */

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; border: 1px solid transparent; }
.flash-success { background: rgba(53, 196, 107, .12); border-color: rgba(53, 196, 107, .38); color: #CFF8DE; }
.flash-error { background: rgba(229, 83, 75, .12); border-color: rgba(229, 83, 75, .42); color: #FFC9C5; }

.empty { color: var(--muted); padding: 26px 8px; text-align: center; margin: 0; }

/* ----------------------------------------------------------------- login -- */

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(900px 500px at 80% -10%, #162026 0%, var(--bg) 60%) no-repeat, var(--bg);
}

.login-card { width: 100%; max-width: 430px; }
.login-help { color: var(--muted); font-size: 12px; margin: 18px 0 0; }
.login-help code { color: var(--muted); background: #0F1417; padding: 2px 6px; border-radius: 5px; }

/* --------------------------------------------------------------- preview -- */

.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.preview { position: sticky; top: 20px; }

.ratio { position: relative; width: 100%; padding-top: 56.25%; border-radius: 10px; overflow: hidden; background: #000; }
.ratio iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.error-card { max-width: 620px; margin: 40px auto; text-align: center; }

/* ---------------------------------------------------------------- footer -- */

.footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    padding: 14px 26px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* ------------------------------------------------------------ responsive -- */

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

    .sidebar { display: none; }

    .mobile-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 10px 16px;
        border-bottom: 1px solid var(--line);
        background: var(--bg-soft);
        position: sticky;
        top: 0;
        z-index: 10;
        flex-wrap: wrap;
    }

    .mobile-brand img { height: 28px; width: auto; }
    .mobile-nav { display: flex; align-items: center; gap: 12px; font-size: 13px; }
    .mobile-nav a { color: var(--muted); font-weight: 600; }
    .mobile-nav a.is-active { color: var(--text); border-bottom: 2px solid var(--accent); padding-bottom: 2px; }
    .mobile-nav form { margin: 0; }

    .container { padding: 18px 16px 36px; }
    .stat-grid { grid-template-columns: 1fr; }
    .split { grid-template-columns: 1fr; }
    .preview { position: static; }
    .grid-2 { grid-template-columns: 1fr; }
    .table { min-width: 700px; }
    .h1 { font-size: 21px; }
}
