:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #0891b2;
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --sidebar: #0f172a;
    --sidebar-text: #94a3b8;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    font-size: 14px;
}

/* Layout */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    background: var(--sidebar);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform .3s;
}

.sidebar-brand {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-icon {
    width: 36px; height: 36px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.brand-text { color: #fff; font-weight: 600; font-size: 15px; }

.sidebar-nav { flex: 1; padding: .75rem 0; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem 1.25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all .15s;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background: rgba(255,255,255,.08);
    color: #fff;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
}

.main-content { flex: 1; margin-left: 240px; }

.topbar {
    background: var(--card);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
}

.page-title { font-size: 1.25rem; font-weight: 600; }

.content { padding: 1.5rem; }

/* Cards */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
}

.card-header h2 { font-size: 1rem; font-weight: 600; }

.card-body { padding: 1.25rem; }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--primary); }
.stat-label { color: var(--text-muted); font-size: 13px; margin-top: .25rem; }
.stat-success .stat-value { color: var(--success); }
.stat-danger .stat-value { color: var(--danger); }
.stat-info .stat-value { color: var(--info); }

/* Grid */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.form-full { grid-column: 1 / -1; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: .35rem; font-weight: 500; font-size: 13px; }

input[type="text"], input[type="email"], input[type="tel"],
input[type="password"], input[type="number"], input[type="date"],
select, textarea {
    width: 100%;
    padding: .55rem .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color .15s;
    background: #fff;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    font-weight: 400 !important;
}

.checkbox-label input { width: auto; }

.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.search-form, .filter-form {
    display: flex;
    gap: .5rem;
    align-items: center;
}

.search-form input, .filter-form input { width: 180px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .55rem 1rem;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-info { background: var(--info); color: #fff; }

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}
.btn-outline:hover { background: var(--bg); }

.btn-sm { padding: .3rem .6rem; font-size: 12px; }
.btn-block { width: 100%; }

/* Table */
.table-responsive { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th, td {
    padding: .65rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th { font-weight: 600; font-size: 12px; text-transform: uppercase; color: var(--text-muted); background: #f8fafc; }

tr:hover td { background: #f8fafc; }

.actions { display: flex; gap: .35rem; flex-wrap: wrap; }

/* Badges */
.badge {
    display: inline-block;
    padding: .2rem .5rem;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-secondary { background: #f1f5f9; color: #475569; }
.badge-info { background: #e0f2fe; color: #075985; }
.badge-warning { background: #fef3c7; color: #92400e; }

/* Alerts */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 13px;
}

.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

code {
    background: #f1f5f9;
    padding: .15rem .4rem;
    border-radius: 4px;
    font-size: 12px;
}

/* Login */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
}

.login-card {
    background: var(--card);
    padding: 2.5rem;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.login-logo {
    width: 56px; height: 56px;
    background: var(--primary);
    color: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    margin: 0 auto 1rem;
}

.login-card h1 { text-align: center; font-size: 1.25rem; margin-bottom: .25rem; }
.login-card .subtitle { text-align: center; color: var(--text-muted); margin-bottom: 1.5rem; font-size: 13px; }

/* Responsive */
@media (max-width: 900px) {
    .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }
    .content { padding: 1rem; }
    .card-header { flex-direction: column; align-items: flex-start; }
    .search-form input, .filter-form input { width: 100%; }
}

/* Havale/EFT */
.card-highlight { border-color: var(--primary); border-width: 2px; }
.btn-lg { padding: .75rem 1.5rem; font-size: 15px; }
.input-readonly { background: #f1f5f9; color: var(--text-muted); }
.template-box {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}
.template-box pre {
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 13px;
    margin-top: .5rem;
    color: var(--text-muted);
}
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.form-section-title { font-size: 14px; font-weight: 600; margin: 1.25rem 0 .75rem; padding-bottom: .35rem; border-bottom: 1px solid var(--border); }
.form-section-title:first-child { margin-top: 0; }
.plan-table .input-sm { padding: .35rem .5rem; font-size: 13px; }
.plan-table td, .plan-table th { padding: .5rem; font-size: 13px; }

/* Açılır kartlar (accordion) */
.accordion { display: flex; flex-direction: column; gap: .6rem; }
.accordion-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    overflow: hidden;
}
.accordion-item[open] {
    border-color: #93c5fd;
    box-shadow: 0 1px 3px rgba(37, 99, 235, .08);
}
.accordion-header {
    list-style: none;
    padding: .85rem 1rem;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    user-select: none;
}
.accordion-header::-webkit-details-marker { display: none; }
.accordion-header::marker { display: none; content: ''; }
.accordion-title { flex: 1; }
.accordion-hint {
    font-weight: 400;
    font-size: 12px;
    color: var(--text-muted);
}
.accordion-chevron {
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    transition: transform .2s;
}
.accordion-item[open] .accordion-chevron { transform: rotate(180deg); }
.accordion-body { padding: 1rem 1.25rem 1.25rem; border-top: 1px solid var(--border); }
.form-sticky-actions {
    position: sticky;
    bottom: 0;
    margin-top: 1rem;
    padding: 1rem 0 0;
    background: linear-gradient(transparent, var(--card) 20%);
    border-top: 1px solid var(--border);
}

/* WhatsApp bildirim ikonları */
.wa-btn-group { display: inline-flex; gap: 4px; align-items: center; vertical-align: middle; }
.wa-icon-btn {
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s, opacity .15s;
    flex-shrink: 0;
}
.wa-icon-btn:hover { transform: scale(1.08); opacity: .92; }
.wa-icon-btn--app { background: #25D366; color: #fff; }
.wa-icon-btn--web { background: #128C7E; color: #fff; }
.wa-notify-alert { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; }
.wa-notify-actions { display: flex; align-items: center; gap: .5rem; }
.wa-tip { font-size: 12px; color: var(--text-muted); margin: 0; width: 100%; }
.wa-action-row { display: inline-flex; align-items: center; gap: .35rem; margin: 2px 4px 2px 0; }
.wa-action-label { font-size: 10px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); min-width: 42px; }
.actions-wa { min-width: 200px; }
.wa-btn-labels { display: flex; gap: 18px; font-size: 10px; color: var(--text-muted); margin-left: 4px; }
