@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&display=swap');

* {
    box-sizing: border-box;
}

*:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fa-solid):not(.fa-regular):not(.fa-brands) {
    font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

body,
body.app-body,
body.auth-body {
    margin: 0;
    font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    background-color: #f8fafc;
    color: #1e293b;
    font-size: 16px !important;
    line-height: 1.6;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* System-wide details and typography font size set to 16px */
p,
table td,
table th,
.table,
.form-control,
.form-select,
.btn,
label,
.modal-body,
.detail-item,
.detail-row,
.card-text,
.list-group-item,
.user-info span,
.equipment-detail,
.item-details,
dt,
dd,
li {
    font-size: 16px;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

.layout {
    display: flex;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fb 0%, #edf2ff 100%);
}

.sidebar {
    width: 270px;
    background: linear-gradient(175deg, #fde047 0%, #eab308 16%, #0369a1 55%, #0f172a 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    padding: 18px 16px 24px;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 4px 0 20px rgba(15, 23, 42, 0.35);
    z-index: 1040;
    transition: width 0.25s ease, padding 0.25s ease;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    margin-bottom: 22px;
}



.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    margin-right: 12px;
    font-size: 20px;
    overflow: hidden;
    padding: 2px;
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.brand-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

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

.brand-title {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #0f172a;
}

.brand-subtitle {
    font-size: 13px;
    color: #1e293b;
    font-weight: 600;
}

/* PSU Hero Welcome Banner Styling */
.welcome-hero-banner {
    background: linear-gradient(135deg, #fde047 0%, #eab308 20%, #0284c7 65%, #0369a1 100%) !important;
    color: #0f172a !important;
}

.welcome-hero-banner h1,
.welcome-hero-banner h2 {
    color: #0f172a !important;
}

.welcome-hero-banner p {
    color: #1e293b !important;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.nav-section {
    list-style: none;
    padding-left: 0;
    margin: 10px 0 18px 0;
}

.nav-section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    padding: 0 10px;
    margin-bottom: 8px;
    font-weight: 700;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 8px;
    color: #e5e7eb;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s, transform 0.1s;
}

.nav-item a i {
    width: 22px;
    font-size: 17px;
    text-align: center;
}

.nav-item a:hover {
    background: rgba(148, 163, 184, 0.25);
    color: #f9fafb;
    transform: translateX(1px);
}

.nav-item.active>a {
    background: linear-gradient(90deg, #6366f1, #22c55e);
    color: #f9fafb;
    font-weight: 600;
}

.nav-item.active>a i {
    color: #e5e7eb;
}

.main-content {
    flex: 1;
    padding: 22px 28px 36px;
    max-width: 100%;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.top-bar h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
}

.mobile-menu-toggle {
    display: none;
    border: none;
    background: transparent;
    color: #111827;
    font-size: 22px;
    margin-right: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #334155;
}

.user-info i {
    font-size: 22px;
    color: #6366f1;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.stat-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 16px 16px 14px;
    display: flex;
    gap: 12px;
    align-items: center;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-details h4 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin: 0 0 4px;
    font-weight: 700;
}

.stat-details h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: #111827;
}

/* Mini Stat Cards styling */
.stats-mini-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.stat-mini-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-mini-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.09);
}

.stat-mini-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: #f1f5f9;
    color: #475569;
    flex-shrink: 0;
}

.stat-mini-details {
    flex: 1;
    min-width: 0;
}

.stat-mini-details h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin: 0 0 3px 0;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-mini-details h3,
.stat-mini-details h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
    line-height: 1.2;
}

.table-container {
    background: #ffffff;
    border-radius: 14px;
    padding: 18px 18px 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.10);
    border: 1px solid rgba(148, 163, 184, 0.18);
    margin-top: 12px;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.table-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #0f172a;
}

.table-header h3 i {
    font-size: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.data-table thead {
    background: #f9fafb;
}

.data-table th,
.data-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle !important;
}

.data-table th {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.status-pending {
    background: #fff7ed;
    color: #c05621;
}

.status-approved {
    background: #dcfce7;
    color: #166534;
}

.status-rejected {
    background: #fee2e2;
    color: #b91c1c;
}

.status-returned {
    background: #e0f2fe;
    color: #0369a1;
}

.status-cancelled {
    background: #f3f4f6;
    color: #4b5563;
}

/* Shown when user clicks Return Now but admin hasn't inspected yet */
.status-pending_return {
    background: #fef3c7;
    color: #92400e;
    font-weight: 600;
}

.status-available {
    background: #dcfce7;
    color: #166534;
}

.status-in_use {
    background: #ede9fe;
    color: #5b21b6;
}

.status-damaged {
    background: #fee2e2;
    color: #b91c1c;
}

.badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 999px;
}

.badge-info {
    background: #e0f2fe;
    color: #0369a1;
}

.btn {
    font-size: 13px;
    border-radius: 999px;
    padding: 6px 14px;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
}

.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
}

.btn-secondary {
    background: #e5e7eb;
    color: #111827;
    border: none;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.action-buttons {
    display: inline-flex !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
}

.action-buttons .btn {
    border-radius: 999px;
    white-space: nowrap !important;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(15, 23, 42, 0.55);
}

.modal-content {
    background-color: #ffffff;
    margin: 50px auto;
    border-radius: 16px;
    padding: 0;
    max-width: 700px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
}

.modal-header,
.modal-footer {
    padding: 12px 18px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header {
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #f9fafb;
}

.modal-body {
    padding: 16px 18px 18px;
}

.modal-footer {
    border-top: 1px solid #e5e7eb;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    background: #f9fafb;
}

.modal .close {
    font-size: 20px;
    cursor: pointer;
}

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(165deg, #fde047 0%, #eab308 22%, #1d4ed8 65%, #0f172a 100%);
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.auth-card {
    background: #0b1120;
    border-radius: 22px;
    padding: 26px 24px 22px;
    box-shadow: 0 25px 70px rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #e5e7eb;
}

.auth-header h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 4px;
}

.auth-header p {
    margin: 0;
    font-size: 13px;
    color: #9ca3af;
}

.auth-header i {
    color: #22c55e;
    margin-right: 6px;
}

.auth-card .form-group label {
    font-size: 13px;
    color: #e5e7eb;
}

.auth-card .form-control {
    background-color: rgba(15, 23, 42, 0.9);
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    color: #e5e7eb;
    font-size: 14px;
}

.auth-card .form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.4);
}

.auth-footer {
    margin-top: 10px;
    font-size: 13px;
    text-align: center;
    color: #9ca3af;
}

.auth-footer a {
    color: #a5b4fc;
}

.alert {
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
}

.toast-item {
    min-width: 220px;
    margin-bottom: 8px;
}

.toast-item .toast-body {
    font-size: 13px;
}

/* On desktop: hide hamburger menu */
@media (min-width: 993px) {
    .mobile-menu-toggle {
        display: none;
    }
}

@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        transform: translateX(-100%);
        transition: transform 0.25s ease-out;
        width: 260px;
    }

    .sidebar-open .sidebar {
        transform: translateX(0);
    }

    .main-content {
        padding: 16px 16px 28px;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }
}

/* Password visibility toggle styling */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input[type="password"]::-webkit-credentials-auto-fill-button {
    display: none !important;
}

.password-input-group {
    position: relative !important;
    display: block !important;
    width: 100% !important;
}

.password-input-group input {
    width: 100% !important;
    padding-right: 42px !important;
}

.password-input-group .toggle-password,
.toggle-password {
    position: absolute !important;
    right: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    cursor: pointer !important;
    color: #64748b !important;
    z-index: 100 !important;
    pointer-events: auto !important;
    user-select: none !important;
    padding: 6px !important;
    font-size: 16px !important;
    line-height: 1 !important;
}

.password-input-group .toggle-password:hover,
.toggle-password:hover {
    color: #2563eb !important;
}

/* =====================================================
   ROLE-BASED UNIQUE DESIGNS & ACCENTS
   ===================================================== */

/* Base Role Pills / Badges */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
}

.role-badge i {
    font-size: 12px;
}

/* 1. Admin - Royal Indigo / Purple */
[data-role="admin"] {
    --role-primary: #4f46e5;
    --role-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --role-sidebar-bg: #0f172a;
    --role-sidebar-active: linear-gradient(90deg, #4f46e5, #7c3aed);
    --role-banner-bg: linear-gradient(135deg, #3730a3 0%, #6b21a8 100%);
}

.role-badge-admin {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 2. Supply Officer - Emerald / Teal Green */
[data-role="supply"] {
    --role-primary: #059669;
    --role-gradient: linear-gradient(135deg, #059669 0%, #0d9488 100%);
    --role-sidebar-bg: #064e3b;
    --role-sidebar-active: linear-gradient(90deg, #059669, #0d9488);
    --role-banner-bg: linear-gradient(135deg, #065f46 0%, #115e59 100%);
}

.role-badge-supply {
    background: linear-gradient(135deg, #059669, #0d9488);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 3. Laboratory Custodian - Cyan / Sapphire Blue */
[data-role="custodian"] {
    --role-primary: #0284c7;
    --role-gradient: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
    --role-sidebar-bg: #0f2942;
    --role-sidebar-active: linear-gradient(90deg, #0284c7, #2563eb);
    --role-banner-bg: linear-gradient(135deg, #f59e0b 0%, #0284c7 100%);
}

.role-badge-custodian {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 4. Instructor - Warm Amber / Gold */
[data-role="instructor"] {
    --role-primary: #d97706;
    --role-gradient: linear-gradient(135deg, #d97706 0%, #ea580c 100%);
    --role-sidebar-bg: #1c1917;
    --role-sidebar-active: linear-gradient(90deg, #d97706, #ea580c);
    --role-banner-bg: linear-gradient(135deg, #f59e0b 0%, #0284c7 100%);
}

.role-badge-instructor {
    background: linear-gradient(135deg, #d97706, #ea580c);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 5. HM Student - HM Burgundy / Rose */
[data-role="user"] {
    --role-primary: #9f1239;
    --role-gradient: linear-gradient(135deg, #9f1239 0%, #be123c 100%);
    --role-sidebar-bg: #2e0815;
    --role-sidebar-active: linear-gradient(90deg, #9f1239, #be123c);
    --role-banner-bg: linear-gradient(135deg, #f59e0b 0%, #0284c7 100%);
}

.role-badge-user {
    background: linear-gradient(135deg, #9f1239, #be123c);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Dynamic Sidebar Customization based on Role */
body.app-body[data-role] .sidebar {
    background: var(--role-sidebar-bg, #0f172a);
}

body.app-body[data-role] .sidebar .nav-item.active>a {
    background: var(--role-sidebar-active, linear-gradient(90deg, #6366f1, #22c55e));
}

body.app-body[data-role] .brand-icon {
    background: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

body.app-body[data-role] .welcome-banner {
    background: var(--role-banner-bg, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
}

body.app-body[data-role] .top-bar {
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 12px;
}

body.app-body[data-role] .top-bar .user-info {
    background: #ffffff;
    padding: 6px 14px;
    border-radius: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.sidebar-role-container {
    margin-top: 6px;
    padding: 0 2px;
}

/* =====================================================
   ANALYTICS DASHBOARD TEMPLATE STYLES
   ===================================================== */
.analytics-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 30px;
}

.analytics-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.analytics-title-group h2 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.analytics-title-group p {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

/* Vibrant Top Metric Fills Grid (Inspired by Reference UI) */
.analytics-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
}

.analytics-card {
    border-radius: 16px;
    padding: 20px 22px;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 125px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
}

.analytics-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18);
}

.analytics-card-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.analytics-card-cyan {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.analytics-card-emerald {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
}

.analytics-card-rose {
    background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%);
}

.analytics-card-amber {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.analytics-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.analytics-card-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.95;
}

.analytics-card-icon {
    font-size: 24px;
    opacity: 0.9;
}

.analytics-card-value {
    font-size: 25px;
    font-weight: 800;
    margin: 8px 0 6px 0;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.analytics-card-sub {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(4px);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    width: fit-content;
}

/* Analytics Panels Grid */
.analytics-panels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 22px;
}

.analytics-panel {
    background: #ffffff;
    border-radius: 16px;
    padding: 22px 24px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    flex-direction: column;
}

.analytics-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.analytics-panel-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.analytics-panel-header h3 i {
    color: var(--role-primary, #4f46e5);
}

/* Rank Items List for Top Borrowed Tools */
.rank-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 12px;
    transition: background 0.2s ease;
}

.rank-item:hover {
    background: #f1f5f9;
}

.rank-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rank-number-1 {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}

.rank-number-2 {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: #fff;
}

.rank-number-3 {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: #fff;
}

.rank-details {
    flex: 1;
    min-width: 0;
}

.rank-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-progress-bg {
    height: 6px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.rank-progress-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    transition: width 0.6s ease;
}

.rank-badge-val {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    background: #ffffff;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

/* ── HM Student Request Cart Styles ────────────────────────── */
.floating-cart-widget {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 1060;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.4);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.floating-cart-widget:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.5);
    color: #ffffff;
}

.floating-cart-widget.cart-bump {
    animation: cartBump 0.35s ease-in-out;
}

@keyframes cartBump {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

.floating-cart-icon {
    font-size: 20px;
    position: relative;
}

.cart-badge-count {
    background: #ef4444;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 12px;
    border: 2px solid #ffffff;
}

.btn-add-cart {
    padding: 6px 14px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.btn-add-cart:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
    color: white;
}

.out-of-stock {
    padding: 6px 14px;
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.12);
    white-space: nowrap;
    cursor: default;
    line-height: 1.2;
}

.cart-item-card {
    transition: background-color 0.2s ease;
}

.cart-item-card:hover {
    background-color: #f8fafc !important;
}

.cart-qty-control .btn {
    padding: 2px 8px;
    font-weight: bold;
}

.cart-qty-control input {
    font-weight: 600;
    padding: 2px 4px;
}

/* =====================================================
   BACK TO TOP FLOATING BUTTON STYLES
   ===================================================== */
.back-to-top-btn {
    position: fixed;
    bottom: 28px;
    left: 28px;
    z-index: 1070;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #0f172a;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 18px;
    border-radius: 50px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-to-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top-btn:hover {
    background: #1e293b;
    color: #38bdf8;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.35);
    transform: translateY(-3px);
}

.back-to-top-btn i {
    font-size: 14px;
    transition: transform 0.2s ease;
}

.back-to-top-btn:hover i {
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .back-to-top-btn {
        bottom: 20px;
        left: 20px;
        padding: 9px 14px;
        font-size: 12px;
    }
}

/* =====================================================
   EQUIPMENT & CATEGORY SIDEBAR STYLES (PREVENTS FOUC)
   ===================================================== */
.search-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.search-form {
    max-width: 600px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    gap: 10px;
}

.search-box input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.content-layout {
    display: flex !important;
    flex-direction: row !important;
    gap: 24px !important;
    width: 100% !important;
    max-width: 100% !important;
    align-items: flex-start !important;
    box-sizing: border-box !important;
}

.content-layout:has(> .categories-sidebar),
.content-layout.has-sidebar {
    display: flex !important;
    flex-direction: row !important;
    gap: 24px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.categories-sidebar {
    background: #ffffff !important;
    padding: 24px 18px !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04) !important;
    border: 1px solid #f1f5f9 !important;
    width: 240px !important;
    min-width: 240px !important;
    flex-shrink: 0 !important;
    height: fit-content !important;
}

.categories-sidebar h3 {
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    color: #1e293b !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.category-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 16px 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
}

.category-list li {
    margin-bottom: 0 !important;
    list-style: none !important;
}

.category-list a {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 16px !important;
    color: #64748b !important;
    text-decoration: none !important;
    border-radius: 20px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px !important;
    transition: all 0.2s ease !important;
    background: transparent !important;
}

.category-list a:hover {
    background: #f8fafc !important;
    color: #0284c7 !important;
}

.category-list a.active {
    background: #38bdf8 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.35) !important;
}

.category-list .count {
    background: #f1f5f9 !important;
    color: #94a3b8 !important;
    padding: 2px 8px !important;
    border-radius: 12px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
}

.category-list a.active .count {
    background: rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

.equipment-grid-section {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

#equipGridContainer,
#supplyEquipGridContainer {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
}

.equipment-grid,
#equipCardsView,
#supplyEquipCardsView {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

@media (max-width: 1600px) {

    .equipment-grid,
    #equipCardsView,
    #supplyEquipCardsView {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (max-width: 1300px) {

    .equipment-grid,
    #equipCardsView,
    #supplyEquipCardsView {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 992px) {

    .content-layout,
    .content-layout:has(> .categories-sidebar),
    .content-layout.has-sidebar {
        flex-direction: column !important;
    }

    .categories-sidebar {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
    }

    .equipment-grid-section {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
    }

    .equipment-grid,
    #equipCardsView,
    #supplyEquipCardsView {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {

    .categories-sidebar {
        padding: 14px 16px !important;
        margin-bottom: 16px !important;
    }

    .categories-sidebar h3 {
        margin-bottom: 8px !important;
        font-size: 14px !important;
    }

    .category-list {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 8px !important;
        padding-bottom: 6px !important;
        margin-bottom: 6px !important;
        scrollbar-width: thin !important;
    }

    .category-list li {
        flex-shrink: 0 !important;
        margin-bottom: 0 !important;
    }

    .category-list a {
        white-space: nowrap !important;
        padding: 6px 14px !important;
        border-radius: 20px !important;
        font-size: 12px !important;
    }
}

@media (max-width: 640px) {

    .equipment-grid-section {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
    }

    .equipment-grid,
    #equipCardsView,
    #supplyEquipCardsView {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .card-icon-banner,
    .card-icon {
        height: 130px !important;
    }
}

@media (max-width: 480px) {

    .equipment-grid,
    #equipCardsView,
    #supplyEquipCardsView {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .card-icon-banner,
    .card-icon {
        height: 120px !important;
    }

    .card-content {
        padding: 10px 12px !important;
    }

    .card-item-title {
        font-size: 13px !important;
        min-height: 34px !important;
    }

    .btn-add-cart,
    .btn-mark-damaged,
    .btn-mark-lost {
        width: 100% !important;
        justify-content: center !important;
        padding: 6px 8px !important;
        font-size: 10px !important;
    }
}

/* Equipment Card Components Matching Reference Photo */
.equipment-card {
    background: #ffffff !important;
    border-radius: 14px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    position: relative !important;
    cursor: pointer !important;
}

.equipment-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.09) !important;
}

.card-icon-banner,
.card-icon {
    height: 160px !important;
    background: linear-gradient(135deg, #5b6cf6 0%, #6366f1 35%, #581c87 100%) !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

.card-icon-banner img,
.card-icon img {
    max-width: 85% !important;
    max-height: 85% !important;
    object-fit: contain !important;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2)) !important;
    transition: transform 0.3s ease !important;
}

.card-icon-banner i,
.card-icon i {
    font-size: 56px !important;
    color: #ffffff !important;
    opacity: 1 !important;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.15)) !important;
}

.card-badge {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    border-radius: 20px !important;
    padding: 4px 12px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    z-index: 5 !important;
    letter-spacing: 0.2px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
}

.card-badge.available {
    background: #dcfce7 !important;
    color: #15803d !important;
}

.card-badge.out-of-stock,
.card-badge.low-stock {
    background: #fef08a !important;
    color: #713f12 !important;
}

.equip-checkbox-wrapper {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    z-index: 6 !important;
}

.card-content {
    padding: 16px 18px 16px 18px !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

.code-badge-row {
    margin-bottom: 8px !important;
}

.code-badge {
    background: #0b1329 !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    padding: 4px 10px !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    font-family: monospace, monospace !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    letter-spacing: 0.4px !important;
}

.code-badge i {
    font-size: 10px !important;
    color: #38bdf8 !important;
}

.card-item-title {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    line-height: 1.3 !important;
    margin: 4px 0 2px 0 !important;
    min-height: 40px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.card-item-title a {
    color: inherit !important;
    text-decoration: none !important;
}

.card-item-title a:hover {
    color: #2563eb !important;
}

.card-item-category {
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #94a3b8 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 24px !important;
    margin-top: 0 !important;
}

.card-footer {
    border-top: 1px solid #f1f5f9 !important;
    padding-top: 12px !important;
    margin-top: auto !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: space-between !important;
    background: transparent !important;
}

.card-stats-group {
    display: flex !important;
    align-items: flex-end !important;
    gap: 16px !important;
}

.stat-col {
    display: flex !important;
    flex-direction: column !important;
}

.stat-lbl {
    font-size: 10px !important;
    color: #64748b !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
}

.stat-lbl.avail-lbl {
    color: #16a34a !important;
    font-weight: 600 !important;
}

.stat-val {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    line-height: 1.2 !important;
}

.stat-val.avail-val {
    color: #16a34a !important;
}

.btn-mark-damaged {
    background: #f97316 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 8px 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.25) !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
}

.btn-mark-damaged:hover {
    background: #ea580c !important;
    box-shadow: 0 4px 10px rgba(234, 88, 12, 0.35) !important;
}

.btn-mark-lost {
    background: #fffbeb !important;
    color: #92400e !important;
    border: 1px solid #f59e0b !important;
    border-radius: 8px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 7px 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
}

.btn-mark-lost:hover {
    background: #fef3c7 !important;
    border-color: #d97706 !important;
    color: #78350f !important;
}

.card-action-btns {
    display: flex !important;
    gap: 6px !important;
    align-items: center !important;
    flex-wrap: wrap !important;
}

.btn-add-cart {
    background: #2563eb !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 8px 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25) !important;
    transition: all 0.2s ease !important;
}

.btn-add-cart:hover {
    background: #1d4ed8 !important;
}

.clear-filters {
    display: block !important;
    text-align: center !important;
    padding: 10px !important;
    background: #f8fafc !important;
    color: #64748b !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    transition: all 0.2s !important;
    font-size: 12px !important;
    font-weight: 600 !important;
}

.clear-filters:hover {
    background: #fee2e2 !important;
    color: #dc2626 !important;
}