/* ==========================================
   KASA PANELİ CSS
   Mavi/mor tema
   ========================================== */

:root {
    --primary: #8e44ad;
    --primary-dark: #7d3c98;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
    --muted: #95a5a6;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --bg: #f5f3f7;
    --white: #fff;
    --sidebar-width: 240px;
    --topbar-height: 60px;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,.12);
}

/* Masa Arama Filtresi */
.table-filter-bar {
    margin-bottom: 16px;
    display: flex;
    justify-content: flex-end;
}
.filter-search {
    position: relative;
    width: 220px;
}
.filter-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 0.85rem;
}
.filter-search input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: var(--white);
    transition: border-color .2s;
}
.filter-search input:focus {
    outline: none;
    border-color: var(--primary);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: #333;
    min-height: 100vh;
    font-size: 15px;
}

/* ===== LOGIN PAGE ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--dark), var(--primary-dark));
}
.login-box {
    background: var(--white);
    padding: 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}
.login-box .logo-area .icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 16px;
}
.login-box h1 { font-size: 22px; margin-bottom: 4px; color: var(--dark); }
.login-box .subtitle { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.login-box .form-group { margin-bottom: 16px; text-align: left; }
.login-box label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: #555; }
.login-box input[type="text"],
.login-box input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    font-size: 15px;
    transition: border-color .2s;
}
.login-box input:focus { border-color: var(--primary); outline: none; }
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; }
.alert-error { background: #fdecea; color: var(--danger); border: 1px solid #f5c6cb; }

/* ===== LAYOUT ===== */
.cashier-wrapper { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
    transition: transform .3s;
}
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-header .logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.sidebar-header h2 { font-size: 15px; font-weight: 600; }
.sidebar-header small { font-size: 11px; opacity: .6; }
.sidebar-menu { padding: 12px 0; }
.sidebar-menu-title {
    padding: 8px 20px 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: .4;
    font-weight: 600;
}
.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    font-size: 14px;
    transition: all .2s;
    position: relative;
}
.sidebar-menu a:hover { background: rgba(255,255,255,.05); color: #fff; }
.sidebar-menu a.active { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-menu a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}
.sidebar-menu .badge {
    margin-left: auto;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}
.sidebar-stat {
    padding: 10px 20px;
    font-size: 13px;
    color: rgba(255,255,255,.6);
    display: flex;
    align-items: center;
    gap: 8px;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== TOPBAR ===== */
.cashier-topbar {
    height: var(--topbar-height);
    background: var(--white);
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-left h1 { font-size: 18px; font-weight: 600; }
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--dark);
}
.topbar-right { display: flex; align-items: center; gap: 16px; }
.cashier-user { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.cashier-user .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.logout {
    color: var(--danger);
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== CONTENT ===== */
.content-area { padding: 20px 24px; flex: 1; }
.cashier-footer-powered {
    text-align: center;
    padding: 16px;
    font-size: 12px;
    color: var(--muted);
}
.cashier-footer-powered a { color: var(--primary); text-decoration: none; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #219a52; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-outline { background: transparent; border: 1px solid #ddd; color: #555; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }

/* ===== TABLES GRID ===== */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* ===== TABLE CARD ===== */
.table-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform .2s;
}
.table-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.table-occupied { border-left: 4px solid var(--primary); }
.table-empty { border-left: 4px solid var(--light); opacity: .7; }

.table-card-header {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.table-number {
    font-weight: 700;
    font-size: 15px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}
.table-number small { font-weight: 400; color: #999; font-size: 12px; }
.order-count {
    font-size: 12px;
    background: var(--primary);
    color: #fff;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.table-card-body { padding: 12px 16px; }
.empty-body { text-align: center; padding: 20px 16px; }
.empty-table-text { color: var(--muted); font-size: 14px; }
.empty-table-text i { color: var(--success); margin-right: 4px; }

/* Mini order inside table card */
.table-orders-summary { margin-bottom: 12px; }
.mini-order {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid #f8f8f8;
    font-size: 13px;
}
.mini-order:last-child { border-bottom: none; }
.mini-order-num { font-weight: 600; color: var(--dark); }
.mini-order-status { color: var(--muted); font-size: 12px; }
.mini-order-amount { margin-left: auto; font-weight: 600; }

/* Table totals */
.table-totals {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px 14px;
}
.total-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
}
.total-row.remaining { color: var(--danger); font-weight: 600; }
.total-row.paid { color: var(--success); }

.table-card-actions {
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 200;
}
.payment-modal,
.account-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--white);
    border-radius: 16px;
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 201;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
}
.modal-body { padding: 20px 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Payment form */
.payment-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 15px;
}
.remaining-amount { font-weight: 700; color: var(--primary); font-size: 18px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #555; }
.form-group select,
.form-group textarea,
.form-group input[type="number"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
}
.form-group select:focus,
.form-group textarea:focus,
.form-group input:focus { border-color: var(--primary); outline: none; }
.input-large { font-size: 20px !important; font-weight: 700; text-align: center; }

.payment-methods {
    display: flex;
    gap: 10px;
}
.method-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all .2s;
    text-align: center;
}
.method-option input { display: none; }
.method-option.active,
.method-option:has(input:checked) {
    border-color: var(--primary);
    background: rgba(142, 68, 173, .05);
    color: var(--primary);
}

/* ===== Account Detail ===== */
.account-orders { margin-bottom: 16px; }
.account-order {
    background: #f8f9fa;
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 8px;
}
.account-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
}
.account-order-items { font-size: 13px; color: #666; }
.account-order-items li { padding: 2px 0; }
.account-summary {
    background: var(--dark);
    color: #fff;
    padding: 16px;
    border-radius: var(--radius);
    text-align: center;
}
.account-summary .total-big { font-size: 28px; font-weight: 700; }
.account-payments { margin-top: 12px; }
.account-payment-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 12px;
    font-size: 13px;
    background: #f0f0f0;
    border-radius: 4px;
    margin-bottom: 4px;
}

/* ===== PAYMENTS PAGE ===== */
.payments-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.date-form input[type="date"] {
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.summary-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}
.summary-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.summary-card.total .summary-icon { background: rgba(142,68,173,.1); color: var(--primary); }
.summary-card.cash .summary-icon { background: rgba(39,174,96,.1); color: var(--success); }
.summary-card.card-pay .summary-icon { background: rgba(52,152,219,.1); color: var(--info); }
.summary-card.other-pay .summary-icon { background: rgba(149,165,166,.1); color: var(--muted); }
.summary-label { font-size: 12px; color: var(--muted); display: block; }
.summary-value { font-size: 18px; color: var(--dark); }
.summary-count { margin-left: auto; font-size: 12px; color: var(--muted); }

/* Data Table */
.payments-list { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { 
    text-align: left;
    padding: 14px 16px;
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 2px solid #eee;
    white-space: nowrap;
}
.data-table td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid #f5f5f5;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafafa; }
.data-table .amount { font-weight: 700; color: var(--dark); }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: .4; }

/* ===== NOTIFICATION ANIMATION ===== */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.empty-state p { font-size: 16px; }

/* Loading */
.loading { text-align: center; padding: 40px; color: var(--muted); font-size: 14px; }

/* ===== SIDEBAR OVERLAY (mobile) ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.active { display: block; }
    .sidebar-toggle { display: block; }
    .main-content { margin-left: 0; }
    .tables-grid { grid-template-columns: 1fr; }
    .payment-methods { flex-direction: column; }
    .summary-cards { grid-template-columns: repeat(2, 1fr); }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 10px 10px; }
}
