* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 500px;
}

.webuye-durum-banner {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.35);
}

.webuye-durum-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

.card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h1 {
    color: #667eea;
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
}

.logo p {
    color: #666;
    font-size: 14px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.required {
    color: #e74c3c;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 12px;
}

.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    padding: 10px 20px;
    width: auto;
}

.btn-secondary:hover {
    background: #5a6268;
}

.message {
    margin-top: 20px;
    padding: 12px;
    border-radius: 8px;
    display: none;
    font-size: 14px;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Dashboard */
#profileImageWrapper:hover #userProfileImage,
#profileImageWrapper:hover #userProfilePlaceholder {
    transform: scale(1.05);
}

#profileImageWrapper:hover .profile-edit-icon {
    background: #5568d3;
}

.header {
    background: white;
    padding: 15px 20px;
    border-radius: 15px;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.user-info {
    text-align: center;
}

.user-info h2 {
    color: #333;
    font-size: 20px;
    margin-bottom: 10px;
}

.dashboard {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.balance-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.balance-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.password-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 18px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.password-card h3 {
    color: #1f2937;
    font-size: 16px;
    margin-bottom: 10px;
}

.password-card p {
    color: #4b5563;
    font-size: 13px;
    margin-bottom: 12px;
}

.inline-message {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    display: none;
}

.inline-message.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
    display: block;
}

.inline-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    display: block;
}

.inline-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    display: block;
}

/* Masa uyarı bandı (yetersiz bakiye vb.) — telefonda kaydırsa da görünsün */
.masa-uyari-banner {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 2px solid #dc2626;
    border-radius: 10px;
    color: #991b1b;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.masa-uyari-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    z-index: 10;
}

.modal.active {
    display: flex;
}

/* Ayarlar modalı */
#settingsModal {
    z-index: 100;
}

#settingsModal.active {
    z-index: 100;
}

/* Ayarlar modal içeriği - kırpma container'ının üstünde olmalı */
#settingsModal .modal-content {
    position: relative;
    z-index: 1;
}

/* Kırpma modalı ayarlar modalının üstünde olmalı */
#cropImageModal {
    z-index: 200 !important;
    background: rgba(0,0,0,0.7) !important;
}

#cropImageModal.active {
    z-index: 200 !important;
    display: flex !important;
}

/* Cropper.js özelleştirmeleri */
.cropper-container {
    direction: ltr;
}

.cropper-view-box {
    outline: 2px solid #667eea;
    outline-color: rgba(102, 126, 234, 0.75);
}

.cropper-face {
    background-color: rgba(102, 126, 234, 0.1);
}

.cropper-line {
    background-color: #667eea;
}

.cropper-point {
    background-color: #667eea;
    width: 8px;
    height: 8px;
}

/* Inline kırpma wrapper (modal dışında) */
#inlineCropWrapper {
    z-index: 10000 !important;
}

#inlineCropWrapper .modal-content {
    z-index: 10001 !important;
}

/* Profil fotoğrafı kırpma container */
#profileImageContainer {
    position: relative;
    overflow: hidden;
}

#profileImageContainer .cropper-container {
    border-radius: 50%;
    overflow: hidden;
}

#profileImageContainer .cropper-view-box {
    border-radius: 50% !important;
    outline: 2px solid #667eea !important;
    outline-offset: -2px;
}

#profileImageContainer .cropper-face {
    border-radius: 50% !important;
}

.cropper-point.point-se {
    cursor: se-resize;
}

.cropper-point.point-sw {
    cursor: sw-resize;
}

.cropper-point.point-nw {
    cursor: nw-resize;
}

.cropper-point.point-ne {
    cursor: ne-resize;
}

.cropper-point.point-n,
.cropper-point.point-s {
    cursor: ns-resize;
}

/* Masa Detay modalı - kart grid */
.masa-detay-modal-content {
    max-width: 560px;
    width: 100%;
}

.masa-detay-desc {
    margin-bottom: 16px;
    color: #666;
    font-size: 14px;
}

.masa-detay-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    padding: 4px;
}

@media (max-width: 480px) {
    .masa-detay-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }
}

@media (min-width: 481px) and (max-width: 600px) {
    .masa-detay-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.masa-kart {
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: transform 0.15s, box-shadow 0.15s;
    min-height: 52px;
    min-width: 0;
    padding: 4px;
}

.masa-kart--bos {
    background: linear-gradient(145deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1.5px solid #059669;
    cursor: pointer;
}

.masa-kart--bos:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.masa-kart--dolu {
    background: linear-gradient(145deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1.5px solid #dc2626;
    cursor: not-allowed;
    opacity: 0.9;
}

.masa-kart--dolu.masa-kart--dolu-tiklanabilir {
    cursor: pointer;
    opacity: 1;
}

.masa-kart--dolu.masa-kart--dolu-tiklanabilir:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.masa-kart--rezerve {
    background: linear-gradient(145deg, #ede9fe 0%, #ddd6fe 100%);
    color: #5b21b6;
    border: 1.5px solid #7c3aed;
    cursor: not-allowed;
    opacity: 0.95;
}

.masa-kart--kapali {
    background: linear-gradient(145deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #6b7280;
    border: 1.5px solid #9ca3af;
    cursor: not-allowed;
    opacity: 0.85;
}

/* Tik kapalıyken: sadece masa numarası, dolu/boş bilgisi yok; nötr tıklanabilir kart */
.masa-kart--normal {
    background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
    color: #334155;
    border: 1.5px solid #94a3b8;
    cursor: pointer;
}

.masa-kart--normal:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.2);
}

.masa-kart-numara {
    font-size: clamp(11px, 2.8vw, 15px);
    margin-bottom: 1px;
    text-align: center;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.masa-kart-durum {
    font-size: clamp(9px, 2.2vw, 11px);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.masa-kart-dolu-tur {
    font-size: clamp(8px, 2vw, 10px);
    font-weight: 600;
    margin-top: 1px;
    opacity: 0.95;
}

.masa-kart-uye-ad {
    font-size: clamp(8px, 2vw, 11px);
    font-weight: 500;
    margin-top: 2px;
    opacity: 0.95;
    display: block;
}

.masa-kart-kalan-dakika {
    font-size: clamp(9px, 2.2vw, 11px);
    font-weight: 700;
    margin-top: 0;
    letter-spacing: 0.02em;
}

/* Inline masa kartları (Masa Aç bölümünde, ayrı modal yok) */
.masa-inline-wrap {
    margin-bottom: 16px;
}

.masa-inline-desc {
    margin-bottom: 12px;
    color: #666;
    font-size: 14px;
}

.masa-detay-grid-inline {
    /* Ayrı kaydırma yok; masalar sayfa ile birlikte aşağı doğru akar */
}

.cropper-point.point-e,
.cropper-point.point-w {
    cursor: ew-resize;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #1f2937;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
}

.balance-amount {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 8px;
}

.bonus-amount {
    font-size: 14px;
    opacity: 0.9;
}

.aktif-oturumlar-section {
    margin-bottom: 30px;
    display: none; /* Başlangıçta gizli, oturum varsa gösterilecek */
}

.aktif-oturumlar-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
}

.oturumlar-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.oturum-kart {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.oturum-bilgi {
    flex: 1;
}

.oturum-bilgi .masa-adi {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.oturum-bilgi .oturum-detay {
    font-size: 14px;
    opacity: 0.9;
}

.kapat-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.kapat-btn:hover {
    background: white;
    color: #10B981;
}

.masalar-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

.masalar-section p {
    color: #4b5563;
    font-size: 13px;
    margin-bottom: 12px;
}

.masa-form .form-group {
    margin-bottom: 15px;
}

.masa-form select, .masa-form input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.masa-form select:focus, .masa-form input:focus {
    outline: none;
    border-color: #667eea;
}

.masalar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.masa-card {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.masa-card:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.masa-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.masa-card .masa-no {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.masa-card .masa-grup {
    font-size: 12px;
    color: #666;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

