/**
 * KERMES POS - Ana Stil Dosyası
 * Renkler: #2563eb, #1e293b, #f8fafc, #ffffff
 */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --dark: #1e293b;
    --light: #f8fafc;
    --white: #ffffff;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;
    --border-radius: 20px;
    --shadow: 0 4px 20px rgba(30, 41, 59, 0.12);
    --shadow-hover: 0 8px 30px rgba(37, 99, 235, 0.2);
    --pos-header-height: 68px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--light);
    color: var(--dark);
}

/* Tam ekran POS - 2 kolon: sol (header+ürünler) | sağ (fiş) */
.pos-wrapper {
    display: flex;
    flex-direction: row;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    align-items: stretch;
}

.pos-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

/* Sol ve sağ header ortak yükseklik */
.pos-header,
.pos-cart-header {
    height: var(--pos-header-height);
    min-height: var(--pos-header-height);
    max-height: var(--pos-header-height);
    padding: 0 1.25rem;
    background: var(--dark);
    color: var(--white);
    display: flex;
    align-items: center;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Sol üst başlık çubuğu */
.pos-header {
    justify-content: space-between;
    z-index: 100;
}

.pos-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1;
}

.pos-header h1 i {
    color: var(--primary);
}

.pos-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pos-header-actions .btn {
    border-radius: 12px;
    font-weight: 600;
    padding: 0.4rem 0.85rem;
    min-height: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Ana 3 kolonlu alan */
.pos-main {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 0;
}

/* Sol kolon - Kategoriler (%15) */
.pos-categories {
    width: 15%;
    min-width: 140px;
    background: var(--white);
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pos-categories-header {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.pos-categories-header h2 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    color: var(--dark);
}

.pos-categories-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Kategori kartı */
.category-card {
    position: relative;
    min-height: 88px;
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
    background-size: cover;
    background-position: center;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-card.has-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(30, 41, 59, 0.4);
    border-radius: inherit;
    transition: background 0.2s ease;
    z-index: 1;
}

.category-card:hover,
.category-card.active {
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.category-card.has-image:hover::before,
.category-card.has-image.active::before {
    background: rgba(37, 99, 235, 0.5);
}

.category-card.active:not(.has-image) {
    background: linear-gradient(135deg, #bfdbfe 0%, #eff6ff 100%);
    border-color: var(--primary);
}

.category-card-body {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.75rem 0.5rem;
    width: 100%;
}

.category-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1rem;
    max-width: 92%;
    background: rgba(255, 255, 255, 0.95);
    color: var(--dark);
    font-weight: 700;
    font-size: 0.82rem;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
    text-align: center;
    line-height: 1.25;
    word-break: break-word;
    transition: all 0.2s ease;
}

.category-card:hover .category-card-btn {
    transform: scale(1.03);
}

.category-card.active .category-card-btn {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}

.category-drag-handle {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    color: #64748b;
    cursor: grab;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.category-drag-handle:active {
    cursor: grabbing;
}

.category-sort-ghost {
    opacity: 0.4;
}

.category-sort-chosen {
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35) !important;
    border-color: var(--primary) !important;
}

/* Kategori yönetim sayfası */
.category-manage-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.category-manage-list {
    list-style: none;
    margin: 0;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.category-manage-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--light);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    cursor: default;
    position: relative;
}

.category-manage-item .category-drag-handle {
    position: static;
    transform: none;
    flex-shrink: 0;
}

.category-manage-thumb {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.category-manage-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-manage-thumb i {
    font-size: 1.5rem;
    color: var(--primary);
}

.category-manage-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.category-manage-info strong {
    font-size: 1rem;
    color: var(--dark);
}

.category-manage-info small {
    color: #64748b;
    font-weight: 600;
}

/* Orta kolon - Ürünler (kalan alan) */
.pos-products {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--light);
}

.pos-products-header {
    padding: 1rem 1.25rem;
    background: var(--white);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.pos-products-header h2,
.pos-products-header .products-header-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pos-products-header .active-category-name {
    color: var(--primary);
    font-weight: 600;
}

.category-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: 0.25rem;
}

.btn-header-action {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.15s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.btn-header-action.edit {
    background: #eff6ff;
    color: var(--primary);
}

.btn-header-action.edit:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-header-action.delete {
    background: #fee2e2;
    color: var(--danger);
}

.btn-header-action.delete:hover {
    background: var(--danger);
    color: var(--white);
}

.pos-products-grid {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    align-content: start;
}

/* Ürün kartı */
.product-card {
    background: var(--white);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    user-select: none;
    min-height: 180px;
}

.product-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
    transform: scale(1.02);
}

.product-card:active {
    transform: scale(0.98);
}

.product-card-image {
    width: 100%;
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    overflow: hidden;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card-image .placeholder-icon {
    font-size: 3rem;
    color: #94a3b8;
}

.product-card-body {
    padding: 0.85rem 1rem;
}

.product-card-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--dark);
    margin-bottom: 0.35rem;
    line-height: 1.3;
}

.product-card-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
    text-align: right;
}

/* Sağ kolon - Fiş (tam yükseklik, header hizalı) */
.pos-cart {
    width: 32%;
    min-width: 260px;
    max-width: 380px;
    flex-shrink: 0;
    align-self: stretch;
    background: var(--white);
    border-left: 2px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pos-cart-header {
    justify-content: space-between;
    width: 100%;
    gap: 0.75rem;
}

.pos-cart-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    line-height: 1;
}

.pos-cart-clock {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
}

/* Sepet kalemleri */
.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #94a3b8;
    gap: 0.75rem;
    padding: 2rem;
    text-align: center;
}

.cart-empty i {
    font-size: 3rem;
}

.cart-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--light);
    border-radius: 14px;
    margin-bottom: 0.5rem;
    border: 1px solid #e2e8f0;
}

.cart-item-top {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    min-width: 0;
}

.cart-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.btn-cart-remove {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: #fee2e2;
    color: var(--danger);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: all 0.15s ease;
}

.btn-cart-remove:hover {
    background: var(--danger);
    color: var(--white);
}

.btn-cart-remove:active {
    transform: scale(0.95);
}

.cart-item-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-unit-price {
    font-size: 0.75rem;
    color: #64748b;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.cart-item-qty .btn-qty {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 10px;
    border: none;
    background: var(--white);
    color: var(--dark);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: all 0.15s ease;
}

.cart-item-qty .btn-qty:hover {
    background: var(--primary);
    color: var(--white);
}

.cart-item-qty .btn-qty:active {
    transform: scale(0.95);
}

.cart-item-qty .qty-value {
    min-width: 32px;
    text-align: center;
    font-weight: 800;
    font-size: 1.1rem;
}

.cart-item-total {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--primary);
    text-align: right;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Sepet alt alanı */
.pos-cart-footer {
    padding: 1rem 1.25rem;
    border-top: 2px solid #e2e8f0;
    background: var(--white);
    flex-shrink: 0;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.cart-total-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
}

.cart-total-amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    text-align: right;
    white-space: nowrap;
}

/* Aksiyon butonları */
.cart-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-cart-action {
    flex: 1;
    padding: 1rem;
    border-radius: 14px;
    border: none;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    min-height: 56px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn-cart-action:active {
    transform: scale(0.97);
}

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

.btn-clear:hover {
    background: var(--danger);
    color: var(--white);
}

.btn-checkout {
    flex: 2;
    background: var(--primary);
    color: var(--white);
    font-size: 1.15rem;
}

.btn-checkout:hover {
    background: var(--primary-dark);
}

.btn-checkout:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* Ekleme butonları */
.btn-add-item {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: var(--primary);
    color: var(--white);
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-add-item:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* Yazdırma alanı (gizli) */
#print-area {
    display: none;
}

/* Fiş yazdırma içeriği - POS ve Satışlar ortak */
.receipt-print {
    width: 80mm;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    color: #000;
    text-align: center;
}

/* Fiş numarası - KERMES POS ile aynı stil, en üstte büyük */
.receipt-print .receipt-no-large {
    text-align: center;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 2px;
    margin: 0 0 6px 0;
    line-height: 1.1;
    width: 100%;
}

.receipt-print .receipt-datetime {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #000;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 6px;
    width: 100%;
}

.receipt-print .receipt-brand {
    text-align: center;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 1px;
    margin-bottom: 4px;
    width: 100%;
}

.receipt-print .receipt-subtitle {
    text-align: center;
    font-size: 11px;
    margin-bottom: 6px;
    color: #333;
    width: 100%;
}

.receipt-print .receipt-item-detail {
    font-size: 10px;
    color: #666;
    text-align: left;
    padding-left: 4px;
    margin-bottom: 3px;
}

.receipt-print .receipt-thanks {
    text-align: center;
    margin-top: 12px;
    font-size: 12px;
    font-weight: 600;
}

.receipt-print .receipt-divider {
    border-top: 1px dashed #000;
    margin: 8px 0;
    width: 100%;
}

.receipt-print .receipt-row {
    display: flex;
    justify-content: space-between;
    text-align: left;
    font-weight: 600;
    margin-bottom: 2px;
}

.receipt-print .receipt-total {
    font-size: 15px;
    font-weight: 900;
    margin-top: 4px;
}

/* Fiş artık iframe ile yazdırılıyor - aşağıdaki kurallar yedek */
@media print {
    @page {
        size: 80mm auto;
        margin: 0;
    }
}

/* Responsive - Tablet */
@media (max-width: 1200px) {
    .pos-categories {
        width: 16%;
        min-width: 120px;
    }

    .pos-cart {
        width: 30%;
        min-width: 240px;
        max-width: 340px;
    }

    .pos-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }

    .cart-total-amount {
        font-size: 1.65rem;
    }
}

/* Dar ekran: sepet sağda kalır, kategoriler üst şerit olur */
@media (max-width: 992px) {
    .pos-main {
        flex-direction: column;
    }

    .pos-cart {
        width: 28%;
        min-width: 220px;
        max-width: 300px;
    }

    .pos-categories {
        width: 100%;
        min-width: 0;
        max-height: 96px;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }

    .pos-categories-header {
        display: none;
    }

    .pos-categories-list {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0.5rem;
    }

    .category-card {
        min-width: 100px;
        min-height: 68px;
        flex-shrink: 0;
    }

    .pos-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .product-card {
        min-height: 150px;
    }

    .cart-total-amount {
        font-size: 1.45rem;
    }

    .btn-cart-action {
        padding: 0.75rem;
        min-height: 48px;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .pos-cart {
        width: 26%;
        min-width: 200px;
        max-width: 260px;
    }

    .pos-header h1 {
        font-size: 1rem;
    }

    .pos-header-actions .btn {
        padding: 0.35rem 0.6rem;
        min-height: 36px;
        height: 36px;
        font-size: 0.8rem;
    }

    .pos-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    }

    .cart-item-total {
        min-width: 70px;
        font-size: 0.9rem;
    }
}

/* Scrollbar özelleştirme */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ─── Kart Aksiyon Butonları ─── */
.category-card,
.product-card {
    position: relative;
}

.card-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 4px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.product-card:hover .card-actions,
.card-actions:focus-within {
    opacity: 1;
}

.btn-card-action {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.btn-card-action.edit {
    background: var(--white);
    color: var(--primary);
}

.btn-card-action.edit:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-card-action.delete {
    background: var(--white);
    color: var(--danger);
}

.btn-card-action.delete:hover {
    background: var(--danger);
    color: var(--white);
}

/* Dokunmatik ekran: aksiyonlar her zaman görünsün */
@media (hover: none) {
    .card-actions {
        opacity: 1;
    }
}

/* ─── Modallar ─── */
.pos-modal {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 20px 60px rgba(30, 41, 59, 0.25);
}

.pos-modal .modal-header {
    background: var(--dark);
    color: var(--white);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    padding: 1rem 1.25rem;
}

.pos-modal .modal-header .btn-close {
    filter: invert(1);
}

.pos-modal .modal-body {
    padding: 1.5rem;
}

.pos-modal .modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #e2e8f0;
}

.pos-modal .form-control,
.pos-modal .form-select {
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.pos-modal .form-control:focus,
.pos-modal .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.image-preview img {
    max-width: 120px;
    max-height: 120px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

/* ─── Satışlar Sayfası ─── */
html.sales-html,
body.sales-page {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
    min-height: 100%;
}

.sales-wrapper {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--light);
}

.sales-main {
    flex: 1;
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.stat-icon.today  { background: #dbeafe; color: var(--primary); }
.stat-icon.week   { background: #dcfce7; color: var(--success); }
.stat-icon.month  { background: #fef3c7; color: var(--warning); }
.stat-icon.total  { background: #f1f5f9; color: var(--dark); }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--dark);
}

.sales-table-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: visible;
}

.sales-table-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
}

.sales-table-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.sales-table thead th {
    background: var(--light);
    font-weight: 700;
    font-size: 0.85rem;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
    padding: 0.85rem 1rem;
}

.sales-table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
}

.btn-detail,
.btn-delete,
.btn-print {
    border-radius: 10px;
    font-weight: 600;
    min-height: 36px;
    min-width: 36px;
    padding: 0.35rem 0.65rem;
}

.sales-actions {
    display: flex;
    gap: 0.35rem;
    justify-content: center;
    align-items: center;
}

.sales-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    background: var(--light);
}

.sales-pagination-info {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 600;
}

.sales-pagination-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.sales-pagination-controls .btn-page {
    min-width: 40px;
    height: 40px;
    padding: 0 0.65rem;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    background: var(--white);
    color: var(--dark);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sales-pagination-controls .btn-page:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.sales-pagination-controls .btn-page.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.sales-pagination-controls .btn-page:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.sales-pagination-controls .btn-page-nav {
    min-width: auto;
    padding: 0 0.85rem;
}

/* PIN giriş modalı */
.pin-input {
    font-size: 2rem;
    letter-spacing: 0.5rem;
    font-weight: 700;
    border-radius: 14px;
    border: 2px solid #e2e8f0;
    max-width: 180px;
    margin: 0 auto;
}

.pin-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.pin-error {
    font-size: 0.9rem;
    font-weight: 600;
    min-height: 1.25rem;
}

/* Satış detay modal */
.sale-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding: 0.85rem 1rem;
    background: var(--light);
    border-radius: 12px;
    font-weight: 600;
}

.sale-detail-meta i {
    color: var(--primary);
    margin-right: 0.3rem;
}

.sale-detail-table thead th {
    background: var(--light);
    font-size: 0.85rem;
}

.detail-total-row td {
    font-size: 1.1rem;
    color: var(--primary);
    border-top: 2px solid #e2e8f0;
    padding-top: 0.85rem !important;
}

/* Satış filtresi */
.sales-filter-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.sales-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
}

.sales-filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 160px;
}

.sales-filter-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
}

.sales-filter-field .form-control {
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    padding: 0.6rem 0.85rem;
}

.btn-filter {
    border-radius: 12px;
    font-weight: 700;
    padding: 0.6rem 1.1rem;
    min-height: 44px;
    white-space: nowrap;
}

.sales-filter-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    background: var(--light);
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
}

.sales-filter-summary i {
    color: var(--primary);
    margin-right: 0.3rem;
}

/* Rapor yazdırma */
#report-print-area {
    display: none;
}

.report-print {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    width: 100%;
    max-width: 210mm;
    padding: 10mm;
    color: #000;
}

.report-print .report-title {
    text-align: center;
    font-size: 20px;
    font-weight: 900;
    margin-bottom: 4px;
}

.report-print .report-subtitle {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.report-print .report-period {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}

.report-print .report-section-title {
    font-size: 13px;
    font-weight: 900;
    margin: 10px 0 6px;
    text-transform: uppercase;
}

.report-print .report-divider {
    border-top: 1px dashed #000;
    margin: 8px 0;
}

.report-print .report-row {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    margin-bottom: 4px;
}

.report-print .report-grand-total {
    font-size: 15px;
    font-weight: 900;
    margin-top: 6px;
}

.report-print .report-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
    font-size: 11px;
}

.report-print .report-table th,
.report-print .report-table td {
    padding: 4px 6px;
    border-bottom: 1px solid #ccc;
}

.report-print .report-table th {
    font-weight: 700;
    text-align: left;
    background: #f1f5f9;
}

.report-print .report-table .text-center { text-align: center; }
.report-print .report-table .text-end { text-align: right; }

.report-print .report-product-group {
    margin-bottom: 10px;
}

.report-print .report-product-cat {
    font-weight: 800;
    font-size: 12px;
    margin-bottom: 4px;
    padding: 4px 0;
    border-bottom: 1px solid #999;
}

.report-print .report-footer {
    text-align: center;
    font-size: 10px;
    color: #666;
    margin-top: 12px;
}

.report-print .report-empty {
    text-align: center;
    color: #666;
    font-style: italic;
}

@media print {
    body.printing-report * {
        visibility: hidden;
    }

    body.printing-report #report-print-area,
    body.printing-report #report-print-area * {
        visibility: visible;
    }

    body.printing-report #report-print-area {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
}

/* ─── Login Sayfası ─── */
body.login-page {
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, var(--dark) 0%, #0f172a 50%, #1e3a8a 100%);
}

.login-wrapper {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--white);
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
    padding: 2.5rem 2rem;
    text-align: center;
}

.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--white);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
}

.login-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--dark);
    margin: 0 0 0.35rem;
}

.login-subtitle {
    color: #64748b;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.login-alert {
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: left;
    margin-bottom: 1.25rem;
}

.login-form {
    text-align: left;
}

.login-form .form-label {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.9rem;
}

.login-form .input-group-text {
    background: var(--light);
    border: 2px solid #e2e8f0;
    border-right: none;
    color: var(--primary);
}

.login-form .form-control {
    border: 2px solid #e2e8f0;
    border-left: none;
    border-radius: 0 12px 12px 0;
    padding: 0.75rem 1rem;
}

.login-form .input-group:focus-within .input-group-text,
.login-form .input-group:focus-within .form-control {
    border-color: var(--primary);
    box-shadow: none;
}

.login-form .input-group-text {
    border-radius: 12px 0 0 12px;
}

.login-submit {
    border-radius: 14px;
    font-weight: 700;
    padding: 0.85rem;
    min-height: 56px;
    font-size: 1.05rem;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

.login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}
