/* /admin/assets/admin.css */

:root {
    --bg: #f6f1e8;
    --surface: #fff;
    --text: #211d19;
    --muted: #756c61;
    --line: #e7ded0;
    --primary: #171412;
    --accent: #b78324;
    --danger: #b42318;
    --success: #067647;
    --sidebar: #171412;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
}

a { color: inherit; text-decoration: none; }

.admin-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px 1fr;
}

.sidebar {
    min-height: 100vh;
    padding: 26px 18px;
    color: #cbd5e1;
    background: var(--sidebar);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.admin-logo {
    width: 174px;
    min-height: 58px;
    display: grid;
    place-items: center;
    padding: 10px 14px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(255,255,255,.18);
    overflow: hidden;
}

.admin-logo img {
    display: block;
    width: 100%;
    height: 38px;
    object-fit: contain;
}

.sidebar nav {
    display: grid;
    gap: 6px;
    margin-top: 34px;
}

.sidebar nav a {
    padding: 11px 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 750;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar nav a svg {
    width: 18px;
    height: 18px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    color: #fff;
    background: rgba(255,255,255,.09);
}

.sidebar-user {
    display: grid;
    gap: 4px;
    margin-top: auto;
    padding: 14px 12px;
    border-top: 1px solid rgba(255,255,255,.1);
}

.sidebar-user small { color: #94a3b8; }
.sidebar-user a { margin-top: 8px; color: #fda4af; font-size: 13px; }

.admin-main { min-width: 0; }

.admin-topbar {
    min-height: 90px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 28px;
    background: rgba(255,255,255,.94);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
}

.admin-topbar h1 {
    margin: 3px 0 0;
    font-size: 25px;
    line-height: 1.1;
}

.top-eyebrow {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .1em;
    color: var(--accent);
    text-transform: uppercase;
}

.menu-button {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

.admin-content {
    padding: 28px;
}

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

.stat-card,
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
}

.stat-card {
    padding: 22px;
    display: grid;
    gap: 5px;
}

.stat-card span,
.stat-card small { color: var(--muted); }

.stat-card strong {
    font-size: 34px;
    letter-spacing: -1px;
}

.panel { margin-bottom: 20px; }

.panel-header {
    padding: 20px 22px;
    border-bottom: 1px solid var(--line);
}

.panel-header.split {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.panel-header h2 {
    margin: 4px 0 0;
    font-size: 20px;
}

.chart-wrap {
    height: 320px;
    padding: 18px 22px 26px;
}

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

th {
    color: var(--muted);
    background: #fafafa;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

td { font-size: 14px; }

.block { display: block; margin-top: 3px; color: var(--muted); }

.actions,
.link-actions,
.button-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.actions form,
.link-actions form { margin: 0; }

.btn {
    border: 0;
    min-height: 42px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    font-weight: 800;
    cursor: pointer;
    font-size: 14px;
}

.btn.primary { color: #fff; background: var(--primary); }
.btn.secondary { background: #fff; border: 1px solid var(--line); }
.btn.danger { color: var(--danger); background: #fff1f0; }
.btn.full { width: 100%; }
.btn.tiny-btn { min-height: 34px; padding: 0 10px; font-size: 12px; }

.filter-form {
    width: min(100%, 740px);
    display: grid;
    grid-template-columns: 1fr 160px auto;
    gap: 10px;
}

input, textarea, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 12px;
    background: #fff;
    color: var(--text);
    outline: none;
    font: inherit;
}

input:focus, textarea:focus, select:focus {
    border-color: #c29a4c;
    box-shadow: 0 0 0 4px rgba(183,131,36,.11);
}

label {
    display: grid;
    gap: 7px;
    font-size: 13px;
    font-weight: 800;
}

label small {
    color: var(--muted);
    font-weight: 500;
}

.stack-form {
    padding: 22px;
    display: grid;
    gap: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 160px;
    gap: 12px;
}

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

.check-label input { width: auto; }

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    gap: 20px;
    align-items: start;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
}

.badge.active { color: var(--success); background: #ecfdf3; }
.badge.inactive { color: var(--danger); background: #fef3f2; }
.primary-badge { color: #7d5415; background: #f8ecd3; margin-left: 6px; }

.code-link {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #966717;
}

.alert {
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 750;
}

.alert.success { color: var(--success); background: #ecfdf3; }
.alert.error { color: var(--danger); background: #fef3f2; }

.empty { text-align: center; padding: 34px; color: var(--muted); }

.link-admin-list {
    padding: 0 22px 22px;
    display: grid;
    gap: 10px;
}

.link-admin-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.link-admin-item > div:first-child { min-width: 0; }

.link-admin-item small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 520px;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
}

.icon-btn:disabled { opacity: .35; cursor: not-allowed; }

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

/* Login */
.admin-login-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 10%, rgba(201,154,61,.12) 0, transparent 32%),
        #FBF8F1;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(100%, 430px);
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(16,24,40,.10);
    display: grid;
    gap: 16px;
}

.login-card h1 { margin: 8px 0 0; }
.login-card p { margin: -6px 0 6px; color: var(--muted); }
.back-link { text-align: center; color: var(--muted); font-size: 13px; }


.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 40;
    border: 0;
    padding: 0;
    background: rgba(23,20,18,.48);
    cursor: pointer;
}

@media (max-width: 920px) {
    .admin-layout { grid-template-columns: 1fr; }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 250px;
        z-index: 50;
        transform: translateX(-100%);
        transition: .2s ease;
    }

    .sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-open .sidebar-overlay { display: block; }
    body.sidebar-open { overflow: hidden; }
    .menu-button { display: inline-grid; place-items: center; }
    .admin-content, .admin-topbar { padding-left: 18px; padding-right: 18px; }
    .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
    .stats-grid { grid-template-columns: 1fr; }
    .panel-header.split { align-items: stretch; flex-direction: column; }
    .filter-form { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .link-admin-item { flex-direction: column; }
}

/* Dinamik işletme sayfası ayarları */
.admin-column {
    min-width: 0;
}

.dynamic-business-grid {
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
}

.form-row.equal {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.subsection {
    display: grid;
    gap: 14px;
    padding-top: 20px;
    margin-top: 4px;
    border-top: 1px solid var(--line);
}

.subsection-heading {
    display: grid;
    gap: 4px;
}

.subsection-heading strong {
    font-size: 15px;
}

.subsection-heading small {
    color: var(--muted);
    font-weight: 500;
    line-height: 1.5;
}

.subsection-heading code {
    padding: 2px 5px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #f8fafc;
}

.logo-admin-row {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
}

.logo-preview {
    width: 84px;
    height: 84px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #f8fafc;
    color: var(--text);
    font-size: 32px;
    font-weight: 900;
}

.logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.logo-controls {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.compact-check {
    font-size: 12px;
    color: var(--muted);
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fafafa;
}

.palette-grid[hidden] {
    display: none !important;
}

.color-field {
    gap: 8px;
}

.color-field > span {
    color: var(--text);
    font-size: 12px;
}

.color-control {
    min-height: 45px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.color-control input[type="color"] {
    width: 38px;
    height: 32px;
    flex: none;
    padding: 0;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
    box-shadow: none;
}

.color-control code {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.link-description-admin {
    color: #475467 !important;
    white-space: normal !important;
}

@media (max-width: 1100px) {
    .dynamic-business-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .form-row.equal,
    .palette-grid {
        grid-template-columns: 1fr;
    }

    .logo-admin-row {
        grid-template-columns: 70px minmax(0, 1fr);
    }

    .logo-preview {
        width: 70px;
        height: 70px;
        border-radius: 16px;
    }
}

/* Satış sayfası CMS */
.sidebar-label { display:block; margin:18px 12px 6px; color:#64748b; font-size:10px; font-weight:900; letter-spacing:.12em; text-transform:uppercase; }
.sidebar nav { overflow-y:auto; padding-right:2px; }
.settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; padding:22px; }
.settings-grid .span-2 { grid-column:1 / -1; }
.form-row.equal { grid-template-columns:repeat(2,minmax(0,1fr)); }
.section-settings { padding:18px; border:1px solid var(--line); border-radius:14px; background:#fbfbfc; display:grid; gap:14px; }
.switch-label { display:flex; align-items:center; gap:10px; font-weight:800; }
.switch-label input { width:auto; }
.upload-field { display:grid; gap:12px; padding:18px; border:1px dashed #cfd4dc; border-radius:14px; background:#fafbfc; }
.upload-field strong,.upload-field small { display:block; }
.upload-field small { color:var(--muted); margin-top:3px; }
.admin-image-preview { display:block; max-width:100%; border:1px solid var(--line); border-radius:12px; background:#fff; object-fit:contain; }
.admin-image-preview.logo-preview { width:220px; max-height:100px; padding:10px; }
.wide-preview { width:min(100%,520px); max-height:260px; object-fit:cover; }
.product-preview { width:260px; max-height:260px; }
.table-thumb { width:56px; height:56px; object-fit:contain; border:1px solid var(--line); border-radius:10px; background:#fff; }
.color-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; padding:22px; }
.color-field { display:flex; align-items:center; gap:10px; }
.color-field input[type=color] { width:52px; min-width:52px; height:42px; padding:3px; }
.color-field code { font-size:12px; color:var(--muted); }
.sticky-save { position:sticky; bottom:16px; z-index:20; display:flex; justify-content:flex-end; gap:10px; padding:12px; margin-top:16px; background:rgba(255,255,255,.92); border:1px solid var(--line); border-radius:14px; backdrop-filter:blur(10px); box-shadow:0 12px 36px rgba(16,24,40,.12); }
.wide-form { max-width:960px; }
.admin-icon-preview { width:38px; height:38px; display:grid; place-items:center; border:1px solid var(--line); border-radius:10px; }
.admin-icon-preview svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.8; }
.quick-admin-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; padding:22px; }
.quick-admin-grid a { display:grid; gap:5px; padding:18px; border:1px solid var(--line); border-radius:13px; background:#fff; transition:.18s ease; }
.quick-admin-grid a:hover { transform:translateY(-2px); border-color:#c8b27d; box-shadow:0 8px 24px rgba(16,24,40,.06); }
.quick-admin-grid span { color:var(--muted); font-size:12px; }
.stats-grid-5 { grid-template-columns:repeat(5,minmax(0,1fr)); }
.lead-note { min-width:300px; white-space:normal; line-height:1.5; }

@media (max-width:1200px) { .stats-grid-5 { grid-template-columns:repeat(3,minmax(0,1fr)); } .color-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:800px) { .settings-grid,.color-grid,.quick-admin-grid { grid-template-columns:1fr; } .settings-grid .span-2 { grid-column:auto; } .form-row.equal { grid-template-columns:1fr; } .stats-grid-5 { grid-template-columns:1fr; } .sticky-save { flex-direction:column; } }

/* TAPPINN UX geliştirmeleri */
.login-logo {
    width: 190px;
    margin: 0 auto 4px;
}

.csrf-error-card {
    text-align: center;
}

.csrf-error-card .button-row {
    justify-content: center;
}

.palette-live-preview {
    margin: 0 22px 22px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #FBF8F1;
    transition: background .18s ease;
}

.palette-preview-card {
    max-width: 420px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    color: var(--text);
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.palette-preview-card strong,
.palette-preview-card p,
.palette-preview-card span {
    display: block;
}

.palette-preview-card strong {
    margin-top: 8px;
    font-size: 22px;
    line-height: 1.15;
}

.palette-preview-card p {
    margin: 10px 0 16px;
    color: var(--muted);
    line-height: 1.5;
}

.palette-preview-kicker {
    color: var(--accent);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .12em;
}

.palette-preview-card button {
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #171412;
    font-weight: 800;
}

.business-theme-preview {
    margin: 14px 0 0;
}

.icon-select-row {
    display: grid;
    grid-template-columns: minmax(0,1fr) 48px;
    gap: 10px;
    align-items: center;
}

.icon-preview-source {
    display: none;
}

.live-icon-preview {
    width: 48px;
    height: 48px;
}

.live-icon-preview svg {
    width: 24px;
    height: 24px;
}

.whatsapp-reply {
    margin-top: 7px;
    color: #075e54;
    background: #e7f8f2;
    border: 1px solid #b7ead8;
}

.whatsapp-reply:hover {
    background: #d9f3e9;
}

.sidebar-label {
    color: #9f9487 !important;
}

@media (max-width: 800px) {
    .palette-live-preview {
        margin-inline: 14px;
    }
}

