:root {
    --primary: #006633;
    --primary-dark: #004d26;
    --primary-darker: #003319;
    --primary-light: #008844;
    --accent: #C5A431;
    --accent-light: #D4B94A;
    --white: #ffffff;
    --gray-50: #f8f9fa;
    --gray-100: #f0f1f3;
    --gray-200: #e2e4e8;
    --gray-300: #cbd0d8;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --red: #dc2626;
    --green-50: #f1f8f3;
    --green-100: #dceee0;
    --green-200: #b3d9bd;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 2px 12px rgba(0,0,0,.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.1);
    --transition: .25s cubic-bezier(.4,0,.2,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', 'Noto Sans', system-ui, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

/* ── Layout ── */
.admin-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--primary-darker) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.sidebar-brand {
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-brand-logo-img {
    height: 56px;
    width: auto;
    display: block;
}
.sidebar-brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--accent-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.sidebar-brand-text { line-height: 1.2; }
.sidebar-brand-text strong {
    display: block;
    color: var(--white);
    font-size: .98rem;
    font-weight: 700;
}
.sidebar-brand-text small {
    display: block;
    color: var(--accent);
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-top: 2px;
    font-weight: 600;
}

.sidebar-nav { padding: 16px 0; flex: 1; }
.sidebar-nav-section {
    padding: 14px 24px 6px;
    font-size: .7rem;
    color: rgba(255,255,255,.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 24px;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    font-size: .88rem;
    font-weight: 500;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}
.sidebar-nav a svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: .8;
}
.sidebar-nav a:hover {
    background: rgba(255,255,255,.06);
    color: var(--white);
}
.sidebar-nav a:hover svg { opacity: 1; }
.sidebar-nav a.active {
    background: rgba(255,255,255,.1);
    color: var(--white);
    border-left-color: var(--accent);
}
.sidebar-nav a.active svg { color: var(--accent-light); opacity: 1; }

.sidebar-footer {
    padding: 18px 24px;
    border-top: 1px solid rgba(255,255,255,.08);
    font-size: .75rem;
    color: rgba(255,255,255,.4);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: var(--primary-darker);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .9rem;
}
.sidebar-user-info { line-height: 1.2; }
.sidebar-user-info strong { display: block; color: var(--white); font-size: .85rem; font-weight: 600; }
.sidebar-user-info span { color: rgba(255,255,255,.5); font-size: .72rem; }
.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,.55);
    font-size: .82rem;
    padding: 6px 0;
    transition: color var(--transition);
}
.sidebar-logout:hover { color: #ff8a80; }

.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 28px 36px;
}

/* ── Header ── */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}
.admin-header h1 {
    font-size: 1.5rem;
    color: var(--primary-dark);
    font-weight: 800;
    letter-spacing: -.3px;
}
.admin-header h1 small {
    display: block;
    font-size: .82rem;
    color: var(--gray-500);
    font-weight: 500;
    margin-top: 4px;
}
.admin-header-actions { display: flex; gap: 8px; }

/* ── Stats Grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 24px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--gray-100);
    transition: all var(--transition);
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
}
.stat-card.accent::before { background: var(--accent); }
.stat-card.success::before { background: #10b981; }
.stat-card.warn::before { background: #f59e0b; }
.stat-card.info::before { background: #3b82f6; }
.stat-card .stat-icon {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 38px;
    height: 38px;
    background: var(--green-50);
    color: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-card .stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--primary-darker);
    line-height: 1.1;
    margin-bottom: 4px;
}
.stat-card .stat-label {
    font-size: .8rem;
    color: var(--gray-500);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
}

/* ── Cards ── */
.admin-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 28px;
    margin-bottom: 20px;
    border: 1px solid var(--gray-100);
}
.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--gray-100);
    flex-wrap: wrap;
    gap: 12px;
}
.admin-card h3 {
    font-size: 1.05rem;
    color: var(--primary-darker);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.admin-card h3 svg { color: var(--primary); }
.admin-card h3 small {
    display: block;
    font-size: .78rem;
    color: var(--gray-500);
    font-weight: 500;
    margin-top: 2px;
}

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-weight: 600;
    font-size: .85rem;
    margin-bottom: 6px;
    color: var(--gray-700);
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-family: inherit;
    transition: all var(--transition);
    background: var(--white);
    color: var(--gray-800);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0,102,51,.1);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-help {
    display: block;
    font-size: .78rem;
    color: var(--gray-500);
    margin-top: 5px;
}

.form-section-title {
    font-size: .82rem;
    color: var(--primary-dark);
    font-weight: 700;
    margin: 24px 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--green-100);
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all var(--transition);
    font-family: inherit;
    white-space: nowrap;
}
.btn-primary {
    background: var(--primary);
    color: var(--white);
}
.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(0,77,38,.2);
    transform: translateY(-1px);
}
.btn-danger {
    background: var(--red);
    color: var(--white);
}
.btn-danger:hover { background: #b91c1c; }
.btn-outline-sm {
    background: transparent;
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    padding: 7px 14px;
    font-size: .8rem;
}
.btn-outline-sm:hover { background: var(--gray-50); border-color: var(--gray-300); }
.btn-outline-danger {
    background: transparent;
    border: 1px solid #fca5a5;
    color: var(--red);
    padding: 7px 14px;
    font-size: .8rem;
}
.btn-outline-danger:hover { background: var(--red); color: var(--white); }
.btn-gold {
    background: var(--accent);
    color: var(--primary-darker);
}
.btn-gold:hover { background: var(--accent-light); }
.btn-sm { padding: 7px 16px; font-size: .82rem; }

/* ── Table ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--gray-100); }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
    background: var(--white);
}
thead th {
    background: var(--green-50);
    padding: 12px 14px;
    text-align: left;
    font-weight: 700;
    color: var(--primary-dark);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .4px;
    border-bottom: 2px solid var(--green-100);
    white-space: nowrap;
}
tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--green-50); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: .73rem;
    font-weight: 700;
    white-space: nowrap;
}
.badge-green { background: #dcfce7; color: #166534; }
.badge-red { background: #fef2f2; color: #991b1b; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ── Room Cards ── */
.room-edit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.room-edit-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    border: 2px solid var(--gray-100);
    transition: all var(--transition);
}
.room-edit-card.active-card {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(0,102,51,.1);
}
.room-edit-card h4 {
    color: var(--primary-darker);
    margin-bottom: 16px;
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.room-edit-card .toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--gray-100);
}
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.status-pill.active { background: #dcfce7; color: #166534; }
.status-pill.inactive { background: var(--gray-100); color: var(--gray-500); }

/* ── Toggle Switch ── */
.toggle {
    position: relative;
    width: 44px;
    height: 24px;
    display: inline-block;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--gray-200);
    border-radius: 24px;
    cursor: pointer;
    transition: .2s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: var(--white);
    border-radius: 50%;
    transition: .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Alert ── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: .88rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
    border: 1px solid;
}
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.alert-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

/* ── Filter Row ── */
.filter-row {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 20px;
    margin-bottom: 18px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: end;
    border: 1px solid var(--gray-100);
}
.filter-row .form-group { margin: 0; }
.filter-row .form-group label { font-size: .75rem; margin-bottom: 4px; }

/* ── Login ── */
.admin-login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-darker) 0%, var(--primary) 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.admin-login-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M40 0l40 40-40 40L0 40z' fill='none' stroke='rgba(212,185,74,.04)' stroke-width='1'/%3E%3C/svg%3E");
}
.admin-login-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 44px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    position: relative;
    z-index: 1;
}
.admin-login-card .login-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 22px;
}
.admin-login-card .login-logo-img {
    height: 72px;
    width: auto;
    display: block;
}
.admin-login-card h2 {
    text-align: center;
    color: var(--primary-darker);
    margin-bottom: 6px;
    font-size: 1.4rem;
    font-weight: 800;
}
.admin-login-card .login-subtitle {
    text-align: center;
    color: var(--gray-500);
    font-size: .88rem;
    margin-bottom: 28px;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .admin-main { padding: 20px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   MOBİL — Hamburger drawer
   ═══════════════════════════════════════════════════════════════════════ */
.admin-hamburger {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 220;
    width: 44px;
    height: 44px;
    background: var(--primary-dark);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.admin-hamburger span {
    display: block;
    width: 22px;
    height: 2.5px;
    background: var(--white);
    border-radius: 2px;
    transition: transform .25s, opacity .2s;
}
.admin-hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.admin-hamburger.open span:nth-child(2) { opacity: 0; }
.admin-hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.admin-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 199;
    opacity: 0;
    transition: opacity .25s;
}
.admin-overlay.open { display: block; opacity: 1; }

body.admin-no-scroll { overflow: hidden; }

@media (max-width: 768px) {
    .admin-hamburger { display: flex; }
    .sidebar {
        transform: translateX(-100%);
        transition: transform .3s cubic-bezier(.4,0,.2,1);
        width: 280px;
        z-index: 210;
    }
    .sidebar.open { transform: translateX(0); }
    .admin-main {
        margin-left: 0;
        padding: 70px 16px 24px;
        max-width: 100vw;
        overflow-x: hidden;
    }
    .form-row { grid-template-columns: 1fr; }
    .room-edit-grid { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
    .admin-card { padding: 20px 18px; }

    /* ── Tüm admin-card form içindeki flex satırları column ── */
    .admin-card form[style*="display:flex"],
    .admin-card form > div[style*="display:flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    .admin-card form[style*="display:flex"] > *,
    .admin-card form > div[style*="display:flex"] > * {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
    .admin-card form[style*="display:flex"] > input[type="file"],
    .admin-card form > div[style*="display:flex"] > input[type="file"] {
        max-width: 100% !important;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .admin-header-actions {
        width: 100%;
        flex-direction: column;
    }
    .admin-header-actions .btn,
    .admin-header-actions a {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    .filter-row,
    form > .filter-row,
    .admin-card form[method="GET"] > div[style*="display:flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .filter-row .form-group,
    .filter-row .form-control,
    .filter-row select,
    .filter-row .btn,
    .admin-card form .form-group,
    .admin-card form .form-control,
    .admin-card form select,
    .admin-card form input[type="text"],
    .admin-card form input[type="number"],
    .admin-card form input[type="date"],
    .admin-card form input[type="file"],
    .admin-card form textarea,
    .admin-card form .btn,
    .admin-card form * {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .stat-card { padding: 18px 16px; }
    .stat-card .stat-value { font-size: 1.4rem; }
    .stat-card .stat-value[style*="font-size"] { font-size: 1.2rem !important; }

    .table-wrap { font-size: .82rem; max-width: 100%; }
    thead th, tbody td { padding: 10px 8px; }

    /* ── Tablo → kart görünümü (mobil) ── */
    .table-wrap table,
    .table-wrap thead,
    .table-wrap tbody,
    .table-wrap th,
    .table-wrap td,
    .table-wrap tr { display: block; }
    .table-wrap thead { display: none; }
    .table-wrap tr {
        background: var(--white);
        border: 1px solid var(--gray-200);
        border-radius: var(--radius);
        margin-bottom: 12px;
        padding: 12px 14px;
        box-shadow: var(--shadow);
    }
    .table-wrap td {
        border-bottom: 1px solid var(--gray-100);
        padding: 8px 0;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        text-align: right;
        word-break: break-word;
        flex-wrap: wrap;
    }
    .table-wrap td > * { max-width: 100%; min-width: 0; }
    .table-wrap td:last-child { border-bottom: none; padding-top: 10px; }
    .table-wrap td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: .72rem;
        color: var(--gray-500);
        text-transform: uppercase;
        letter-spacing: .4px;
        text-align: left;
        flex-shrink: 0;
    }
    .table-wrap td[colspan] {
        display: block;
        text-align: center;
    }
    .table-wrap td[colspan]::before { display: none; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .admin-header h1 { font-size: 1.2rem; }
    .admin-main { padding: 70px 12px 20px; }
}

/* Sidebar drawer transition (desktop'ta da transform bozukluğu olmasın) */
@media (min-width: 769px) {
    .sidebar { transform: none !important; }
    .admin-overlay { display: none !important; }
    .admin-hamburger { display: none !important; }
}
