/* ============================================================
   LRC Inventory - AdminLTE Style CSS
   ============================================================ */

/*===== LAYOUT =====*/
.wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/*===== MAIN HEADER / NAVBAR =====*/
.main-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    z-index: 1030;
    height: var(--navbar-height);
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: left var(--transition-speed);
}

[data-bs-theme="dark"] .main-header {
    background: #1e2029;
    border-bottom-color: #2d2d3f;
}

.main-header .navbar-nav .nav-link {
    padding: 0.5rem 0.75rem;
    color: #6c757d;
    font-size: 1rem;
}

.main-header .navbar-nav .nav-link:hover {
    color: #0d6efd;
}

/*===== SIDEBAR =====*/
.main-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    z-index: 1040;
    color: #aab4d0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width var(--transition-speed);
    box-shadow: 4px 0 24px rgba(15, 20, 40, 0.12);
    background-color: #0f1428;
    background-image:
        radial-gradient(900px 380px at -10% -10%, rgba(99, 102, 241, 0.30) 0%, transparent 60%),
        radial-gradient(700px 320px at 120% 110%, rgba(34, 211, 238, 0.14) 0%, transparent 55%),
        linear-gradient(180deg, #0e1329 0%, #151b3a 100%);
}

.brand-link {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(15, 20, 40, 0.85);
    backdrop-filter: blur(8px);
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}

.brand-link:hover {
    color: #fff;
}

.brand-image {
    display: inline-flex;
    flex-shrink: 0;
}

.brand-logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.45);
    color: #fff;
    font-size: 1.15rem;
}

.brand-text {
    font-size: 1.22rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    line-height: 1.05;
}

.brand-text small {
    display: block;
    color: #8b93b0;
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    margin-top: 2px;
}

/* User Panel */
.user-panel {
    padding: 1rem 1.25rem;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 0.9rem;
    border-radius: 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
}

.user-card .image img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(99,102,241,0.5);
}

.user-card .info {
    min-width: 0;
    flex: 1;
}

.user-card .user-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card .user-role {
    display: block;
    color: #8b93b0;
    font-size: 0.76rem;
    margin-top: 2px;
}

.online-dot {
    color: #34d399;
    font-size: 8px;
}

/* Sidebar Navigation */
.nav-sidebar {
    padding-top: 0.25rem;
}

.nav-header {
    padding: 1.15rem 1.4rem 0.4rem;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #6b7395;
    user-select: none;
}

.nav-sidebar > .nav-item > .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    color: #aab4d0;
    padding: 0.55rem 0.85rem;
    margin: 0.12rem 0.9rem;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.91rem;
    transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}

.nav-sidebar > .nav-item > .nav-link p {
    margin: 0;
    flex: 1;
}

.nav-sidebar > .nav-item > .nav-link .nav-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    margin-right: 0.8rem;
    font-size: 0.95rem;
    color: #8b93b0;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.06);
    transition: all 0.2s;
}

.nav-sidebar > .nav-item > .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
}

.nav-sidebar > .nav-item > .nav-link:hover .nav-icon {
    color: #a5b4fc;
    background: rgba(99,102,241,0.16);
    border-color: rgba(99,102,241,0.35);
}

.nav-sidebar > .nav-item > .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4);
}

.nav-sidebar > .nav-item > .nav-link.active .nav-icon {
    color: #fff;
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.22);
}

.nav-sidebar > .nav-item > .nav-link.active::before {
    content: '';
    position: absolute;
    left: -0.9rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 22px;
    border-radius: 0 3px 3px 0;
    background: #818cf8;
    box-shadow: 0 0 8px rgba(129, 140, 248, 0.7);
}

.nav-sidebar .right {
    margin-left: 0.35rem;
    color: #6b7395;
    font-size: 0.72rem;
    transition: transform 0.3s;
}

.nav-sidebar > .nav-item.menu-open > .nav-link .right {
    transform: rotate(-90deg);
}

.nav-sidebar .nav-badge {
    margin-left: 0.5rem;
    font-size: 0.66rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.18em 0.55em;
}

/* Treeview submenu */
.nav-treeview {
    padding: 0;
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    position: relative;
}

.nav-item.menu-open > .nav-treeview {
    max-height: 900px;
}

.nav-treeview::before {
    content: '';
    position: absolute;
    left: 1.9rem;
    top: 0.3rem;
    bottom: 0.3rem;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(180deg, rgba(99,102,241,0.55), rgba(34,211,238,0.08));
}

.nav-treeview .nav-item > .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem 0.5rem 2.55rem;
    font-size: 0.87rem;
    color: #97a2c0;
    margin: 0.08rem 0.9rem;
    border-radius: 10px;
    transition: color 0.2s, background 0.2s;
}

.nav-treeview .nav-item > .nav-link .nav-icon {
    display: none;
}

.nav-treeview .nav-item > .nav-link::before {
    content: '';
    position: absolute;
    left: 1.86rem;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #46507a;
    transition: all 0.2s;
    z-index: 1;
}

.nav-treeview .nav-item > .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.nav-treeview .nav-item > .nav-link:hover::before {
    background: #a5b4fc;
}

.nav-treeview .nav-item > .nav-link.active {
    color: #c7d2fe;
    background: linear-gradient(135deg, rgba(99,102,241,0.16), rgba(59,130,246,0.08));
    box-shadow: inset 0 0 0 1px rgba(99,102,241,0.25);
}

.nav-treeview .nav-item > .nav-link.active::before {
    background: #818cf8;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.25);
}

/* Sidebar support card */
.sidebar-support {
    margin: 1.1rem 0.9rem 0.5rem;
    padding: 1rem 1.1rem;
    border-radius: 16px;
    background: linear-gradient(150deg, rgba(99,102,241,0.22), rgba(34,211,238,0.10));
    border: 1px solid rgba(148,163,255,0.22);
}

.sidebar-support-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    color: #fff;
    font-size: 0.9rem;
    margin-bottom: 0.55rem;
    box-shadow: 0 6px 14px rgba(99,102,241,0.35);
}

.sidebar-support-title {
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
}

.sidebar-support-text {
    color: #aab4d0;
    font-size: 0.75rem;
    line-height: 1.45;
    margin: 0.25rem 0 0.7rem;
}

.sidebar-support-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.76rem;
    font-weight: 600;
    color: #fff;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    text-decoration: none;
    transition: background 0.2s;
}

.sidebar-support-btn:hover {
    background: rgba(255,255,255,0.22);
    color: #fff;
}

/* Sidebar scrollbar */
.main-sidebar::-webkit-scrollbar {
    width: 5px;
}

.main-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 4px;
}

.main-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}

/*===== CONTENT WRAPPER =====*/
.content-wrapper {
    margin-left: var(--sidebar-width);
    margin-top: var(--navbar-height);
    padding: 1.5rem;
    min-height: calc(100vh - var(--navbar-height));
    transition: margin-left var(--transition-speed);
}

[data-bs-theme="dark"] .content-wrapper {
    background: #1a1d23;
}

/*===== CONTENT =====*/
.content {
    padding: 0;
}

/*===== FOOTER =====*/
.main-footer {
    margin-left: var(--sidebar-width);
    background: #fff;
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    font-size: 0.875rem;
    color: #6c757d;
    transition: margin-left var(--transition-speed);
}

[data-bs-theme="dark"] .main-footer {
    background: #1e2029;
    border-top-color: #2d2d3f;
    color: #9ca3af;
}

/*===== COLLAPSED SIDEBAR =====*/
body.sidebar-collapse .main-header {
    left: 0;
}

body.sidebar-collapse .main-sidebar {
    width: 0;
    overflow: hidden;
}

body.sidebar-collapse .content-wrapper,
body.sidebar-collapse .main-footer {
    margin-left: 0;
}

/*===== CARDS =====*/
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

[data-bs-theme="dark"] .card {
    background: #1e2029;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.card:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

[data-bs-theme="dark"] .card-header {
    border-bottom-color: rgba(255,255,255,0.05);
}

.card-footer {
    background: transparent;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/*===== STAT CARDS =====*/
.small-box {
    border-radius: 0.75rem;
    padding: 1.5rem;
    color: #fff;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.small-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.small-box .inner {
    position: relative;
    z-index: 1;
}

.small-box h3 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.small-box p {
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.9;
}

.small-box .icon {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 3.5rem;
    opacity: 0.3;
    transition: all 0.3s;
}

.small-box:hover .icon {
    font-size: 4rem;
    opacity: 0.5;
    right: 10px;
}

.small-box .small-box-footer {
    display: block;
    color: rgba(255,255,255,0.8);
    padding: 0.5rem 0 0;
    text-decoration: none;
    margin-top: 0.75rem;
}

/* Info Box */
.info-box {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
    margin-bottom: 1rem;
    transition: transform 0.2s;
}

[data-bs-theme="dark"] .info-box {
    background: #1e2029;
}

.info-box:hover {
    transform: translateY(-2px);
}

.info-box-icon {
    width: 60px;
    height: 60px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    margin-right: 1rem;
    flex-shrink: 0;
}

.info-box-content {
    flex: 1;
}

.info-box-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.info-box-number {
    font-size: 1.5rem;
    font-weight: 700;
}

/*===== BUTTONS =====*/
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
}

/*===== TABLES =====*/
.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
}

[data-bs-theme="dark"] .table thead th {
    border-bottom-color: #2d2d3f;
    color: #9ca3af;
}

.table td {
    vertical-align: middle;
}

/*===== BADGES =====*/
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    font-size: 0.8rem;
    border-radius: 0.375rem;
}

.navbar-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.6rem;
    padding: 0.2em 0.4em;
}

/*===== FORMS =====*/
.form-control, .form-select {
    border-radius: 0.5rem;
    padding: 0.5rem 0.875rem;
    border: 1px solid #dee2e6;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus, .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13,110,253,0.15);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background: #1a1d23;
    border-color: #2d2d3f;
    color: #e5e7eb;
}

.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: #374151;
    margin-bottom: 0.375rem;
}

/*===== PROGRESS BARS =====*/
.progress {
    border-radius: 0.5rem;
    height: 0.625rem;
}

/*===== ALERTS =====*/
.alert {
    border: none;
    border-radius: 0.75rem;
}

/*===== PAGE HEADER =====*/
.page-header {
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

[data-bs-theme="dark"] .page-header {
    border-bottom-color: #2d2d3f;
}

/*===== SCROLLBAR =====*/
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

/*===== ANIMATIONS =====*/
.animate__animated {
    animation-duration: 0.5s;
}

/*===== LOGIN PAGE =====*/
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1c2e 0%, #2d2d3f 50%, #0d6efd 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(13,110,253,0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 1; }
}

.login-box {
    width: 420px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

[data-bs-theme="dark"] .login-card {
    background: rgba(30,32,41,0.95);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo h3 {
    font-weight: 700;
    color: #1a1c2e;
}

[data-bs-theme="dark"] .login-logo h3 {
    color: #fff;
}

/*===== RESPONSIVE =====*/
@media (max-width: 768px) {
    .main-sidebar {
        width: 0;
        overflow: hidden;
    }

    .main-header {
        left: 0;
    }

    .content-wrapper,
    .main-footer {
        margin-left: 0;
    }

    body.sidebar-open .main-sidebar {
        width: var(--sidebar-width);
    }

    body.sidebar-open .main-header {
        left: var(--sidebar-width);
    }

    body.sidebar-open::after {
        content: '';
        position: fixed;
        inset: 0;
        z-index: 1035;
        background: rgba(0, 0, 0, 0.45);
    }

    body.sidebar-open .main-sidebar {
        box-shadow: 4px 0 18px rgba(0, 0, 0, 0.25);
    }

    .login-box {
        width: 90%;
        max-width: 420px;
    }

    .small-box h3 {
        font-size: 1.6rem;
    }
}

/*===== TIMELINE =====*/
.timeline {
    position: relative;
    padding: 0;
    list-style: none;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 1rem;
    width: 2px;
    background: #dee2e6;
}

.timeline-item {
    position: relative;
    padding-left: 3rem;
    margin-bottom: 1.5rem;
}

.timeline-item .timeline-icon {
    position: absolute;
    left: 0.3rem;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.875rem;
}

/*===== PRINT =====*/
@media print {
    .main-sidebar, .main-header, .main-footer {
        display: none !important;
    }

    .content-wrapper {
        margin-left: 0 !important;
        margin-top: 0 !important;
        padding: 0 !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }

    .no-print {
        display: none !important;
    }
}
