/* --- VARIABLES & BASE --- */
:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --secondary: #10B981;
    --dark: #1F2937;
    --light: #F3F4F6;
    --white: #FFFFFF;
    --gray: #9CA3AF;
    --danger: #EF4444;
    --warning: #F59E0B;
    --success: #10B981;

    --bg-color: #F8FAFC;
    --card-bg: #FFFFFF;
    --border-color: #E2E8F0;
    --text-main: #334155;
    --text-muted: #64748B;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- DARK MODE OVERRIDES --- */
.dark-mode {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --border-color: #334155;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --dark: #f8fafc;
    --light: #1e293b;
    --white: #1e293b;
    --gray: #475569;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

.dark-mode input:not([type="submit"]):not([type="button"]),
.dark-mode select,
.dark-mode textarea {
    background-color: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

.dark-mode .sidebar,
.dark-mode .topbar,
.dark-mode .search-dropdown,
.dark-mode .notif-dropdown {
    background: rgba(30, 41, 59, 0.9);
    border-color: #334155;
}

.dark-mode .search-wrapper input {
    background: #0f172a;
    border-color: #334155;
}

.dark-mode .sidebar-nav a:hover,
.dark-mode .sidebar-nav a.active {
    background: rgba(79, 70, 229, 0.2);
}

.dark-mode .search-item:hover {
    background: #334155;
}

.dark-mode .notif-item:hover {
    background: #334155;
}

.dark-mode .notif-item.unread {
    background: rgba(79, 70, 229, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    margin: 0;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* --- TYPOGRAPHY --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
    font-weight: 700;
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    gap: 0.5rem;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #818CF8);
    color: var(--white);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(79, 70, 229, 0.4);
    color: var(--white);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #FCA5A5);
    color: var(--white);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

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

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* --- FORMS & INPUTS --- */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border: 1px solid #E2E8F0;
    background: var(--white);
    color: var(--text-main);
    transition: var(--transition);
    font-size: 1rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.textarea-premium {
    background: #F8FAFC !important;
    border: 2px solid #E2E8F0 !important;
    border-radius: 16px !important;
    padding: 1.2rem !important;
    font-size: 1.05rem !important;
    line-height: 1.6 !important;
    resize: vertical;
    min-height: 120px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.textarea-premium:focus {
    background: #FFFFFF !important;
    border-color: var(--primary) !important;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.1) !important;
    transform: translateY(-2px);
}

/* --- ALERTS --- */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-weight: 600;
}

.alert-danger {
    background-color: #FEF2F2;
    color: #B91C1C;
    border: 1px solid #FECACA;
}

.alert-success {
    background-color: #ECFDF5;
    color: #047857;
    border: 1px solid #A7F3D0;
}

/* --- AUTH PAGES (Login/Register/Expired) --- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
}

.auth-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    animation: slideUp 0.6s ease-out;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-muted);
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
}

/* --- DASHBOARD LAYOUT --- */
.wrapper {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--card-bg);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    z-index: 100;
    box-shadow: var(--shadow);
}

.logo-box {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

/* Sidebar Profile (Mobile Only) */
.sidebar-profile {
    display: none;
    /* Shown in mobile */
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    gap: 1rem;
    background: var(--bg-color);
}

.sidebar-profile .avatar {
    width: 45px;
    height: 45px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.sidebar-profile .user-info {
    display: flex;
    flex-direction: column;
}

.sidebar-profile .user-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.sidebar-profile .user-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.trial-badge,
.premium-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    transition: var(--transition);
}

.trial-badge {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.2);
}

.premium-badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.2);
}

.dark-mode .trial-badge {
    background: rgba(245, 158, 11, 0.15);
}

.dark-mode .premium-badge {
    background: rgba(16, 185, 129, 0.15);
}

.logo-icon {
    font-size: 1.8rem;
    background: var(--primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-box h3 {
    font-size: 1.3rem;
    color: var(--primary);
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-weight: 600;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--bg-color);
    color: var(--primary);
}

.sidebar-nav a.active {
    position: relative;
}

.sidebar-nav a.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 60%;
    width: 4px;
    background: var(--primary);
    border-radius: 4px;
}

.nav-icon {
    font-size: 1.2rem;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    color: var(--danger);
    font-weight: 600;
    border-radius: var(--radius);
}

.logout-btn:hover {
    background: #FEF2F2;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Important for flex-child to obey container width */
    max-width: 100%;
}

/* Topbar */
.topbar {
    height: 70px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    overflow: visible !important;
}

.topbar-mobile-actions {
    display: none;
    gap: 0.8rem;
    align-items: center;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
}

.mobile-logo-text {
    display: none;
}

/* Micro-animations for topbar icons */
.btn-icon:active {
    transform: scale(0.92);
}

.topbar-mobile-actions .btn-icon {
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.topbar-center {
    flex: 1;
    max-width: 600px;
    margin: 0 1.5rem;
    display: flex;
}

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

.search-wrapper input {
    width: 100%;
    padding: 0.7rem 2.8rem 0.7rem 1rem;
    border-radius: 50px;
    border: 1px solid #E2E8F0;
    background: #F8FAFC;
    transition: var(--transition);
    font-size: 0.95rem;
}

.search-wrapper input:focus {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

#searchIcon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    pointer-events: none;
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    left: 0;
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #E2E8F0;
    max-height: 450px;
    overflow-y: auto;
    display: none;
    z-index: 2000;
}

.search-dropdown.active {
    display: block;
    animation: slideUp 0.3s ease;
}

.search-result-group-title {
    padding: 0.6rem 1rem;
    background: #F8FAFC;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-item {
    display: flex;
    padding: 0.8rem 1rem;
    gap: 1rem;
    align-items: center;
    border-bottom: 1px solid #F1F5F9;
    transition: var(--transition);
    color: var(--text-main);
}

.search-item:hover {
    background: #F1F5F9;
}

.search-item-info {
    flex: 1;
}

.search-item-title {
    font-weight: 700;
    font-size: 0.95rem;
    display: block;
    margin-bottom: 2px;
}

.search-item-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-shrink: 0;
}

/* Notifications */
.notification-wrapper {
    position: relative;
    overflow: visible !important;
}

.btn-icon-top {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    font-size: 1.2rem;
}

.btn-icon-top:hover,
.btn-icon-top.btn-active {
    background: #EEF2FF;
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.badge {
    position: absolute;
    top: -5px;
    left: -5px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 50px;
    border: 2px solid white;
    font-weight: 700;
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    left: 0;
    width: 350px;
    max-width: 90vw;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    display: none;
    z-index: 9999 !important;
    pointer-events: auto !important;
}

.notif-dropdown.active {
    display: block !important;
    animation: slideUp 0.3s ease-out;
}

.notif-header {
    padding: 1rem;
    border-bottom: 1px solid #E2E8F0;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notif-list {
    max-height: 400px;
    overflow-y: auto;
}

.notif-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.notif-item:hover {
    background: #F8FAFC;
}

.notif-item.unread {
    background: #F0F7FF;
    border-right: 4px solid var(--primary);
}

.notif-subject {
    font-weight: 700;
    color: var(--dark);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.notif-message-preview {
    font-size: 0.85rem;
    color: #64748B;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-meta {
    font-size: 0.75rem;
    color: #94A3B8;
}

.notif-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

.bg-low-stock {
    background: #FEF2F2;
    color: var(--danger);
}

.bg-late-debt {
    background: #FFFBEB;
    color: var(--warning);
}

.trial-badge {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #818CF8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.user-name {
    font-weight: 700;
    color: var(--text-main);
}

.user-name small {
    display: block;
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Content Body */
.content-body {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

/* Widgets */
.dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.widget-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    color: white;
}

.widget-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.widget-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

.widget-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: rgba(255, 255, 255, 0.9);
}

.widget-info h2 {
    font-size: 1.8rem;
    color: white;
}

.widget-info small {
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.8;
}

.gradient-primary {
    background: linear-gradient(135deg, var(--primary), #818CF8);
}

.gradient-success {
    background: linear-gradient(135deg, var(--success), #34D399);
}

.gradient-warning {
    background: linear-gradient(135deg, var(--warning), #FCD34D);
}

.gradient-danger {
    background: linear-gradient(135deg, var(--danger), #F87171);
}

/* Grid Utilities */
.grid-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* --- ICON DASHBOARD --- */
.dashboard-header {
    margin-bottom: 2.5rem;
    animation: slideUp 0.5s ease;
}

.dashboard-header h1 {
    font-size: 2.2rem;
    background: linear-gradient(135deg, var(--dark), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.dashboard-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.icon-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 1.8rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid rgba(226, 232, 240, 0.5);
    position: relative;
    overflow: hidden;
}

.icon-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--primary);
}

.icon-card .icon-box {
    width: 70px;
    height: 70px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.icon-card:hover .icon-box {
    transform: scale(1.1) rotate(5deg);
}

.icon-card .card-label {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-main);
}

.icon-card .card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Glassmorphism utility for cards */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
    .icon-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .icon-card {
        padding: 1.2rem;
    }

    .icon-card .icon-box {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }

    .dashboard-header h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .icon-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .icon-card {
        padding: 1rem;
    }

    .icon-card .card-label {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .grid-dashboard {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Content Section (Cards) */
.content-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.quick-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

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

table th,
table td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

table th {
    background: var(--bg-color);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
}

table tr:hover {
    background: var(--bg-color);
}

.actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon-small {
    padding: 0.4rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    background: var(--light);
    color: var(--text-main);
    transition: var(--transition);
}

.btn-icon-small:hover {
    background: var(--border-color);
}

/* --- MODALS --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

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

.modal-content {
    background: var(--card-bg);
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: var(--transition);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
}

.close-modal:hover {
    color: var(--danger);
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

/* Responsive */
@media (max-width: 1200px) {
    .topbar-center {
        margin: 0 1rem;
    }
}

@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        right: -280px;
        top: 0;
        bottom: 0;
        z-index: 2000;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    }

    .sidebar.active {
        right: 0;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(4px);
        z-index: 1999;
        display: none;
    }

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

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

    .topbar {
        padding: 0 1rem;
    }

    .status-badge {
        min-width: 120px;
        padding: 0.5rem;
    }
}

@media (max-width: 768px) {
    .topbar {
        padding: 0 0.8rem;
        height: 65px;
    }

    .topbar-left {
        flex: 0 0 auto;
        /* Protect toggle icon */
        display: flex;
        align-items: center;
    }

    .topbar-left h2 {
        display: none;
    }

    .topbar-center {
        display: none !important;
    }

    .btn-easy-toggle span:last-child {
        display: none !important;
    }

    .btn-easy-toggle {
        padding: 0 !important;
        border-radius: 50% !important;
        width: 40px !important;
        height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .topbar-right {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .notif-dropdown {
        position: fixed !important;
        top: 70px !important;
        left: 5% !important;
        right: 5% !important;
        width: 90% !important;
        max-width: 380px !important;
        margin: 0 auto !important;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2) !important;
        border-radius: 20px !important;
    }

    .topbar-mobile-actions {
        display: none;
        /* No search toggle needed anymore */
    }

    .topbar-right {
        gap: 0.5rem;
    }

    .user-profile,
    .status-badge {
        display: none;
    }

    .sidebar-profile {
        display: flex;
    }

    .btn-icon {
        width: 36px;
        height: 36px;
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .topbar {
        padding: 0 0.8rem;
    }
}

@media (max-width: 768px) {
    .content-body {
        padding: 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .section-header .btn {
        width: 100%;
    }

    /* --- RESPONSIVE TABLES (CARD VIEW) --- */
    .table-responsive table,
    .table-responsive thead,
    .table-responsive tbody,
    .table-responsive th,
    .table-responsive td,
    .table-responsive tr {
        display: block;
    }

    .table-responsive thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .table-responsive tr {
        border: 1px solid var(--border-color);
        border-radius: 15px;
        margin-bottom: 1.5rem;
        background: var(--card-bg);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
        padding: 0.5rem;
    }

    .table-responsive td {
        border: none;
        border-bottom: 1px solid var(--border-color);
        position: relative;
        padding-right: 50% !important;
        text-align: left !important;
        min-height: 45px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    .table-responsive td:last-child {
        border-bottom: 0;
    }

    .table-responsive td:before {
        position: absolute;
        right: 1rem;
        width: 45%;
        padding-left: 10px;
        white-space: nowrap;
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        text-align: right;
        pointer-events: none;
        z-index: 1;
    }

    .actions {
        display: flex;
        justify-content: flex-end;
        width: 100%;
        position: relative;
        z-index: 5;
    }

    .pagination {
        padding: 0.4rem;
        gap: 0.15rem;
        scale: 0.9;
    }

    .page-link {
        padding: 0.6rem 0.9rem;
    }
}

/* --- SLEEK PILL PAGINATION BAR --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    margin: 4rem auto 2rem;
    padding: 0.5rem;
    list-style: none;
    background: var(--card-bg);
    border-radius: 50px;
    width: fit-content;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 10;
}

.page-item {
    display: flex;
}

.page-link {
    padding: 0.7rem 1.4rem;
    border-radius: 50px;
    background: transparent;
    color: #64748b;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-item.active .page-link {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #ffffff;
    box-shadow: 0 8px 15px rgba(79, 70, 229, 0.25);
    transform: scale(1.05);
}

.page-item.disabled .page-link {
    color: #cbd5e1;
    pointer-events: none;
    opacity: 0.6;
}

.page-link:hover:not(.disabled) {
    background: #f8fafc;
    color: #4f46e5;
    transform: translateY(-2px);
}

.page-item.active .page-link:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    color: #ffffff;
}

/* Custom styles for Previous/Next links within the bar */
.page-item:first-child .page-link,
.page-item:last-child .page-link {
    background: var(--light);
    color: var(--text-main);
}

.page-item:first-child .page-link:hover,
.page-item:last-child .page-link:hover {
    background: #e2e8f0;
}

.page-item:first-child .page-link {
    margin-left: 0.5rem;
}

.page-item:last-child .page-link {
    margin-right: 0.5rem;
}

/* --- SCIENTIFIC DASHBOARD HEADER --- */
.dashboard-header-scientific {
    margin-bottom: 2.5rem;
    padding: 1.5rem 2rem;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    animation: slideInUp 0.6s ease;
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-header-scientific h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-main);
    background: linear-gradient(135deg, var(--text-main), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    background: var(--bg-color);
    border-radius: 50px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .dashboard-header-scientific {
        padding: 1.2rem;
    }

    .header-main {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-header-scientific h1 {
        font-size: 1.5rem;
    }
}

/* --- VIBRANT "ALIVE" DASHBOARD --- */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1.2rem;
    margin-bottom: 3.5rem;
    animation: slideInUp 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.app-item {
    aspect-ratio: 1 / 1;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    text-decoration: none;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.2);
    animation: float 6s ease-in-out infinite;
}

/* Different delay for each item to look "alive" */
.app-item:nth-child(2n) {
    animation-delay: 1s;
}

.app-item:nth-child(3n) {
    animation-delay: 2s;
}

.app-item:nth-child(4n) {
    animation-delay: 1.5s;
}

.app-item:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}

.app-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.app-item:hover .app-icon-wrapper {
    transform: scale(1.2) rotate(8deg);
    background: rgba(255, 255, 255, 0.3);
}

.app-label {
    font-size: 1rem;
    font-weight: 800;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Vibrant Colorful Gradients */
.bg-vibrant-indigo {
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.35);
}

.bg-vibrant-emerald {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.35);
}

.bg-vibrant-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.35);
}

.bg-vibrant-rose {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    box-shadow: 0 15px 35px rgba(244, 63, 94, 0.35);
}

.bg-vibrant-slate {
    background: linear-gradient(135deg, #64748b 0%, #334155 100%);
    box-shadow: 0 15px 35px rgba(100, 116, 139, 0.35);
}

.bg-vibrant-purple {
    background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%);
    box-shadow: 0 15px 35px rgba(168, 85, 247, 0.35);
}

.bg-vibrant-cyan {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    box-shadow: 0 15px 35px rgba(6, 182, 212, 0.35);
}

.bg-vibrant-orange {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    box-shadow: 0 15px 35px rgba(249, 115, 22, 0.35);
}

.bg-vibrant-amber {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 15px 35px rgba(245, 158, 11, 0.35);
}

.bg-vibrant-gray {
    background: linear-gradient(135deg, #9ca3af 0%, #4b5563 100%);
    box-shadow: 0 15px 35px rgba(156, 163, 175, 0.35);
}

/* Glass Shine Overlay */
.glass-glow {
    position: absolute;
    top: -20%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .app-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .app-item {
        border-radius: 24px;
        padding: 1rem;
    }

    .app-icon-wrapper {
        width: 55px;
        height: 55px;
        font-size: 1.8rem;
    }

    .app-label {
        font-size: 1rem;
    }
}

/* --- EASY MODE SPECIAL STYLES --- */
.easy-mode-active {
    --primary: #8B5CF6;
    /* Vibrant violet for easy mode */
    --primary-hover: #7C3AED;
}

/* Easy Mode Toggle Button in Topbar */
.btn-easy-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.btn-easy-toggle.pro-to-easy {
    background: rgba(139, 92, 246, 0.1);
    color: #8B5CF6;
    border-color: rgba(139, 92, 246, 0.2);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
    animation: pulseEasy 2s infinite;
}

.btn-easy-toggle.easy-to-pro {
    background: rgba(71, 85, 105, 0.1);
    color: #475569;
    border-color: rgba(71, 85, 105, 0.2);
}

@keyframes pulseEasy {
    0% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(139, 92, 246, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0);
    }
}

/* Easy Mode Dashboard Card Style */
.easy-dashboard-header {
    background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
    color: white;
    padding: 2.5rem;
    border-radius: 24px;
    margin-bottom: 2rem;
    box-shadow: 0 20px 40px rgba(109, 40, 217, 0.25);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.easy-dashboard-header .glass-glow {
    width: 300px;
    height: 300px;
    top: -50px;
    left: -50px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.25) 0%, transparent 70%);
}

.easy-dashboard-header h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.easy-dashboard-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.15rem;
}

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

.easy-stat-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 1.8rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.easy-stat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.easy-stat-icon {
    width: 65px;
    height: 65px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    transition: var(--transition);
}

.easy-stat-card:hover .easy-stat-icon {
    transform: scale(1.15) rotate(-5deg);
}

.easy-stat-info h3 {
    font-size: 1.05rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.easy-stat-info h2 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1;
}

.easy-stat-info h2 small {
    font-size: 1rem;
    color: var(--text-muted);
    margin-right: 5px;
}

/* Quick Actions Grid */
.easy-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.easy-action-btn {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 24px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.easy-action-btn:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.08);
}

.easy-action-btn.btn-sale {
    border-color: rgba(139, 92, 246, 0.2);
}

.easy-action-btn.btn-sale:hover {
    border-color: #8B5CF6;
    background: rgba(139, 92, 246, 0.02);
}

.easy-action-btn.btn-invoices {
    border-color: rgba(99, 102, 241, 0.2);
}

.easy-action-btn.btn-invoices:hover {
    border-color: #6366F1;
    background: rgba(99, 102, 241, 0.02);
}

.easy-action-btn.btn-products {
    border-color: rgba(16, 185, 129, 0.2);
}

.easy-action-btn.btn-products:hover {
    border-color: #10B981;
    background: rgba(16, 185, 129, 0.02);
}

.easy-action-btn.btn-customers {
    border-color: rgba(59, 130, 246, 0.2);
}

.easy-action-btn.btn-customers:hover {
    border-color: #3B82F6;
    background: rgba(59, 130, 246, 0.02);
}

.easy-action-icon {
    font-size: 3rem;
    transition: var(--transition);
}

.easy-action-btn:hover .easy-action-icon {
    transform: scale(1.2);
}

.easy-action-label {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
}

/* Quick Pay Cash Buttons in POS */
.quick-pay-container {
    margin-top: 15px;
    padding: 12px;
    background: var(--white);
    border-radius: 16px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.quick-pay-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.quick-pay-bills {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.btn-quick-bill {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 4px;
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.btn-quick-bill:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.2);
}

.btn-quick-bill:active {
    transform: translateY(0);
}

/* Easy POS Touch Mode adjustments */
.easy-mode-active .product-card {
    border-radius: 22px;
    padding: 1.25rem;
    border-width: 2px;
}

.easy-mode-active .card-icon {
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
    border-radius: 16px;
}

.easy-mode-active .card-name {
    font-size: 1.05rem;
    font-weight: 800;
    height: 2.8rem;
}

.easy-mode-active .card-price {
    font-size: 1.2rem;
}

.easy-mode-active .pos-left,
.easy-mode-active .pos-right {
    border-width: 2px;
}

.easy-mode-active .cart-item {
    border-bottom-width: 2px;
    padding: 20px 12px;
}

.easy-mode-active .qty-btn {
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
}

.easy-mode-active .qty-val {
    width: 45px;
    font-size: 1.05rem;
}

.easy-mode-active .btn-icon-top {
    width: 44px;
    height: 44px;
}

@media (max-width: 480px) {
    .easy-dashboard-header {
        padding: 1.5rem;
    }

    .easy-dashboard-header h1 {
        font-size: 1.8rem;
    }

    .easy-stat-card {
        padding: 1.2rem;
        gap: 1rem;
    }

    .easy-stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.6rem;
    }

    .easy-stat-info h2 {
        font-size: 1.5rem;
    }

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

/* ==========================================================================
   EASY MODE COMPREHENSIVE REDESIGN (MATCHING USER SCREENSHOT)
   ========================================================================== */

/* Hide Sidebar & Stretch Layout */
.easy-mode-active .sidebar {
    display: none !important;
}

.easy-mode-active .main-content {
    margin-right: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    flex: 1 !important;
}

/* Custom Navy Topbar */
.easy-mode-active .topbar.easy-topbar {
    background: #205483 !important;
    /* Rich Steel Blue */
    color: #ffffff !important;
    border-bottom: 3px solid #fbbf24 !important;
    /* Yellow bottom accent border */
    height: 70px !important;
    padding: 0 3rem !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
    transition: var(--transition);
}

.easy-mode-active .easy-topbar .notif-dropdown {
    left: auto !important;
    right: 0 !important;
}

.easy-mode-active .easy-topbar-right .easy-logo-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #ffffff !important;
}

.easy-mode-active .easy-topbar-right h2 {
    color: #ffffff !important;
    font-size: 1.6rem !important;
    font-weight: 800 !important;
    margin: 0 !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
}

.easy-mode-active .easy-topbar-center {
    display: flex !important;
    align-items: center !important;
    gap: 1.5rem !important;
}

.easy-mode-active .easy-topbar-center a {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    display: flex !important;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 50px;
    transition: var(--transition);
}

.easy-mode-active .easy-topbar-center a:hover {
    color: #fbbf24 !important;
    background: rgba(255, 255, 255, 0.1) !important;
    transform: translateY(-2px);
}

.easy-mode-active .easy-topbar-left {
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
}

.easy-mode-active .easy-topbar-left .btn-icon-top {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 50% !important;
    width: 42px !important;
    height: 42px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.2rem !important;
    cursor: pointer !important;
    transition: var(--transition) !important;
    position: relative !important;
}

.easy-mode-active .easy-topbar-left .btn-icon-top:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.08);
}

/* Centered Main Search */
.easy-search-section {
    max-width: 600px;
    margin: 2.5rem auto 1.5rem auto;
    position: relative;
    padding: 0 1rem;
    z-index: 2000;
}

.easy-search-section .search-wrapper {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    padding: 0.2rem 1.8rem;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.easy-search-section .search-wrapper:focus-within {
    border-color: #8b5cf6;
    box-shadow: 0 15px 35px rgba(139, 92, 246, 0.12);
    transform: translateY(-2px);
}

.easy-search-section #globalSearchInput {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    font-size: 1.15rem !important;
    font-weight: 600 !important;
    padding: 0.8rem 0 !important;
    width: 100% !important;
}

.easy-search-section #searchIcon {
    font-size: 1.3rem;
    color: #94a3b8;
    order: -1;
    margin-left: 12px;
}

.easy-search-section #searchResults {
    top: 110% !important;
    left: 0 !important;
    right: 0 !important;
    border-radius: 20px !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12) !important;
    border: 1px solid #e2e8f0 !important;
    overflow: hidden !important;
    background: #ffffff !important;
    z-index: 99999 !important;
}

/* Purple Quick Access Bar */
.easy-quick-access-bar {
    background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%);
    border-radius: 24px;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem auto 2.5rem auto;
    box-shadow: 0 15px 35px rgba(109, 40, 217, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 1300px;
}

.easy-quick-access-right {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-weight: 800;
    font-size: 1.15rem;
}

.easy-quick-access-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.easy-quick-pill {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 6px 16px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.25s ease;
    position: relative;
}

.easy-quick-pill:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.easy-quick-pill.pill-new-version {
    background: #3b82f6;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.easy-quick-pill.pill-new-version:hover {
    background: #2563eb;
}

.easy-quick-pill .pill-badge {
    background: #ef4444;
    color: #ffffff;
    font-size: 0.75rem;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    position: absolute;
    top: -5px;
    right: -5px;
    border: 1.5px solid #8b5cf6;
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4);
}

/* 9 White Micro-Cards Grid */
.easy-micro-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 1rem;
    margin: 0 auto 2.5rem auto;
    max-width: 1300px;
}

.easy-micro-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.25rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.easy-micro-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.easy-micro-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    position: relative;
}

.easy-micro-icon-wrap.bg-light-blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.easy-micro-icon-wrap.bg-light-green {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.easy-micro-icon-wrap.bg-light-orange {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.easy-micro-icon-wrap.bg-light-red {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.easy-micro-card .micro-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #ffffff;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.easy-micro-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 0.2rem;
}

.easy-micro-subtitle {
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
}

/* 4 Metric Cards Row */
.easy-metrics-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin: 0 auto 3rem auto;
    max-width: 1300px;
}

.easy-metric-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.easy-metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.06);
    border-color: #cbd5e1;
}

.easy-metric-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.easy-metric-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #64748b;
}

.easy-metric-val {
    font-size: 1.8rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.2;
}

.easy-metric-subtext {
    font-size: 0.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 4px;
}

.easy-metric-subtext.green {
    color: #10b981;
}

.easy-metric-subtext.red {
    color: #ef4444;
}

.easy-metric-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.easy-metric-icon.bg-blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.easy-metric-icon.bg-orange {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.easy-metric-icon.bg-red {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.easy-metric-icon.bg-green {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

/* 16 Colorful Actions Grid */
.easy-actions-section-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 auto 1.5rem auto;
    max-width: 1300px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.easy-actions-grid-16 {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1.2rem;
    margin: 0 auto 3rem auto;
    max-width: 1300px;
}

/* Responsive adjust for 16 grid */
@media (max-width: 1200px) {
    .easy-actions-grid-16 {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 992px) {
    .easy-actions-grid-16 {
        grid-template-columns: repeat(4, 1fr);
    }

    .easy-micro-grid {
        grid-template-columns: repeat(5, 1fr);
    }

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

@media (max-width: 768px) {
    .easy-actions-grid-16 {
        grid-template-columns: repeat(3, 1fr);
    }

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

    .easy-mode-active .topbar.easy-topbar {
        padding: 0 1rem !important;
    }

    .easy-mode-active .easy-topbar-center {
        display: none !important;
        /* Hide links on mobile to fit screen */
    }
}

@media (max-width: 480px) {
    .easy-actions-grid-16 {
        grid-template-columns: repeat(2, 1fr);
    }

    .easy-metrics-container {
        grid-template-columns: 1fr;
    }
}

.easy-action-card-color {
    aspect-ratio: 1.15 / 1;
    border-radius: 20px;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.15);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.easy-action-card-color:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.easy-action-card-color .glass-glow {
    position: absolute;
    top: -30%;
    left: -30%;
    width: 70%;
    height: 70%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.25) 0%, transparent 70%);
    pointer-events: none;
}

.easy-action-card-color .card-icon-circle {
    width: 55px !important;
    height: 55px !important;
    min-width: 55px !important;
    min-height: 55px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    aspect-ratio: 1 / 1 !important;
    box-sizing: border-box !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.45) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 0.9rem !important;
    box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.1) !important;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.easy-action-card-color:hover .card-icon-circle {
    transform: scale(1.15) rotate(8deg);
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.easy-action-card-color .card-icon-circle svg {
    width: 26px !important;
    height: 26px !important;
    stroke-width: 2.5px !important;
    color: #ffffff !important;
}

.easy-action-card-color .card-icon-circle i {
    font-size: 24px !important;
    display: inline-block !important;
    line-height: 1 !important;
    color: #ffffff !important;
}

.easy-action-card-color .card-title-text {
    font-size: 1.02rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
    color: #ffffff;
}

.easy-action-card-color .card-sub-text {
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
}

/* Card Specific Colors matching the screenshot perfectly */
.easy-card-navy {
    background: linear-gradient(135deg, #375375 0%, #253952 100%);
    box-shadow: 0 10px 20px rgba(37, 57, 82, 0.2);
}

.easy-card-blue {
    background: linear-gradient(135deg, #2b70c9 0%, #1a4f94 100%);
    box-shadow: 0 10px 20px rgba(43, 112, 201, 0.2);
}

.easy-card-orange {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    box-shadow: 0 10px 20px rgba(249, 115, 22, 0.2);
}

.easy-card-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.2);
}

.easy-card-amber {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.2);
}

.easy-card-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.2);
}

.easy-card-skyblue {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.2);
}

.easy-card-red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.2);
}

.easy-card-grey {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    box-shadow: 0 10px 20px rgba(148, 163, 184, 0.2);
}

.easy-card-darksalt {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    box-shadow: 0 10px 20px rgba(51, 65, 85, 0.2);
}

.easy-card-teal {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    box-shadow: 0 10px 20px rgba(20, 184, 166, 0.2);
}

.easy-action-card-color .card-badge-count {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ef4444;
    color: white;
    font-size: 0.8rem;
    font-weight: 800;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

/* Speedup animation overlays */
.easy-speedup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.easy-speedup-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.easy-speedup-spinner {
    width: 80px;
    height: 80px;
    border: 6px solid rgba(16, 185, 129, 0.2);
    border-top: 6px solid #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 2rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Toast Success Notification */
.easy-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #10b981;
    color: white;
    padding: 1rem 2rem;
    border-radius: 16px;
    font-weight: 800;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
    z-index: 100000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 10px;
}

.easy-toast.active {
    transform: translateY(0);
    opacity: 1;
}

/* Premium Back Button Styles */
.back-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.back-btn:hover {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
    transform: translateX(3px) !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15) !important;
}

.back-btn:active {
    transform: scale(0.92) !important;
}

.easy-topbar .back-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #fbbf24 !important;
    transform: translateX(3px) !important;
    box-shadow: none !important;
}

.dark-mode .back-btn:hover {
    background: #334155 !important;
    color: #818cf8 !important;
}

/* Customer Action Buttons Pills Styling */
.customer-action-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-cust-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.22rem 0.52rem;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    outline: none;
}

.btn-cust-statement {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.15) !important;
}
.btn-cust-statement:hover {
    background: #2563eb;
    color: #ffffff;
}

.btn-cust-add-debt {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.15) !important;
}
.btn-cust-add-debt:hover {
    background: #059669;
    color: #ffffff;
}

.btn-cust-pay-debt {
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
    border: 1px solid rgba(99, 102, 241, 0.15) !important;
}
.btn-cust-pay-debt:hover {
    background: #4f46e5;
    color: #ffffff;
}

.btn-cust-edit {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.15) !important;
}
.btn-cust-edit:hover {
    background: #d97706;
    color: #ffffff;
}

.btn-cust-delete {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.15) !important;
}
.btn-cust-delete:hover {
    background: #dc2626;
    color: #ffffff;
}

/* Responsive Table Overrides for Mobile Devices */
@media (max-width: 768px) {
    .hide-on-mobile {
        display: none !important;
    }
    
    .table-responsive td.no-label-on-mobile::before,
    .table-responsive td.no-label-on-mobile:before {
        display: none !important;
    }
    
    .table-responsive td.no-label-on-mobile {
        padding-right: 1rem !important;
        justify-content: center !important;
        text-align: center !important;
    }
    
    .table-responsive td.no-label-on-mobile .customer-action-buttons {
        justify-content: center !important;
        width: 100% !important;
    }
}

/* Email Prompt Alert Responsive Design */
.email-prompt-alert {
    margin: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fffbeb;
    border: 1px solid #fef3c7;
    color: #92400e;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.dark-mode .email-prompt-alert {
    background: #2d2613;
    border-color: #45371c;
    color: #fbbf24;
}

.email-prompt-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.email-prompt-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.email-prompt-text strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
}

.email-prompt-text small {
    display: block;
    font-size: 0.8rem;
    color: #92400e;
    opacity: 0.9;
    margin-top: 2px;
}

.dark-mode .email-prompt-text small {
    color: #fef3c7;
}

.email-prompt-btn {
    padding: 8px 18px;
    font-size: 0.85rem;
    text-decoration: none;
    white-space: nowrap;
    border-radius: 8px;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

@media (max-width: 576px) {
    .email-prompt-alert {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 1rem;
        margin: 1rem;
    }
    
    .email-prompt-content {
        align-items: flex-start;
    }
    
    .email-prompt-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
        display: flex;
    }
}