/* ============================================
   MODERN SAAS ADMIN DASHBOARD - STYLES
   ============================================ */

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

:root {
    --primary-dark: #1a2a4e;
    --primary-darker: #0f1a2e;
    --white: #ffffff;
    --light-gray: #f5f7fa;
    --gray-light: #e9ecef;
    --gray-medium: #6c757d;
    --gray-dark: #495057;
    --blue: #0d6efd;
    --blue-light: #0dcaf0;
    --green: #198754;
    --orange: #fd7e14;
    --red: #dc3545;
    --purple: #6f42c1;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.18);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--light-gray);
    color: var(--gray-dark);
    overflow: hidden;
}

/* ============================================
   DASHBOARD CONTAINER
   ============================================ */

.dashboard-container {
    display: flex;
    height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
}

/* ============================================
   SIDEBAR STYLES
   ============================================ */

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary-darker) 100%);
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    position: relative;
    z-index: 1000;
}

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

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

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--white);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.logo-img {
    height: 55px;
    width: 55px;
    object-fit: cover;
    border-radius: 14px;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 10px;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.nav-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.logout-section {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 10px;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.logout-btn:hover {
    background-color: rgba(220, 53, 69, 0.2);
    color: var(--red);
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
}

.main-content::-webkit-scrollbar {
    width: 8px;
}

.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* ============================================
   TOP HEADER
   ============================================ */

.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px 35px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    gap: 30px;
}

.search-container {
    flex: 1;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid var(--gray-light);
    transition: var(--transition);
}

.search-container:focus-within {
    background: var(--white);
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.search-container i {
    color: var(--gray-medium);
    font-size: 16px;
}

.search-container input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
    color: var(--gray-dark);
}

.search-container input::placeholder {
    color: var(--gray-medium);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 25px;
}

.notification-bell {
    position: relative;
    cursor: pointer;
    font-size: 20px;
    color: var(--gray-dark);
    transition: var(--transition);
}

.notification-bell:hover {
    color: var(--blue);
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--red);
    color: var(--white);
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.admin-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--blue);
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.2);
}

.admin-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.admin-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-dark);
}

.admin-role {
    font-size: 12px;
    color: var(--gray-medium);
}

.current-date {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    border-radius: 10px;
    color: var(--gray-dark);
    font-size: 14px;
    font-weight: 500;
}

.current-date i {
    font-size: 16px;
}

/* ============================================
   STATISTICS CARDS
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    padding: 30px 35px;
}

.stat-card {
    background: var(--white);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    gap: 18px;
    align-items: flex-start;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--gray-light);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-icon-bg {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--white);
    flex-shrink: 0;
}

.stat-icon-bg.blue {
    background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.stat-icon-bg.green {
    background: linear-gradient(135deg, #198754 0%, #20c997 100%);
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3);
}

.stat-icon-bg.orange {
    background: linear-gradient(135deg, #fd7e14 0%, #ff9e64 100%);
    box-shadow: 0 4px 12px rgba(253, 126, 20, 0.3);
}

.stat-icon-bg.purple {
    background: linear-gradient(135deg, #6f42c1 0%, #9775fa 100%);
    box-shadow: 0 4px 12px rgba(111, 66, 193, 0.3);
}

.stat-icon-bg.red {
    background: linear-gradient(135deg, #dc3545 0%, #ff6b9d 100%);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--gray-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-dark);
    margin-bottom: 10px;
}

.stat-growth {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}

.stat-growth i {
    font-size: 12px;
}

.stat-growth.positive {
    color: var(--green);
}

.stat-growth.negative {
    color: var(--red);
}

.stat-growth.neutral {
    color: var(--gray-medium);
}

/* ============================================
   DASHBOARD SECTIONS
   ============================================ */

.dashboard-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    padding: 30px 35px;
    flex: 1;
}

.dashboard-card {
    background: var(--white);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-light);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.dashboard-card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-light);
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-dark);
}

.view-all {
    font-size: 13px;
    color: var(--blue);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.view-all:hover {
    color: var(--primary-dark);
}

.period-selector {
    padding: 8px 12px;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    font-size: 13px;
    color: var(--gray-dark);
    background: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

.period-selector:hover,
.period-selector:focus {
    border-color: var(--blue);
    outline: none;
}

/* ============================================
   MEMBERSHIP CARD
   ============================================ */

.membership-card {
    grid-column: 1;
    grid-row: 1;
}

.chart-container {
    display: flex;
    align-items: center;
    gap: 30px;
}

.chart-wrapper {
    flex: 1;
    position: relative;
    min-height: 300px;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 150px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--gray-dark);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* ============================================
   ANALYTICS CARD
   ============================================ */

.analytics-card {
    grid-column: 2;
    grid-row: 1;
}

.analytics-card .chart-container {
    min-height: 300px;
}

/* ============================================
   EXPIRING CARD
   ============================================ */

.expiring-card {
    grid-column: 1;
    grid-row: 2 / 4;
}

.expiring-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.expiring-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    border-radius: 12px;
    transition: var(--transition);
}

.expiring-item:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dde4ed 100%);
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--blue);
}

.expiring-info {
    flex: 1;
}

.expiring-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-dark);
    margin-bottom: 4px;
}

.membership-plan {
    font-size: 12px;
    color: var(--gray-medium);
    margin-bottom: 4px;
}

.expiry-status {
    font-size: 12px;
    font-weight: 600;
}

.expiry-status.urgent {
    color: var(--red);
}

.expiry-status.warning {
    color: var(--orange);
}

.expiry-status.safe {
    color: var(--green);
}

.expiry-days {
    display: flex;
    gap: 8px;
}

.days-badge {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--white);
}

.days-badge.red {
    background: linear-gradient(135deg, #dc3545 0%, #ff6b9d 100%);
}

.days-badge.orange {
    background: linear-gradient(135deg, #fd7e14 0%, #ff9e64 100%);
}

.days-badge.yellow {
    background: linear-gradient(135deg, #ffc107 0%, #ffd700 100%);
    color: #333;
}

.days-badge.green {
    background: linear-gradient(135deg, #198754 0%, #20c997 100%);
}

/* ============================================
   ACTIVITY CARD
   ============================================ */

.activity-card {
    grid-column: 2;
    grid-row: 2;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    gap: 14px;
    padding: 14px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    border-radius: 12px;
    transition: var(--transition);
}

.activity-item:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dde4ed 100%);
}

.activity-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--white);
    flex-shrink: 0;
}

.activity-icon.new-user {
    background: linear-gradient(135deg, #198754 0%, #20c997 100%);
}

.activity-icon.renewal {
    background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%);
}

.activity-icon.payment {
    background: linear-gradient(135deg, #6f42c1 0%, #9775fa 100%);
}

.activity-icon.expired {
    background: linear-gradient(135deg, #dc3545 0%, #ff6b9d 100%);
}

.activity-icon.email {
    background: linear-gradient(135deg, #fd7e14 0%, #ff9e64 100%);
}

.activity-content h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-dark);
    margin-bottom: 4px;
}

.activity-content p {
    font-size: 12px;
    color: var(--gray-medium);
    margin-bottom: 6px;
}

.activity-time {
    font-size: 11px;
    color: var(--gray-medium);
    font-style: italic;
}

/* ============================================
   PAYMENT SUMMARY
   ============================================ */

.payment-summary {
    grid-column: 2;
    grid-row: 3;
}

.payment-content {
    display: flex;
    gap: 24px;
    align-items: center;
}

.payment-chart-wrapper {
    flex: 0 0 220px;
    position: relative;
    height: 220px;
}

.chart-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.chart-center-label {
    font-size: 12px;
    color: var(--gray-medium);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.chart-center-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-dark);
}

.payment-methods {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-method {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    border-radius: 10px;
}

.method-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--white);
    flex-shrink: 0;
}

.method-icon.cash {
    background: linear-gradient(135deg, #ffc107 0%, #ffd700 100%);
}

.method-icon.upi {
    background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%);
}

.method-icon.card {
    background: linear-gradient(135deg, #6f42c1 0%, #9775fa 100%);
}

.method-info {
    flex: 1;
}

.method-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-dark);
    margin-bottom: 2px;
}

.method-amount {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-dark);
}

/* ============================================
   QUICK ACTIONS
   ============================================ */

.quick-actions {
    grid-column: 1 / 3;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px 16px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    border: 1px solid var(--gray-light);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-dark);
    text-align: center;
}

.action-btn:hover {
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
    color: var(--white);
    border-color: var(--blue);
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.action-btn i {
    font-size: 24px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1400px) {
    .dashboard-sections {
        grid-template-columns: 1fr;
    }

    .membership-card,
    .analytics-card,
    .expiring-card,
    .activity-card,
    .payment-summary,
    .quick-actions {
        grid-column: 1 !important;
    }

    .actions-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
        padding: 20px 15px;
    }

    .logo-text {
        font-size: 18px;
    }

    .nav-item span {
        display: none;
    }

    .nav-item {
        padding: 12px;
        justify-content: center;
    }

    .logout-btn span {
        display: none;
    }

    .logout-btn {
        padding: 12px;
        justify-content: center;
    }

    .top-header {
        padding: 20px 25px;
        gap: 20px;
    }

    .search-container {
        max-width: 250px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 20px 25px;
    }

    .dashboard-sections {
        padding: 20px 25px;
        gap: 20px;
    }

    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding: 15px;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .logo-section {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        padding-right: 20px;
        margin-right: 20px;
    }

    .nav-menu {
        flex-direction: row;
        gap: 0;
        overflow-x: auto;
    }

    .nav-item {
        white-space: nowrap;
        padding: 10px 12px;
    }

    .nav-item span {
        display: inline;
    }

    .logout-section {
        border-top: none;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 0;
        padding-left: 20px;
        margin-left: 20px;
    }

    .logout-btn {
        padding: 10px 12px;
    }

    .logout-btn span {
        display: inline;
    }

    .main-content {
        flex: 1;
    }

    .top-header {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
    }

    .header-actions {
        flex-wrap: wrap;
        gap: 15px;
    }

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

    .dashboard-sections {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .chart-container {
        flex-direction: column;
    }

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

/* ============================================
   SCROLLBAR CUSTOMIZATION
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.stat-card,
.dashboard-card {
    animation: slideInDown 0.5s ease-out;
}

.nav-item:hover {
    animation: none;
}

/* ============================================
   UTILITIES
   ============================================ */

.glassmorphism {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
