/* ============================================
   ADMIN SPECIFIC STYLES
   Location: assets/css/admin.css
   ============================================ */

/* ============================================
   SIDEBAR TOGGLE BUTTONS - CRITICAL
   ============================================ */

   #sidebar .sidebar-header .toggle-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    z-index: 10;
}

#sidebar .sidebar-header .toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

#sidebar .sidebar-header .toggle-btn:active {
    transform: scale(0.92);
}

#sidebar .sidebar-header .toggle-btn i {
    font-size: 18px;
    pointer-events: none;
    transition: transform 0.3s ease;
}

/* Desktop: Show desktop toggle, hide mobile toggle */
@media (min-width: 993px) {
    #sidebar .sidebar-header .toggle-btn {
        display: flex !important;
    }
    #sidebar .sidebar-header .toggle-btn-mobile {
        display: none !important;
    }
}

/* Mobile: Hide desktop toggle, show mobile toggle */
@media (max-width: 992px) {
    #sidebar .sidebar-header .toggle-btn {
        display: none !important;
    }
    #sidebar .sidebar-header .toggle-btn-mobile {
        display: flex !important;
    }
}

/* ============================================
   SIDEBAR COLLAPSED STATE - ENSURE TOGGLE VISIBLE
   ============================================ */

   #sidebar.collapsed .sidebar-header .toggle-btn {
    display: flex !important;
    margin-left: auto;
}

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

/* ============================================
   SIDEBAR TOGGLE ICON ROTATION
   ============================================ */

#sidebar:not(.collapsed) .sidebar-header .toggle-btn i {
    transform: rotate(0deg);
}

/* ============================================
   SIDEBAR OVERLAY
   ============================================ */

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    transition: all 0.3s ease;
}

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


/* ============================================
   DASHBOARD CARDS
   ============================================ */

.dashboard-stat {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s;
    height: 100%;
}

.dashboard-stat:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.dashboard-stat .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.dashboard-stat .stat-number {
    font-size: 28px;
    font-weight: 700;
    margin-top: 10px;
    color: #333;
}

.dashboard-stat .stat-label {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
}

/* ============================================
   SIDEBAR COLLAPSED STATE - ENSURE TOGGLE VISIBLE
   ============================================ */

#sidebar.collapsed .sidebar-header .toggle-btn {
    display: flex !important;
    margin-left: auto;
}

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

/* ============================================
   SIDEBAR TOGGLE ICON ROTATION
   ============================================ */

#sidebar:not(.collapsed) .sidebar-header .toggle-btn i {
    transform: rotate(0deg);
}

/* ============================================
   SIDEBAR OVERLAY
   ============================================ */

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    transition: all 0.3s ease;
}

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

/* ============================================
   MOBILE SIDEBAR BEHAVIOR
   ============================================ */

   @media (max-width: 992px) {
    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
        min-width: 280px;
        max-width: 280px;
        box-shadow: 2px 0 20px rgba(0,0,0,0.3);
    }
    
    #sidebar.active {
        transform: translateX(0);
    }
    
    #sidebar.collapsed {
        transform: translateX(-100%);
        min-width: 280px;
        max-width: 280px;
    }
    
    #sidebar.collapsed.active {
        transform: translateX(0);
    }
    
    #sidebar.collapsed .sidebar-header .logo .logo-full {
        display: flex;
    }
    
    #sidebar.collapsed .sidebar-header .logo .logo-icon {
        display: none;
    }
    
    #sidebar.collapsed .sidebar-header .toggle-btn {
        display: none !important;
    }
    
    #sidebar.collapsed .sidebar-header .toggle-btn-mobile {
        display: flex !important;
    }
    
    #sidebar.collapsed .sidebar-nav .nav-item span:not(.badge) {
        display: inline;
    }
    
    #sidebar.collapsed .sidebar-nav .nav-item .badge {
        display: inline;
    }
    
    #sidebar.collapsed .sidebar-nav .nav-item {
        justify-content: flex-start;
        padding: 10px 20px;
    }
    
    #sidebar.collapsed .sidebar-nav .nav-item i {
        font-size: 16px;
        width: 20px;
    }
    
    #sidebar.collapsed .sidebar-nav .nav-section {
        display: block;
    }
    
    #content {
        margin-left: 0 !important;
        width: 100%;
    }
    
    body.sidebar-open {
        overflow: hidden;
    }
}



/* ============================================
   SUBSCRIPTION PLANS
   ============================================ */

.plan-card {
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s;
    cursor: pointer;
    height: 100%;
    position: relative;
}

.plan-card:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.plan-card.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.plan-card.active .price {
    color: #fff;
}

.plan-card.active .features li {
    color: rgba(255,255,255,0.9);
}

.plan-card .price {
    font-size: 32px;
    font-weight: 700;
    color: #667eea;
}

.plan-card .price span {
    font-size: 16px;
    font-weight: 400;
}

.plan-card .features {
    list-style: none;
    padding: 0;
    margin-top: 15px;
}

.plan-card .features li {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    color: #6c757d;
    font-size: 14px;
}

.plan-card .features li:last-child {
    border-bottom: none;
}

.plan-card .features li i {
    margin-right: 10px;
    color: #28a745;
    width: 16px;
}

.plan-card.active .features li i {
    color: #fff;
}

.plan-card .badge-popular {
    position: absolute;
    top: -10px;
    right: 20px;
    background: #ff6b6b;
    color: #fff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* ============================================
   MODULE SELECTION
   ============================================ */

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.module-item {
    padding: 10px 12px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.module-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.module-item.selected {
    border-color: #667eea;
    background: #667eea;
    color: #fff;
}

.module-item .price-tag {
    font-size: 12px;
    color: #6c757d;
}

.module-item.selected .price-tag {
    color: rgba(255,255,255,0.8);
}

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

.payment-summary {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.payment-summary .total {
    font-size: 28px;
    font-weight: 700;
    color: #667eea;
}

/* ============================================
   NOTIFICATIONS
   ============================================ */

.notification-dropdown {
    width: 350px;
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
}

.notification-dropdown .dropdown-header {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
}

.notification-dropdown .notification-item {
    display: flex;
    gap: 12px;
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.notification-dropdown .notification-item:hover {
    background: #f8f9fa;
}

.notification-dropdown .notification-item .icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    flex-shrink: 0;
}

.notification-dropdown .notification-item .content {
    flex: 1;
}

.notification-dropdown .notification-item .content .title {
    font-weight: 500;
    font-size: 13px;
    color: #333;
}

.notification-dropdown .notification-item .content .message {
    font-size: 12px;
    color: #6c757d;
}

.notification-dropdown .notification-item .content .time {
    font-size: 11px;
    color: #adb5bd;
    margin-top: 3px;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

   .toast-container {
    z-index: 9999 !important;
}


/* ============================================
   RESPONSIVE TABLES
   ============================================ */

.table-responsive {
    overflow-x: auto;
}

.table-actions {
    display: flex;
    gap: 5px;
}

.table-actions .btn {
    padding: 3px 8px;
    font-size: 12px;
}

/* ============================================
   RESPONSIVE TABLE ACTIONS
   ============================================ */

   @media (max-width: 768px) {
    .table-actions .btn {
        padding: 2px 6px;
        font-size: 11px;
    }
    
    .table-actions .btn i {
        font-size: 11px;
    }
}



/* ============================================
   BADGE STATUS COLORS
   ============================================ */

.badge-status-active {
    background: #d4edda;
    color: #155724;
}

.badge-status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.badge-status-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-status-completed {
    background: #d4edda;
    color: #155724;
}

.badge-status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.badge-status-paid {
    background: #d4edda;
    color: #155724;
}

.badge-status-unpaid {
    background: #f8d7da;
    color: #721c24;
}

.badge-status-partial {
    background: #fff3cd;
    color: #856404;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
    
    .main-content {
        padding: 0 !important;
    }
}

/* ============================================
   RESPONSIVE TOPBAR
   ============================================ */

@media (max-width: 992px) {
    .topbar .left .sidebar-toggle {
        display: block !important;
    }
}