/* ==========================================================================
   Avcılar Zeytin — Yönetim Paneli Stili
   ========================================================================== */

:root {
    --olive: #2F4532;
    --olive-dark: #1C2B1F;
    --olive-soft: #EBF1E9;
    --gold: #B8923A;
    --bg: #F5F3EC;
    --card: #FFFFFF;
    --border: #E4DFD2;
    --ink: #1C211B;
    --muted: #626A60;
    --danger: #B83535;
    --danger-bg: #FCECEC;
    --warning: #996200;
    --warning-bg: #FFF5DE;
    --success: #226B3B;
    --success-bg: #E7F5EC;
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Cormorant Garamond', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.55;
    font-size: 14.5px;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 .5rem; font-weight: 700; color: var(--olive-dark); }
p { margin: 0 0 .85rem; }
code {
    background: #EFECE3;
    padding: .15rem .4rem;
    border-radius: 5px;
    font-size: .82rem;
}

.muted { color: var(--muted); }
.small { font-size: .82rem; }
.text-right { text-align: right; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-gold { color: var(--gold); font-weight: 600; }
.line-through { text-decoration: line-through; }
.nowrap { white-space: nowrap; }

/* Login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #1A291D 0%, #2F4532 100%);
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--card);
    border-radius: 18px;
    padding: 2.25rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}
.login-brand { text-align: center; margin-bottom: 1.5rem; }
.login-brand img { max-height: 54px; margin: 0 auto .85rem; }
.login-brand h1 { font-family: var(--font-serif); font-size: 1.9rem; margin-bottom: .15rem; }
.login-brand p { font-size: .85rem; color: var(--muted); margin: 0; }
.login-footer {
    display: flex;
    justify-content: space-between;
    font-size: .8rem;
    color: var(--muted);
    margin-top: 1.35rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.login-footer a:hover { color: var(--olive); text-decoration: underline; }

/* Shell */
.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: 262px;
    flex-shrink: 0;
    background: var(--olive-dark);
    color: #E4EBE3;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .35rem .5rem .9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.sidebar-brand img {
    max-height: 44px;
    background: rgba(251, 249, 244, 0.96);
    padding: .3rem .65rem;
    border-radius: 8px;
}
.sidebar-close {
    display: none;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
}

.sidebar-status-pills {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .45rem;
    margin: .9rem 0;
}
.mini-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    font-size: .74rem;
    font-weight: 700;
    padding: .35rem .5rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}
.mini-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.mini-pill.is-success { color: #8BE0A4; }
.mini-pill.is-warning { color: #F7CB6B; }
.mini-pill.is-danger  { color: #FF8C8C; }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    flex: 1;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .68rem .9rem;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 500;
    color: #CBD6C9;
    transition: background .15s, color .15s;
}
.sidebar-nav a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.sidebar-nav a.is-active {
    background: var(--gold);
    color: #fff;
    font-weight: 600;
}
.nav-badge {
    font-style: normal;
    font-size: .72rem;
    font-weight: 700;
    padding: .1rem .5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}
.nav-badge--danger { background: #D94545; }
.nav-badge--warn { background: #D98E2B; }

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: .9rem;
    margin-top: 1rem;
}
.sidebar-footer .abtn--outline { border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.sidebar-footer .abtn--outline:hover { background: #fff; color: var(--olive-dark); }
.sidebar-footer .abtn--ghost { color: #BCC7BA; }
.sidebar-footer .abtn--ghost:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

/* Main area */
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
    height: 66px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 0 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 40;
}
.topbar-left { display: flex; align-items: center; gap: .85rem; }
.topbar-menu-btn {
    display: none;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .35rem .65rem;
    font-size: 1.15rem;
    cursor: pointer;
}
.topbar-title { font-size: 1.18rem; margin: 0; }
.topbar-user {
    font-size: .86rem;
    font-weight: 600;
    background: var(--olive-soft);
    color: var(--olive-dark);
    padding: .35rem .85rem;
    border-radius: 999px;
}

.admin-content { padding: 1.75rem; max-width: 1320px; width: 100%; }

/* Control Cards (Open/Close Site & Sales) */
.control-banner-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
.control-card {
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 1.35rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.control-card.is-open { border-left: 5px solid var(--success); }
.control-card.is-closed { border-left: 5px solid var(--danger); background: #FFF8F8; }
.control-card.is-warn { border-left: 5px solid var(--warning); background: #FFFDF5; }
.control-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.control-card h2 { font-size: 1.18rem; margin: .15rem 0 .25rem; }
.control-card p { font-size: .84rem; color: var(--muted); margin: 0; max-width: 390px; }

/* KPI */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.kpi-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem;
}
.kpi-card span { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; }
.kpi-card strong { display: block; font-size: 1.75rem; margin: .25rem 0; color: var(--olive-dark); }
.kpi-card small { font-size: .78rem; color: var(--muted); }
.kpi-card small a { color: var(--olive); font-weight: 600; }

/* Cards & Grids */
.admin-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    align-items: start;
}
.stack-col { display: flex; flex-direction: column; gap: 1.5rem; }
.panel-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.4rem;
}
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.panel-head--wrap { flex-wrap: wrap; }
.panel-head h3 { margin: 0; font-size: 1.05rem; }
.panel-desc { font-size: .87rem; color: var(--muted); margin-bottom: 1.15rem; }
.panel-divider { border: none; border-top: 1px solid var(--border); margin: 1.35rem 0; }
.sub-box { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 1.2rem; }
.empty-note { color: var(--muted); padding: 1rem 0; margin: 0; }

/* Buttons */
.abtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .58rem 1.05rem;
    border-radius: 9px;
    font-family: var(--font-sans);
    font-size: .86rem;
    font-weight: 600;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all .15s;
}
.abtn--lg { padding: .78rem 1.4rem; font-size: .92rem; }
.abtn--sm { padding: .38rem .72rem; font-size: .8rem; border-radius: 7px; }
.abtn--block { width: 100%; }
.abtn--primary { background: var(--olive); color: #fff; }
.abtn--primary:hover { background: var(--olive-dark); }
.abtn--success { background: var(--success); color: #fff; }
.abtn--success:hover { background: #1A552E; }
.abtn--danger { background: var(--danger); color: #fff; }
.abtn--danger:hover { background: #962828; }
.abtn--warning { background: #B87914; color: #fff; }
.abtn--warning:hover { background: #96610E; }
.abtn--outline { background: transparent; border-color: var(--border); color: var(--ink); }
.abtn--outline:hover { border-color: var(--olive); color: var(--olive); }
.abtn--ghost { background: transparent; color: var(--muted); }
.abtn--ghost:hover { background: var(--bg); color: var(--ink); }
.abtn--danger-ghost { background: transparent; color: var(--danger); }
.abtn--danger-ghost:hover { background: var(--danger-bg); }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Fields & Forms */
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink); margin-bottom: .35rem; }
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="url"],
.field input[type="tel"],
.field select,
.field textarea {
    width: 100%;
    padding: .62rem .82rem;
    border: 1.5px solid var(--border);
    border-radius: 9px;
    font-family: var(--font-sans);
    font-size: .9rem;
    background: #FCFBF8;
    color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--olive);
    background: #fff;
}
.field input[type="file"] { font-size: .85rem; }
.field-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }

.switch-row {
    display: flex;
    align-items: center;
    gap: .55rem;
    cursor: pointer;
    font-size: .88rem;
    font-weight: 500;
}
.switch-row input { width: 17px; height: 17px; accent-color: var(--olive); }

.radio-card-group { display: flex; flex-direction: column; gap: .65rem; margin-bottom: 1.25rem; }
.radio-card {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .9rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
}
.radio-card input { margin-top: .2rem; accent-color: var(--olive); }
.radio-card strong { display: block; font-size: .92rem; }
.radio-card small { color: var(--muted); font-size: .8rem; }
.radio-card:has(input:checked) { border-color: var(--olive); background: var(--olive-soft); }
.radio-card--danger:has(input:checked) { border-color: var(--danger); background: var(--danger-bg); }
.radio-card--warn:has(input:checked) { border-color: var(--warning); background: var(--warning-bg); }

.form-sticky-bar {
    margin-top: 1.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .75rem;
    flex-wrap: wrap;
}

/* Tables */
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.admin-table th, .admin-table td {
    padding: .72rem .65rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}
.admin-table th {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    background: #FAF8F3;
}
.table-prod { display: flex; align-items: center; gap: .75rem; }
.table-prod img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.table-prod small { display: block; }

/* Stock Stepper */
.stock-stepper { display: inline-flex; align-items: center; gap: .3rem; }
.step-btn {
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--olive-dark);
    font-weight: 700;
    font-size: .78rem;
    padding: .35rem .55rem;
    border-radius: 7px;
    cursor: pointer;
}
.step-btn:hover { background: var(--olive); color: #fff; border-color: var(--olive); }
.stock-input, .threshold-input {
    width: 72px;
    padding: .38rem .45rem;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    text-align: center;
    font-weight: 700;
    font-family: var(--font-sans);
}

/* Filter Pills & Search */
.filter-pills { display: flex; gap: .4rem; flex-wrap: wrap; }
.fpill {
    padding: .4rem .85rem;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 600;
    border: 1px solid var(--border);
    color: var(--muted);
}
.fpill.is-active { background: var(--olive); border-color: var(--olive); color: #fff; }

.search-bar-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.search-bar-form input, .search-bar-form select {
    padding: .5rem .75rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: .86rem;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: .22rem .65rem;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 700;
}
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info    { background: #E6F1FA; color: #19568A; }
.badge-primary { background: var(--olive-soft); color: var(--olive-dark); }
.badge-purple  { background: #F1EAFA; color: #5E2E91; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger  { background: var(--danger-bg); color: var(--danger); }
.badge-muted   { background: #ECEAE4; color: #666; }

.status-btn {
    border: none;
    padding: .28rem .72rem;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 700;
    cursor: pointer;
}
.status-btn.is-on { background: var(--success-bg); color: var(--success); }
.status-btn.is-off { background: #ECEAE4; color: #666; }

/* Alerts */
.admin-alert {
    padding: .9rem 1.15rem;
    border-radius: 10px;
    margin-bottom: 1.2rem;
    font-size: .88rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.admin-alert ul { margin: 0; padding-left: 1.15rem; }
.admin-alert--success { background: var(--success-bg); color: var(--success); border: 1px solid #BCE2C8; }
.admin-alert--error   { background: var(--danger-bg); color: var(--danger); border: 1px solid #F0C4C4; }
.admin-alert--warning { background: var(--warning-bg); color: var(--warning); border: 1px solid #EFD59B; }
.admin-alert--info    { background: var(--olive-soft); color: var(--olive-dark); border: 1px solid #C8D9C3; }

/* Media Previews */
.upload-preview-box {
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    justify-content: center;
}
.upload-preview-box img { max-height: 220px; border-radius: 10px; object-fit: cover; }

.media-preview {
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: .9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .8rem;
}
.media-preview--logo img { max-height: 64px; object-fit: contain; }
.media-preview--icon img { width: 48px; height: 48px; object-fit: contain; }
.media-preview--wide img { width: 100%; max-height: 170px; object-fit: cover; border-radius: 8px; }

/* Info list & Messages & Checklist */
.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li { padding: .42rem 0; border-bottom: 1px solid var(--bg); display: flex; justify-content: space-between; gap: 1rem; }
.info-list span { color: var(--muted); }

.msg-list { display: flex; flex-direction: column; gap: .9rem; }
.msg-item { border: 1px solid var(--border); border-radius: 12px; padding: 1.1rem; background: #FCFBF8; }
.msg-item.is-unread { border-left: 4px solid var(--gold); background: #FFFDF6; }
.msg-item__head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .7rem; }
.msg-item__body { margin: 0; font-size: .92rem; }

.sec-checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .75rem; }
.sec-checklist li { display: flex; align-items: flex-start; gap: .75rem; }
.sec-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .8rem;
    flex-shrink: 0;
}
.sec-checklist li.is-ok .sec-dot { background: var(--success-bg); color: var(--success); }
.sec-checklist li.is-warn .sec-dot { background: var(--warning-bg); color: var(--warning); }
.sec-checklist strong { display: block; font-size: .88rem; }
.sec-checklist small { color: var(--muted); font-size: .8rem; }

/* Toast */
.toast-container { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 99; display: flex; flex-direction: column; gap: .5rem; }
.toast { background: var(--olive-dark); color: #fff; padding: .75rem 1.1rem; border-radius: 9px; font-size: .86rem; border-left: 4px solid var(--gold); box-shadow: 0 10px 28px rgba(0,0,0,0.2); }
.toast.is-error { background: #6E1C1C; border-left-color: #FF8E8E; }

@media (max-width: 1024px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .control-banner-grid, .admin-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    .topbar-menu-btn, .sidebar-close { display: inline-flex; }
    .admin-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 80;
        transition: left .22s ease;
    }
    .admin-sidebar.is-open { left: 0; }
    .admin-content { padding: 1.1rem; }
    .field-grid-2 { grid-template-columns: 1fr; }
}
