/* Main styles for HeroMetrics */

:root {
    /* Color palette */
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --secondary-color: #2ecc71;
    --secondary-dark: #27ae60;
    --accent-color: #e74c3c;
    --accent-dark: #c0392b;
    --gray-dark: #343a40;
    --gray: #6c757d;
    --gray-light: #f8f9fa;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 3rem;
    
    /* Font sizes */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --font-size-xxl: 2rem;
    
    /* Border radius */
    --border-radius-sm: 0.2rem;
    --border-radius-md: 0.35rem;
    --border-radius-lg: 0.5rem;
    
    /* Box shadow */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: var(--font-size-md);
    line-height: 1.5;
    color: var(--gray-dark);
    background-color: var(--gray-light);
}

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

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

ul, ol {
    list-style: none;
}

/* Button styles */
.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--font-size-md);
    line-height: 1.5;
    border-radius: var(--border-radius-md);
    transition: all 0.15s ease-in-out;
    cursor: pointer;
}

.btn:hover, .btn:focus {
    text-decoration: none;
}

.btn:disabled,
.btn[disabled],
.btn.is-disabled {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-sm {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-sm);
    border-radius: var(--border-radius-sm);
}

.btn-light {
    color: var(--gray-dark);
    background-color: white;
    border-color: white;
}

.btn-light:hover {
    background-color: var(--gray-light);
    border-color: var(--gray-light);
}

.btn-light:hover {
    background-color: var(--gray-light);
    border-color: var(--gray-light);
}

.btn-outline-light {
    color: white;
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-outline-light:hover {
    color: var(--gray-dark);
    background-color: white;
    border-color: white;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-secondary {
    color: white;
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: var(--secondary-dark);
    border-color: var(--secondary-dark);
}

.btn-outline {
    color: var(--gray-dark);
    background-color: transparent;
    border-color: var(--gray);
}

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

/* Form styles */
.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 500;
}

.form-group input:not([type="radio"]):not([type="checkbox"]),
.form-group select,
.form-group textarea {
    display: block;
    width: 100%;
    padding: var(--space-sm);
    font-size: var(--font-size-md);
    line-height: 1.5;
    color: var(--gray-dark);
    background-color: white;
    border: 1px solid var(--gray);
    border-radius: var(--border-radius-md);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-group input[type="radio"],
.form-group input[type="checkbox"] {
    display: inline-block;
    width: auto;
    margin-right: var(--space-xs);
}

#enhanced-customer-type-options,
.customer-type-selection {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

#enhanced-customer-type-options label,
.customer-type-selection .radio-option {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.form-error {
    color: var(--danger);
    font-size: var(--font-size-sm);
    margin-top: var(--space-sm);
    display: none;
}

/* Login page styles */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--space-xl);
}

.login-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.login-header h1 {
    color: var(--primary-color);
    font-size: var(--font-size-xxl);
    margin-bottom: var(--space-sm);
}

.login-form-container {
    background-color: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-xl);
    width: 100%;
    max-width: 400px;
}

.oauth-login {
    margin-bottom: var(--space-md);
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    background-color: white;
    color: var(--gray-dark);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: var(--shadow-sm);
}

.btn-google:hover,
.btn-google:focus {
    background-color: #f5f5f5;
    color: var(--gray-dark);
    border-color: rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.btn-google-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background-color: #4285f4;
    color: white;
    font-weight: bold;
}

.login-divider {
    position: relative;
    text-align: center;
    margin: var(--space-md) 0;
    color: var(--gray);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.login-divider::before,
.login-divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background-color: var(--gray-light);
}

.login-divider::before {
    left: 0;
}

.login-divider::after {
    right: 0;
}

.login-divider span {
    background-color: white;
    padding: 0 var(--space-sm);
    position: relative;
    z-index: 1;
}

.login-form .btn {
    width: 100%;
}

/* App layout styles */
.app-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: var(--gray-dark);
    color: white;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.sidebar-header {
    padding: var(--space-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h1 {
    font-size: var(--font-size-lg);
    color: var(--primary-color);
}

.sidebar-menu {
    flex-grow: 1;
    padding: var(--space-md) 0;
    overflow-y: auto;
}

.menu-item {
    display: block;
}

.menu-item a {
    display: block;
    padding: var(--space-sm) var(--space-lg);
    color: rgba(255, 255, 255, 0.75);
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.menu-item a:hover,
.menu-item.active a {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-color);
    text-decoration: none;
}

.sidebar-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.user-info {
    font-size: var(--font-size-sm);
}

.content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.content-header {
    padding: var(--space-lg);
    background-color: white;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.content-header h1 {
    font-size: var(--font-size-xl);
    margin: 0;
}

.content-body {
    flex-grow: 1;
    padding: var(--space-lg);
    overflow-y: auto;
}

/* Utility classes */
.loading {
    display: inline-block;
    opacity: 0.5;
}

.loading::after {
    content: "...";
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { content: "."; }
    33% { content: ".."; }
    66% { content: "..."; }
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

/* Utility classes */
.loading {
    display: inline-block;
    opacity: 0.5;
}

.loading::after {
    content: "...";
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { content: "."; }
    33% { content: ".."; }
    66% { content: "..."; }
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-warning {
    color: var(--warning);
}

.text-danger {
    color: var(--danger);
}

.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 0;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 600px;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: var(--space-md) var(--space-lg);
    background-color: var(--gray-light);
    border-top-left-radius: var(--border-radius-lg);
    border-top-right-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    font-size: var(--font-size-lg);
}

.modal-close {
    color: var(--gray);
    font-size: var(--font-size-xl);
    font-weight: bold;
    cursor: pointer;
}

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

.modal-body {
    padding: var(--space-lg);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.form-row {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.form-group-half {
    flex: 1;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

.checkbox-label input {
    width: auto;
}

/* Table styles */
.table-container {
    overflow-x: auto;
    margin-top: var(--space-md);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
}

.data-table th,
.data-table td {
    padding: var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--gray-light);
}

.data-table th {
    background-color: var(--gray-light);
    font-weight: 600;
    position: sticky;
    top: 0;
}

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

.data-table tbody tr:hover td {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Compact status column for license tables */
#licenses-table th:first-child,
#licenses-table td:first-child {
    width: 1.5rem;
    padding: 0;
    text-align: center;
    vertical-align: middle;
}

/* Reduce padding for the column following the status icon */
#licenses-table th:nth-child(2),
#licenses-table td:nth-child(2) {
    padding-left: var(--space-sm);
}

#licenses-table th.license-key-column,
#licenses-table td.license-key {
    min-width: 26ch;
    white-space: nowrap;
}

#licenses-table th.customer-column,
#licenses-table td.customer-column {
    width: 14rem;
}

#licenses-table td.customer-column {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#licenses-table td.customer-column a,
#licenses-table td.customer-column span {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}

#licenses-table th.created-column,
#licenses-table td.created-column {
    min-width: 10ch;
    white-space: nowrap;
}

#licenses-table th.expires-column,
#licenses-table td.expires-column {
    min-width: 11ch;
    white-space: nowrap;
}

/* Sortable table headers */
th.sortable {
    cursor: pointer;
    user-select: none;
}

th.sortable .sort-indicator {
    margin-left: 4px;
}

th.sorted-asc .sort-indicator::after {
    content: "\25B2"; /* up arrow */
}

th.sorted-desc .sort-indicator::after {
    content: "\25BC"; /* down arrow */
}

/* Search and filter styles */
.search-bar {
    margin-bottom: var(--space-md);
}

.search-bar input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--gray);
    border-radius: var(--border-radius-md);
    font-size: var(--font-size-md);
}

.filter-bar {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.filter-row {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.date-filter-row {
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.filter-group label {
    font-weight: 500;
}

.filter-group select {
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--gray);
    border-radius: var(--border-radius-md);
    background-color: white;
}

.date-range-filter {
    gap: var(--space-sm);
}

.date-range-filter.is-disabled {
    opacity: 0.6;
}

.date-range-filter.is-disabled input,
.date-range-filter.is-disabled button {
    cursor: not-allowed;
}

.date-range-filter .btn {
    white-space: nowrap;
}

.date-range-inputs {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.date-range-inputs input[type="date"] {
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--gray);
    border-radius: var(--border-radius-md);
    font-size: var(--font-size-sm);
}

.custom-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 220px;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
    z-index: 100;
    border-radius: var(--border-radius-sm);
    margin-top: 4px;
    padding: var(--space-xs) 0;
}

.dropdown-content.show {
    display: block;
}

.dropdown-item {
    padding: var(--space-xs) var(--space-md);
    cursor: pointer;
}

.dropdown-item:hover {
    background-color: var(--gray-light);
}

.dropdown-heading {
    padding: var(--space-xs) var(--space-md);
    font-weight: 600;
    color: var(--gray-dark);
    cursor: default;
    pointer-events: none;
}

.dropdown-heading + .dropdown-item {
    border-top: 1px solid var(--gray-light);
}

/* Status colors for subscriptions */
.status-expired td {
    background-color: rgba(220, 53, 69, 0.1);
}

.status-critical td {
    background-color: rgba(255, 193, 7, 0.1);
}

.status-warning td {
    background-color: rgba(23, 162, 184, 0.1);
}

.days-expired {
    color: var(--danger);
    font-weight: 600;
}

.days-critical {
    color: var(--danger);
    font-weight: 600;
}

.days-warning {
    color: var(--warning);
    font-weight: 600;
}

.days-normal {
    color: var(--success);
}

/* License status indicator */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid transparent;
}

.status-indicator.status-active {
    border-color: #28a745;
    background-color: #d4edda;
}

.status-indicator.status-expired {
    border-color: #721c24;
    background-color: #f8d7da;
}

.status-indicator.status-revoked {
    border-color: #721c24;
    background-color: #f5c6cb;
}

.status-indicator.status-suspended {
    border-color: #856404;
    background-color: #fff3cd;
}

.status-indicator.unactivated {
    background-color: #ffffff;
}

/* Button variants */
.btn-success {
    color: white;
    background-color: var(--success);
    border-color: var(--success);
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.btn-danger {
    color: white;
    background-color: var(--danger);
    border-color: var(--danger);
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* Read-only field styling */
.readonly-field {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #ced4da;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    cursor: not-allowed;
    font-weight: 500;
}

/* Label styling for read-only fields */
label + .readonly-field, 
label + .input-group .readonly-field {
    margin-top: 0.25rem;
}

/* Special styling for renewal modal to make it clear what's editable */
#renewSubscriptionModal .form-group {
    margin-bottom: 1.5rem;
}

#renewSubscriptionModal .input-group-text {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #ced4da;
}

/* Label emphasis for current vs new values */
#renewSubscriptionModal label[for^="current"] {
    color: #6c757d;
    font-weight: normal;
}

#renewSubscriptionModal label[for^="new"] {
    color: #212529;
    font-weight: 500;
}

/* Styling for current vs new value sections */
#renewSubscriptionModal .current-value-group {
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
    border-left: 3px solid #6c757d;
}

#renewSubscriptionModal .new-value-group {
    padding: 0.75rem;
    background-color: #f0f9ff;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
    border-left: 3px solid #0d6efd;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    color: white;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    animation: notification-in 0.3s ease-out;
}
.notification-info { background-color: #2196F3; }
.notification-success { background-color: #4CAF50; }
.notification-warning { background-color: #FF9800; }
.notification-error { background-color: #F44336; }
.notification-hide {
    animation: notification-out 0.5s forwards;
}

/* Loading indicator */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    font-style: italic;
    color: #666;
}
.loading::after {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    margin-left: 10px;
    animation: spin 1s linear infinite;
}

/* Animation keyframes */
@keyframes notification-in {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes notification-out {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(-30px); opacity: 0; }
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Read-only field styling */
.readonly-field {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #ced4da;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    cursor: not-allowed;
    font-weight: 500;
}

/* Financial goals specific styles */
.goals-container {
    margin-top: var(--space-md);
}

.goal-progress-container {
    width: 100%;
}

.goal-progress {
    height: 8px;
    background-color: var(--gray-light);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 4px;
}

.goal-progress-bar {
    height: 100%;
    background-color: var(--primary-color);
}

.goal-progress-text {
    font-size: var(--font-size-sm);
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
}

.goal-on-track {
    color: var(--success);
}

.goal-at-risk {
    color: var(--warning);
}

.goal-behind {
    color: var(--danger);
}

.goal-card {
    background-color: white;
    border-radius: var(--border-radius-md);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-md);
    border-left: 4px solid var(--primary-color);
}

.goal-card.at-risk {
    border-left-color: var(--warning);
}

.goal-card.behind {
    border-left-color: var(--danger);
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-sm);
}

.goal-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.goal-amount {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--gray-dark);
}

.goal-date {
    color: var(--gray);
    font-size: var(--font-size-sm);
}

.goal-metrics {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
}

.goal-metric {
    flex: 1;
}

.goal-metric-label {
    font-size: var(--font-size-sm);
    color: var(--gray);
    margin-bottom: var(--space-xs);
}

.goal-metric-value {
    font-size: var(--font-size-lg);
    font-weight: 600;
}
/* Additional CSS for Customer Management Notifications and Badges */

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    color: white;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    animation: notification-in 0.3s ease-out;
    max-width: 400px;
    font-weight: 500;
}

.notification-success { 
    background-color: #4CAF50; 
}

.notification-error { 
    background-color: #F44336; 
}

.notification-warning { 
    background-color: #FF9800; 
}

.notification-info { 
    background-color: #2196F3; 
}

.notification-hide {
    animation: notification-out 0.5s forwards;
}

@keyframes notification-in {
    from { 
        transform: translateX(100%); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0); 
        opacity: 1; 
    }
}

@keyframes notification-out {
    from { 
        transform: translateX(0); 
        opacity: 1; 
    }
    to { 
        transform: translateX(100%); 
        opacity: 0; 
    }
}

/* Badge styles for customer types */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background-color: #007bff;
    color: white;
}

.badge-secondary {
    background-color: #6c757d;
    color: white;
}

/* Form error display improvements */
.form-error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 8px;
    padding: 8px 12px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    display: none;
}

.form-error:empty {
    display: none !important;
}

/* Enhanced table styling */
.customer-table tbody tr {
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.customer-table tbody tr:hover {
    border-left-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Link styling within tables */
.customer-table a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.customer-table a:hover {
    text-decoration: underline;
}

/* Text muted for unassigned users */
.text-muted {
    color: #6c757d;
    font-style: italic;
}

/* Warning text styling */
.text-warning {
    color: #856404;
    background-color: #fff3cd;
    padding: 8px 12px;
    border-radius: 4px;
    margin: 8px 0;
    font-size: 14px;
}

/* Improved modal sizing for forms */
.modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

/* Enhanced form row styling */
.form-row {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.form-group-half {
    flex: 1;
}

/* Better spacing for form actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--gray-light);
}

/* Improved association section styling */
.current-association {
    padding: 12px 16px;
    background-color: #e3f2fd;
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    margin-bottom: 16px;
}

.association-form {
    display: flex;
    gap: 16px;
    align-items: end;
    margin-bottom: 16px;
}

.association-form .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Enhanced header actions styling */
.header-actions {
    display: flex;
    gap: var(--space-sm);
}

@media (max-width: 768px) {
    .header-actions {
        flex-direction: column;
    }
    
    .header-actions .btn {
        width: 100%;
    }
}

/* Add these styles to your existing style.css file */

/* Enhanced Navigation Styles */
.sidebar-menu {
    padding: var(--space-md) 0;
}

.menu-item {
    display: block;
    margin-bottom: 2px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-size: var(--font-size-sm);
}

.menu-link:hover,
.menu-item.active .menu-link {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-color);
    text-decoration: none;
}

.menu-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.chevron-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
    stroke: currentColor;
}

/* Menu Groups */
.menu-group {
    margin-bottom: 2px;
}

.menu-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-lg);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-size: var(--font-size-sm);
    text-align: left;
}

.menu-group-toggle:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-color);
}

.menu-group-content {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.chevron-icon {
    flex-shrink: 0;
    transition: transform 0.2s ease;
    stroke: currentColor;
}

.menu-group.expanded .chevron-icon {
    transform: rotate(180deg);
}

.menu-group-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    margin-left: var(--space-lg);
}

.menu-group.expanded .menu-group-items {
    max-height: 200px; /* Adjust based on your needs */
}

.submenu-link {
    padding-left: calc(var(--space-xl) - 16px); /* Add space for the bullet */
    /* font-size: var(--font-size-xs); */
    border-left: none;
    position: relative;
}

/* .submenu-link::before {
    content: '';
    position: absolute;
    left: calc(var(--space-lg) - 16px);
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    transition: background-color 0.2s ease;
} */

/* .menu-item.active .submenu-link::before,
.submenu-link:hover::before {
    background-color: var(--primary-color);
} */

.menu-item.active .submenu-link {
    color: white;
    background-color: rgba(255, 255, 255, 0.15);
}

/* Group active states */
.menu-group.has-active-child .menu-group-toggle {
    color: rgba(255, 255, 255, 0.9);
}

/* Smooth animations */
@keyframes slideDown {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 200px;
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        max-height: 200px;
        opacity: 1;
    }
    to {
        max-height: 0;
        opacity: 0;
    }
}

.menu-group.expanding .menu-group-items {
    animation: slideDown 0.3s ease forwards;
}

.menu-group.collapsing .menu-group-items {
    animation: slideUp 0.3s ease forwards;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .menu-group-toggle {
        padding: var(--space-xs) var(--space-md);
    }
    
    .menu-link {
        padding: var(--space-xs) var(--space-md);
    }
    
    .submenu-link {
        padding-left: var(--space-lg);
    }
}

/* License tables */
.licenses-section,
.billings-section {
    grid-column: 1 / -1;
    background-color: white;
    border-radius: var(--border-radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-light);
    margin-top: var(--space-lg);
}

.licenses-header,
.billings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--gray-light);
}

.licenses-controls {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background-color: var(--gray-light);
    padding: var(--space-sm);
    border-radius: var(--border-radius-md);
}

.licenses-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    border: 1px solid var(--gray-light);
}

.licenses-table th {
    background-color: var(--gray-light);
    padding: var(--space-md);
    text-align: left;
    font-weight: 600;
    color: var(--gray-dark);
    border-bottom: 2px solid var(--gray);
}

.licenses-table td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--gray-light);
    color: var(--gray-dark);
}

.licenses-table tbody tr {
    transition: background-color 0.2s ease;
}

.licenses-table tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.05);
}

.licenses-table tr.selected {
    background-color: rgba(52, 152, 219, 0.1);
}

.license-key-link,
.license-detail-link {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
    border-bottom: 1px solid transparent;
}

.license-key-link:hover,
.license-detail-link:hover {
    color: var(--primary-dark);
    border-bottom-color: var(--primary-dark);
}

.license-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid;
}

.license-status-active {
    background-color: #d4edda;
    color: #155724;
    border-color: #22c55e;
}

.license-status-expired {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #ef4444;
}

.license-status-revoked {
    background-color: #f5c6cb;
    color: #721c24;
    border-color: #f87171;
}

.license-status-suspended {
    background-color: #fff3cd;
    color: #856404;
    border-color: #f59e0b;
}

.license-status-unknown {
    background-color: #e2e3e5;
    color: #495057;
    border-color: #9ca3af;
}

.trial-badge {
    background-color: #e3f2fd;
    color: #0d47a1;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 6px;
    text-transform: uppercase;
    border: 1px solid #3b82f6;
}

.active-seats-clickable {
    cursor: pointer;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
    border-bottom: 1px solid transparent;
}

.active-seats-clickable:hover {
    color: var(--primary-dark);
    border-bottom-color: var(--primary-dark);
}

.active-seats-zero {
    color: var(--gray);
    font-style: italic;
}

.license-row-active {
    background-color: rgba(40, 167, 69, 0.02);
}

.license-row-expired {
    background-color: rgba(220, 53, 69, 0.02);
}

.license-row-revoked {
    background-color: rgba(220, 53, 69, 0.05);
    opacity: 0.7;
}

.license-row-suspended {
    background-color: rgba(255, 193, 7, 0.02);
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

.status-revoked {
    background-color: #f5c6cb;
    color: #721c24;
    border: 1px solid #f1b0b7;
}

.status-suspended {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Enhanced Billing Dashboard Styles - Updated */
.billing-dashboard-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    padding: var(--space-lg);
    background-color: #f8f9fa;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Enhanced Billing Table Card - Updated */
.billing-table-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--gray-light);
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

.billing-table-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--success), var(--info));
}

.billing-table-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.table-content {
    overflow: visible;
    max-height: none;
    background-color: white;
    width: 100%;
}

/* Simplified Enhanced Billing Table */
.enhanced-billing-table {
    width: 100%;
    min-width: 1400px; /* Ensure minimum width for all columns */
    border-collapse: collapse;
    font-size: var(--font-size-sm);
    background-color: white;
    table-layout: fixed;
}

/* Simplified Table Headers */
.enhanced-billing-table th {
    background-color: var(--gray-light);
    padding: var(--space-md);
    text-align: left;
    font-weight: 600;
    color: var(--gray-dark);
    border-bottom: 2px solid var(--gray);
    font-size: var(--font-size-sm);
    white-space: nowrap;
    position: relative;
}

.enhanced-billing-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.enhanced-billing-table th.sortable:hover {
    background-color: var(--gray);
    color: white;
}

.enhanced-billing-table th .sort-indicator {
    margin-left: var(--space-xs);
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.enhanced-billing-table th.sorted-asc .sort-indicator::after {
    content: "▲";
    opacity: 1;
    color: var(--primary-color);
}

.enhanced-billing-table th.sorted-desc .sort-indicator::after {
    content: "▼";
    opacity: 1;
    color: var(--primary-color);
}

.enhanced-billing-table th.sortable:hover .sort-indicator {
    opacity: 1;
}

/* Column Widths */
.enhanced-billing-table th:nth-child(1) { width: 200px; } /* Customer */
.enhanced-billing-table th:nth-child(2) { width: 120px; } /* Invoice # */
.enhanced-billing-table th:nth-child(3) { width: 100px; } /* Type */
.enhanced-billing-table th:nth-child(4) { width: 110px; } /* Issue Date */
.enhanced-billing-table th:nth-child(5) { width: 110px; } /* Start Date */
.enhanced-billing-table th:nth-child(6) { width: 110px; } /* End Date */
.enhanced-billing-table th:nth-child(7) { width: 100px; } /* Days Left */
.enhanced-billing-table th:nth-child(8) { width: 100px; } /* Status */
.enhanced-billing-table th:nth-child(9) { width: 120px; } /* Amount */
.enhanced-billing-table th:nth-child(10) { width: 240px; } /* Actions - Wider for buttons */

/* Enhanced Action Buttons - Compact */
.enhanced-billing-table .actions-column {
    width: 240px;
    text-align: left;
    padding-left: var(--space-sm);
}

.enhanced-billing-table .btn {
    margin: 0 3px 0 0;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
    display: inline-block;
    min-width: 50px;
    text-align: center;
    white-space: nowrap;
}

.enhanced-billing-table .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.enhanced-billing-table .btn-success {
    background-color: var(--success);
    border-color: var(--success);
    color: white;
}

.enhanced-billing-table .btn-success:hover {
    background-color: #20c997;
    border-color: #20c997;
}

.enhanced-billing-table .btn-outline {
    background-color: white;
    border: 1px solid var(--gray);
    color: var(--gray-dark);
}

.enhanced-billing-table .btn-outline:hover {
    background-color: var(--gray);
    border-color: var(--gray);
    color: white;
}

/* Table Body */
.enhanced-billing-table td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--gray-light);
    color: var(--gray-dark);
    vertical-align: middle;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
}

.enhanced-billing-table tbody tr {
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.enhanced-billing-table tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.05);
    border-left-color: var(--primary-color);
}

/* Enhanced Status Badges - Simplified */
.enhanced-billing-table .status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    border: 1px solid;
}

.status-badge.status-paid {
    background-color: #d4edda;
    border-color: var(--success);
    color: #155724;
}

.status-badge.status-issued {
    background-color: #d1ecf1;
    border-color: var(--info);
    color: #0c5460;
}

.status-badge.status-draft {
    background-color: #fff3cd;
    border-color: var(--warning);
    color: #856404;
}

/* Enhanced Days Left Styling - Simplified */
.days-critical {
    color: var(--danger);
    font-weight: 700;
    background-color: rgba(220, 53, 69, 0.1);
    padding: 2px 6px;
    border-radius: var(--border-radius-sm);
}

.days-warning {
    color: var(--warning);
    font-weight: 600;
    background-color: rgba(255, 193, 7, 0.1);
    padding: 2px 6px;
    border-radius: var(--border-radius-sm);
}

.days-normal {
    color: var(--success);
    font-weight: 600;
}

.days-expired {
    color: var(--danger);
    font-weight: 700;
    background-color: rgba(220, 53, 69, 0.15);
    padding: 2px 6px;
    border-radius: var(--border-radius-sm);
    text-transform: uppercase;
    font-size: var(--font-size-xs);
}

/* Enhanced Customer Links */
.enhanced-billing-table .customer-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.enhanced-billing-table .customer-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Enhanced Currency Display */
.enhanced-billing-table td:nth-child(9) {
    font-family: inherit;
    font-weight: 600;
    text-align: right;
    color: var(--success);
}

/* Fix oversized icons */
.billing-filter-card .card-icon {
    width: 16px;
    height: 16px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.billing-table-card .card-icon {
    width: 16px;
    height: 16px;
    color: var(--success);
    flex-shrink: 0;
}

.billing-filter-card .card-title,
.billing-table-card .card-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--gray-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Date Range Controls - Horizontal Layout */
.billing-filter-card .date-filter-row {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    flex-wrap: nowrap;
}

.billing-filter-card .date-range-filter {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: nowrap;
}

.billing-filter-card .date-range-filter label {
    white-space: nowrap;
    margin: 0;
    font-weight: 600;
    color: var(--gray-dark);
}

.date-controls {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: nowrap;
}

.custom-dropdown {
    position: relative;
    display: inline-block;
}

.date-range-inputs {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background-color: white;
    padding: var(--space-xs);
    border-radius: var(--border-radius-md);
    border: 2px solid var(--gray-light);
    transition: border-color 0.2s ease;
    white-space: nowrap;
}

.date-range-inputs:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.date-range-inputs input[type="date"] {
    border: none;
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-sm);
    background: transparent;
    color: var(--gray-dark);
    font-weight: 500;
    min-width: 130px;
}

.date-range-inputs input[type="date"]:focus {
    outline: none;
    background-color: rgba(52, 152, 219, 0.05);
    border-radius: var(--border-radius-sm);
}

.date-separator {
    color: var(--gray);
    font-weight: 500;
    padding: 0 var(--space-xs);
    flex-shrink: 0;
}

/* Responsive adjustments for date controls */
@media (max-width: 1200px) {
    .billing-filter-card .date-filter-row {
        flex-wrap: wrap;
        gap: var(--space-md);
    }
    
    .date-controls {
        gap: var(--space-sm);
    }
}

@media (max-width: 768px) {
    .billing-filter-card .date-filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-md);
    }
    
    .billing-filter-card .date-range-filter {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-sm);
    }
    
    .date-controls {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-sm);
    }
    
    .date-range-inputs {
        justify-content: space-between;
    }
}

/* Responsive Design */
@media (max-width: 1600px) {
    .enhanced-billing-table {
        min-width: 1200px;
    }
    
    .enhanced-billing-table th:nth-child(1) { width: 180px; } /* Customer */
    .enhanced-billing-table th:nth-child(10) { width: 200px; } /* Actions */
}

@media (max-width: 1400px) {
    .enhanced-billing-table {
        min-width: 1100px;
    }
    
    .enhanced-billing-table th:nth-child(1) { width: 160px; } /* Customer */
    .enhanced-billing-table th:nth-child(10) { width: 180px; } /* Actions */
    
    .enhanced-billing-table .btn {
        font-size: 10px;
        padding: 3px 6px;
        min-width: 45px;
    }
}

@media (max-width: 768px) {
    .billing-dashboard-container {
        padding: var(--space-md);
        gap: var(--space-md);
    }
    
    .enhanced-billing-table {
        font-size: var(--font-size-xs);
        min-width: 800px;
    }
    
    .enhanced-billing-table th,
    .enhanced-billing-table td {
        padding: var(--space-xs) var(--space-sm);
    }
    
    .enhanced-billing-table .btn {
        font-size: 9px;
        padding: 2px 4px;
        margin: 0 1px;
        min-width: 35px;
    }
}

/* Print Styles */
@media print {
    .billing-dashboard-container {
        background-color: white;
        padding: 0;
    }
    
    .billing-filter-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--gray);
    }
    
    .billing-table-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--gray);
    }
    
    .enhanced-billing-table {
        font-size: 10px;
    }
    
    .enhanced-billing-table th,
    .enhanced-billing-table td {
        padding: 4px;
    }
    
    .billing-filter-card .card-header,
    .billing-table-card .card-header {
        background: var(--gray-light);
    }
    
    .enhanced-billing-table .btn {
        display: none;
    }
    
    .loading-spinner {
        display: none;
    }
}

/* Fix main page scrolling issues */
/* Fix main page scrolling issues - Billing page only */
/* OR if the above doesn't work, use this more specific selector */
body:has(.billing-dashboard-container) .content-body {
    overflow-x: auto;
    overflow-y: visible;
    padding: 0;
}

.billing-dashboard-container {
    max-width: none;
    overflow-x: visible;
}

/* Ensure table scrolls properly on smaller screens */
.table-content {
    overflow-x: auto;
    overflow-y: visible;
}