:root {
    --primary-color: #1E5F46;
    /* Deep LivingTree Green */
    --primary-dark: #154231;
    /* Darker shade for contrast/sidebar */
    --primary-light: #2D8A66;
    /* Lighter shade for accents */
    --primary-surface: #E8F5F0;
    /* Very light green for backgrounds */
    --accent-gold: #D4AF37;
    /* Subtle gold accent if needed */

    --text-dark: #111827;
    --text-secondary: #4B5563;
    --text-light: #9CA3AF;

    --surface-white: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.95);

    --sidebar-width: 260px;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 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);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.07);

    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
}

body {
    font-family: var(--font-main);
    color: var(--text-dark);
    background-color: #F3F4F6;
    /* Light gray/green tint background */
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* --- Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.fade-in-delay-1 {
    animation-delay: 0.1s;
}

.fade-in-delay-2 {
    animation-delay: 0.2s;
}

.fade-in-delay-3 {
    animation-delay: 0.3s;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(30, 95, 70, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(30, 95, 70, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(30, 95, 70, 0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

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

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

/* --- Gradient Text --- */
.text-gradient-green {
    background: linear-gradient(135deg, #1E5F46 0%, #34D399 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

/* --- Sidebar Styling --- */
#wrapper {
    display: flex;
    overflow-x: hidden;
}

#sidebar-wrapper {
    min-height: 100vh;
    width: var(--sidebar-width);
    margin-left: 0;
    transition: margin 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: fixed;
    z-index: 1000;
    background-color: var(--primary-dark);
    /* Subtle gradient overlay */
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);

    /* Flex column to push user section to bottom */
    display: flex;
    flex-direction: column;
}

#sidebar-wrapper .sidebar-heading {
    padding: 1.5rem 1.5rem;
    /* Original similar padding */
    height: 90px;
    /* Fixed height container similar to original */
    display: flex;
    align-items: center;
}

/* Sidebar Logo Adjustment */
#sidebar-wrapper .sidebar-heading img {
    height: auto;
    width: 140px;
    /* Wider logo */
    max-height: 60px;
    object-fit: contain;
}

.nav-section-title {
    padding: 1rem 1.7rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.4);
}

#sidebar-wrapper .list-group {
    padding: 0 1rem;
}

#sidebar-wrapper .list-group-item {
    border: none;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    background-color: transparent;
    border-radius: var(--radius-md);
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

#sidebar-wrapper .list-group-item i {
    font-size: 1.1rem;
    margin-right: 0.75rem;
    opacity: 0.8;
    transition: all 0.2s;
}

#sidebar-wrapper .list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: translateX(3px);
}

#sidebar-wrapper .list-group-item.active {
    background-color: var(--primary-light);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#sidebar-wrapper .list-group-item.active i {
    opacity: 1;
}

/* User Profile Section in Sidebar */
.sidebar-user-section {
    margin-top: auto;
    /* Push to bottom */
    padding: 1.5rem 1rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.user-profile-mini {
    display: flex;
    align-items: center;
    padding: 0.75rem 0.5rem;
    border-radius: var(--radius-md);
    transition: background 0.2s;
}

.user-profile-mini:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.user-avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* --- Page Content --- */
#page-content-wrapper {
    margin-left: var(--sidebar-width);
    transition: margin 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
}

#wrapper.toggled #sidebar-wrapper {
    margin-left: calc(-1 * var(--sidebar-width));
}

#wrapper.toggled #page-content-wrapper {
    margin-left: 0;
    width: 100%;
}

/* --- Top Navbar --- */
.navbar {
    height: 70px;
    background-color: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow-sm);
    z-index: 900;
}

.navbar-toggler-custom {
    border: none;
    background: transparent;
    font-size: 1.25rem;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.navbar-toggler-custom:hover {
    color: var(--primary-color);
}

/* --- Cards & Glassmorphism --- */
.card-premium {
    background: var(--surface-white);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
    position: relative;
}

.card-premium:hover {
    transform: translateY(-5px) scale(1.02);
    /* Expand slightly */
    box-shadow: 0 15px 30px -5px rgba(30, 95, 70, 0.25);
    /* Green hue surround */
    border-color: rgba(30, 95, 70, 0.3);
    z-index: 10;
}

/* Specific Card Styles - Reduced Size */
.stat-card {
    padding: 1rem 1.25rem;
    /* Reduced padding */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.stat-icon-bg {
    width: 42px;
    /* Slightly smaller icon bg */
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: transform 0.3s;
}

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

.bg-green-soft {
    background-color: rgba(30, 95, 70, 0.1);
    color: var(--primary-color);
}

.bg-gold-soft {
    background-color: rgba(212, 175, 55, 0.1);
    color: #B4941F;
}

/* Call to Action Card */
.cta-card {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
    border: 1px dashed var(--primary-light);
}

/* --- Tables & Lists --- */
.table-premium-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.table-premium {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-premium thead th {
    background-color: #F9FAFB;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #E5E7EB;
}

.table-premium tbody td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #F3F4F6;
    color: var(--text-dark);
    font-size: 0.95rem;
    vertical-align: middle;
    transition: background-color 0.2s;
}

.table-premium tbody tr:hover td {
    background-color: #F9FAFB;
}

.table-premium tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.status-badge {
    padding: 0.35em 0.8em;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-badge.active {
    background-color: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.status-badge.active::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #059669;
    box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.7);
    animation: pulse-green 2s infinite;
}

.status-badge.expired {
    background-color: rgba(239, 68, 68, 0.1);
    color: #DC2626;
}

.status-badge.trial {
    background-color: rgba(245, 158, 11, 0.1);
    color: #D97706;
}

/* Notification Badge "NEW" Style */
.badge-notification-new {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: #DC2626;
    color: white;
    font-size: 0.55rem;
    font-weight: 800;
    padding: 1px 3px;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3);
    line-height: 1;
    animation: bounceIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }

    80% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* --- Buttons --- */
.btn-primary-custom {
    background-color: var(--primary-color);
    color: #ffffff !important;
    /* Force white text */
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(30, 95, 70, 0.2);
}

.btn-primary-custom:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(30, 95, 70, 0.3);
}

.btn-outline-custom {
    background: transparent;
    border: 1px solid #E5E7EB;
    color: var(--text-secondary);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-outline-custom:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: rgba(30, 95, 70, 0.05);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    #sidebar-wrapper {
        margin-left: calc(-1 * var(--sidebar-width));
    }

    #page-content-wrapper {
        margin-left: 0;
        width: 100%;
    }

    #wrapper.toggled #sidebar-wrapper {
        margin-left: 0;
        box-shadow: 0 0 100px rgba(0, 0, 0, 0.5);
        /* heavy shadow when open on mobile */
    }

    #wrapper.toggled #page-content-wrapper {
        margin-left: 0;
        /* Overlay */
    }

    /* Overlay backdrop when sidebar is open */
    #wrapper.toggled #page-content-wrapper::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 999;
        backdrop-filter: blur(4px);
        animation: fadeIn 0.3s ease-out;
    }

    /* Fitted fonts on mobile */
    body {
        font-size: 0.9rem;
    }

    h1,
    .h1 {
        font-size: 1.5rem;
    }

    h2,
    .h2 {
        font-size: 1.35rem;
    }

    h3,
    .h3 {
        font-size: 1.2rem;
    }

    h4,
    .h4 {
        font-size: 1.1rem;
    }

    h5,
    .h5 {
        font-size: 1rem;
    }

    h6,
    .h6 {
        font-size: 0.9rem;
    }

    /* Navbar adjustments */
    .navbar {
        height: auto;
        min-height: 56px;
        padding: 0.5rem 0.75rem;
    }

    .navbar h5 {
        font-size: 1rem;
    }

    /* Container padding reduction */
    .container-fluid {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .px-4 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .py-4 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    /* Card adjustments */
    .card-body {
        padding: 0.75rem !important;
    }

    .card h2,
    .card .display-6 {
        font-size: 1.5rem !important;
    }

    /* Table responsive improvements */
    .table-premium thead th {
        padding: 0.5rem 0.75rem;
        font-size: 0.65rem;
        white-space: nowrap;
    }

    .table-premium tbody td {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .table-premium .font-monospace {
        font-size: 0.7rem !important;
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* License key truncation */
    .table-premium td:nth-child(4) {
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Badge sizing */
    .badge {
        font-size: 0.65rem;
        padding: 0.25em 0.5em;
    }

    .status-badge {
        font-size: 0.65rem;
        padding: 0.25em 0.5em;
    }

    /* Stat cards */
    .stat-icon-bg {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    /* Modal improvements */
    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-body {
        padding: 1rem;
    }

    /* Dropdown menus */
    .dropdown-menu {
        font-size: 0.85rem;
    }

    /* Filters row */
    .row.g-2.mb-3>div {
        margin-bottom: 0.5rem;
    }

    /* Action buttons in header */
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Extra small devices */
@media (max-width: 576px) {

    /* Even tighter on very small screens */
    body {
        font-size: 0.85rem;
    }

    .navbar h5 {
        font-size: 0.9rem;
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Hide less important columns on very small screens */
    .table-premium th:nth-child(5),
    .table-premium td:nth-child(5) {
        display: none;
    }

    /* Stack cards */
    .row.g-3>[class*="col-"] {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Sidebar width adjustment */
    :root {
        --sidebar-width: 280px;
    }
}

/* Mobile action buttons in sidebar */
.sidebar-mobile-actions {
    display: none;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 991px) {
    .sidebar-mobile-actions {
        display: block;
    }
}

/* Privacy Mode Blur Utility */
.blur-text {
    filter: blur(8px);
    -webkit-filter: blur(8px);
    user-select: none;
    transition: filter 0.3s ease;
    cursor: default;
}