:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --light: #f8fafc;
    --dark: #1e293b;
    --border: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f1f5f9;
    color: var(--dark);
    line-height: 1.6;
}

.wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--dark) 0%, #0f172a 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: var(--primary);
}

.nav-link i {
    width: 24px;
    margin-right: 12px;
    font-size: 1.1rem;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 0;
}

.top-bar {
    background: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left{
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-toggle{
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    line-height: 1;
    cursor: pointer;
}

.sidebar-toggle i{
    font-size: 1.4rem;
}

.sidebar-close{
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 10px;
    padding: 6px 8px;
    line-height: 1;
    cursor: pointer;
}

.sidebar-header{
    position: relative;
}

.sidebar-overlay{
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 999;
}
.sidebar-overlay.show{
    display: block;
}


.top-bar h4 {
    font-weight: 600;
    color: var(--dark);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-menu .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--dark);
}

.content-area {
    padding: 30px;
}

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: none;
    margin-bottom: 24px;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

.stat-card {
    border-radius: 12px;
    padding: 24px;
    color: white;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: rgba(255,255,255,0.1);
    transform: rotate(30deg);
}

.stat-card.primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); }
.stat-card.success { background: linear-gradient(135deg, var(--success) 0%, #16a34a 100%); }
.stat-card.warning { background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%); }
.stat-card.danger { background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%); }
.stat-card.info { background: linear-gradient(135deg, var(--info) 0%, #2563eb 100%); }

.stat-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-card p {
    opacity: 0.9;
    margin: 0;
    font-size: 0.9rem;
}

.stat-card .icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    opacity: 0.3;
}

.module-card {
    text-align: center;
    padding: 30px 20px;
    border-radius: 12px;
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    border: 2px solid var(--border);
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: var(--primary);
}

.module-card i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.module-card h5 {
    font-weight: 600;
    margin-bottom: 10px;
}

.module-card p {
    color: var(--secondary);
    font-size: 0.875rem;
    margin: 0;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 10px 15px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.table {
    margin-bottom: 0;
}

.table th {
    background: var(--light);
    font-weight: 600;
    color: var(--dark);
    border-bottom: 2px solid var(--border);
    padding: 12px 15px;
}

.table td {
    padding: 12px 15px;
    vertical-align: middle;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.alert-fund-low {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    color: #92400e;
    padding: 15px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.alert-fund-low i {
    font-size: 1.5rem;
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--dark);
}

.login-card .logo {
    text-align: center;
    margin-bottom: 20px;
}

.login-card .logo i {
    font-size: 3rem;
    color: var(--primary);
}

.image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.image-preview img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--border);
}

.image-preview .remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.fund-balance-card {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
}

.fund-balance-card.low {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.fund-balance-card h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

/* Vendor Tabs - ensure names are always visible */
.nav-tabs .nav-link {
    color: var(--dark);
    font-weight: 500;
    padding: 10px 20px;
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    font-weight: 600;
    border-color: var(--primary) var(--primary) #fff;
}

.nav-tabs .nav-link .badge {
    margin-left: 5px;
}

/* Employee Selector Card */
.employee-selector-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
}

.employee-selector-card h5 {
    font-weight: 600;
    margin-bottom: 20px;
}

.employee-btn {
    padding: 15px 30px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.employee-btn.btn-light {
    background: white;
    color: var(--primary);
}

.employee-btn.btn-light:hover, .employee-btn.btn-light.active {
    background: rgba(255,255,255,0.9);
    transform: scale(1.05);
}

.employee-btn.btn-outline-light {
    color: white;
    border-color: rgba(255,255,255,0.5);
}

.employee-btn.btn-outline-light:hover, .employee-btn.btn-outline-light.active {
    background: rgba(255,255,255,0.2);
    border-color: white;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }
}

/* =========================
   TOPBAR + MENU BUTTON (MOBILE ONLY)
   Desktop remains unchanged
   ========================= */

.topbar-left{
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Default (desktop): keep your existing look */
.sidebar-toggle{
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  line-height: 1;
  cursor: pointer;
}

/* Mobile improvements */
@media (max-width: 991.98px){

  .top-bar{
    position: sticky;
    top: 0;
    z-index: 1200;
    padding: 12px 12px !important;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }

  /* Menu button becomes "☰ Menu" pill */
  .sidebar-toggle{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px !important;
    border-radius: 14px !important;
    border: 1px solid rgba(255,255,255,0.14) !important;
    background: rgba(255,255,255,0.06) !important;
    box-shadow: 0 10px 22px rgba(0,0,0,0.22);
  }

  .sidebar-toggle:active{
    transform: scale(0.98);
  }

  .sidebar-toggle-icon{
    font-size: 18px;
    line-height: 1;
    display: inline-block;
    margin-top: -1px;
  }

  .sidebar-toggle-text{
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
  }

  /* Title alignment and spacing */
  .topbar-left h4{
    font-size: 16px !important;
    line-height: 1.2;
    margin: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 58vw;
  }

  /* right side compact */
  .user-menu{
    gap: 10px;
  }
}

@media (max-width: 575.98px){
  .user-menu .badge{
    display: none; /* hide role badge on very small screens */
  }
}

