:root {
    --primary-color: #6697e6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --info-color: #0ea5e9;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-color: #f8fafc;
    --dark-color: #0f172a;

    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --top-header-height: 70px;
    --sidebar-bg: #1e293b;
    --sidebar-color: #94a3b8;
    --sidebar-active-color: #ffffff;
    --sidebar-hover-bg: #334155;
    --sidebar-border: rgba(255, 255, 255, 0.08);

    --card-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --card-border-radius: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    margin: 0;
}

/* Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
#sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-color);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1001;
    transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s ease;
    overflow: visible;
    border-right: 1px solid var(--sidebar-border);
    box-shadow: 2px 0 24px rgba(0, 0, 0, 0.08);
}

#sidebar .sidebar-header {
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

#sidebar .brand-name {
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
    white-space: nowrap;
    transition: opacity 0.2s;
}

#desktop-toggle {
    transition: all 0.2s ease;
    padding: 0.5rem !important;
    border-radius: 8px;
}

#desktop-toggle:hover {
    color: var(--primary-color) !important;
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

#sidebar .nav-group {
    padding: 0 1.25rem;
    margin-bottom: 1.75rem;
}

#sidebar .nav-label {
    padding: 0 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.6rem;
}

#sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 0.9rem;
    color: var(--sidebar-color);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 4px;
    position: relative;
    min-height: 48px;
    background: transparent;
}

#sidebar .nav-link:hover {
    background-color: transparent;
    color: var(--sidebar-color);
}

#sidebar .nav-link.active {
    background-color: transparent;
    color: var(--sidebar-color);
}

#sidebar .nav-link i {
    font-size: 1.25rem;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    text-align: center;
    color: #cbd5e1;
    border-radius: 12px;
    transition: color 0.2s ease, background-color 0.2s ease;
    background-color: transparent;
}

#sidebar .nav-link:hover i {
    color: var(--primary-color);
    background-color: transparent;
}

#sidebar .nav-link.active i {
    color: var(--primary-color);
    background-color: transparent;
}

body:not(.sidebar-collapsed) #sidebar .nav-link:hover i {
    background-color: rgba(255, 255, 255, 0.06);
}

body:not(.sidebar-collapsed) #sidebar .nav-link.active i {
    background-color: rgba(59, 130, 246, 0.12);
}

#sidebar .nav-link .link-text {
    flex: 1;
}

#sidebar .sidebar-inner,
#sidebar .brand-name,
#sidebar .nav-label,
#sidebar .nav-link .link-text,
#sidebar .sidebar-footer .user-details {
    transition: opacity 0.2s ease, width 0.2s ease, visibility 0.2s ease;
}

#sidebar .sidebar-footer {
    margin-top: auto;
    padding: 1.5rem 1.25rem;
    border-top: 1px solid var(--sidebar-border);
}

#sidebar .user-avatar {
    width: 36px;
    height: 36px;
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
}

#sidebar .sidebar-user {
    color: #e2e8f0;
}

#sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
    position: fixed;
    left: 0;
    align-items: center;
}

#sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 1.25rem 0;
    flex-direction: column;
    gap: 10px;
}

#sidebar.collapsed .sidebar-header img {
    margin: 0 auto;
}

#sidebar.collapsed .brand-name,
#sidebar.collapsed .nav-label,
#sidebar.collapsed .link-text,
#sidebar.collapsed .sidebar-footer .user-details {
    opacity: 0;
    width: 0;
    visibility: hidden;
    overflow: hidden;
    white-space: nowrap;
}

#sidebar.collapsed .nav-group {
    padding: 0 0.65rem;
}

#sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.8rem 0;
}

#sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 1.5rem 0;
}

#sidebar.collapsed .sidebar-footer {
    padding: 1rem 0.75rem 1.25rem;
}

#sidebar.collapsed .sidebar-footer .sidebar-user {
    justify-content: center;
}

#sidebar.collapsed .sidebar-footer .btn {
    width: 56px;
    padding: 0.65rem;
    justify-content: center;
}

#sidebar.collapsed .sidebar-footer .btn i {
    margin: 0;
}

#sidebar.collapsed .sidebar-collapse-toggle i {
    transform: rotate(180deg);
}

/* Tooltip effect for collapsed sidebar */
#sidebar .nav-link::after {
    content: '';
    opacity: 0;
    pointer-events: none;
}

#sidebar.collapsed .nav-link::after {
    content: attr(data-label);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translate(8px, -50%);
    background: #0f172a;
    color: white;
    padding: 0.55rem 0.85rem;
    border-radius: 10px;
    white-space: nowrap;
    margin-left: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1003;
    font-size: 0.875rem;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

#sidebar.collapsed .nav-link:hover::after,
#sidebar.collapsed .nav-link:focus-visible::after {
    opacity: 1;
    transform: translate(14px, -50%);
}

/* Main Content Area */
.content-with-sidebar,
.content-standalone {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.content-standalone {
    width: 100%;
}

body:not(.sidebar-collapsed) .content-with-sidebar {
    margin-left: var(--sidebar-width);
}

body.sidebar-collapsed .content-with-sidebar {
    margin-left: var(--sidebar-collapsed-width);
}

#top-header {
    height: var(--top-header-height);
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-container {
    padding: 2rem;
}

/* Stat Cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: currentColor;
    opacity: 0.03;
    border-radius: 0 0 0 100%;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-card.primary {
    color: var(--primary-color);
}

.stat-card.success {
    color: var(--success-color);
}

.stat-card.warning {
    color: var(--warning-color);
}

.stat-card.danger {
    color: var(--danger-color);
}

.stat-card.info {
    color: var(--info-color);
}

.stat-card.primary .stat-icon {
    background: rgba(59, 130, 246, 0.1);
}

.stat-card.success .stat-icon {
    background: rgba(16, 185, 129, 0.1);
}

.stat-card.warning .stat-icon {
    background: rgba(245, 158, 11, 0.1);
}

.stat-card.danger .stat-icon {
    background: rgba(239, 68, 68, 0.1);
}

.stat-card.info .stat-icon {
    background: rgba(14, 165, 233, 0.1);
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: #0f172a;
}

/* Table Style */
.card-table-wrap {
    background: white;
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.card-header-custom {
    padding: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title-custom {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
}

.custom-table th {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    border-bottom: 1px solid #f1f5f9;
}

.custom-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

/* Global Form Elements */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    height: 48px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0 1rem;
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #ffffff;
    color: #1e293b;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

textarea {
    height: auto;
    min-height: 100px;
    padding: 1rem;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    outline: none;
}

.form-label {
    font-weight: 600;
    font-size: 0.75rem;
    color: #475569;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.badge-validated {
    background: #dcfce7;
    color: #166534;
}


.btn {
    padding: 0.875rem 1.75rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    font-size: 0.95rem;
}

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

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    filter: brightness(1.1);
}

.btn-lg {
    padding: 1.125rem 2.25rem;
    font-size: 1.05rem;
}

.bg-light {
    background-color: #f8fafc !important;
}

.rounded-4 {
    border-radius: 1.25rem !important;
}

.bg-danger-subtle {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
}

.bg-warning-subtle {
    background-color: #fef3c7 !important;
    color: #92400e !important;
}

.bg-primary-subtle {
    background-color: #dbeafe !important;
    color: #1e40af !important;
}

/* Dashboard Balance Specifics */
.balance-card-mini {
    padding: 1rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

/* Utilities */
.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.font-medium {
    font-weight: 500;
}

.font-bold {
    font-weight: 700;
}

.uppercase {
    text-transform: uppercase;
}

.rounded-circle {
    border-radius: 50% !important;
}

.shadow-sm {
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.bg-gradient-dark {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.letter-spacing-1 {
    letter-spacing: 0.05em;
}

.z-index-1 {
    z-index: 1;
}

.text-xxs {
    font-size: 0.65rem;
}

/* Responsive */
@media (max-width: 1024px) {
    #sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        transform: translateX(-100%);
        width: var(--sidebar-width);
        box-shadow: none;
        transition: transform 0.25s ease-in-out;
    }

    #sidebar.open {
        transform: translateX(0);
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    }
    body.sidebar-open #sidebar {
        transform: translateX(0);
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    }

    #sidebar.collapsed {
        width: var(--sidebar-width);
    }

    .content-with-sidebar {
        width: 100%;
        margin-left: 0 !important;
    }

    body.sidebar-collapsed .content-with-sidebar,
    body:not(.sidebar-collapsed) .content-with-sidebar {
        margin-left: 0 !important;
    }
}

/* Collector Admin Specific Styles */
.table-warning {
    background-color: #fff3cd !important;
}

.table-success {
    background-color: #d1e7dd !important;
}

.table-danger {
    background-color: #f8d7da !important;
}

.table-primary {
    background-color: #cfe2ff !important;
}

.transition-base {
    transition: background-color 0.3s;
}

.donation-row.table-success td {
    background-color: #d1e7dd !important;
}

.avatar-xs-initials {
    width: 24px;
    height: 24px;
    background: #e1e7f0;
    color: #475569;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
}

.btn-white {
    background: #fff;
}

.shadow-xs {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.select2-container--bootstrap-5 .select2-selection {
    border-radius: 12px;
    border-color: #e2e8f0;
    height: 48px !important;
    display: flex;
    align-items: center;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: #1e293b;
    padding-left: 0.5rem;
}
/*cards*/
    /* Accent color based on semantic class */
.stat-card.primary::before {
    background: linear-gradient(180deg, var(--primary-color), #8bb3ff);
}

.stat-card.success::before {
    background: linear-gradient(180deg, var(--success-color), #34d399);
}

.stat-card.warning::before {
    background: linear-gradient(180deg, var(--warning-color), #fbbf24);
}

.stat-card.danger::before {
    background: linear-gradient(180deg, var(--danger-color), #f87171);
}

.stat-card.info::before {
    background: linear-gradient(180deg, var(--info-color), #38bdf8);
}

/* Elegant left border */
.stat-card::before {
    content: "";
    position: absolute;
    top: 12px;
    left: 0;
    width: 6px;
    height: calc(100% - 24px);
    border-radius: 8px;
    background: linear-gradient(
        180deg,
        currentColor 0%,
        rgba(255, 255, 255, 0.4) 100%
    );
    opacity: 0.9;
}

.stat-card::after {
    content: "";
    position: absolute;
    top: 12px;
    left: 6px;
    width: 2px;
    height: calc(100% - 24px);
    background: currentColor;
    opacity: 0.15;
    border-radius: 8px;
}



.stat-card::before {
    transition: all 0.3s ease;
}

.stat-card:hover::before {
    width: 10px;
    opacity: 1;
}
