/* =============================================================================
   Bike Portal — temel stil
   Elle yazilmis CSS. Tailwind/CDN kullanilmaz (sartname 2).
   Tablet oncelikli; dokunmatik hedefler en az 44px.
   ============================================================================= */

:root {
    --c-bg: #f4f6f8;
    --c-surface: #ffffff;
    --c-border: #d9dfe5;
    --c-text: #1c2733;
    --c-text-muted: #6b7a89;
    --c-primary: #0f6fbe;
    --c-primary-dark: #0b578f;
    --c-success: #1b7f4d;
    --c-warning: #a86b00;
    --c-error: #b3261e;
    --c-success-bg: #e6f4ec;
    --c-warning-bg: #fdf3e2;
    --c-error-bg: #fdeceb;
    --c-info-bg: #e8f1fa;

    --radius: 8px;
    --radius-sm: 5px;
    --touch: 44px;
    --gap: 16px;
    --shadow: 0 1px 2px rgba(28, 39, 51, .08), 0 2px 8px rgba(28, 39, 51, .06);

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--c-text);
    background: var(--c-bg);
}

h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.25; }
p { margin: 0 0 .75rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }

/* --- Ust bar ------------------------------------------------------------- */

.topbar {
    display: flex;
    align-items: center;
    gap: var(--gap);
    min-height: 60px;
    padding: 8px 16px;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    flex-wrap: wrap;
}

.topbar__brand { display: flex; align-items: center; gap: 10px; }

.topbar__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    background: var(--c-primary);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .5px;
}

.topbar__title { font-weight: 600; font-size: 18px; }

.topbar__areas { display: flex; gap: 4px; margin-left: 8px; }

.topbar__area {
    display: inline-flex;
    align-items: center;
    min-height: var(--touch);
    padding: 0 14px;
    border-radius: var(--radius-sm);
    color: var(--c-text-muted);
    text-decoration: none;
    font-weight: 500;
}

.topbar__area:hover { background: var(--c-bg); color: var(--c-text); }
.topbar__area.is-active { background: var(--c-info-bg); color: var(--c-primary-dark); }

.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.branch-switcher { display: flex; align-items: center; gap: 8px; }
.branch-switcher__label { font-size: 13px; color: var(--c-text-muted); }

.branch-switcher__select,
.field__input,
select {
    min-height: var(--touch);
    padding: 8px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    background: var(--c-surface);
    color: var(--c-text);
    font: inherit;
    font-size: 15px;
}

.branch-badge {
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--c-info-bg);
    color: var(--c-primary-dark);
    font-size: 14px;
    font-weight: 500;
}

.user-menu { display: flex; align-items: center; gap: 10px; }
.user-menu__info { display: flex; flex-direction: column; line-height: 1.2; text-align: right; }
.user-menu__name { font-weight: 600; font-size: 14px; }
.user-menu__role { font-size: 12px; color: var(--c-text-muted); }

/* --- Yerlesim ------------------------------------------------------------ */

.shell { display: flex; align-items: flex-start; min-height: calc(100vh - 61px); }

.sidebar {
    flex: 0 0 240px;
    padding: 16px 12px;
    border-right: 1px solid var(--c-border);
    background: var(--c-surface);
    min-height: calc(100vh - 61px);
}

.content { flex: 1 1 auto; padding: 24px; max-width: 1200px; }

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

.nav__group {
    margin: 14px 0 4px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--c-text-muted);
}

.nav__item {
    display: flex;
    align-items: center;
    min-height: var(--touch);
    padding: 0 12px;
    border-radius: var(--radius-sm);
    color: var(--c-text);
    text-decoration: none;
    font-size: 15px;
}

.nav__item:hover { background: var(--c-bg); }
.nav__item.is-active { background: var(--c-info-bg); color: var(--c-primary-dark); font-weight: 600; }
.nav__item.is-disabled { color: var(--c-text-muted); cursor: default; opacity: .65; }
.nav__item.is-disabled:hover { background: transparent; }

/* --- Basliklar ve kartlar ------------------------------------------------ */

.page-head { margin-bottom: 20px; }
.page-head__title { font-size: 24px; }
.page-head__subtitle { color: var(--c-text-muted); margin: 0; }

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--gap);
    margin-bottom: 24px;
}

.card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card--muted { opacity: .6; }
.card__label { font-size: 13px; color: var(--c-text-muted); }
.card__value { font-size: 26px; font-weight: 700; }

.panel {
    padding: 20px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: var(--gap);
}

.panel__title { font-size: 17px; }
.panel__text { color: var(--c-text-muted); margin: 0; }

.checklist { margin: 0; padding-left: 20px; color: var(--c-text-muted); }
.checklist li { margin-bottom: 4px; }

.empty-state {
    padding: 48px 24px;
    text-align: center;
    background: var(--c-surface);
    border: 1px dashed var(--c-border);
    border-radius: var(--radius);
}

.empty-state__title { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.empty-state__text { color: var(--c-text-muted); max-width: 520px; margin: 0 auto 16px; }

/* --- Formlar ------------------------------------------------------------- */

.form { display: flex; flex-direction: column; gap: var(--gap); }
.form__note { font-size: 13px; color: var(--c-text-muted); margin: 0; }

.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.field { display: flex; flex-direction: column; gap: 5px; }
.field__label { font-size: 14px; font-weight: 600; }
.field__input { width: 100%; }
.field__input:focus,
.branch-switcher__select:focus,
.btn:focus-visible {
    outline: 2px solid var(--c-primary);
    outline-offset: 1px;
}
.field__input.has-error { border-color: var(--c-error); }
.field__hint { font-size: 12px; color: var(--c-text-muted); }
.field__error { font-size: 13px; color: var(--c-error); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--touch);
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--c-surface);
    color: var(--c-text);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--c-primary); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--c-primary-dark); }
.btn--ghost { border-color: var(--c-border); }
.btn--ghost:hover { background: var(--c-bg); }
.btn--block { width: 100%; }
.btn--lg { min-height: 52px; font-size: 16px; }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: 14px; }

/* --- Bildirimler --------------------------------------------------------- */

.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: var(--gap); }

.flash {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 15px;
}

.flash__text { flex: 1 1 auto; }

.flash__close {
    border: 0;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    min-width: 32px;
    min-height: 32px;
}

.flash--success { background: var(--c-success-bg); border-color: #bfe3cf; color: var(--c-success); }
.flash--error   { background: var(--c-error-bg);   border-color: #f3c9c6; color: var(--c-error); }
.flash--warning { background: var(--c-warning-bg); border-color: #f0dcb4; color: var(--c-warning); }
.flash--info    { background: var(--c-info-bg);    border-color: #c5dcf1; color: var(--c-primary-dark); }

.callout {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--c-primary);
    background: var(--c-info-bg);
    margin-bottom: var(--gap);
    font-size: 15px;
}

.callout--warning { background: var(--c-warning-bg); border-left-color: var(--c-warning); }
.callout--error   { background: var(--c-error-bg);   border-left-color: var(--c-error); }

/* --- Giris ekrani -------------------------------------------------------- */

.auth {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.auth__panel {
    width: 100%;
    max-width: 400px;
    padding: 32px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.auth__brand { text-align: center; margin-bottom: 24px; }

.auth__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px; height: 52px;
    border-radius: 12px;
    background: var(--c-primary);
    color: #fff;
    font-weight: 700;
    margin-bottom: 12px;
}

.auth__title { font-size: 22px; margin: 0; }
.auth__subtitle { color: var(--c-text-muted); font-size: 14px; margin: 0; }

.notice { text-align: center; }
.notice__title { font-size: 18px; }
.notice__text { color: var(--c-text-muted); font-size: 15px; }

/* --- Sade sayfalar / hata ------------------------------------------------ */

.plain {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.plain__panel {
    width: 100%;
    max-width: 560px;
    padding: 32px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.error-page { text-align: center; }
.error-page__code { font-size: 48px; font-weight: 800; color: var(--c-text-muted); }
.error-page__title { font-size: 20px; }
.error-page__text { color: var(--c-text-muted); }

.error-page__detail {
    text-align: left;
    padding: 12px;
    background: var(--c-bg);
    border-radius: var(--radius-sm);
    font-size: 12px;
    overflow-x: auto;
}

/* --- Kurulum ------------------------------------------------------------- */

.install { padding: 24px; }

.install__panel {
    max-width: 760px;
    margin: 0 auto;
    padding: 32px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.install__panel--narrow { max-width: 520px; }
.install__head { margin-bottom: 24px; }
.install__title { font-size: 24px; }
.install__subtitle { color: var(--c-text-muted); margin: 0; }
.install__section { margin-bottom: 28px; }
.install__section-title { font-size: 17px; padding-bottom: 8px; border-bottom: 1px solid var(--c-border); }
.install__note { font-size: 13px; color: var(--c-text-muted); }

.reqs { list-style: none; margin: 0; padding: 0; }

.reqs__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--c-bg);
    font-size: 14px;
}

.reqs__mark { width: 20px; text-align: center; font-weight: 700; }
.reqs__label { flex: 1 1 auto; }
.reqs__detail { color: var(--c-text-muted); font-size: 13px; }
.reqs__item.is-ok .reqs__mark { color: var(--c-success); }
.reqs__item.is-fail .reqs__mark { color: var(--c-error); }
.reqs__item.is-warn .reqs__mark { color: var(--c-warning); }

/* --- Dar ekran ----------------------------------------------------------- */

@media (max-width: 900px) {
    .shell { flex-direction: column; }

    .sidebar {
        flex: 1 1 auto;
        width: 100%;
        min-height: 0;
        border-right: 0;
        border-bottom: 1px solid var(--c-border);
    }

    .nav { flex-direction: row; flex-wrap: wrap; }
    .nav__group { width: 100%; margin-top: 8px; }
    .content { padding: 16px; }
    .topbar__right { width: 100%; margin-left: 0; justify-content: space-between; }
}

/* --- Kurulum kurtarma / tehlikeli islemler ------------------------------- */

.btn--danger { background: var(--c-error); color: #fff; }
.btn--danger:hover:not(:disabled) { background: #8f1e17; }

.field__input--area { min-height: 88px; resize: vertical; padding-top: 10px; }
.field__optional { font-weight: 400; color: var(--c-text-muted); font-size: 13px; }

.table-list {
    list-style: none;
    margin: 0 0 var(--gap);
    padding: 12px;
    background: var(--c-bg);
    border-radius: var(--radius-sm);
    max-height: 220px;
    overflow-y: auto;
    columns: 2;
    column-gap: var(--gap);
}

.table-list li { break-inside: avoid; padding: 2px 0; font-size: 14px; }

/* --- Sube kunyesi -------------------------------------------------------- */
/* Fis (Faz 2), servis formu ve bakim karti (Faz 3), odeme/onay sayfasi (Faz 4).
   Icerik her zaman branch_info() uzerinden gelir; sabit adres/telefon yazilmaz. */

.letterhead {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--c-border);
}

.letterhead__logo { width: 120px; height: auto; flex: 0 0 auto; }
.letterhead__body { flex: 1 1 auto; }
.letterhead__name { font-weight: 700; font-size: 16px; margin: 0 0 2px; }
.letterhead__line { margin: 0; font-size: 13px; color: var(--c-text-muted); line-height: 1.4; }
.letterhead__hours { margin-top: 4px; font-style: italic; }

@media (max-width: 600px) {
    .table-list { columns: 1; }
}

/* --- Kurulum ekrani ek bilesenleri --------------------------------------- */

.install__logo { display: block; width: 150px; height: auto; margin-bottom: 12px; }
.install__note--warn { color: var(--c-warning); }

.callout__list { margin: 8px 0; padding-left: 20px; }
.callout__list li { margin-bottom: 4px; }

.test-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.test-row__result { font-size: 14px; font-weight: 600; }
.test-row__result.is-ok { color: var(--c-success); }
.test-row__result.is-fail { color: var(--c-error); }
.test-row__result.is-pending { color: var(--c-text-muted); font-weight: 400; }

.reqs__item.is-fail .reqs__label { font-weight: 600; }

/* --- Kurulum sihirbazı adım göstergesi ----------------------------------- */

.steps {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    counter-reset: step;
}

.steps__item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 130px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: var(--c-bg);
    font-size: 13px;
    color: var(--c-text-muted);
}

.steps__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 50%;
    background: var(--c-border);
    color: var(--c-surface);
    font-weight: 700;
    font-size: 12px;
}

.steps__item.is-current { background: var(--c-info-bg); color: var(--c-primary-dark); font-weight: 600; }
.steps__item.is-current .steps__mark { background: var(--c-primary); }
.steps__item.is-done { color: var(--c-success); }
.steps__item.is-done .steps__mark { background: var(--c-success); }

.wizard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--gap);
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid var(--c-border);
}

.wizard-nav form { margin: 0; }
.wizard-nav .btn--lg { min-width: 180px; }

.install__note--ok { color: var(--c-success); font-weight: 600; }

.install__done-mark {
    font-size: 42px;
    line-height: 1;
    color: var(--c-success);
    margin: 0 0 4px;
}

/* --- Özet ekranı --------------------------------------------------------- */

.summary {
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    margin-bottom: var(--gap);
    overflow: hidden;
}

.summary__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: var(--c-bg);
    border-bottom: 1px solid var(--c-border);
}

.summary__title { font-size: 15px; margin: 0; }

.summary__edit {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    color: var(--c-primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.summary__edit:hover { text-decoration: underline; }

.summary__list { margin: 0; padding: 6px 14px 12px; }

.summary__row {
    display: flex;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--c-bg);
}

.summary__row:last-child { border-bottom: 0; }
.summary__label { flex: 0 0 150px; margin: 0; font-size: 14px; color: var(--c-text-muted); }
.summary__value { flex: 1 1 auto; margin: 0; font-size: 14px; word-break: break-word; }

@media (max-width: 600px) {
    .summary__row { flex-direction: column; gap: 2px; }
    .summary__label { flex: 1 1 auto; }
    .wizard-nav { flex-direction: column-reverse; align-items: stretch; }
    .wizard-nav .btn { width: 100%; }
}
