:root {
    --primary-color: #4F46E5;
    /* Indigo 600 */
    --primary-hover: #4338CA;
    /* Indigo 700 */
    --secondary-color: #10B981;
    /* Emerald 500 */
    --danger-color: #EF4444;
    /* Red 500 */
    --text-main: #1F2937;
    /* Gray 800 */
    --text-muted: #6B7280;
    /* Gray 500 */
    --bg-body: #F3F4F6;
    /* Gray 100 */
    --bg-card: #FFFFFF;
    --border-color: #E5E7EB;
    /* Gray 200 */
    --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);
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #111827;
}

h1 {
    font-size: 1.875rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: white;
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: #F9FAFB;
    border-color: #D1D5DB;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    filter: brightness(0.9);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Inputs */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: white;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 1.5rem;
}

/* Stats */
.stat-card {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    background: white;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: #F9FAFB;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tr:last-child td {
    border-bottom: none;
}

.table th {
    background-color: #F8F9FA;
    font-weight: 600;
    color: #6B7280;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    color: #374151;
    font-size: 0.875rem;
}

/* Checkbox styling */
.custom-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid #D1D5DB;
    cursor: pointer;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.badge-active {
    background-color: #DEF7EC;
    color: #03543F;
}

.badge-inactive {
    background-color: #FDE8E8;
    color: #9B1C1C;
}

/* Table Actions */
.table-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    color: #6B7280;
    background: transparent;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.action-btn:hover {
    background-color: #F3F4F6;
    color: var(--primary-color);
}

.action-btn.delete:hover {
    background-color: #FDE8E8;
    color: #EF4444;
}

/* Products Page Specifics */
.product-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.product-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background-color: #F3F4F6;
}

.rating-stars {
    color: #F59E0B;
    font-size: 0.75rem;
    margin-top: 0.125rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Sidebar/Layout */
/* Sidebar/Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 200px;
    background-color: white;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 40;
    transition: width 0.3s ease;
}

.main-content {
    flex: 1;
    margin-left: 200px;
    padding: 2rem;
    transition: margin-left 0.3s ease;
}

/* Modern Nav Links */
.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #6B7280;
    /* text-gray-500 */
    font-weight: 500;
    transition: all 0.2s ease;
    margin: 4px 10px;
    /* Reduced margins for narrower sidebar */
    border-radius: 8px;
    /* Slightly smaller radius */
    position: relative;
    font-size: 0.9rem;
    /* Slightly smaller text */
    white-space: nowrap;
    /* Prevent wrapping */
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-link:hover {
    background-color: #F8FAFC;
    color: #1F2937;
}

.nav-link.active {
    background-color: #EEF2FF;
    /* indigo-50 */
    color: var(--primary-color);
    font-weight: 600;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 50%;
    transform: translateY(-50%);
    height: 24px;
    width: 4px;
    background-color: var(--primary-color);
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    display: none;
    /* Optional: Sidebar accent line */
}

.nav-link i {
    margin-right: 1rem;
    width: 24px;
    text-align: center;
    font-size: 1.25rem;
    transition: color 0.2s;
}

.nav-link:hover i {
    color: var(--primary-color);
}

.nav-link.active i {
    color: var(--primary-color);
}

/* Sidebar Branding Area */
.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
}

/* App Label */
.app-label {
    padding: 0 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Login Page specific */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.3s ease-out;
}

/* =========================================
   Additional Utilities (Tailwind-compatible)
   ========================================= */

/* Grid */
.grid {
    display: grid;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gap-1 {
    gap: 0.25rem;
}

.content-start {
    align-content: flex-start;
}

/* Flex Extensions */
.flex-1 {
    flex: 1 1 0%;
}

.items-center {
    align-items: center;
}

.self-end {
    align-self: flex-end;
}

.justify-between {
    justify-content: space-between;
}

/* Spacing */
.p-2 {
    padding: 0.5rem;
}

.p-3 {
    padding: 0.75rem;
}

.px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.py-1 {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-10 {
    margin-top: 2.5rem;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}


.mb-2 {
    margin-bottom: 0.5rem;
}

.ml-2 {
    margin-left: 0.5rem;
}

.pb-2 {
    padding-bottom: 0.5rem;
}

.pt-2 {
    padding-top: 0.5rem;
}

.space-y-1> :not([hidden])~ :not([hidden]) {
    --tw-space-y-reverse: 0;
    margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));
    margin-bottom: calc(0.25rem * var(--tw-space-y-reverse));
}

/* Sizing */
.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.h-32 {
    height: 8rem;
}

.w-1\/3 {
    width: 33.333333%;
}

.w-6 {
    width: 1.5rem;
}

.h-6 {
    height: 1.5rem;
}

.w-16 {
    width: 4rem;
}

.w-20 {
    width: 5rem;
}

.col-span-1 {
    grid-column: span 1 / span 1;
}

.col-span-full {
    grid-column: 1 / -1;
}

/* More Sizing */
.w-12 {
    width: 3rem;
}

.w-24 {
    width: 6rem;
}

.w-96 {
    width: 24rem;
}

.max-w-xl {
    max-width: 36rem;
}

.h-10 {
    height: 2.5rem;
}

.h-12 {
    height: 3rem;
}

.h-16 {
    height: 4rem;
}

.h-40 {
    height: 10rem;
}

.w-10 {
    width: 2.5rem;
}


/* Colors - Backgrounds */
.bg-white {
    background-color: white;
}

.bg-gray-50 {
    background-color: #F9FAFB;
}

.bg-gray-100 {
    background-color: #F3F4F6;
}

.bg-gray-200 {
    background-color: #E5E7EB;
}

.bg-indigo-50 {
    background-color: #EEF2FF;
}

/* Colors - Text */
.text-gray-300 {
    color: #D1D5DB;
}

.text-gray-400 {
    color: #9CA3AF;
}

.text-gray-500 {
    color: #6B7280;
}

.text-gray-600 {
    color: #4B5563;
}

.text-gray-800 {
    color: #1F2937;
}

.text-indigo-500 {
    color: #6366F1;
}

.text-indigo-600 {
    color: #4F46E5;
}

.text-indigo-700 {
    color: #4338CA;
}

.text-indigo-900 {
    color: #312E81;
}

.text-red-400 {
    color: #F87171;
}

.text-red-500 {
    color: #EF4444;
}

/* Hover */
.hover\:bg-gray-300:hover {
    background-color: #D1D5DB;
}

.hover\:text-red-600:hover {
    color: #DC2626;
}

.hover\:text-red-700:hover {
    color: #B91C1C;
}

.hover\:shadow-lg:hover {
    box-shadow: var(--shadow-lg);
}

.hover\:border-indigo-300:hover {
    border-color: #A5B4FC;
}

/* Borders */
.border {
    border-width: 1px;
    border-style: solid;
    border-color: var(--border-color);
}

.border-b {
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: var(--border-color);
}

.border-t {
    border-top-width: 1px;
    border-top-style: solid;
    border-top-color: var(--border-color);
}

.border-r {
    border-right-width: 1px;
    border-right-style: solid;
    border-right-color: var(--border-color);
}

.border-gray-200 {
    border-color: #E5E7EB;
}

.border-gray-100 {
    border-color: #F3F4F6;
}

.border-gray-300 {
    border-color: #D1D5DB;
}

/* Typography */
.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.text-xl {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.text-left {
    text-align: left;
}

/* Layout & Misc */
.overflow-hidden {
    overflow: hidden;
}

.overflow-y-auto {
    overflow-y: auto;
}

.shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.z-10 {
    z-index: 10;
}

.cursor-pointer {
    cursor: pointer;
}

.rounded {
    border-radius: 0.25rem;
}

.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Custom / Complex */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Specific Fixes */
.min-w-\[400px\] {
    min-width: 400px;
}

/* Dashboard Utilities */
.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.text-muted {
    color: var(--text-muted);
}

.rounded-full {
    border-radius: 9999px;
}

/* Border Left Colors */
.border-l-4 {
    border-left-width: 4px;
    border-left-style: solid;
}

.border-l-indigo-500 {
    border-left-color: #6366F1;
}

.border-l-emerald-500 {
    border-left-color: #10B981;
}

.border-l-blue-500 {
    border-left-color: #3B82F6;
}

.border-l-gray-500 {
    border-left-color: #6B7280;
}

/* Backgrounds & Text Colors */
.bg-indigo-100 {
    background-color: #E0E7FF;
}

.bg-emerald-100 {
    background-color: #D1FAE5;
}

.text-emerald-600 {
    color: #059669;
}

.bg-blue-100 {
    background-color: #DBEAFE;
}

.text-blue-600 {
    color: #2563EB;
}

/* Font Awesome Icon Alignment Fix (optional) */
.fa-2x {
    font-size: 2em;
}

/* =========================================
   New Soft UI Utilities (Billing Page)
   ========================================= */

/* Border Radius */
.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-xl {
    border-radius: 0.75rem;
}

.rounded-2xl {
    border-radius: 1rem;
}

/* Shadows */
.shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.shadow-2xl {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.shadow-inner {
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

/* Focus Rings (Simulated) */
.focus\:ring-2:focus {
    box-shadow: 0 0 0 2px var(--primary-color);
}

.focus\:ring-indigo-200:focus {
    box-shadow: 0 0 0 4px #C7D2FE;
}

/* Simple replacement */
.outline-none {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

/* Group Hover (Simulated - limited support in vanilla CSS without complex selectors,
   but we can support specific cases used in billing.php) */
.group:hover .group-hover\:translate-y-\[-2px\] {
    transform: translateY(-2px);
}

/* Responsive (Mobile First defaults, add simple media queries) */
.hidden {
    display: none;
}

@media (min-width: 768px) {
    .md\:flex {
        display: flex;
    }

    .md\:hidden {
        display: none;
    }

    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .lg\:block {
        display: block;
    }
}

/* Colors - New Additions */
.hover\:bg-gray-100:hover {
    background-color: #F3F4F6;
}

.bg-emerald-500 {
    background-color: #10B981;
}

.hover\:bg-emerald-600:hover {
    background-color: #059669;
}

.hover\:shadow-emerald-500\/30:hover {
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3);
}

/* Positioning & Layout */
.absolute {
    position: absolute;
}

.relative {
    position: relative;
}

.left-3 {
    left: 0.75rem;
}

.top-1\/2 {
    top: 50%;
}

.transform {
    transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

.-translate-y-1\/2 {
    transform: translateY(-50%);
}

.shrink-0 {
    flex-shrink: 0;
}

.min-w-0 {
    min-width: 0;
}

.ml-4 {
    margin-left: 1rem;
}

.pl-10 {
    padding-left: 2.5rem;
}

.pr-4 {
    padding-right: 1rem;
}

.pl-9 {
    padding-left: 2.25rem;
}

.pr-3 {
    padding-right: 0.75rem;
}

.py-2\.5 {
    padding-top: 0.625rem;
    padding-bottom: 0.625rem;
}

/* Text Extras */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leading-tight {
    line-height: 1.25;
}

.select-none {
    user-select: none;
}

/* Borders dashed */
.border-dashed {
    border-style: dashed;
}


/* Additional Missing Utilities for Billing Page */
.text-gray-700 {
    color: #374151;
}

.text-gray-900 {
    color: #111827;
}

.text-indigo-100 {
    color: #E0E7FF;
}

.border-indigo-100 {
    border-color: #E0E7FF;
}

.border-indigo-200 {
    border-color: #C7D2FE;
}

.border-red-200 {
    border-color: #FECACA;
}

.bg-red-50 {
    background-color: #FEF2F2;
}

.hover\:bg-red-50:hover {
    background-color: #FEF2F2;
}

.hover\:bg-indigo-50:hover {
    background-color: #EEF2FF;
}

.hover\:bg-indigo-600:hover {
    background-color: #4F46E5;
}

.hover\:text-white:hover {
    color: white;
}

/* Active States */
.active\:scale-\[0\.98\]:active {
    transform: scale(0.98);
}

/* Custom Scrollbar override for clean look */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px;
}

/* More Layout */
.w-48 {
    width: 12rem;
}

.w-20 {
    width: 5rem;
}

.w-5 {
    width: 1.25rem;
}

.h-5 {
    height: 1.25rem;
}

.max-w-2xl {
    max-width: 42rem;
}

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.border-b-dotted {
    border-bottom-style: dotted;
}

.tracking-wide {
    letter-spacing: 0.025em;
}

.uppercase {
    text-transform: uppercase;
}

.bg-white\/90 {
    background-color: rgba(255, 255, 255, 0.9);
}

.text-\[10px\] {
    font-size: 10px;
    line-height: 14px;
}

.opacity-90 {
    opacity: 0.9;
}

.opacity-30 {
    opacity: 0.3;
}

/* Colors */
.bg-orange-100 {
    background-color: #ffedd5;
}

.bg-teal-100 {
    background-color: #ccfbf1;
}

.bg-purple-100 {
    background-color: #f3e8ff;
}

.text-emerald-100 {
    color: #d1fae5;
}

.hover\:bg-emerald-600:hover {
    background-color: #059669;
}

.border-indigo-600 {
    border-color: #4f46e5;
}

.text-indigo-700 {
    color: #4338ca;
}

.focus\:ring-1:focus {
    box-shadow: 0 0 0 1px var(--primary-color);
}