/* Procurement Common Styles - Inspired by AdminV16.razor */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --gold: #D4AF37;
    --gold-bg: rgba(212, 175, 55, 0.1);
    --gold-shadow: rgba(212, 175, 55, 0.25);
    --dark-brown: #1e1412;
    --light-gray: #f4f4f7;
    --muted-text: #a38f8a;
    --pure-white: #ffffff;
    --border-color: #f0f0f5;
    --success-green: #22c55e;
    --error-red: #ef4444;
}

.admin-container {
    background: var(--light-gray);
    min-height: 100vh;
    padding: 25px;
    font-family: 'Outfit', sans-serif;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.admin-title {
    color: var(--gold);
    font-weight: 800;
    font-size: 2.2rem;
    margin: 0;
    text-decoration: none !important;
}

.add-btn-pos {
    background: var(--gold);
    color: var(--dark-brown);
    border: none;
    padding: 12px 28px;
    border-radius: 15px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 5px 15px var(--gold-shadow);
    transition: all 0.3s ease;
}

.add-btn-pos:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--gold-shadow);
}

.tab-bar-black {
    background: var(--dark-brown);
    border-radius: 20px;
    display: flex;
    flex-wrap: wrap;
    padding: 6px;
    gap: 4px;
    margin-bottom: 25px;
    width: 100%;
    justify-content: center;
}

.tab-bar-black button {
    border: none;
    background: transparent;
    color: var(--muted-text);
    padding: 12px 18px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 800;
    transition: 0.3s;
    font-size: 0.9rem;
    white-space: nowrap;
    flex-grow: 1;
    min-width: 110px;
}

.tab-bar-black button.active {
    background: var(--gold);
    color: var(--dark-brown);
}

.admin-search-wrap input {
    width: 100%;
    max-width: 450px;
    padding: 16px 20px;
    border-radius: 16px;
    border: 1.5px solid #eee;
    margin-bottom: 30px;
    outline: none;
    background: var(--pure-white);
    font-weight: 600;
    color: var(--dark-brown) !important;
}

.pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
}

.pos-card {
    background: var(--pure-white);
    padding: 20px;
    border-radius: 28px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 15px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.pos-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.pos-card.inactive {
    opacity: 0.6;
    filter: grayscale(0.5);
}

.pos-card-info h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--dark-brown) !important;
}

.pos-price {
    font-weight: 900;
    color: var(--gold);
    font-size: 1rem;
}

.badge-cat {
    font-size: 0.75rem;
    color: var(--muted-text);
    background: #f4f4f7;
    padding: 6px 14px;
    border-radius: 10px;
    font-weight: 800;
    display: inline-block;
    margin-top: 5px;
}

.pos-card-actions {
    display: flex;
    gap: 10px;
    border-top: 1.5px solid #f8f8fa;
    padding-top: 15px;
    flex-wrap: wrap;
}

.btn-pos-sm {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    border: none;
    font-weight: 800;
    cursor: pointer;
    background: #f4f4f7;
    color: var(--dark-brown);
    text-align: center;
    min-width: 80px;
    transition: all 0.2s ease;
}

.btn-pos-sm:hover {
    background: #e0e0e7;
}

.btn-pos-sm.status.green {
    color: var(--success-green);
    background: rgba(34, 197, 94, 0.08);
}

.btn-pos-sm.status.red {
    color: var(--error-red);
    background: rgba(239, 68, 68, 0.08);
}

/* Modals */
.admin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pos-modal {
    background: var(--pure-white);
    width: 100%;
    max-width: 480px;
    border-radius: 45px;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.pos-modal-header {
    background: var(--dark-brown);
    padding: 35px 20px;
    text-align: center;
    position: relative;
    flex-shrink: 0;
}

.pos-modal-header h2 {
    color: var(--gold) !important;
    margin: 0;
    font-size: 1.6rem;
    font-weight: 900;
    text-transform: uppercase;
}

.close-x {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    color: var(--gold);
    font-size: 2.2rem;
    cursor: pointer;
}

.pos-modal-body {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
}

.pos-form-group {
    margin-bottom: 22px;
}

.pos-form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 12px;
    color: var(--dark-brown) !important;
}

.pos-form-group input,
.pos-textarea,
.pos-select-full {
    width: 100%;
    padding: 15px;
    border-radius: 16px;
    border: 2px solid var(--border-color);
    outline: none;
    font-weight: 700;
    color: #000 !important;
    background: var(--pure-white);
    font-family: inherit;
}

.pos-select-full {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23D4AF37' stroke-width='3'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 18px;
}

/* Premium Table Row Hover/Active */
.premium-table tr {
    transition: background 0.2s ease;
    cursor: pointer;
}

.premium-table tr:hover {
    background: rgba(212, 175, 55, 0.03);
}

.premium-table tr.active {
    background: rgba(212, 175, 55, 0.08);
}

.pos-save-btn {
    width: calc(100% - 60px);
    background: var(--gold);
    color: var(--dark-brown);
    padding: 20px;
    border-radius: 24px;
    border: none;
    font-weight: 900;
    font-size: 1.1rem;
    cursor: pointer;
    margin: 0 30px 30px;
    transition: 0.3s;
}

.pos-save-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 20px var(--gold-shadow);
}

/* Animations */
.animate-pop {
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spin-pos {
    width: 50px;
    height: 50px;
    border: 5px solid #f0f0f0;
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-sizing: border-box;
    flex-shrink: 0;
}

.mini-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px;
    width: 100%;
    margin-top: 20px;
}

/* Table body scroll support */
.details-grid-scroll {
    overflow-y: auto !important;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--gold) transparent;
    min-height: 0;
}

/* CRITICAL FIX: Ensure wrapping content scales with flex */
.details-content-wrap {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

/* Right Panel Loading State */
.details-loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 35px;
    box-sizing: border-box;
}

.details-loader-overlay p {
    margin-top: 15px;
    font-weight: 700;
    color: var(--dark-brown);
    font-size: 0.9rem;
}

/* Glassmorphism utility */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

/* Button Loading & Success Feedbacks */
.btn-loading {
    position: relative !important;
    color: transparent !important;
    pointer-events: none;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-sizing: border-box;
}

.btn-success-tick {
    background: var(--success-green) !important;
    color: white !important;
    pointer-events: none;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-success-tick::before {
    content: "✓";
    font-size: 1.2rem;
    font-weight: 900;
}

/* Refresh Animation */
.refresh-spin {
    animation: spin 1s linear infinite;
}

/* Mobile Floating Cart (FAB) */
.mobile-cart-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: var(--gold);
    color: var(--dark-brown);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 999;
    border: none;
    cursor: pointer;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mobile-cart-fab:active {
    transform: scale(0.9);
}

.cart-badge-fab {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--error-red);
    color: white;
    font-size: 0.7rem;
    font-weight: 900;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--gold);
}

@media (max-width: 1024px) {
    .mobile-cart-fab {
        display: flex;
    }
}

/* Standardize Input Mini */
.premium-input-mini,
.premium-select-mini {
    padding: 10px 15px !important;
    font-size: 0.95rem !important;
    border-radius: 12px !important;
    font-weight: 800 !important;
}

.main-details-panel {
    position: relative !important;
}

/* --- SIDEBAR PORTED STYLES (Menu Style) --- */
.compact-sidebar {
    width: 90px;
    background: var(--dark-brown);
    display: flex;
    flex-direction: column;
    padding: 15px 0;
    overflow-y: auto;
    scrollbar-width: none;
    flex-shrink: 0;
    border-radius: 12px;
    height: calc(100vh - 140px);
    position: sticky;
    top: 20px;
}

.nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 5px;
    cursor: pointer;
    gap: 8px;
    transition: background 0.3s;
}

.nav-item.active {
    background: rgba(212, 175, 55, 0.1);
}

.nav-item.active .nav-label {
    color: #D4AF37;
    font-weight: 900;
}

.nav-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: #a38f8a;
    text-transform: uppercase;
    text-align: center;
}

.active-line-centered {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 35px;
    background: #D4AF37;
    border-radius: 0 4px 4px 0;
    box-shadow: 2px 0 10px rgba(212, 175, 55, 0.4);
}

.cat-sidebar-img {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
    background: white;
}

.icon-box {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e1412;
}