/* ============================================================
   Equipment Borrowing System - Custom Styles
   ============================================================ */

:root {
    --primary:      #2c3e50;
    --primary-dark: #1a252f;
    --accent:       #3498db;
    --accent-dark:  #2176ae;
    --success:      #27ae60;
    --warning:      #f39c12;
    --danger:       #e74c3c;
    --info:         #17a589;
    --light-bg:     #f0f2f5;
    --sidebar-w:    250px;
    --transition:   0.25s ease;
}

/* ── Global ── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: #333;
    margin: 0;
    padding: 0;
}

a { text-decoration: none; }
a:hover { text-decoration: none; }

/* ── Custom Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #bbb; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #888; }

/* ============================================================
   SIDEBAR LAYOUT (Admin & User)
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--primary);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    transition: transform var(--transition);
}

.sidebar-brand {
    padding: 22px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: #fff;
}

.sidebar-brand .brand-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    display: block;
    color: #fff;
}

.sidebar-brand .brand-subtitle {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.55);
    display: block;
    margin-top: 2px;
}

.sidebar-brand .brand-icon {
    font-size: 1.8rem;
    color: var(--accent);
    margin-bottom: 6px;
    display: block;
}

.sidebar-user {
    padding: 14px 20px;
    background: rgba(0,0,0,0.15);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user .user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-role {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.55);
    display: block;
    margin-top: 2px;
    text-transform: capitalize;
}

.sidebar-nav {
    padding: 10px 0;
    flex: 1;
}

.sidebar-nav .nav-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    padding: 12px 20px 4px;
    display: block;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,0.75);
    font-size: 0.88rem;
    border-left: 3px solid transparent;
    transition: all var(--transition);
}

.sidebar-nav .nav-link i {
    width: 18px;
    text-align: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.sidebar-nav .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
    border-left-color: var(--accent);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background: rgba(52,152,219,0.2);
    border-left-color: var(--accent);
    font-weight: 600;
}

.sidebar-nav .nav-link.text-danger { color: rgba(231,76,60,0.85) !important; }
.sidebar-nav .nav-link.text-danger:hover { color: #e74c3c !important; background: rgba(231,76,60,0.1); border-left-color: #e74c3c; }

/* ── Main Content ── */
.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    padding: 28px 28px 40px;
    transition: margin var(--transition);
}

/* ── Top bar inside main content ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.page-header .breadcrumb {
    margin: 0;
    font-size: 0.8rem;
}

/* ============================================================
   DASHBOARD STAT CARDS
   ============================================================ */
.stat-card {
    border: none;
    border-radius: 12px;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform var(--transition), box-shadow var(--transition);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    right: -20px;
    top: -20px;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.stat-card.blue   { background: linear-gradient(135deg, #3498db, #2176ae); }
.stat-card.orange { background: linear-gradient(135deg, #f39c12, #d68910); }
.stat-card.green  { background: linear-gradient(135deg, #27ae60, #1e8449); }
.stat-card.red    { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.stat-card.teal   { background: linear-gradient(135deg, #17a589, #148f77); }
.stat-card.purple { background: linear-gradient(135deg, #8e44ad, #6c3483); }

.stat-card .stat-icon {
    font-size: 2.2rem;
    opacity: 0.9;
    flex-shrink: 0;
}

.stat-card .stat-info .stat-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    display: block;
}

.stat-card .stat-info .stat-label {
    font-size: 0.8rem;
    opacity: 0.85;
    margin-top: 4px;
    display: block;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.07);
    border-radius: 10px 10px 0 0 !important;
    padding: 16px 20px;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body { padding: 20px; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    overflow: hidden;
}

.table thead th {
    background: var(--primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: none;
    padding: 12px 14px;
    white-space: nowrap;
}

.table tbody td {
    vertical-align: middle;
    font-size: 0.88rem;
    padding: 11px 14px;
    border-bottom: 1px solid #f0f0f0;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f8faff; }

/* ============================================================
   FORMS
   ============================================================ */
.form-label { font-weight: 600; font-size: 0.87rem; color: #444; margin-bottom: 5px; }
.form-control, .form-select {
    border: 1.5px solid #dde1e7;
    border-radius: 7px;
    font-size: 0.9rem;
    padding: 9px 13px;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(52,152,219,0.15);
    outline: none;
}
textarea.form-control { resize: vertical; min-height: 90px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { border-radius: 7px; font-size: 0.88rem; font-weight: 500; padding: 8px 18px; transition: all var(--transition); }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-dark { background: var(--primary); border-color: var(--primary); }
.btn-dark:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

/* ============================================================
   BADGES
   ============================================================ */
.badge { font-size: 0.75rem; padding: 5px 10px; border-radius: 5px; font-weight: 600; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert { border: none; border-radius: 8px; font-size: 0.88rem; }
.alert-success { background: #d4edda; color: #155724; }
.alert-danger  { background: #f8d7da; color: #721c24; }
.alert-warning { background: #fff3cd; color: #856404; }
.alert-info    { background: #d1ecf1; color: #0c5460; }

/* ============================================================
   LOGIN / REGISTER PAGE
   ============================================================ */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #3d5a73 50%, var(--accent) 100%);
    padding: 24px;
}

.auth-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 430px;
    overflow: hidden;
}

.auth-card-header {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    padding: 32px 24px;
    text-align: center;
    color: #fff;
}

.auth-card-header .auth-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    display: block;
}

.auth-card-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.auth-card-header p {
    font-size: 0.8rem;
    opacity: 0.8;
    margin: 5px 0 0;
}

.auth-card-body { padding: 28px 28px 24px; }

.auth-divider {
    text-align: center;
    font-size: 0.82rem;
    color: #888;
    margin: 12px 0;
}

/* ============================================================
   EQUIPMENT CARDS (Browse)
   ============================================================ */
.equip-card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    transition: transform var(--transition), box-shadow var(--transition);
    overflow: hidden;
    height: 100%;
}

.equip-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.13);
}

.equip-card-icon {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 110px;
}

.equip-card .card-body { padding: 16px; }
.equip-card .card-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; color: var(--primary); }
.equip-card .card-text  { font-size: 0.8rem; color: #666; }

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-box {
    position: relative;
}

.search-box .form-control {
    padding-left: 38px;
}

.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 0.9rem;
    pointer-events: none;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination .page-link {
    border-radius: 6px;
    margin: 0 2px;
    color: var(--accent);
    border-color: #dde1e7;
    font-size: 0.87rem;
}

.pagination .page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */

/* ── Mobile toggle button (burger) ── */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1100;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    width: 44px;
    height: 44px;
    font-size: 1.15rem;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
    transition: background var(--transition);
    text-align: center;
    line-height: 44px;
    padding: 0;
}
.mobile-toggle:hover { background: var(--accent); }

/* ── Overlay ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 999;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

@media (max-width: 991px) {

    /* Show burger */
    .mobile-toggle { display: block; }

    /* Hide sidebar off-screen */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 6px 0 28px rgba(0,0,0,0.3);
    }

    /* Main content takes full width */
    .main-content {
        margin-left: 0 !important;
        padding: 72px 16px 32px;
    }

    /* Page header stacks */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .page-header h1 { font-size: 1.25rem; }

    /* Stat cards */
    .stat-card { padding: 16px 14px; }
    .stat-card .stat-icon { font-size: 1.7rem; }
    .stat-card .stat-info .stat-number { font-size: 1.6rem; }
    .stat-card .stat-info .stat-label  { font-size: 0.75rem; }

    /* Tables */
    .table-responsive { -webkit-overflow-scrolling: touch; }
    .table thead th   { font-size: 0.75rem; padding: 10px; }
    .table tbody td   { font-size: 0.83rem; padding: 9px 10px; }

    /* Card header */
    .card-header { flex-wrap: wrap; gap: 8px; }

    /* Search box full width */
    .search-box { width: 100% !important; }

    /* Equipment cards */
    .equip-card-icon { height: 90px; font-size: 2rem; }

    /* Auth */
    .auth-card-body   { padding: 20px 18px; }
    .auth-card-header { padding: 24px 18px; }

    /* Forms */
    .form-control, .form-select { font-size: 0.88rem; padding: 8px 11px; }
}

@media (max-width: 575px) {
    .main-content { padding: 66px 12px 28px; }
    .stat-card .stat-info .stat-number { font-size: 1.4rem; }
    .page-header h1 { font-size: 1.1rem; }
    .card-header { flex-direction: column; align-items: flex-start; }
    .page-header .btn { width: 100%; text-align: center; }
    .badge { font-size: 0.7rem; padding: 4px 8px; }
    .modal-dialog { margin: 8px; }
    .modal-content { border-radius: 12px; }
    .auth-card { border-radius: 12px; }
    .auth-card-header .auth-icon { font-size: 2.2rem; }
    .auth-card-header h2 { font-size: 1.05rem; }
}

/* ── Misc utilities ── */
.text-primary-custom { color: var(--primary) !important; }
.bg-primary-custom   { background: var(--primary) !important; }
.fw-600 { font-weight: 600; }
.rounded-10 { border-radius: 10px; }
.shadow-sm-custom { box-shadow: 0 2px 8px rgba(0,0,0,0.07); }
