/* RESET & BASE STYLES - Köhnə qara fonları tamamilə əzir */
html, body {
    overflow-x: hidden;
    width: 100%;
    height: 100%;
    position: relative;
    margin: 0;
    padding: 0;
}

.admin-layout-wrapper {
    display: flex;
    min-height: 100vh;
    background-color: #f8fafc !important;
    color: #334155 !important;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
    overflow-x: hidden;
}
.password-relative {
    position: relative;
}

.match-icon {
    position: absolute;
    right: 10px;
    top: 38px; /* Inputun label və hündürlüyünə görə tənzimləyin */
    display: flex;
    align-items: center;
}

.admin-layout-wrapper *, 
.admin-layout-wrapper *::before, 
.admin-layout-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* HAMBURGER TRIGGER (MOBİL) */
.mobile-menu-trigger {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 999;
    padding: 0.75rem;
    background-color: #ffffff;
    color: #ea580c;
    border: 1px solid #ffedd5;
    border-radius: 1rem;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.mobile-menu-trigger:active {
    transform: scale(0.95);
}

.icon-svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* SİDEBAR STYLES */
.admin-sidebar {
    width: 18rem;
    height: 100vh;
    background-color: #ffffff;
    border-right: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1001;
}

/* LOGO SECTION */
.sidebar-logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f8fafc;
}

.logo-box {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #f97316, #fbbf24);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(249, 115, 22, 0.2);
}

.logo-text {
    color: #ffffff;
    font-weight: 900;
    font-size: 1.25rem;
}

.brand-name {
    font-size: 1.15rem;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
}

.brand-badge {
    color: #f97316;
    font-size: 0.7rem;
    background-color: #fff7ed;
    padding: 0.125rem 0.375rem;
    border-radius: 0.375rem;
    margin-left: 0.35rem;
    font-weight: 700;
}

.brand-sub {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

/* NAVIGATION LINKS */
.sidebar-nav {
    margin-top: 2rem;
}

.nav-list {
    list-style: none;
    padding: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 1rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.875rem;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
    color: #64748b;
}

.nav-item:hover {
    background-color: #f8fafc;
    color: #0f172a;
}

.nav-item.active {
    background-color: #fff7ed;
    color: #ea580c;
    box-shadow: inset 0 0 0 1px #ffedd5;
}

/* LOGOUT BUTTON */
.sidebar-footer {
    border-top: 1px solid #f1f5f9;
    padding-top: 1rem;
}

.logout-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #94a3b8;
    border: none;
    background-color: transparent;
    cursor: pointer;
    width: 100%;
    padding: 0.75rem;
    font-weight: 700;
    border-radius: 0.75rem;
    transition: all 0.2s;
}

.logout-button:hover {
    color: #ef4444;
    background-color: #fef2f2;
}

/* BACKDROP OVERLAY (MOBİL) */
.mobile-sidebar-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.15);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none !important;
    z-index: 1000;
}

/* MAIN CONTENT STYLES */
.admin-main-content {
    flex: 1;
    padding: 1.5rem;
    padding-bottom: 80px; /* Aşağı menyu üçün boşluq */
    margin-left: 18rem; /* Sidebar üçün yer buraxırıq */
    width: 100%;
    min-width: 0; /* Flexbox daşmasını önləyən kritik kod */
}

/* MAIN HEADER */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    gap: 1rem;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.025em;
}

.header-subtitle {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.add-new-button {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 1rem;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(249, 115, 22, 0.2);
    transition: all 0.2s;
}

.add-new-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px -3px rgba(249, 115, 22, 0.3);
}

.add-new-button:active {
    transform: translateY(0);
}

/* MENYU KARTLARI (GRID) */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.empty-state-card {
    grid-column: 1 / -1;
    background-color: #ffffff;
    padding: 5rem 2rem;
    text-align: center;
    border-radius: 1.5rem;
    border: 1px solid #e2e8f0;
}

.empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.empty-text {
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 500;
}

/* MENYU KARTI */
.menu-item-card {
    background-color: #ffffff;
    border-radius: 1.5rem;
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
    transition: all 0.3s ease;
}

.menu-item-card.deactive {
    opacity: 0.6;
    filter: grayscale(1);
}

.menu-item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.05);
}

.card-image-area {
    height: 12.5rem;
    width: 100%;
    background-color: #f8fafc;
    position: relative;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background-color: #fff7ed;
}

.category-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    color: #1e293b;
    font-size: 10px;
    font-weight: 900;
    padding: 0.4rem 0.8rem;
    border-radius: 0.75rem;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.card-details {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.item-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

.item-price {
    color: #ea580c;
    font-weight: 900;
    font-size: 0.95rem;
    background-color: #fff7ed;
    padding: 0.25rem 0.75rem;
    border-radius: 0.75rem;
    white-space: nowrap;
}

.item-description {
    color: #64748b;
    font-size: 0.75rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.card-footer {
    padding-top: 1rem;
    border-top: 1px solid #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-code {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 700;
}

.delete-btn {
    border: none;
    background-color: transparent;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.delete-btn:hover {
    background-color: #fef2f2;
}

.delete-svg {
    width: 1.25rem;
    height: 1.25rem;
    color: #ef4444;
}

/* POS ÜSLUBU ÜÇÜN ƏLAVƏLƏR */
.pos-category-bar {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 1.25rem;
    margin-bottom: 0.5rem;
    scrollbar-width: none;
}

.pos-category-bar::-webkit-scrollbar {
    display: none;
}

.cat-chip {
    padding: 0.6rem 1.25rem;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.cat-chip:hover {
    border-color: #f97316;
    color: #f97316;
}

.cat-chip.active {
    background-color: #f97316;
    border-color: #f97316;
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(249, 115, 22, 0.2);
}

.products-grid.pos-mode {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.menu-item-card.pos-card {
    border-radius: 1.25rem;
}

.card-image-area.pos-img {
    height: 9rem;
}

.card-details.pos-details {
    padding: 0.75rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.item-name.pos-name {
    font-size: 0.95rem;
    margin-bottom: 0;
}

.item-price.pos-price {
    font-size: 0.85rem;
    padding: 0.2rem 0.6rem;
}

.pos-delete-btn {
    border: none;
    background: none;
    cursor: pointer;
    margin-top: 0.25rem;
}

/* KATEQORİYALAR CƏDVƏLİ */
.table-container {
    background-color: #ffffff;
    border-radius: 1.5rem;
    border: 1px solid #f1f5f9;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th {
    padding: 1.25rem;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.admin-table td {
    padding: 1.25rem;
    font-size: 0.875rem;
    border-bottom: 1px solid #f1f5f9;
}

.cat-name-cell {
    font-weight: 700;
    color: #1e293b;
}

.edit-btn {
    border: none;
    background-color: #fff7ed;
    color: #ea580c;
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    margin-right: 0.5rem;
    transition: background-color 0.2s;
}

.edit-btn:hover {
    background-color: #ffedd5;
}

/* MODERN MODAL (BLUR OVERLAY) */
.modal-fixed-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 10000;
}

.modal-blur-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-window {
    background-color: #ffffff;
    width: 95%;
    max-width: 500px;
    border-radius: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    border: 1px solid #f1f5f9;
    animation: modalOpenAnimation 0.2s ease-out;
}

@keyframes modalOpenAnimation {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8fafc;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 900;
    color: #0f172a;
}

.modal-subtitle {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.modal-close-btn {
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    border-radius: 0.75rem;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    color: #64748b;
    transition: background-color 0.2s;
}

.modal-close-btn:hover {
    background-color: #f8fafc;
}

.modal-body {
    padding: 1.5rem;
}

/* FORM ELEMENTLƏRİ */
.admin-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-grid-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    font-size: 14px;
    outline: none;
    color: #334155;
    transition: all 0.2s;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    background-color: #ffffff;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.file-upload-box {
    border: 2px dashed #cbd5e1;
    background-color: #f8fafc;
    border-radius: 0.75rem;
    padding: 1.25rem;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: border-color 0.2s;
}

.file-upload-box:hover {
    border-color: #f97316;
}

.file-upload-box input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-text {
    font-size: 13px;
    color: #64748b;
}

.form-submit-btn {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #ffffff;
    border: none;
    padding: 1rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    margin-top: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(249, 115, 22, 0.2);
    transition: transform 0.1s;
}

.form-submit-btn:active {
    transform: scale(0.99);
}

/* SETTINGS & QR SECTION */
.settings-card {
    background: #ffffff;
    border-radius: 1.5rem;
    padding: 2rem;
    border: 1px solid #f1f5f9;
    margin-bottom: 2rem;
}

.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: #fff7ed;
    border-radius: 1.5rem;
    border: 2px dashed #fb923c;
}

.qr-image {
    background: #ffffff;
    padding: 1rem;
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

.cafe-logo-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #ffffff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    margin: 0 auto 1rem;
    display: block;
}

/* ÇAP ÜÇÜN STİLLƏR */
#printArea {
    display: none;
}

@media print {
    @page {
        size: A4;
        margin: 10mm;
    }
    body {
        background: white !important;
    }
    .admin-layout-wrapper, .modal-fixed-container {
        display: none !important;
    }
    #printArea {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, var(--qr-size));
        gap: 10mm;
    }
}

/* MOBILE BOTTOM NAV */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #ffffff;
    border-top: 1px solid #f1f5f9;
    height: 70px;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 9999;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.03);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    background: none;
    border: none;
    cursor: pointer;
}

.bottom-nav-item.active {
    color: #ea580c;
}

.bottom-nav-item svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* RESPONSIVE DESIGN (MOBİL UYUM) */
@media (max-width: 1024px) {
    .mobile-menu-trigger {
        display: block;
    }

    .admin-layout-wrapper {
        display: block;
        width: 100%;
    }

    .admin-sidebar {
        display: none !important;
        transform: none !important;
        transition: none !important;
    }

    .admin-sidebar.open {
        display: flex !important; /* Düyməyə basanda görünsün */
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        box-shadow: 10px 0 50px rgba(0,0,0,0.2);
    }

    .mobile-sidebar-overlay.show {
        display: block !important;
    }

    .admin-main-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: 5rem;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;
        overflow-x: hidden; /* Məzmunun kənara çıxmasını qəti şəkildə blokla */
    }

    .mobile-bottom-nav {
        display: none !important;
    }

    .content-header {
        margin-bottom: 1.5rem;
        flex-direction: column;
        align-items: stretch;
        text-align: left;
        width: 100%;
        gap: 1rem;
    }
    
    .add-new-button {
        width: 100%;
        justify-content: center;
    }

    .header-title {
        font-size: 1.35rem;
    }

    .modal-fixed-container {
        z-index: 10001; /* Sidebar və triggerdən yuxarıda olsun */
    }
}

@media (max-width: 640px) {
    /* Modal Bottom Sheet Style */
    .products-grid.pos-mode {
        grid-template-columns: 1fr; /* Mobildə tək sütun (siyahı görünüşü) */
        gap: 0.75rem;
    }

    .menu-item-card.pos-card {
        flex-direction: row; /* Şəkil və yazıları yan-yana qoy */
        align-items: center;
        height: auto;
    }

    .card-image-area.pos-img {
        width: 85px;
        height: 85px;
        margin: 0.75rem;
        border-radius: 1rem;
        flex-shrink: 0; /* Şəklin sıxılmasının qarşısını al */
    }

    .card-details.pos-details {
        padding: 0.75rem 0.75rem 0.75rem 0;
        text-align: left;
        align-items: flex-start;
        flex: 1;
        gap: 0.2rem;
    }

    .item-name.pos-name {
        font-size: 1rem;
        margin: 0;
    }

    .modal-window {
        margin-top: auto;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        width: 100%;
        animation: bottomSheetSlide 0.3s ease-out;
    }

    .form-grid-row {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 1.5rem;
        border-radius: 1.5rem;
    }
}

@keyframes bottomSheetSlide {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* AUTH PAGES STYLES (Login & Register) */
.auth-page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8fafc;
    padding: 2rem;
}

.auth-card {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 900;
    color: #0f172a;
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    text-align: center;
    margin-bottom: 2rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}