/* Müşteri Takip - Açık tema, modern panel */

:root {
    --bg-body: #f0f2f5;
    --bg-card: #ffffff;
    --sidebar-bg: #2c3e50;
    --sidebar-text: #ecf0f1;
    --sidebar-active: #3498db;
    --primary: #3498db;
    --primary-hover: #2980b9;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --text: #2c3e50;
    --text-muted: #7f8c8d;
    --border: #dfe6e9;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
}

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

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

a:hover {
    text-decoration: underline;
}

/* ----- Login ----- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 380px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 2rem;
}

.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-header h1 {
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
    color: var(--text);
}

.login-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.login-icon {
    margin-top: 1.25rem;
    display: flex;
    justify-content: center;
}

.login-icon svg {
    width: 88px;
    height: 88px;
    display: block;
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

.login-form .form-group-checkbox {
    margin-bottom: 1rem;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0 !important;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-label span {
    user-select: none;
}

/* ----- Panel layout ----- */
.panel-body {
    display: flex;
    min-height: 100vh;
}

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

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

.sidebar-brand a {
    color: var(--sidebar-text);
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
}

.sidebar-brand a:hover {
    text-decoration: none;
    color: #fff;
}

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

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    text-decoration: none;
}

.sidebar-nav a.active {
    background: var(--sidebar-active);
    color: #fff;
}

.sidebar-nav .icon {
    font-size: 1.1rem;
    opacity: 0.9;
}

.sidebar-nav .icon-svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-nav .icon-svg svg {
    color: inherit;
}

.sidebar-menu-group {
    padding: 0.5rem 0;
}

.sidebar-group-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1.25rem;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: transparent;
    font-size: inherit;
    font-family: inherit;
    text-align: left;
    transition: color 0.2s, background 0.2s;
}

.sidebar-group-label:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
}

.sidebar-group-chevron {
    margin-left: auto;
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
}

.sidebar-menu-group.open .sidebar-group-chevron {
    transform: rotate(45deg);
}

.sidebar-menu-group.open .sidebar-group-label {
    color: #fff;
}

.sidebar-submenu {
    display: flex;
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.sidebar-menu-group.open .sidebar-submenu {
    max-height: 20rem;
    overflow: visible;
}

.sidebar-submenu a {
    display: block;
    padding: 0.5rem 1.25rem 0.5rem 2.5rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.sidebar-submenu a:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
    text-decoration: none;
}

.sidebar-submenu a.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-left-color: var(--sidebar-active);
}

.sidebar-link-danger {
    color: #ffcccc !important;
}

.sidebar-link-danger:hover {
    background: rgba(231, 76, 60, 0.18) !important;
    color: #ffffff !important;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.user-name {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
}

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

.page-header {
    background: var(--bg-card);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-header h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text);
}

.header-bakiye-kutu {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.35);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    min-height: 3.5rem;
    box-sizing: border-box;
    align-self: center;
}

.header-bakiye-label {
    font-size: 0.8rem;
    opacity: 0.95;
    line-height: 1.2;
    display: block;
    text-align: center;
}

.header-bakiye-tutar {
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
    display: block;
    text-align: center;
}

.page-content {
    flex: 1;
    min-height: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

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

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

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
}

input[type="date"],
input[type="datetime-local"] {
    min-height: 2.5rem;
    box-sizing: border-box;
    color-scheme: light;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

textarea {
    min-height: 80px;
    resize: vertical;
}

/* ----- Buttons ----- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

a.btn:hover {
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

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

.btn-success:hover:not(:disabled) {
    background: #219a52;
}

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

.btn-danger:hover:not(:disabled) {
    background: #c0392b;
}

.satis-kalem-sil,
.main-content .btn-outline.satis-kalem-sil,
table.data-table .btn-outline.satis-kalem-sil {
    background: crimson !important;
    color: #fff !important;
    border-color: crimson !important;
}
.satis-kalem-sil:hover,
.main-content .btn-outline.satis-kalem-sil:hover,
table.data-table .btn-outline.satis-kalem-sil:hover {
    background: #b01030 !important;
    color: #fff !important;
    border-color: #b01030 !important;
}

.btn-outline {
    background: transparent;
    color: var(--sidebar-text);
    border: 1px solid rgba(255,255,255,0.4);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.1);
    text-decoration: none;
}

.main-content .btn-outline,
table.data-table .btn-outline {
    color: var(--text);
    border-color: var(--border);
}
.main-content .btn-outline:hover,
table.data-table .btn-outline:hover {
    background: rgba(0,0,0,0.05);
    color: var(--text);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
}

.btn-add {
    padding: 0.5rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.15s ease;
    letter-spacing: 0.01em;
}

.btn-add:hover {
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.4);
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-icon {
    display: inline-block;
    margin-right: 2px;
    font-style: normal;
}

.btn-excel-import {
    background: #ffffff;
    color: #16a34a;
    border: 1px solid rgba(22, 163, 74, 0.35);
    box-shadow: 0 1px 3px rgba(22, 163, 74, 0.25);
}

.btn-excel-import::first-letter {
    font-size: 1em;
}

.btn-excel-import:hover {
    background: #f0fdf4;
    border-color: #16a34a;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.35);
    text-decoration: none;
}

.btn-excel-import .btn-excel-icon {
    font-size: 1em;
}

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

/* ----- Cards & Tables ----- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.toolbar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.input-search {
    width: 200px;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.input-search:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-print {
    background: linear-gradient(to bottom, #ffffff, #f8fafc);
    color: #475569;
    border: 1px solid #cbd5e1;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.15s ease;
}

.btn-print:hover {
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
    color: #1e293b;
    border-color: #94a3b8;
    box-shadow: 0 2px 6px rgba(71, 85, 105, 0.15);
}

.card-body {
    padding: 1.25rem;
}

.table-wrap {
    overflow-x: auto;
}

.card-musteri-list {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}
.card-musteri-list .card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.card-musteri-list .table-wrap {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.table-wrap-no-scroll {
    overflow-x: visible;
}

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

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

table.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--text);
    font-size: 0.85rem;
}

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

table.data-table .actions {
    white-space: nowrap;
    text-align: right;
}

table.data-table th.actions {
    text-align: right;
}

table.data-table .actions a,
table.data-table .actions button {
    margin-right: 0.35rem;
}

table.data-table .actions .btn-sm {
    font-size: 0.75rem;
}

table.data-table-cari {
    table-layout: fixed;
    width: 100%;
}
table.data-table-cari .col-islemtur {
    width: 120px;
    white-space: nowrap;
}
table.data-table-cari .col-tarih {
    width: 120px;
    white-space: nowrap;
}
table.data-table-cari .col-tutar {
    width: 120px;
    white-space: nowrap;
}
table.data-table-cari .col-aciklama {
    width: auto;
    min-width: 0;
}
table.data-table-cari .actions {
    width: 180px;
    white-space: nowrap;
}

table.data-table-cari tr.cari-row-satis .col-islemtur {
    background: rgba(13, 110, 253, 0.08);
    color: #0a58ca;
    font-weight: 500;
}
table.data-table-cari tr.cari-row-tahsilat .col-islemtur {
    background: rgba(25, 135, 84, 0.08);
    color: #146c43;
    font-weight: 500;
}
table.data-table-cari tr.cari-row-tahsilat .col-islemtur .text-muted {
    color: #198754 !important;
    opacity: 0.9;
}
table.data-table-cari tr.cari-row-satis .col-islemtur .text-muted {
    color: #0a58ca !important;
    opacity: 0.9;
}

.only-print {
    display: none !important;
}

table.data-table-musteri {
    width: 100%;
}

table.data-table-musteri .col-sira {
    width: 3rem;
    min-width: 3rem;
    text-align: center;
}

table.data-table-musteri .col-adsoyad {
    width: 10rem;
    min-width: 8rem;
}

table.data-table-musteri .col-gsm {
    width: 8rem;
    min-width: 6rem;
}

table.data-table-musteri .col-mail {
    width: 11rem;
    min-width: 8rem;
}

table.data-table-musteri .col-bakiye {
    width: 8rem;
    min-width: 6rem;
}

table.data-table-musteri th.actions,
table.data-table-musteri td.actions {
    width: 14rem;
    min-width: 12rem;
}

.dropdown-inline {
    display: inline-block;
    position: relative;
    vertical-align: middle;
    margin-right: 0.35rem;
}
.dropdown-menu {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 4px;
    min-width: 12rem;
    padding: 0.35rem 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    z-index: 100;
    text-align: left;
}
.dropdown-menu.dropdown-menu-cari {
    min-width: 14rem;
    padding: 0.4rem 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    text-align: left;
}
.dropdown-inline.open .dropdown-menu {
    display: block;
}
.card-musteri-list .dropdown-inline.open .dropdown-menu {
    position: fixed;
    left: 0;
    top: 0;
    margin-top: 0;
    z-index: 1050;
}
.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.6rem;
    padding: 0.5rem 1rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    text-align: left;
}
.dropdown-item:hover {
    background: rgba(52, 152, 219, 0.08);
    color: var(--primary);
    text-decoration: none;
}
.dropdown-item-icon {
    font-size: 1rem;
    line-height: 1;
    opacity: 0.9;
}
.dropdown-menu-cari .dropdown-item {
    padding: 0.55rem 1.1rem;
    font-size: 0.925rem;
    text-align: left;
    justify-content: flex-start;
}
.dropdown-menu-cari .dropdown-item:hover {
    text-decoration: none;
}
.dropdown-menu-cari .dropdown-item:first-child {
    border-radius: 4px 4px 0 0;
}
.dropdown-menu-cari .dropdown-item:last-child {
    border-radius: 0 0 4px 4px;
}
.dropdown-menu-cari .dropdown-item + .dropdown-item {
    margin-top: 1px;
}
.dropdown-menu-cari .dropdown-item:hover {
    background: rgba(52, 152, 219, 0.1);
}
table.data-table .dropdown-menu {
    text-align: left;
}
table.data-table .dropdown-menu .dropdown-item {
    text-align: left;
    justify-content: flex-start;
}
.modal.modal-lg {
    max-width: 42rem;
}

.accordion-item {
    border-bottom: 1px solid var(--border);
}
.accordion-item:last-child {
    border-bottom: none;
}
.accordion-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 0;
    border: none;
    background: none;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    text-align: left;
    color: var(--text);
}
.accordion-trigger:hover {
    color: var(--primary);
}
.accordion-chevron {
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.accordion-item.open .accordion-chevron {
    transform: rotate(-135deg);
}
.accordion-content {
    overflow: hidden;
    transition: max-height 0.25s ease;
}
.accordion-item:not(.open) .accordion-content {
    max-height: 0 !important;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
}
.accordion-item.open .accordion-content {
    max-height: 2000px;
}
.accordion-item .accordion-content.table-wrap {
    margin-bottom: 0.5rem;
}

table.data-table-musteri .col-firma {
    min-width: 6rem;
}

table.data-table-urun {
    width: 100%;
}

table.data-table-urun .col-sira {
    width: 3rem;
    min-width: 3rem;
    text-align: center;
}

table.data-table-urun .col-urunkod {
    width: 120px;
    min-width: 120px;
}

table.data-table-urun .col-urunad {
    min-width: 8rem;
}

table.data-table-urun .col-kategori {
    width: 8rem;
    min-width: 6rem;
}

table.data-table-urun .col-birim {
    width: 5rem;
    min-width: 4rem;
}

table.data-table-urun .col-fiyat {
    width: 6rem;
    min-width: 5rem;
}

table.data-table-urun .col-kdv {
    width: 4rem;
    min-width: 3rem;
}

table.data-table-urun th.actions,
table.data-table-urun td.actions {
    width: 10rem;
    min-width: 9rem;
}

/* ----- Alerts ----- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-danger {
    background: #fde8e8;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* ----- Grid ----- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.stat-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ----- Dashboard (Ana Sayfa) ----- */
.dashboard-wrap {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr);
    gap: 1.5rem;
    align-items: flex-start;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.dashboard-stats .stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-card-musteri .stat-card-icon { background: rgba(52, 152, 219, 0.15); }
.stat-card-musteri .value { color: #2980b9; }
.stat-card-urun .stat-card-icon { background: rgba(155, 89, 182, 0.15); }
.stat-card-urun .value { color: #8e44ad; }
.stat-card-satis-adi .stat-card-icon { background: rgba(46, 204, 113, 0.15); }
.stat-card-satis-adi .value { color: #27ae60; }
.stat-card-satis-tutar .stat-card-icon { background: rgba(241, 196, 15, 0.2); }
.stat-card-satis-tutar .value { color: #d4a506; }
.stat-card-tahsilat .stat-card-icon { background: rgba(39, 174, 96, 0.2); color: #27ae60; font-weight: 700; font-size: 1.2rem; }
.stat-card-tahsilat .value { color: #1e8449; }

.stat-card-content {
    min-width: 0;
}

.dashboard-recent {
    max-width: 640px;
}

.recent-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.recent-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.recent-item-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    color: var(--text);
    text-decoration: none;
    flex: 1;
    min-width: 0;
}

.recent-item-link:hover {
    color: var(--primary);
}

.recent-item-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    flex-shrink: 0;
}

.recent-item-badge-satis {
    background: rgba(46, 204, 113, 0.2);
    color: #27ae60;
}

.recent-item-badge-tahsilat {
    background: rgba(52, 152, 219, 0.2);
    color: #2980b9;
}

.recent-item-firma {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-item-tutar {
    font-weight: 600;
    color: var(--text);
}

.recent-item-tarih {
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Dashboard hero */
.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr);
    gap: 1.5rem;
    align-items: center;
    background: radial-gradient(circle at top left, #6a89cc 0, #4a69bd 30%, #2c3e50 90%);
    color: #f8f9ff;
    border-radius: 18px;
    padding: 1.75rem 2rem;
    box-shadow: 0 14px 30px rgba(0,0,0,0.18);
    position: relative;
    overflow: hidden;
}

.dashboard-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 0 0, rgba(255,255,255,0.16), transparent 55%),
        radial-gradient(circle at 100% 0, rgba(52,152,219,0.26), transparent 60%);
    opacity: 0.5;
    pointer-events: none;
}

.dashboard-hero-left,
.dashboard-hero-right {
    position: relative;
    z-index: 1;
}

.dashboard-hero-kucuk-baslik {
    margin: 0 0 0.35rem 0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    opacity: 0.95;
}

.dashboard-hero-baslik {
    margin: 0 0 0.5rem 0;
    font-size: 1.4rem;
    font-weight: 700;
}

.dashboard-hero-aciklama {
    margin: 0 0 1.1rem 0;
    font-size: 0.95rem;
    max-width: 32rem;
    opacity: 0.9;
}

.dashboard-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.dashboard-hero-actions .btn-primary {
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.dashboard-hero-actions .btn-outline,
.dashboard-hero-actions .btn-outline-primary {
    border-color: rgba(255,255,255,0.6);
    color: #f8f9ff;
    background: transparent;
}

.dashboard-hero-actions .btn-outline:hover,
.dashboard-hero-actions .btn-outline-primary:hover {
    background: rgba(255,255,255,0.1);
}

.dashboard-hero-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

.dashboard-hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(0,0,0,0.18);
    backdrop-filter: blur(10px);
    font-size: 0.8rem;
}

.dashboard-hero-pill-label {
    opacity: 0.8;
}

.dashboard-hero-pill-value {
    font-weight: 600;
}

.dashboard-hero-mini-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0.8rem;
    background: rgba(0,0,0,0.2);
    border-radius: 14px;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.dashboard-hero-mini-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.dashboard-hero-mini-list .label {
    opacity: 0.8;
}

.dashboard-hero-mini-list .value {
    font-weight: 600;
}

@media (max-width: 960px) {
    .dashboard-hero {
        grid-template-columns: 1fr;
        padding: 1.4rem 1.25rem;
    }

    .dashboard-hero-right {
        align-items: flex-start;
    }

    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }
}

/* ----- Modal ----- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    width: 100%;
}

.modal.modal-toast {
    max-width: 320px;
}

.modal-toast .modal-body.text-center {
    text-align: center;
}

.modal-toast-danger .modal-body {
    background: #fde8e8;
    color: #c0392b;
}

.modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.15rem;
}

.modal-subtitle {
    margin: 0.25rem 0 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.modal-danger {
    max-width: 520px;
}

.modal-danger-header {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
}

.modal-danger-header h2 {
    color: #fff;
}

.modal-danger-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.modal-danger-subtitle {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.9;
}

.modal-danger-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 0.75rem;
    font-size: 1rem;
}

.modal-danger-text {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.modal-danger-list {
    margin: 0 0 0.75rem 1.1rem;
    padding-left: 0.8rem;
}

.modal-danger-list li {
    margin-bottom: 0.2rem;
}

.modal-danger-small {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.modal-header .btn[aria-label="Kapat"] {
    padding: 0.25rem 0.5rem;
    font-size: 1.5rem;
    line-height: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-header .btn[aria-label="Kapat"]:hover {
    color: var(--text);
}

.modal-body {
    padding: 1.25rem;
}

.modal-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.modal-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1rem;
}

.modal-form-grid .form-group {
    margin-bottom: 0;
}

.modal-form-grid .modal-form-full {
    grid-column: 1 / -1;
}

.modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.table-footer-text {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: #f8f9fa;
}

.table-footer-bakiye-label {
    text-align: right !important;
}

.table-footer-bakiye {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
}

.modal-sil-onay {
    max-width: 400px;
}

#musteri_sil_modal .modal-body {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-sil-icon {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
}

.modal-sil-icon svg {
    width: 56px;
    height: 56px;
    color: var(--warning);
}

.modal-sil-bilgi {
    font-size: 0.95rem;
    margin: 0 0 0.75rem 0;
    line-height: 1.5;
    text-align: center;
    width: 100%;
}

.modal-sil-bakiye {
    font-weight: 600;
    color: var(--text);
}

.modal-sil-soru {
    margin: 0 0 1rem 0;
    font-weight: 500;
    color: var(--text);
    text-align: center;
}

.modal-sil-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0;
}

.modal-sil-actions .btn {
    font-size: 0.85rem;
}

.modal-header a[aria-label="Kapat"] {
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    font-size: 1.5rem;
    line-height: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-header a[aria-label="Kapat"]:hover {
    color: var(--text);
}

/* ----- Utilities ----- */
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); font-size: 0.9rem; }
.mb-0 { margin-bottom: 0; }
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mt-1 { margin-top: 0.5rem; }

@media (max-width: 768px) {
    .panel-body {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        padding: 0.5rem;
    }
    .sidebar-nav a {
        padding: 0.5rem 0.75rem;
    }
    .sidebar-footer {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

/* Yazdırma */
@media print {
    @page {
        size: A4;
        margin: 14mm;
    }
    .sidebar,
    .page-header,
    .toolbar-row,
    .modal-overlay,
    .btn-print,
    .no-print {
        display: none !important;
    }
    table.data-table-cari th.actions,
    table.data-table-cari td.actions {
        display: none !important;
    }
    .only-print {
        display: block !important;
    }
    tr.only-print {
        display: table-row !important;
    }
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    .panel-body {
        display: block;
    }
}

.satis-proforma-yazdir {
    display: none;
}

@media print {
    body:has(.satis-proforma-yazdir-kopya) > *:not(.satis-proforma-yazdir-kopya) {
        display: none !important;
    }
    .satis-proforma-yazdir-kopya {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #fff !important;
        width: 100% !important;
    }

    .proforma {
        font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 8mm 0;
        color: #1a1a1a;
        font-size: 11pt;
        line-height: 1.35;
        box-sizing: border-box;
    }
    .proforma-header {
        text-align: center;
        margin-bottom: 22px;
        padding-bottom: 16px;
        border-bottom: 3px solid #1a1a1a;
    }
    .proforma-title {
        margin: 0 0 12px 0;
        font-size: 18pt;
        font-weight: 700;
        letter-spacing: 0.02em;
        color: #1a1a1a;
        text-transform: uppercase;
    }
    .proforma-meta {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 24px 32px;
        font-size: 11pt;
    }
    .proforma-meta-item {
        color: #333;
    }
    .proforma-table {
        width: 100%;
        table-layout: fixed;
        border-collapse: collapse;
        margin-top: 8px;
        font-size: 10.5pt;
    }
    .proforma-table th,
    .proforma-table td {
        border: 1px solid #333;
        padding: 8px 10px;
        text-align: left;
        vertical-align: top;
    }
    .proforma-table th {
        background: #2c3e50;
        color: #fff;
        font-weight: 700;
        text-align: center;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .proforma-table .col-no {
        width: 5%;
        text-align: center;
    }
    .proforma-table .col-urun {
        width: 47%;
        min-width: 0;
    }
    .proforma-table .col-miktar {
        width: 12%;
        text-align: right;
    }
    .proforma-table .col-fiyat {
        width: 18%;
        text-align: right;
    }
    .proforma-table .col-toplam {
        width: 18%;
        text-align: right;
    }
    .proforma-table tbody tr:nth-child(even) {
        background: #f8f9fa;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .proforma-table tbody tr {
        page-break-inside: avoid;
    }
    .proforma-table tfoot tr {
        background: #f0f0f0 !important;
        font-weight: 700;
        font-size: 11pt;
        color: #1a1a1a;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .proforma-table tfoot td {
        border: 1px solid #333;
        border-top: 2px solid #333;
        padding: 10px 12px;
    }
    .proforma-table tfoot td:empty {
        border-left: none;
        border-right: none;
        background: transparent !important;
    }
    .proforma-toplam-label {
        text-align: right;
        padding-right: 8px !important;
        white-space: nowrap;
    }
    .proforma-toplam-deger {
        text-align: right;
        font-size: 12pt;
    }
    .proforma-table .proforma-bos {
        text-align: center;
        color: #666;
        font-style: italic;
        padding: 24px;
    }
}

.satislar-print-area {
    display: none;
}

.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 0.5rem; }
.gap-1 { gap: 0.25rem; }
.text-nowrap { white-space: nowrap; }
.form-control { padding: 0.35rem 0.5rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9rem; }
.form-control-sm { padding: 0.25rem 0.4rem; font-size: 0.85rem; }

@media print {
    .sayfa-satislar-wrap .satislar-no-print {
        display: none !important;
    }
    .sayfa-satislar-wrap .satislar-print-area {
        display: block !important;
    }
    .satislar-print-doc {
        font-family: 'Segoe UI', Helvetica, Arial, sans-serif;
        font-size: 11pt;
        color: #1a1a1a;
        max-width: none;
    }
    .satislar-print-header {
        text-align: center;
        margin-bottom: 1.2rem;
        padding-bottom: 0.8rem;
        border-bottom: 2px solid #1a1a1a;
    }
    .satislar-print-header h1 {
        margin: 0 0 0.3rem 0;
        font-size: 18pt;
        font-weight: 700;
    }
    .satislar-print-tarih {
        margin: 0;
        font-size: 10pt;
        color: #444;
    }
    .satislar-print-musteri {
        margin-bottom: 1.2rem;
        page-break-inside: avoid;
    }
    .satislar-print-musteri h2 {
        margin: 0 0 0.5rem 0;
        font-size: 12pt;
        font-weight: 700;
        color: #2c3e50;
    }
    .satislar-print-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 0.6rem;
        font-size: 10pt;
    }
    .satislar-print-table th,
    .satislar-print-table td {
        border: 1px solid #333;
        padding: 6px 8px;
        text-align: left;
    }
    .satislar-print-table th {
        background: #2c3e50;
        color: #fff;
        font-weight: 700;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .satislar-print-table .col-tarih { width: 14%; }
    .satislar-print-table .col-urun { width: 38%; }
    .satislar-print-table .col-miktar { width: 12%; text-align: right; }
    .satislar-print-table .col-fiyat { width: 18%; text-align: right; }
    .satislar-print-table .col-toplam { width: 18%; text-align: right; }
    .satislar-print-table tfoot td {
        background: #f0f0f0;
        font-weight: 600;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .satislar-print-musteri-toplam {
        margin: 0 0 0.8rem 0;
        font-size: 10pt;
    }
    .satislar-print-genel {
        margin-top: 1rem;
        padding-top: 0.8rem;
        border-top: 2px solid #1a1a1a;
        font-size: 12pt;
    }
    .satislar-print-bos {
        text-align: center;
        color: #666;
        font-style: italic;
        padding: 2rem;
    }
}

.tahsilat-print-area {
    display: none;
}

@media print {
    .sayfa-tahsilat-wrap .tahsilat-no-print {
        display: none !important;
    }
    .sayfa-tahsilat-wrap .tahsilat-print-area {
        display: block !important;
    }
    .tahsilat-print-doc {
        font-family: 'Segoe UI', Helvetica, Arial, sans-serif;
        font-size: 11pt;
        color: #1a1a1a;
    }
    .tahsilat-print-header {
        text-align: center;
        margin-bottom: 1.2rem;
        padding-bottom: 0.8rem;
        border-bottom: 2px solid #1a1a1a;
    }
    .tahsilat-print-header h1 {
        margin: 0 0 0.3rem 0;
        font-size: 18pt;
        font-weight: 700;
    }
    .tahsilat-print-tarih {
        margin: 0;
        font-size: 10pt;
        color: #444;
    }
    .tahsilat-print-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 10pt;
    }
    .tahsilat-print-table th,
    .tahsilat-print-table td {
        border: 1px solid #333;
        padding: 8px 10px;
        text-align: left;
    }
    .tahsilat-print-table th {
        background: #2c3e50;
        color: #fff;
        font-weight: 700;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .tahsilat-print-table tfoot td {
        background: #f0f0f0;
        font-weight: 700;
        border-top: 2px solid #333;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .tahsilat-print-bos {
        text-align: center;
        color: #666;
        font-style: italic;
        padding: 2rem;
    }
}

/* Tahsilat bakiye kutusu */
.tahsilat-bakiye-box {
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    background: #f1f5f9;
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all 0.2s ease;
    min-height: 38px;
    display: flex;
    align-items: center;
}
.tahsilat-bakiye-borc {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}
.tahsilat-bakiye-alacak {
    background: #f0fdf4;
    border-color: #86efac;
    color: #16a34a;
}
.tahsilat-bakiye-temiz {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}

/* Filtre çubuğu */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.filter-bar-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex: 1;
}
.filter-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}
.filter-input {
    padding: 0.4rem 0.6rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.82rem;
    color: var(--text);
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.filter-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
}
.btn-filter {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
    transition: all 0.15s ease;
}
.btn-filter:hover {
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.4);
    transform: translateY(-1px);
}
