/* ========================================================
   Kemerpide - Admin Panel Stilleri
   ======================================================== */

:root {
    --primary: #b8923c;
    --primary-dark: #9a7a2e;
    --primary-light: #e3c77a;
    --secondary: #0f2942;
    --cream: #e7eef4;
    --cream-light: #f3f7fa;
    --bg: #eef2f6;
    --card: #ffffff;
    --text: #14202e;
    --text-soft: #566879;
    --text-muted: #8a98a6;
    --border: #e2e8ed;
    --border-strong: #ccd6de;
    --success: #059669;
    --success-bg: #d1fae5;
    --error: #dc2626;
    --error-bg: #fee2e2;
    --warning: #b8923c;
    --warning-bg: #fbf3df;
    --info: #2563eb;
    --info-bg: #dbeafe;
    --shadow-sm: 0 1px 2px rgba(15, 41, 66, 0.06);
    --shadow: 0 2px 8px rgba(15, 41, 66, 0.10);
    --shadow-lg: 0 10px 30px rgba(15, 41, 66, 0.16);
    --radius: 12px;
    --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

/* ================== MOBİL UX İYİLEŞTİRMELERİ (U6) ================== */
@media (max-width: 768px) {
    /* Toplu işlem barı mobilde daha kompakt */
    #bulk-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
    }
    #bulk-bar > * { width: 100%; }
    #bulk-bar select,
    #bulk-bar input[type="number"] { width: 100% !important; }

    /* Tablo scroll'u mobilde daha kullanışlı */
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table { min-width: 600px; }

    /* Drag handle mobilde daha büyük */
    .drag-handle {
        font-size: 20px !important;
        padding: 8px !important;
        touch-action: none;
    }

    /* Form alanlarında daha rahat dokunmatik */
    input, select, textarea, button {
        font-size: 16px !important; /* iOS zoom önler */
    }

    /* Modal/Card padding mobilde küçült */
    .card { padding: 14px; }

    /* Sidebar açıkken arka plan blur */
    .sidebar-backdrop { backdrop-filter: blur(2px); }
}

/* Touch device'larda title tooltip görünmesin (uzun basınca rahatsız edici) */
@media (hover: none) {
    [title] { -webkit-touch-callout: none; }
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.55;
    min-height: 100vh;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ================== LOGIN ================== */
.login-body {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary-dark) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-wrap { width: 100%; max-width: 420px; }

.login-card {
    background: var(--card);
    border-radius: 20px;
    padding: 36px 28px 28px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 26px;
}

.login-logo {
    font-size: 48px;
    margin-bottom: 10px;
}

.login-header h1 {
    font-family: inherit;
    font-size: 25px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--secondary);
    margin-bottom: 4px;
}

.login-header p {
    font-size: 13px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.login-form .form-group {
    margin-bottom: 16px;
}

.login-back {
    text-align: center;
    font-size: 13px;
    margin-top: 20px;
    color: var(--text-muted);
}

.login-back a { color: var(--text-muted); }

.password-wrap {
    position: relative;
}

.toggle-pw {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 6px 8px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.toggle-pw:hover { opacity: 1; }

/* ================== FORM ================== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-group label .req {
    color: var(--error);
    margin-left: 2px;
}

.form-group small {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    font-family: inherit;
    background: var(--card);
    color: var(--text);
    outline: none;
    transition: all 0.15s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(184, 146, 60, 0.18);
}

textarea {
    min-height: 90px;
    resize: vertical;
}

input[type="file"] {
    padding: 6px;
    background: var(--cream-light);
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 640px) {
    .form-row { grid-template-columns: 1fr; }
}

/* Checkbox */
.check-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--cream-light);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}

.check-group:hover {
    border-color: var(--primary-light);
}

.check-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.check-group span {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

/* Gün seçici */
.day-picker {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.day-chip {
    flex: 1 1 60px;
    min-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 6px;
    background: var(--card);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-soft);
    transition: all 0.15s;
    user-select: none;
    text-align: center;
}

.day-chip:hover {
    border-color: var(--primary-light);
}

.day-chip.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.day-picker-buttons {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.day-picker-buttons button {
    padding: 6px 12px;
    background: var(--cream-light);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-soft);
    cursor: pointer;
    transition: all 0.15s;
}

.day-picker-buttons button:hover {
    background: var(--cream);
    color: var(--secondary);
}

/* ================== BUTONLAR ================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    text-decoration: none;
    line-height: 1.3;
    white-space: nowrap;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--primary);
    color: #0a1626;
    box-shadow: 0 3px 10px rgba(184, 146, 60, 0.35);
}

.btn-primary:hover { background: var(--primary-dark); color: #0a1626; box-shadow: 0 5px 15px rgba(184, 146, 60, 0.45); }

.btn-secondary {
    background: var(--card);
    color: var(--text);
    border: 1.5px solid var(--border-strong);
}

.btn-secondary:hover { border-color: var(--primary); color: var(--primary-dark); }

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover { background: #b91c1c; }

.btn-success {
    background: var(--success);
    color: white;
}

.btn-block { width: 100%; }

.btn-sm {
    padding: 6px 12px;
    font-size: 12.5px;
}

.btn-icon {
    padding: 7px 9px;
    font-size: 14px;
}

/* ================== ALERT ================== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 4px solid;
}

.alert-success { background: var(--success-bg); color: #065f46; border-color: var(--success); }
.alert-error { background: var(--error-bg); color: #991b1b; border-color: var(--error); }
.alert-warning { background: var(--warning-bg); color: #92400e; border-color: var(--warning); }
.alert-info { background: var(--info-bg); color: #1e40af; border-color: var(--info); }

/* ================== ADMIN LAYOUT ================== */
.admin-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: var(--secondary);
    color: white;
    padding: 20px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 10px;
}

.sidebar-header .logo {
    font-family: inherit;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--primary-light);
    margin-bottom: 2px;
}

.sidebar-header .sub {
    font-size: 11px;
    opacity: 0.65;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0 10px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
    text-decoration: none;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    text-decoration: none;
}

.sidebar-nav a.active {
    background: var(--primary);
    color: #0a1626;
    box-shadow: 0 3px 10px rgba(184, 146, 60, 0.35);
}

.sidebar-nav .nav-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 10px 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin-top: 10px;
}

.sidebar-footer a {
    display: block;
    padding: 8px 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
}

.sidebar-footer a:hover { color: white; }

.main {
    flex: 1;
    padding: 20px 24px 40px;
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.topbar h1 {
    font-size: 22px;
    color: var(--secondary);
    font-weight: 700;
}

.topbar p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.menu-toggle {
    display: none;
    background: var(--secondary);
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 20px;
    border: none;
    cursor: pointer;
}

@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 50;
        transform: translateX(-100%);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
    }
    .sidebar.open { transform: translateX(0); }
    .menu-toggle { display: inline-flex; }
    .main { padding: 14px 16px 40px; }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 49;
        display: none;
    }
    .sidebar-backdrop.open { display: block; }
}

/* ================== KARTLAR ================== */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 18px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    gap: 10px;
    flex-wrap: wrap;
}

.card-header h2 {
    font-size: 17px;
    color: var(--secondary);
    font-weight: 700;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--cream);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-card .stat-body { flex: 1; min-width: 0; }

.stat-card .stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--secondary);
    line-height: 1.1;
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* ================== TABLO ================== */
.table-wrap {
    overflow-x: auto;
    margin: 0 -20px;
    padding: 0 20px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    min-width: 600px;
}

.table th {
    background: var(--cream-light);
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    color: var(--secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover { background: var(--cream-light); }

.table .actions {
    display: flex;
    gap: 5px;
    flex-wrap: nowrap;
}

.table img.thumb {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--cream);
}

.thumb-placeholder {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--cream);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary);
}

/* Durum etiketleri */
.status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
}

.status.active { background: var(--success-bg); color: #065f46; }
.status.inactive { background: var(--error-bg); color: #991b1b; }
.status.featured { background: linear-gradient(135deg, var(--primary-light), var(--primary)); color: white; }

/* ================== FOTO ÖNİZLEME ================== */
.image-preview {
    width: 100%;
    max-width: 260px;
    aspect-ratio: 4 / 3;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--cream-light);
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    position: relative;
    margin-bottom: 10px;
}

.image-preview .placeholder {
    font-size: 42px;
    color: var(--primary);
    opacity: 0.5;
}

.image-preview .remove-img {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.95);
    color: white;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}

.image-preview.has-image .placeholder { display: none; }
.image-preview.has-image .remove-img { display: flex; }

/* ================== FORM FOOTER ================== */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .form-actions .btn { flex: 1; }
}

.empty {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.empty .icon {
    font-size: 48px;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* Allergen suggestions */
.tag-suggest {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.tag-suggest button {
    padding: 4px 10px;
    background: var(--cream-light);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.tag-suggest button:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.help-box {
    background: var(--info-bg);
    border-left: 4px solid var(--info);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: #1e3a8a;
    margin-bottom: 16px;
    line-height: 1.6;
}

.help-box strong { color: #1e40af; }
