/* ============================================================
   QNB Pay Ödeme Sistemi — Modern Kurumsal Tema
   ============================================================ */

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

:root {
    --primary: #5b2a86;
    --primary-light: #7444a5;
    --primary-dark: #3f1d5e;
    --primary-soft: #f2ecf8;
    --secondary: #e8821e;

    --success: #1f9d57;
    --success-soft: #e6f6ed;
    --danger: #d63b3b;
    --danger-soft: #fdeaea;
    --warning: #cf8a12;
    --warning-soft: #fbf1dc;
    --info: #2b7cc4;
    --info-soft: #e7f1fb;

    --bg: #f4f3f8;
    --card-bg: #ffffff;
    --text: #2a2433;
    --text-light: #7c7689;
    --border: #e8e5ef;

    --shadow: 0 2px 14px rgba(45, 22, 78, 0.06);
    --shadow-md: 0 6px 24px rgba(45, 22, 78, 0.10);
    --shadow-lg: 0 16px 48px rgba(45, 22, 78, 0.18);

    --radius: 16px;
    --radius-sm: 10px;

    --sidebar-w: 256px;
}

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

::selection { background: rgba(91, 42, 134, 0.18); }

/* ============================================================
   LOGIN / SONUÇ EKRANLARI
   ============================================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.12) 0%, transparent 45%),
        linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, var(--primary-light) 100%);
    padding: 24px;
}

.login-container {
    width: 100%;
    max-width: 430px;
}

.login-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 36px 30px;
    text-align: center;
}

.login-header .logo-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 20px;
}

.login-header h1 {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.login-header p {
    font-size: 14px;
    opacity: 0.82;
    margin-top: 6px;
}

.login-body { padding: 32px 30px; }

.login-footer {
    text-align: center;
    margin-top: 22px;
    color: var(--text-light);
}

/* ============================================================
   FORM ÖGELERİ
   ============================================================ */
.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 7px;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
    background: #faf9fc;
}

.form-control:focus {
    border-color: var(--primary-light);
    background: #fff;
    box-shadow: 0 0 0 3.5px rgba(91, 42, 134, 0.12);
}

.form-control:disabled {
    background: #f0eef4;
    color: var(--text-light);
    cursor: not-allowed;
}

.form-control::placeholder { color: #b3aec0; }

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235b2a86' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
    cursor: pointer;
}

textarea.form-control {
    min-height: 84px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 10px;
}

.form-check input[type="checkbox"] {
    width: 19px;
    height: 19px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-check label { cursor: pointer; }

.input-hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ============================================================
   BUTONLAR
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 22px;
    font-size: 14.5px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.2s, background 0.2s, opacity 0.2s;
    text-decoration: none;
    text-align: center;
    line-height: 1.4;
    white-space: nowrap;
}

.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-block { width: 100%; }
.btn-sm { padding: 8px 15px; font-size: 13px; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); box-shadow: 0 6px 18px rgba(91, 42, 134, 0.32); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #1c8c4e; box-shadow: 0 6px 18px rgba(31, 157, 87, 0.32); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c12f2f; box-shadow: 0 6px 18px rgba(214, 59, 59, 0.32); }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #b9790c; box-shadow: 0 6px 18px rgba(207, 138, 18, 0.3); }

.btn-secondary { background: #6f6982; color: #fff; }
.btn-secondary:hover { background: #5d586d; }

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

.btn-outline:hover {
    background: var(--primary-soft);
    border-color: var(--primary-light);
}

/* ============================================================
   ALERT
   ============================================================ */
.alert {
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid transparent;
    border-left-width: 4px;
}

.alert-error   { background: var(--danger-soft);  color: #a82c2c; border-color: #f3c4c4; }
.alert-success { background: var(--success-soft); color: #167a42; border-color: #bce5cd; }
.alert-warning { background: var(--warning-soft); color: #93630b; border-color: #eed6a5; }
.alert-info    { background: var(--info-soft);    color: #1f5e96; border-color: #bcd9f1; }

/* ============================================================
   BADGE
   ============================================================ */
.badge {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success   { background: var(--success-soft); color: #167a42; }
.badge-danger    { background: var(--danger-soft);  color: #a82c2c; }
.badge-warning   { background: var(--warning-soft); color: #93630b; }
.badge-info      { background: var(--info-soft);    color: #1f5e96; }
.badge-secondary { background: #efedf3;             color: #6f6982; }

/* ============================================================
   GENEL YERLEŞİM
   ============================================================ */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* --- Kenar Çubuğu (masaüstü) --- */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(185deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
}

.sidebar-brand {
    padding: 24px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand h2 {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.sidebar-brand small {
    font-size: 12px;
    opacity: 0.65;
}

.sidebar-user {
    padding: 16px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
    opacity: 0.9;
}

.sidebar-user strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 14px 14px;
    overflow-y: auto;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    margin-bottom: 3px;
    color: rgba(255, 255, 255, 0.78);
    border-radius: var(--radius-sm);
    transition: background 0.18s, color 0.18s;
    font-size: 14px;
    font-weight: 500;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-weight: 600;
}

.sidebar-nav a .icon,
.sidebar-nav a svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-nav .nav-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 16px 14px 6px;
    opacity: 0.45;
    letter-spacing: 0.09em;
}

.sidebar-footer {
    padding: 16px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer a {
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    transition: background 0.18s, color 0.18s;
}

.sidebar-footer a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.sidebar-footer a svg { width: 18px; height: 18px; }

.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    padding: 28px 34px;
    min-height: 100vh;
    max-width: 100%;
}

/* --- Mobil alt menü çubuğu --- */
.bottom-nav { display: none; }
.mobile-toggle { display: none; }

/* ============================================================
   SAYFA BAŞLIĞI
   ============================================================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 26px;
    flex-wrap: wrap;
    gap: 14px;
}

.page-header h1 {
    font-size: 25px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.page-header p {
    color: var(--text-light);
    font-size: 14px;
    margin-top: 2px;
}

/* ============================================================
   KARTLAR
   ============================================================ */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 22px;
    overflow: hidden;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.card-body { padding: 24px; }

/* ============================================================
   İSTATİSTİK KARTLARI
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 26px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    flex-shrink: 0;
}

.stat-icon.blue   { background: var(--info-soft);    color: var(--info); }
.stat-icon.green  { background: var(--success-soft); color: var(--success); }
.stat-icon.orange { background: var(--warning-soft); color: var(--warning); }
.stat-icon.red    { background: var(--danger-soft);  color: var(--danger); }
.stat-icon.purple { background: var(--primary-soft); color: var(--primary); }

.stat-info h3 {
    font-size: 23px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.stat-info p {
    font-size: 13px;
    color: var(--text-light);
    margin: 2px 0 0;
}

/* ============================================================
   TABLOLAR
   ============================================================ */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
}

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

table th {
    background: #faf9fc;
    padding: 13px 15px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-light);
    white-space: nowrap;
    border-bottom: 1.5px solid var(--border);
}

table td {
    padding: 13px 15px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

table tbody tr { transition: background 0.14s; }
table tbody tr:hover { background: #faf9fc; }
table tbody tr:last-child td { border-bottom: none; }

table .actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Tablo içi işlem butonları */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    font-size: 16px;
    transition: background 0.15s, color 0.15s;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    text-decoration: none;
}

.btn-icon:hover { background: var(--bg); }
.btn-icon.view:hover   { color: var(--info);    background: var(--info-soft); }
.btn-icon.edit:hover   { color: var(--warning); background: var(--warning-soft); }
.btn-icon.delete:hover { color: var(--danger);  background: var(--danger-soft); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(31, 18, 50, 0.55);
    backdrop-filter: blur(2px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.show { display: flex; }

.modal {
    background: #fff;
    border-radius: var(--radius);
    padding: 30px;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    max-height: 88vh;
    overflow-y: auto;
    animation: modalIn 0.22s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal h2 {
    margin-bottom: 22px;
    font-size: 20px;
    font-weight: 700;
}

.modal .btn-group {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 22px;
    flex-wrap: wrap;
}

/* ============================================================
   YÜKLENİYOR / BOŞ DURUM
   ============================================================ */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 42px;
    height: 42px;
    border: 4px solid rgba(91, 42, 134, 0.15);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-light);
}

.empty-state .icon {
    font-size: 50px;
    margin-bottom: 14px;
    opacity: 0.65;
}

.empty-state h3 {
    font-size: 17px;
    margin-bottom: 6px;
    color: var(--text);
}

/* ============================================================
   SATIŞ FORMU ÜRÜN ÖGELERİ
   ============================================================ */
.product-item {
    background: #faf9fc;
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.product-item .remove-product {
    float: right;
    cursor: pointer;
    color: var(--danger);
    font-size: 22px;
    line-height: 1;
    background: none;
    border: none;
}

/* ============================================================
   YARDIMCI SINIFLAR
   ============================================================ */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-light); }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-10 { gap: 10px; }

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 18px 0;
}

/* ============================================================
   DUYARLI TASARIM (MOBİL)
   ============================================================ */
@media (max-width: 992px) {
    .main-content { padding: 24px 22px; }
}

@media (max-width: 768px) {
    .sidebar { display: none; }

    .main-content {
        margin-left: 0;
        padding: 18px 15px calc(82px + env(safe-area-inset-bottom, 0px));
    }

    .page-header h1 { font-size: 21px; }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .card-body { padding: 18px; }
    .card-header { padding: 16px 18px; }

    /* --- Sabit alt menü çubuğu --- */
    .bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        background: #fff;
        border-top: 1px solid var(--border);
        box-shadow: 0 -3px 18px rgba(45, 22, 78, 0.09);
        z-index: 1500;
        padding: 6px 4px;
        padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    }

    .bottom-nav a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        padding: 7px 2px;
        font-size: 10.5px;
        font-weight: 600;
        color: var(--text-light);
        text-decoration: none;
        border-radius: 10px;
        transition: color 0.15s;
        min-width: 0;
    }

    .bottom-nav a svg {
        width: 23px;
        height: 23px;
        stroke-width: 2;
    }

    .bottom-nav a span {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .bottom-nav a.active { color: var(--primary); }

    .bottom-nav a.active svg {
        stroke-width: 2.4;
    }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card { padding: 17px; }
    .stat-info h3 { font-size: 20px; }
    .login-body { padding: 26px 22px; }
    .login-header { padding: 30px 22px; }
    .main-content { padding: 16px 12px calc(82px + env(safe-area-inset-bottom, 0px)); }
    .card-body { padding: 15px; }
    .btn { padding: 11px 16px; }
    .modal { padding: 22px; }
}

/* ============================================================
   YAZDIRMA
   ============================================================ */
@media print {
    .sidebar,
    .bottom-nav,
    .mobile-toggle,
    .no-print { display: none !important; }

    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    .card { box-shadow: none; border: 1px solid #ccc; }
}
