/**
 * Yıkama Otomasyonu - Admin panel teması
 * CRM tarzı sidebar + teal vurgu (#008B74)
 */
:root {
    --primary: #008B74;
    --primary-dark: #006b5a;
    --primary-light: #00a88a;
    --sidebar-bg: #1e2a38;
    --sidebar-text: #b0b8c4;
    --sidebar-hover: #2a3a4a;
    --body-bg: #f0f2f5;
    --card-bg: #fff;
    --text: #333;
    --text-muted: #6c757d;
    --border: #dee2e6;
    --danger: #dc3545;
    --success: #28a745;
}

* { box-sizing: border-box; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--body-bg);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
    line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

/* Layout: sidebar + main */
.app-wrap {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand a { color: #fff; text-decoration: none; }
.sidebar-brand a:hover { text-decoration: none; color: #fff; opacity: .9; }
.sidebar-brand .sidebar-logo { max-width: 200px; height: auto; display: block; }
.sidebar-brand .sidebar-logo:hover { opacity: .95; }

.sidebar-nav {
    flex: 1;
    padding: .75rem 0;
}

.sidebar-nav a {
    display: block;
    padding: .6rem 1.25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: background .15s, color .15s;
}

.sidebar-nav a:hover {
    background: var(--sidebar-hover);
    color: #fff;
    text-decoration: none;
}

.sidebar-nav a.active {
    background: rgba(0,139,116,.25);
    color: #fff;
    border-left: 3px solid var(--primary);
    padding-left: calc(1.25rem - 3px);
}

.sidebar-user {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,.08);
    font-size: .9rem;
}

.sidebar-user .name { color: #fff; font-weight: 500; }
.sidebar-user .role { color: var(--sidebar-text); font-size: .8rem; }
.sidebar-user a { color: var(--primary-light); }
.sidebar-user .lang-switcher a { color: var(--primary-light); }
.sidebar-user .lang-active { color: #fff; font-weight: 500; }

/* Main content */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    background: var(--card-bg);
    padding: .75rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 1.1rem;
    font-weight: 500;
}

.content {
    flex: 1;
    padding: 1.5rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: .75rem 1.25rem;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

.card-body { padding: 1.25rem; }

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: .35rem;
    font-weight: 500;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: .5rem .75rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,139,116,.15);
}

input.form-control[type="checkbox"] {
    width: auto;
    margin-right: .5rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.form-check label { margin-bottom: 0; }

.form-error { color: var(--danger); font-size: .875rem; margin-top: .25rem; }

/* Buttons */
.btn {
    display: inline-block;
    padding: .5rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    transition: background .15s, color .15s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
    text-decoration: none;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover { background: #5a6268; color: #fff; text-decoration: none; }

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover { background: #c82333; color: #fff; text-decoration: none; }

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}

.btn-sm { padding: .35rem .6rem; font-size: .875rem; }
.table-wrap { overflow-x: auto; }

table.data-table {
    width: 100%;
    border-collapse: collapse;
}

table.data-table th,
table.data-table td {
    padding: .6rem .75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

table.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: .875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .02em;
}

table.data-table tr:hover td { background: #f8f9fa; }

.badge {
    display: inline-block;
    padding: .25rem .5rem;
    font-size: .75rem;
    font-weight: 500;
    border-radius: 4px;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-primary { background: rgba(0,139,116,.2); color: var(--primary-dark); }

.alert {
    padding: .75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }

.text-muted { color: var(--text-muted); font-size: .9rem; }

.output-chip { display: inline-block; margin: 2px 4px 2px 0; padding: 4px 8px; background: #e9ecef; border-radius: 4px; font-size: .85rem; }

.data-table-sortable .sort-link { color: inherit; font-weight: 600; text-decoration: none; }
.data-table-sortable .sort-link:hover { color: var(--primary); text-decoration: underline; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: 1rem; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: .5rem; }

/* ========== Mobil uyumluluk ========== */

/* Menü açma butonu (mobilde görünür) */
.menu-toggle {
    display: none;
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1001;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: var(--sidebar-bg);
    color: #fff;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    transition: background .2s;
}
.menu-toggle:hover { background: var(--sidebar-hover); }
.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0,0,0,.4);
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
}
.app-wrap.mobile-nav-open .sidebar-overlay {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 991px) {
    .menu-toggle { display: flex; }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 260px;
        max-width: 85vw;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: 4px 0 20px rgba(0,0,0,.15);
    }
    .app-wrap.mobile-nav-open .sidebar { transform: translateX(0); }
    .main { margin-left: 0; }
    .topbar {
        padding-left: 3.5rem;
        padding-right: 1rem;
        min-height: 52px;
        display: flex;
        align-items: center;
    }
    .topbar-title { font-size: 1rem; }
    .content { padding: 1rem; }
    .card-body { padding: 1rem; }
    .card-header { padding: .6rem 1rem; font-size: .95rem; }
}

@media (max-width: 768px) {
    html { font-size: 14px; }
    .content { padding: 0.75rem; }
    .topbar { padding-left: 3.25rem; padding-right: 0.75rem; }
    /* Tablolar: yatay kaydırma, dokunma desteği */
    .table-wrap,
    .report-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -0.75rem;
        padding: 0 0.75rem;
    }
    table.data-table,
    .report-table {
        min-width: 600px;
        font-size: 0.85rem;
    }
    table.data-table th,
    table.data-table td,
    .report-table th,
    .report-table td {
        padding: 0.5rem 0.4rem;
        white-space: nowrap;
    }
    .report-table .date-cell { white-space: nowrap; }
    .card { margin-bottom: 1rem; border-radius: 6px; }
}

@media (max-width: 480px) {
    .menu-toggle { left: 0.5rem; top: 0.5rem; width: 40px; height: 40px; }
    .sidebar { width: 280px; max-width: 90vw; }
    .topbar { padding-left: 2.75rem; font-size: 0.95rem; }
    .content { padding: 0.5rem; }
    .btn { padding: 0.5rem 0.75rem; font-size: 0.9rem; }
    .btn-sm { padding: 0.3rem 0.5rem; font-size: 0.8rem; }
    .form-control { padding: 0.5rem 0.6rem; font-size: 16px; }
    /* Rapor sayfası filtreleri */
    .report-filters .filter-row { flex-direction: column; align-items: stretch; }
    .report-filters .filter-group input,
    .report-filters .filter-group select { width: 100% !important; max-width: none !important; }
    .report-summary { grid-template-columns: 1fr; }
    .report-summary .summary-card .value { font-size: 1.5rem; }
    .report-toolbar { flex-direction: column; align-items: stretch; }
    .report-pagination { flex-direction: column; align-items: stretch; gap: 0.75rem; }
    .report-pagination .pager { justify-content: center; }
}
