/* style.css */
:root {
    --sidebar-bg: #f8fafc;
    --gold: #540107;
    --gold-rgb: 84, 1, 7;
    --gold-light: #fbebed;
    --gold-muted: #73010a;
    --bg-dark: linear-gradient(135deg, #e4eaf5 0%, #f7f6fb 50%, #f3eff4 100%);
    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(255, 255, 255, 0.8);
    --text-main: #1f2937;
    --text-muted: #64748b;
    --font-sans: 'Inter', sans-serif;
    --font-serif: 'Inter', sans-serif;
}

body,
.bg-light {
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    background: #f7f6fb !important;
    background-image: url('../images/8.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
    background-attachment: fixed !important;
    color: var(--text-main) !important;
    letter-spacing: -0.01em;

}

h1,
h2,
h3,
h4,
h5,
h6,
.logo-text {
    font-family: var(--font-serif);
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--text-main);
}

/* Sidebar Styling */
.sidebar {
    width: 250px;
    background: var(--glass-bg) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--glass-border) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03) !important;
    color: var(--text-main) !important;
}

@media (min-width: 992px) {
    .sidebar {
        height: 100vh;
        position: sticky;
        top: 0;
    }
}

.sidebar .sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.5) !important;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
}

.sidebar .logo-icon,
.sidebar .logo-text {
    color: var(--gold);
}

.sidebar .logo-img {
    border-radius: 10px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}

.top-nav .logo-img.logo-img-topnav {
    height: 28px;
    max-width: 120px;
}

.sidebar .nav-link {
    color: var(--text-muted) !important;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
    margin: 5px 5px;
    border-radius: 12px !important;
}

.sidebar .nav-link:hover {
    color: var(--text-main) !important;
    background-color: rgba(255, 255, 255, 0.6) !important;
}

.sidebar .nav-link.active {
    background: #ffffff !important;
    color: #460005 !important;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
}

.sidebar .nav-link i {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.sidebar .nav-link.active i {
    color: #460005 !important;
}

.sidebar .text-white {
    color: #334155 !important;
}

.sidebar .btn-close-white {
    filter: invert(1) grayscale(100%) brightness(50%);
}

/* Top Nav */
.top-nav {
    height: 72px;
    background: var(--glass-bg) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03) !important;
}

.top-nav .logo-icon,
.top-nav .logo-text {
    color: var(--gold);
}

/* For mobile header text */
.top-nav .logo-text.text-dark {
    color: var(--text-main) !important;
}

.search-bar input {
    border-radius: 20px;
    font-size: 0.9rem;
    background-color: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-main);
}

.search-bar input:focus {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
    background-color: #ffffff !important;
}

.user-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
    background-color: rgba(255, 255, 255, 0.8);
    color: var(--text-main) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.bg-warning {
    background-color: #d4af37 !important;
}

.text-warning {
    color: var(--gold) !important;
}

.border-warning {
    border-color: var(--gold) !important;
}

/* Dashboard Content */
.page-title {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.035em;
    line-height: 1.2;
}

.card {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border) !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03) !important;
}

.stat-card {
    border-radius: 20px !important;
}

.stat-card .card-body {
    background-color: transparent !important;
    border-radius: 20px !important;
}

.stat-card h6 {
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

.stat-card h2 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--text-main);
}

.btn-view-more {
    display: inline-block;
    padding: 0.35rem 1rem;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 20px;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.stat-card-link:-webkit-any-link {
    text-decoration: none;
}

.stat-card-link:hover .btn-view-more,
.btn-view-more:hover {
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.08);
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* Apply frosted view-more style to general action buttons inside cards */
.card .btn-outline-secondary,
.card .btn-light,
.card .btn-outline-danger {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.card .btn-outline-secondary,
.card .btn-light {
    color: var(--text-main);
}

.card .btn-outline-danger {
    color: #dc3545;
}

.card .btn-outline-secondary:hover,
.card .btn-light:hover {
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.08);
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-main);
    transform: translateY(-1px);
}

.card .btn-outline-danger:hover {
    background: #dc3545;
    color: #ffffff;
    box-shadow: 0 2px 3px rgba(220, 53, 69, 0.4);
    border-color: #dc3545;
    transform: translateY(-1px);
}

.icon-box {
    width: 48px;
    height: 48px;

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    border-radius: 12px !important;
    font-size: 1.25rem;
    box-shadow: none !important;
    color: var(--gold);
}

.icon-box i {
    color: var(--gold) !important;
}

/* Table styling */
.border-bottom {
    border-bottom: 1px solid var(--glass-border) !important;
}

.custom-table {
    background: transparent !important;
    color: var(--text-main) !important;
}

.custom-table thead,
.custom-table th,
.table> :not(caption)>*>* {
    background-color: transparent !important;
    border-bottom-color: var(--glass-border) !important;
    box-shadow: none !important;
}

.custom-table th {
    font-size: 0.75rem;
    color: var(--text-muted) !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--glass-border) !important;
    font-weight: 700;
}

.custom-table td {
    border-bottom: 1px solid var(--glass-border) !important;
    background: transparent !important;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main) !important;
}

.custom-table tbody tr:last-child td {
    border-bottom: none !important;
}

.custom-table tbody tr:hover td {
    background-color: rgba(255, 255, 255, 0.4) !important;
}

.code-badge {
    font-family: monospace;
    background-color: #dbeafe;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #1e40af;
    font-weight: 600;
}

/* Bottom Nav (Mobile) */
.bottom-nav {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--glass-border) !important;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.03) !important;
    z-index: 1030;
}

.bottom-nav .nav-link {
    padding: 0.5rem;
}

.add-btn-mobile {
    transition: transform 0.2s;
}

.add-btn-mobile:active {
    transform: scale(0.95);
}

.cursor-pointer {
    cursor: pointer;
}

/* Text overrides based on Image */
.text-dark {
    color: var(--text-main) !important;
    font-weight: 500;
}

.text-muted {
    color: var(--text-muted) !important;
    font-weight: 400;
}

.text-success {
    color: #10b981 !important;
}

/* Specific Card Texts to simulate Native Typography */
h4.card-title {
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-main);
}

/* Responsive tweaks */
@media (max-width: 991.98px) {
    .main-wrapper {
        flex-direction: column;
        padding-bottom: 90px;
    }
}

/* Collapsed Sidebar Styling (Desktop) */
.sidebar {
    transition: width 0.3s ease;
}

.sidebar.collapsed {
    width: 88px;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-link span {
    display: none !important;
}

.sidebar.collapsed .sidebar-header {
    flex-direction: column;
    gap: 15px;
    padding: 1.5rem 0.5rem !important;
}

.sidebar.collapsed .nav-link {
    justify-content: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.sidebar.collapsed .nav-link i {
    margin-right: 0 !important;
}

.sidebar.collapsed .logo-icon {
    font-size: 1.5rem !important;
    padding-left: 0 !important;
}

.sidebar.collapsed .logo-img {
    content: url('../images/logo-collapsed.png');
    max-width: 44px;
    /* Slight bump in size for square legibility */
    height: 44px;
    object-fit: contain;
}

.sidebar.collapsed #desktopToggle {
    margin: 0 auto;
}

/* login.css */

.login-body {
    background-color: var(--sidebar-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    margin: 0;
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

.login-card {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 3rem 2.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.login-logo-circle {
    width: 64px;
    height: 64px;
    background-color: #540107;
    /* Slightly adjusted brand color to match image closely */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo-circle i {
    font-size: 1.8rem;
}

.login-logo-circle .login-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.login-title {
    font-family: var(--font-serif);
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.03em;
    margin-top: 1rem;
}

.login-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.login-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.login-input {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.5);
    transition: all 0.2s ease;
}

.login-input::placeholder {
    color: var(--text-muted);
}

.login-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(84, 1, 7, 0.15);
    background-color: #ffffff;
}

.btn-login {
    background-color: var(--gold);
    border: none;
    border-radius: 6px;
    font-weight: 600;
    padding: 0.75rem;
    margin-top: 1rem;
    transition: background-color 0.2s;
    color: white;
}

.btn-login:hover,
.btn-login:focus {
    background-color: var(--gold-muted);
    color: white;
}

.login-footer-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2rem;
}

.bi-eye {
    cursor: pointer;
}

/* Item List Page Styles */

.page-subtitle-list {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.action-bar-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* Unified style for all action-bar form controls and buttons */
.action-bar-container .search-input-wrapper input,
.action-bar-container .form-select,
.action-bar-container .btn,
.action-bar-container .btn-filter {
    height: 38px !important;
    border-radius: 6px !important;
    border: 1px solid rgba(84, 1, 7, 0.1) !important;
    background: rgba(255, 255, 255, 0.4) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.02) !important;
    color: var(--text-main) !important;
    font-size: 0.9rem !important;
    position: relative;
    z-index: 1;
    transition: all 0.2s;
}

.action-bar-container .search-input-wrapper {
    position: relative;
    flex-grow: 1;
    max-width: 320px;
}

.action-bar-container .search-input-wrapper input {
    padding: 0 1rem 0 2.5rem !important;
    width: 100%;
}

.action-bar-container .search-input-wrapper input:focus,
.action-bar-container .form-select:focus {
    outline: none !important;
    border-color: var(--gold) !important;
    box-shadow: 0 0 0 2px rgba(84, 1, 7, 0.15) !important;
    z-index: 3 !important;
}

.action-bar-container .search-input-wrapper i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    z-index: 2;
}

.action-bar-container .btn,
.action-bar-container .btn-filter {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 0.85rem !important;
    font-weight: 500 !important;
}

.action-bar-container .btn:hover,
.action-bar-container .btn-filter:hover {
    background: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-1px);
}

/* Fix btn-group radiuses (list/grid view toggles) */
.action-bar-container .btn-group .btn {
    border-radius: 0 !important;
}

.action-bar-container .btn-group .btn:first-child {
    border-top-left-radius: 6px !important;
    border-bottom-left-radius: 6px !important;
}

.action-bar-container .btn-group .btn:last-child {
    border-top-right-radius: 6px !important;
    border-bottom-right-radius: 6px !important;
}

/* View toggle active state */
.action-bar-container .item-view-toggle.active {
    background: #460005 !important;
    color: #ffffff !important;
    border-color: #460005 !important;
}

.view-toggle-group {
    display: flex;
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    overflow: hidden;
}

.view-toggle-btn {
    background-color: var(--glass-bg);
    color: var(--text-muted);
    padding: 0.45rem 0.75rem;
    font-size: 1.1rem;
    border: none;
    border-right: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.2s;
}

.view-toggle-btn:last-child {
    border-right: none;
}

.view-toggle-btn:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.6);
    color: var(--text-main);
}

.view-toggle-btn.active {
    background-color: var(--gold);
    color: white;
}

.btn-filter {
    border: 1px solid var(--glass-border);
    background-color: var(--glass-bg);
    color: var(--text-main);
    padding: 0.45rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-filter i {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.btn-filter:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.items-table-card {
    border-radius: 12px;
}

.item-img-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--glass-border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.item-img-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-gallery-trigger {
    cursor: pointer;
}

.item-gallery-trigger:hover {
    opacity: 0.9;
    box-shadow: 0 0 0 2px rgba(84, 1, 7, 0.4);
}

.item-detail-images-wrap {
    min-height: 120px;
    background: transparent !important;
}

.item-detail-carousel {
    max-width: 100%;
}

.item-detail-carousel .carousel-inner {
    max-height: 320px;
    background: transparent !important;
}

.item-detail-slide-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 1rem;
}

.item-detail-carousel .item-detail-slide-img {
    max-height: 280px;
    max-width: 100%;
    width: auto;
    object-fit: contain;
    margin: 0 auto;
}

.item-detail-carousel .carousel-control-prev,
.item-detail-carousel .carousel-control-next {
    width: 48px;
    height: 48px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.4);
    opacity: 1;
    margin: 0 0.5rem;
}

.item-detail-carousel .carousel-control-prev:hover,
.item-detail-carousel .carousel-control-next:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

.item-detail-carousel .carousel-indicators {
    margin-bottom: 0.5rem;
}

.item-detail-carousel .carousel-indicators [data-bs-target] {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.4);
}

.item-detail-carousel .carousel-indicators .active {
    background-color: var(--gold, #540107);
}

.item-detail-row {
    padding: 0.35rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.item-detail-row:last-child {
    border-bottom: 0;
}

.item-detail-row .fw-medium {
    font-size: 0.9rem;
    word-break: break-word;
}

.table-row-item td {
    vertical-align: middle;
    padding-top: 0.85rem !important;
    padding-bottom: 0.85rem !important;
}

.status-badge-approved {
    background-color: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.2rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
}

.btn-view-action {
    background-color: #fff;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-view-action:hover {
    background-color: #f8fafc;
    border-color: var(--gold);
    color: var(--gold);
}

.btn-view-action i {
    font-size: 0.9rem;
}

.pagination-container {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.pagination-container .pagination {
    margin: 0;
    gap: 0.5rem;
}

.pagination-container .page-item:first-child .page-link,
.pagination-container .page-item:last-child .page-link {
    border-radius: 6px;
}

.pagination-container .page-link {
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    font-weight: 500;
    padding: 0;
    transition: all 0.2s;
    background-color: #ffffff;
}

.pagination-container .page-item.active .page-link {
    background-color: var(--gold);
    border-color: var(--gold);
    color: white;
    z-index: 1;
}

.pagination-container .page-link:hover:not(.active) {
    background-color: #f8fafc;
    color: var(--text-main);
    border-color: var(--gold);
}

.pagination-container .page-link:focus {
    box-shadow: 0 0 0 0.25rem rgba(84, 1, 7, 0.2);
}

/* Global page loader */
.page-loader-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.page-loader-spinner {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 4px solid rgba(248, 250, 252, 0.25);
    border-top-color: var(--gold);
    animation: pageLoaderSpin 0.8s linear infinite;
}

@keyframes pageLoaderSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Modal Glassmorphism Styling */
.modal-content {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border) !important;
    border-radius: 20px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08) !important;
}

.modal-header,
.modal-footer {
    border-color: rgba(0, 0, 0, 0.05) !important;
}

.modal-title {
    color: var(--text-main);
    font-family: var(--font-serif);
}

.modal .border-top {
    border-top-color: rgba(0, 0, 0, 0.05) !important;
}