@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
    --primary: #059669;
    --primary-hover: #047857;
    --primary-light: #ecfdf5;
    --secondary: #475569;
    --dark: #0f172a;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --border-color: #e2e8f0;
}

html, body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1e293b;
    background-color: #f1f5f9;
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

/* ======================================================== */
/* 0. ANA UYGULAMA ROOT DÜZENİ */
/* ======================================================== */
.app-window-root {
    display: flex;
    flex-direction: row;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background-color: #f1f5f9;
}

.app-main-wrapper {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ======================================================== */
/* 1. ÜST PANEL BAŞLIĞI (HEADER) - Görsel 1 & 2 Birebir */
/* ======================================================== */
.app-top-header {
    height: 52px;
    flex-shrink: 0;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    position: relative;
    z-index: 900;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    -webkit-app-region: drag;
    user-select: none;
}

.app-top-header button,
.app-top-header input,
.app-top-header a,
.app-top-header .btn-top-action,
.app-top-header .win-btn,
.app-top-header .user-role-badge {
    -webkit-app-region: no-drag;
}

.top-header-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.brand-badge-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.top-logo {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    flex-shrink: 0;
}

.brand-text-container {
    display: flex;
    flex-direction: column;
}

.top-brand-title {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #0f172a;
    line-height: 1.1;
    white-space: nowrap;
}

.top-brand-subtitle {
    font-size: 0.65rem;
    color: #059669;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

/* Kullanıcı Rol Rozetleri (Yönetici / Personel) - Kullanıcı İsteği Doğrultusunda */
.user-role-badge {
    background-color: #0f172a;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.user-role-badge.badge-admin {
    color: #fb7185;
    border: 1px solid rgba(244, 63, 94, 0.4);
}

.user-role-badge.badge-admin:hover {
    background-color: #1e293b;
    border-color: #f43f5e;
    color: #ffffff;
}

.user-role-badge.badge-staff {
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.user-role-badge.badge-staff:hover {
    background-color: #1e293b;
    border-color: #38bdf8;
    color: #ffffff;
}

.role-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.dot-admin {
    background-color: #f43f5e;
    box-shadow: 0 0 6px #f43f5e;
    animation: pulseGlow 1.8s infinite ease-in-out;
}

.dot-staff {
    background-color: #38bdf8;
    box-shadow: 0 0 6px #38bdf8;
    animation: pulseGlow 1.8s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.time-pill-badge {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Orta Arama Kutusu (Görsel 1) */
.top-header-center {
    flex: 1;
    max-width: 380px;
    margin: 0 1rem;
}

.search-input-pill-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 25px;
    padding: 4px 10px 4px 14px;
    transition: all 0.2s ease;
}

.search-input-pill-wrapper:focus-within {
    background: #ffffff;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.search-icon {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-right: 8px;
}

.top-search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.82rem;
    width: 100%;
    color: #1e293b;
}

.top-search-input::placeholder {
    color: #94a3b8;
}

/* Sağ Alan (Görsel 2) */
.top-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.header-action-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    background: #f1f5f9;
    color: #334155;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.header-notif-pill {
    background: #f8fafc;
    padding: 4px 8px;
}

.badge-count {
    background: #ef4444;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 12px;
}

.header-tg-pill {
    background: #0f172a;
    color: #f8fafc;
    border-color: #334155;
    font-size: 0.72rem;
    font-weight: 600;
}

.tg-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
}

.header-user-pill {
    cursor: pointer;
    background: #ffffff;
    border: 1px solid #cbd5e1;
}

.header-user-pill:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.btn-top-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn-refresh {
    background: #f0fdf4;
    color: #0284c7;
    border-color: #bae6fd;
}

.btn-refresh:hover {
    background: #e0f2fe;
    color: #0369a1;
}

.btn-settings {
    background: #059669;
    color: #ffffff;
}

.btn-settings:hover {
    background: #047857;
}

/* Pencere Kontrol Butonları (—, □, ✕) */
.window-controls-container {
    display: flex;
    align-items: center;
    margin-left: 0.5rem;
    border-left: 1px solid #e2e8f0;
    padding-left: 0.5rem;
    gap: 3px;
}

.win-btn {
    width: 28px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    color: #64748b;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.win-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.win-btn.win-close:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

/* ======================================================== */
/* 2. ANA GÖVDE & SAYFA İÇERİĞİ */
/* ======================================================== */
.app-body-container {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

main.main-content {
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background-color: #f1f5f9;
}

.sidebar {
    width: 250px;
    min-width: 250px;
    flex-shrink: 0;
    height: 100%;
    overflow: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background-color: #0f172a;
    color: #e2e8f0;
    z-index: 1000;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar-container {
    background-color: #0f172a;
    color: #e2e8f0;
    min-height: 100%;
}

.brand-section {
    padding: 1.15rem 1rem 1rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    flex-shrink: 0;
}

.brand-title {
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #ffffff;
    line-height: 1.2;
    white-space: nowrap !important;
}

.brand-sub {
    font-size: 0.72rem;
    color: #10b981;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap !important;
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 1rem;
    color: #94a3b8;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 0.65rem;
    transition: all 0.15s ease-in-out;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
}

.nav-link i.bi {
    font-size: 1.25rem;
    width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
    color: #64748b;
    transition: color 0.15s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.nav-link:hover i.bi {
    color: #10b981;
}

.nav-link.active {
    background-color: rgba(16, 185, 129, 0.15);
    color: #10b981;
    font-weight: 700;
    border-left: 3px solid #10b981;
}

.nav-link.active i.bi {
    color: #10b981;
}

.nav-link-highlight {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.nav-link-highlight i.bi {
    color: #ffffff !important;
}

.nav-link-highlight:hover {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    transform: translateY(-1px);
}

/* CARDS & WIDGETS */
.card-custom {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.card-custom:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

.stat-widget {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

.stat-widget .stat-icon {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    opacity: 0.15;
}

/* RECEIPT TABLE */
.receipt-table th {
    background-color: #f8fafc;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    padding: 0.65rem 0.75rem;
    border-bottom: 2px solid #e2e8f0;
}

.receipt-table td {
    padding: 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.receipt-line-total {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #047857;
}

/* TOUCH FRIENDLY BUTTONS */
.btn-touch {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border-radius: 0.75rem;
    transition: all 0.15s ease-in-out;
}

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

.fs-7 { font-size: 0.85rem !important; }
.fs-8 { font-size: 0.75rem !important; }
.fs-9 { font-size: 0.65rem !important; }

/* RESPONSIVE LAYOUT */
@media (min-width: 768px) {
    .app-window-root {
        flex-direction: row !important;
    }

    .app-main-wrapper {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    .sidebar {
        width: 250px !important;
        min-width: 250px !important;
        height: 100% !important;
        position: static !important;
    }

    .nav-scrollable {
        display: block !important;
        height: 100%;
        overflow-y: auto;
    }

    .navbar-toggler-btn {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    html, body {
        height: auto;
        overflow-x: hidden;
        overflow-y: auto;
        max-width: 100vw;
    }

    .app-window-root {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
        max-width: 100vw;
    }

    .app-top-header {
        display: none !important;
    }

    .sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        position: sticky;
        top: 0;
        z-index: 1050;
        max-width: 100vw;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    }

    .app-main-wrapper {
        height: auto;
        min-height: calc(100vh - 72px);
        overflow: visible;
        max-width: 100vw;
    }

    main.main-content {
        height: auto;
        overflow: visible;
        max-width: 100vw;
    }

    .brand-section {
        padding: 0.75rem 1rem;
    }

    .nav-scrollable {
        display: none !important;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }

    .nav-scrollable.show-on-mobile {
        display: block !important;
        background-color: #0f172a;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* KESİNTİSİZ ÇALIŞMA: HATA VE YENİLE BİLDİRİMİNİ GİZLE */
#blazor-error-ui {
    display: none !important;
}

/* SCROLLBAR */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}