/* Content Area */
.content-wrapper {
    padding: 2.25rem;
}

.page-header {
    margin-bottom: 2.25rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-dark);
    margin-bottom: 0.625rem;
    letter-spacing: -1px;
}

.page-subtitle {
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 400;
}

/* Stats Grid - Design 62 Layout */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.25rem;
}

/* Design 62: Circle Progress Card (Design G) - White Theme */
.stat-card-design-g {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border: 2px solid var(--border);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.stat-card-design-g:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.design-g-ring {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 4px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-dark);
    flex-shrink: 0;
    position: relative;
}

/* Border color variants */
.design-g-ring.primary {
    border-top-color: #3b82f6;
    border-right-color: #3b82f6;
}

.design-g-ring.success {
    border-top-color: #10b981;
    border-right-color: #10b981;
}

.design-g-ring.warning {
    border-top-color: #f59e0b;
    border-right-color: #f59e0b;
}

.design-g-ring.danger {
    border-top-color: #ef4444;
    border-right-color: #ef4444;
}

.design-g-content h4 {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.design-g-content .design-g-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-top: 0.25rem;
    line-height: 1.2;
}

/* Charts Section */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.75rem;
    margin-bottom: 2.25rem;
}

.chart-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 2px solid var(--border);
}

.chart-card canvas {
    touch-action: pan-y;
    display: block;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 2px solid var(--border);
}

.chart-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-dark);
}

/* Breadcrumb Styles */
.breadcrumb-container {
    background: white;
    padding: 1rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    align-items: center;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item+.breadcrumb-item::before {
    content: "/";
    display: inline-block;
    padding: 0 0.5rem;
    color: var(--text);
    font-weight: 400;
}

.breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--text-dark);
    font-weight: 500;
}

.page-title-section {
    margin-bottom: 2rem;
}

.page-title-section h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.page-title-section p {
    color: var(--text);
    margin: 0;
    font-size: 0.9rem;
}

/* Stats Bar */
.stats-bar {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.stat-item {
    text-align: center;
    padding: 1rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Filters Section */
.filters-section {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 2.25rem;
    border: 2px solid var(--border);
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 0.9rem;
    background: var(--light);
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.search-box i {
    position: absolute;
    left: 1.125rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text);
    pointer-events: none;
    z-index: 1;
}

/* Custom Dropdown Styles */
.filter-box {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.filter-box:has(.custom-dropdown.active) {
    z-index: 10001;
}

.filter-label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
    margin: 0;
}

.custom-dropdown {
    position: relative;
    width: 100%;
    z-index: 1;
}

.custom-dropdown.active {
    z-index: 10001 !important;
    position: relative;
}

.custom-dropdown.active .custom-dropdown-menu {
    z-index: 10001 !important;
}

.custom-dropdown-btn {
    width: 100%;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    color: var(--text-dark);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.custom-dropdown-btn:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}

.custom-dropdown-btn:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
    background: white;
}

.custom-dropdown-btn:disabled {
    background: var(--light);
    color: var(--text);
    cursor: not-allowed;
    opacity: 0.7;
}

.custom-dropdown-btn i {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    color: var(--text);
}

.custom-dropdown.active .custom-dropdown-btn i {
    transform: rotate(180deg);
}

.custom-dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: white !important;
    border: 2px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.2);
    z-index: 10001 !important;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    display: none;
}

.custom-dropdown.active .custom-dropdown-menu {
    display: block;
}

.custom-dropdown-items {
    max-height: 300px;
    overflow-y: auto;
    background: white !important;
}

.custom-dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border);
    color: var(--text-dark);
    font-weight: 500;
    background: white !important;
}

.custom-dropdown-item:last-child {
    border-bottom: none;
}

.custom-dropdown-item:hover {
    background: var(--light) !important;
    color: var(--primary);
}

.custom-dropdown-item.selected {
    color: var(--primary);
    font-weight: 600;
    background: rgba(220, 38, 38, 0.08) !important;
}

/* Custom Date Input */
.custom-date-input {
    position: relative;
    width: 100%;
}

.custom-date-field {
    width: 100%;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    font-size: 0.9rem;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    color: var(--text-dark);
    font-weight: 500;
    cursor: pointer;
}

.custom-date-field:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}

.custom-date-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
    background: white;
}

.custom-date-input i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text);
    pointer-events: none;
    font-size: 0.9rem;
}

.custom-date-field::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    right: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.filter-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border);
    background: var(--light);
    color: var(--text-dark);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
}

.filter-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Login Events Section */
.login-events-section {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 2rem;
    border: 2px solid var(--border);
    border: 1px solid var(--border);
}

.login-events-section h3 {
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
}

.login-event-item {
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.login-event-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.login-event-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.login-event-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
    color: white;
}

.login-event-icon.regular {
    background: var(--success);
}

.login-event-icon.business {
    background: var(--info);
}

.login-event-icon.admin {
    background: var(--danger);
}

.login-event-content {
    flex: 1;
}

.login-event-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.login-event-message {
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.login-event-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text);
}

.login-event-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: var(--success);
    color: white;
}

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

.badge-warning {
    background: var(--warning);
    color: var(--text-dark);
}

.badge-info {
    background: var(--info);
    color: white;
}

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

.badge-secondary {
    background: var(--text);
    color: white;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

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

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

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text);
}

.empty-state i {
    font-size: 4rem;
    color: var(--border);
    margin-bottom: 1rem;
}

.empty-state h4 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.loading-spinner {
    text-align: center;
    padding: 3rem;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
}

/* Sidebar Toggle States */
.sidebar.hidden {
    transform: translateX(-100%);
    left: -100%;
}

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

/* Desktop toggle support */
@media (min-width: 1025px) {
    .sidebar.hidden {
        transform: translateX(-100%);
        left: -100%;
    }

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

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        left: -100%;
    }

    .sidebar.active {
        left: 0;
    }

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

    .menu-toggle {
        display: block;
    }

    .search-box {
        width: 300px;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .search-box {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .content-wrapper {
        padding: 1.5rem;
    }
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

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

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.alert {
    border-radius: 6px;
    border: 1px solid;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background: #e8f5e9;
    color: var(--success);
    border-color: #c8e6c9;
}

.alert-danger {
    background: #fff5f5;
    color: var(--danger);
    border-color: #fecaca;
}

.alert-warning {
    background: #fff9e6;
    color: #856404;
    border-color: #ffeaa7;
}

.alert-info {
    background: #e3f2fd;
    color: var(--info);
    border-color: #90caf9;
}

.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

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

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* --- Design 2: Modern Cards (Floating Rows) for Login Tracking --- */
.d2-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.d2-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
    transition: transform 0.2s;
}

.d2-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
}

.d2-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #ecfdf5;
    color: #059669;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-right: 20px;
}

.d2-icon.fail {
    background: #fef2f2;
    color: #ef4444;
}

.d2-main {
    flex-grow: 1;
}

.d2-title {
    font-weight: 700;
    margin-bottom: 4px;
    color: #0f172a;
}

.d2-meta {
    font-size: 0.85rem;
    color: #64748b;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.d2-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
}

.d2-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    margin-right: 6px;
}