@import url('boxicons.min.css');

:root {
    --primary-color: #8a42ff;
    --secondary-color: #2b2b36;
    --accent-color: #6c63ff;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --whatsapp-color: #25D366;
    --light-color: #f8f9fa;
    --dark-color: #2b2b36;
    --border-radius: 12px;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    overflow-x: hidden;
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.preloader.hide {
    opacity: 0;
    pointer-events: none;
}

.loader__text {
    font-size: 48px;
    font-weight: 700;
    color: white;
    position: relative;
}

.loader__text::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    color: var(--primary-color);
    overflow: hidden;
    width: 0;
    animation: loading 2s linear infinite;
}

@keyframes loading {
    0% { width: 0; }
    100% { width: 100%; }
}

/* Scroll to Top */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    text-decoration: none;
    font-size: 12px;
    text-align: center;
    line-height: 1.2;
    padding: 5px;
    border: none;
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Layout Core */
.dashboard {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.dashboard__sidebar {
    width: 250px;
    background: linear-gradient(180deg, var(--secondary-color) 0%, #1a1a24 100%);
    color: #fff;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
    z-index: 1000;
    transition: var(--transition);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

/* Hamburger: hidden on desktop, shown on mobile */
.sidebar__open {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
}

.sidebar__close {
    display: none;
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 24px;
    color: white;
    cursor: pointer;
    z-index: 1001;
}

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

.dashboard__logo img {
    max-width: 180px;
    height: auto;
}

.dashboard__menu {
    padding: 20px 0;
}

.dashboard__menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dashboard__menu > ul > li {
    position: relative;
}

.dashboard__menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.dashboard__menu a:hover {
    background: rgba(138, 66, 255, 0.15);
    color: #fff;
    border-left-color: rgba(138, 66, 255, 0.6);
    padding-left: 26px;
}

.dashboard__menu a.active {
    background: linear-gradient(90deg, rgba(138, 66, 255, 0.85) 0%, rgba(108, 99, 255, 0.5) 100%);
    color: #fff !important;
    border-left: 4px solid #fff;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: inset 0 0 12px rgba(138, 66, 255, 0.3);
}

.dashboard__menu a i {
    width: 24px;
    text-align: center;
    margin-right: 10px;
    font-size: 18px;
}

/* Sub-menu (sidebar dropdown) items */
.sidebar__dropdown ul {
    list-style: none;
    padding: 4px 0 4px 20px;
    margin: 0;
}

.sidebar__dropdown ul li a {
    display: block;
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar__dropdown ul li a:hover {
    background: rgba(138, 66, 255, 0.15);
    color: #fff;
    border-left-color: rgba(138, 66, 255, 0.6);
}

.sidebar__dropdown ul li a.active {
    background: linear-gradient(90deg, rgba(138, 66, 255, 0.75) 0%, rgba(108, 99, 255, 0.4) 100%);
    color: #fff !important;
    border-left: 3px solid #fff;
    font-weight: 600;
}

/* Dashboard Wrap */
/* Responsive Sidebar */
@media (max-width: 768px) {
  .dashboard__sidebar {
    transform: translateX(-100%);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 250px;
    transition: var(--transition);
    z-index: 1001;
  }
  .dashboard__sidebar.active {
    transform: translateX(0);
  }
  .sidebar__close {
    display: block;
  }
  .sidebar__open {
    display: block;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1002;
    background: var(--primary-color);
    border: none;
    color: #fff;
    font-size: 24px;
    padding: 8px;
    border-radius: 4px;
  }
}

.dashboard__wrap {
    flex: 1 1 0%;
    min-width: 0;
    max-width: calc(100vw - 250px);
    width: 100%;
    transition: var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

@media (max-width: 991px) {
    .dashboard__wrap {
        max-width: 100vw;
    }
}

/* Dashboard Header */
.dashboard__header {
    height: 70px;
    background: #fff;
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 99;
}

.current__balance {
    display: flex;
    align-items: center;
    gap: 10px;
}

.current__balance h4 {
    margin: 0;
    font-size: 16px;
    color: var(--secondary-color);
}

.dashboard__header__widgets {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header__widget {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--secondary-color);
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.header__widget:hover {
    color: var(--primary-color);
}

.notification__badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile__dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.profile__dropdown img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.profile__info {
    text-align: left;
}

.profile__info h5 {
    margin: 0;
    font-size: 14px;
    color: var(--secondary-color);
}

.profile__info span {
    font-size: 12px;
    color: #666;
}

.sidebar__open {
    display: none;
    font-size: 24px;
    color: var(--primary-color);
    background: none;
    border: none;
    cursor: pointer;
}

/* Dashboard Wrapper */
.dashboard__wrapper {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

/* Page Header */
.page__header {
    margin-bottom: 30px;
}

.page__header h2 {
    font-size: 24px;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.page__header p {
    color: #666;
    font-size: 14px;
}

/* Media Queries for layout */
@media (max-width: 991px) {
    .dashboard__sidebar {
        position: fixed;
        transform: translateX(-100%);
    }
    
    .dashboard__sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar__close {
        display: block;
    }
    
    .dashboard__wrap {
        margin-left: 0;
    }
    
    .sidebar__open {
        display: block;
    }
}

@media (max-width: 768px) {
    .dashboard__wrapper {
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .dashboard__header {
        padding: 0 15px;
    }
    .profile__info {
        display: none;
    }
}

/* ---------------------------------------------------
    COMMON DASHBOARD BUTTONS (Globally Extracted)
----------------------------------------------------- */

/* Status Toggle */
.status-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.status-toggle.active {
    color: #10b981;
}

.status-toggle.inactive {
    color: #ef4444;
}

.status-toggle:hover {
    transform: scale(1.1);
}

/* Action Buttons */
.action-buttons,
.table-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-action,
.action-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease-in-out;
    border: none !important;
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.btn-action i,
.action-btn i,
.btn-action svg,
.action-btn svg {
    color: #ffffff !important;
    font-size: 14px;
    line-height: 1;
    display: inline-block;
    transition: transform 0.2s ease;
}

.btn-action:hover i,
.action-btn:hover i {
    transform: scale(1.15);
}

/* Edit Button - Solid Blue/Indigo */
.btn-edit,
.edit-btn,
.btn-action.btn-edit,
.action-btn.edit-btn {
    background: #4f46e5 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 5px rgba(79, 70, 229, 0.35) !important;
}

.btn-edit:hover,
.edit-btn:hover,
.btn-action.btn-edit:hover,
.action-btn.edit-btn:hover {
    background: #3730a3 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.5) !important;
    transform: translateY(-2px);
}

/* Delete Button - Solid Red */
.btn-delete,
.delete-btn,
.btn-action.btn-delete,
.action-btn.delete-btn {
    background: #ef4444 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.35) !important;
}

.btn-delete:hover,
.delete-btn:hover,
.btn-action.btn-delete:hover,
.action-btn.delete-btn:hover {
    background: #dc2626 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.5) !important;
    transform: translateY(-2px);
}

/* View Button - Solid Emerald Green */
.btn-view,
.view-btn,
.btn-action.btn-view,
.action-btn.view-btn {
    background: #10b981 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 5px rgba(16, 185, 129, 0.35) !important;
}

.btn-view:hover,
.view-btn:hover,
.btn-action.btn-view:hover,
.action-btn.view-btn:hover {
    background: #059669 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.5) !important;
    transform: translateY(-2px);
}

/* Copy / Duplicate Button - Solid Amber */
.btn-copy,
.btn-action.btn-copy {
    background: #f59e0b !important;
    color: #ffffff !important;
    box-shadow: 0 2px 5px rgba(245, 158, 11, 0.35) !important;
}

.btn-copy:hover,
.btn-action.btn-copy:hover {
    background: #d97706 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.5) !important;
    transform: translateY(-2px);
}

/* Info / Purple Button */
.btn-info-action,
.btn-action.btn-info-action {
    background: #8a42ff !important;
    color: #ffffff !important;
    box-shadow: 0 2px 5px rgba(138, 66, 255, 0.35) !important;
}

.btn-info-action:hover,
.btn-action.btn-info-action:hover {
    background: #7a3ae6 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(138, 66, 255, 0.5) !important;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .action-buttons {
        gap: 4px;
    }
}

/* Responsive Dashboard Layout */
.dashboard__wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .dashboard__sidebar {
        position: fixed;
        left: -250px;
        top: 0;
        height: 100vh;
        transition: var(--transition);
        z-index: 1100;
    }
    .dashboard__sidebar.active {
        left: 0;
    }
    .sidebar__open {
        display: block;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1200;
    }
    .sidebar__close {
        display: block;
    }
}
