/* Design System Variables (Dark Glassmorphism & Emerald Accent) */
:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --glass-bg: rgba(17, 24, 39, 0.6);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-highlight: rgba(255, 255, 255, 0.03);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent-emerald: #10b981;
    --accent-emerald-glow: rgba(16, 185, 129, 0.2);
    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.2);
    --accent-rose: #f43f5e;
    
    --sidebar-width: 260px;
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    --border-radius-sm: 6px;
    
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition-fast: 0.2s ease-in-out;
}

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

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(at 10% 20%, rgba(16, 185, 129, 0.06) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(59, 130, 246, 0.06) 0px, transparent 50%);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 400;
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    overflow-y: scroll;
}

input, select, button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: transparent;
    border: none;
    outline: none;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* App Wrapper Layout */
.app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar Navigation Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding-left: 8px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-emerald), var(--accent-blue));
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.logo-icon i {
    width: 22px;
    height: 22px;
    color: white;
}

.brand-info h1 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.brand-info span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
    width: 100%;
    text-align: left;
}

.nav-item i {
    width: 20px;
    height: 20px;
}

.nav-item span {
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-item:hover {
    background-color: var(--glass-highlight);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: var(--accent-emerald-glow);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.sidebar-footer {
    padding-left: 8px;
}

.sidebar-footer .version {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content Area Styling */
.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 32px 40px;
    max-width: calc(100vw - var(--sidebar-width));
}

/* Content Header & Dashboard Cards */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    gap: 24px;
}

.header-title-area h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 4px;
}

.header-title-area .subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.quick-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: rgba(20, 20, 20, 0.75);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    border-radius: var(--border-radius-md);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: var(--transition-fast);
}

.stat-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.stat-card .stat-label {
    font-size: 0.74rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.stat-card .stat-value {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card.highlight {
    border-color: rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.03));
}

.stat-card.highlight .stat-value {
    color: var(--accent-emerald);
    font-size: 1.25rem;
}

/* Glassmorphic Panel Cards */
.glass-card {
    background-color: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

.panel-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-header i {
    width: 20px;
    height: 20px;
    color: var(--accent-emerald);
}

.panel-header h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
}

.panel-body {
    padding: 24px;
}

/* Form Styles */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 calc(50% - 8px);
    min-width: 220px;
}

.form-group.col-span-2 {
    grid-column: span 2;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 10px 14px;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.form-group input:focus {
    border-color: var(--accent-emerald);
    box-shadow: 0 0 0 2px var(--accent-emerald-glow);
}

/* Custom Glassmorphic Dark Theme Select & Option Dropdowns */
select,
.form-group select,
.grid-shared-cost-currency-select {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    font-size: 0.9rem !important;
    outline: none !important;
    cursor: pointer !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

select:focus,
.form-group select:focus,
.grid-shared-cost-currency-select:focus {
    border-color: var(--accent-cyan) !important;
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.25) !important;
}

select option,
.form-group select option,
.grid-shared-cost-currency-select option {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    padding: 10px 14px !important;
    font-size: 0.9rem !important;
}

select option:hover,
select option:focus,
select option:checked {
    background-color: #1e293b !important;
    color: var(--accent-cyan) !important;
}

/* Tab Display Logic */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Table Card Panel & Structure */
.table-panel {
    margin-bottom: 24px;
}

.table-header-area {
    padding: 18px 24px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.table-title i {
    width: 20px;
    height: 20px;
    color: var(--accent-emerald);
}

.table-title h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
}

.table-wrapper {
    overflow-x: auto;
    width: 100%;
}

.grid-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 0;
}

/* Supplier Tables - Fits 100% width without horizontal scroll */
.supplier-data-table,
.supplier-subtab-table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.supplier-data-table th,
.supplier-subtab-table th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.82rem;
    padding: 10px 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--glass-border);
    vertical-align: middle !important;
}

.supplier-data-table td,
.supplier-subtab-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.88rem;
    vertical-align: middle !important;
}

/* Modal Table Overrides - Prevent overflow & clipping */
.modal-content .grid-table {
    min-width: 100% !important;
    width: 100% !important;
    table-layout: fixed !important;
}

.modal-content .grid-table th,
.modal-content .grid-table td {
    padding: 10px 12px;
    word-break: break-word;
}

#pricing-breakdown-modal .grid-table th {
    text-transform: none !important;
}

.grid-table th,
.grid-table td {
    padding: 10px 10px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
    vertical-align: middle !important;
}

.grid-table th {
    background-color: rgba(0, 0, 0, 0.15);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.grid-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Specialized Table Inputs */
.grid-table td input[type="text"],
.grid-table td input {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 6px 10px;
    width: 100%;
    height: 36px;
    font-size: 0.85rem;
    color: var(--text-primary);
    box-sizing: border-box;
    transition: var(--transition-fast);
}

.grid-table td input.grid-wid,
.grid-table td input.grid-hgt,
.grid-table td input.grid-len {
    height: 36px !important;
    padding: 4px 4px !important;
    font-size: 0.8rem !important;
    text-align: center !important;
}

.grid-table td input:focus {
    border-color: var(--accent-emerald);
    background-color: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 2px var(--accent-emerald-glow);
}

.grid-table td .read-only-val {
    font-weight: 600;
    color: var(--text-primary);
    line-height: 36px;
    height: 36px;
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
    vertical-align: middle;
}

.grid-table td .highlight-val {
    font-weight: 700;
    color: var(--accent-emerald);
    line-height: 36px;
    height: 36px;
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
    vertical-align: middle;
}

/* Button UI Styling */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.btn i {
    width: 18px;
    height: 18px;
}

.btn.primary {
    background-color: var(--accent-emerald);
    color: var(--bg-primary);
    font-weight: 600;
}

.btn.primary:hover {
    background-color: #34d399; /* Light emerald */
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn.secondary {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.btn.secondary:hover {
    background-color: var(--glass-highlight);
    border-color: var(--text-secondary);
}

.btn.danger-icon {
    padding: 6px;
    background-color: rgba(244, 63, 94, 0.1);
    color: var(--accent-rose);
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.btn.danger-icon:hover {
    background-color: var(--accent-rose);
    color: white;
}

.btn.edit-icon {
    padding: 6px;
    background-color: var(--accent-blue-glow);
    color: var(--accent-blue);
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.btn.edit-icon:hover {
    background-color: var(--accent-blue);
    color: white;
}

.form-actions-bar {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-bottom: 40px;
}

/* Category Page Split Grid Layout */
.categories-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 24px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.data-table th {
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
    font-weight: 500;
}

.data-table tr:hover td {
    background-color: var(--glass-highlight);
}

/* Checkbox Switch styling */
.form-group.inline-checkbox {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
}

.form-group.inline-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-emerald);
    cursor: pointer;
}

/* Utility alert boxes */
.alert-pill {
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    text-transform: uppercase;
}

.alert-pill.success {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
}

.alert-pill.warning {
    background-color: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.alert-pill.info {
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

/* Hide utility */
.hidden {
    display: none !important;
}

/* Row Action Wrapper */
.action-cell {
    display: flex;
    gap: 8px;
}

/* Responsive Overrides */
@media (max-width: 1024px) {
    .categories-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
        max-width: 100vw;
        padding: 20px;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Custom Toast Notification System */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 30000 !important;
    max-width: 350px;
}

.toast {
    background: rgba(17, 24, 39, 0.85);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-md);
    padding: 14px 20px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    opacity: 0;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    border-left: 4px solid var(--accent-emerald);
}

.toast.success i {
    color: var(--accent-emerald);
}

.toast.error {
    border-left: 4px solid var(--accent-rose);
}

.toast.error i {
    color: var(--accent-rose);
}

.toast.info {
    border-left: 4px solid var(--accent-blue);
}

.toast.info i {
    color: var(--accent-blue);
}

/* Custom Confirm Modal Overlay */
.confirm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(3, 7, 18, 0.7);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000 !important;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.confirm-modal-overlay.show {
    opacity: 1;
}

.confirm-modal-card {
    width: 90%;
    max-width: 420px;
    transform: scale(0.9);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.confirm-modal-overlay.show .confirm-modal-card {
    transform: scale(1);
}

.confirm-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.confirm-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-emerald);
}

.confirm-modal-header h4 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
}

.confirm-modal-body {
    padding: 24px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.confirm-modal-actions {
    padding: 16px 24px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background-color: rgba(0, 0, 0, 0.1);
}

/* Product list sub-tabs styling */
.sub-tabs-container {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 8px;
    margin-left: 24px;
}

.sub-tab-item {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    position: relative;
    transition: var(--transition-fast);
}

.sub-tab-item:hover {
    color: var(--text-primary);
}

.sub-tab-item.active {
    color: var(--accent-emerald);
    font-weight: 600;
}

.sub-tab-item.active::after {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
}

/* Retail pricing styles */
.btn-pricing-action {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--accent-emerald);
    padding: 5px 10px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition-fast);
}

.btn-pricing-action:hover {
    background-color: var(--accent-emerald);
    color: white;
}

@media (max-width: 1024px) {
    .split-pricing-layout {
        flex-direction: column !important;
    }
    .pricing-costs-left {
        border-right: none !important;
        padding-right: 0 !important;
        border-bottom: 1px solid var(--glass-border) !important;
        padding-bottom: 24px !important;
        margin-bottom: 24px !important;
    }
}

/* Redesigned Retail Pricing styles */
.grid-table tbody tr.active-row {
    background-color: rgba(16, 185, 129, 0.12) !important;
    border-left: 4px solid var(--accent-emerald) !important;
}

.pricing-group-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 16px;
    transition: background-color 0.2s ease;
}

.pricing-group-box:hover {
    background: rgba(255, 255, 255, 0.04);
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

.badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Sub-tabs Navigation styling */
.sub-tabs-nav button {
    transition: all 0.2s ease;
    border: 1px solid var(--glass-border) !important;
}

.sub-tabs-nav button.active {
    background: var(--accent-emerald) !important;
    color: #000 !important;
    font-weight: 700;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

/* Modal styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.25s ease;
}

.modal-overlay.hidden {
    display: none !important;
}

.modal-content {
    animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Phase 3 Segmented Progress Bar & Financial Analytics Styles */
#segmented-bar-container > div {
    font-family: var(--font-family);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    padding: 0 4px;
}

@media print {
    .sidebar, .modal-overlay, button, .form-actions {
        display: none !important;
    }
    .app-container {
        display: block !important;
    }
    .glass-card {
        background: #fff !important;
        color: #000 !important;
        border: 1px solid #ccc !important;
    }
}

/* User Guide Custom Styles */
.user-guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.guide-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 24px;
    backdrop-filter: blur(12px);
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.guide-card:hover {
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}
.formula-box {
    background: rgba(0, 0, 0, 0.35);
    border-left: 4px solid #3b82f6;
    border-radius: 6px;
    padding: 12px 16px;
    font-family: monospace;
    font-size: 0.88rem;
    color: #60a5fa;
    margin: 10px 0;
    line-height: 1.5;
}
.kpi-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.kpi-badge-blue { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); }
.kpi-badge-emerald { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.kpi-badge-purple { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }
.kpi-badge-amber { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.kpi-badge-rose { background: rgba(244, 63, 94, 0.2); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.4); }

/* Supplier Modal Subtabs Styling */
.subtabs-bar {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 14px;
    overflow-x: auto;
}

.subtab-btn {
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.subtab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.subtab-btn.active {
    color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
}

/* Custom Glassmorphic Dark Theme Textarea & Form Controls */
.form-group textarea,
textarea {
    background-color: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--border-radius-md) !important;
    padding: 10px 14px !important;
    font-size: 0.9rem !important;
    color: var(--text-primary) !important;
    font-family: inherit !important;
    outline: none !important;
    transition: var(--transition-fast) !important;
}

.form-group textarea:focus,
textarea:focus {
    border-color: var(--accent-emerald) !important;
    box-shadow: 0 0 0 2px var(--accent-emerald-glow) !important;
    background-color: rgba(15, 23, 42, 0.85) !important;
}

/* Hide default browser up/down arrow spinners on number inputs */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

/* Modal Form Control Consistent Theme Styling */
.modal-card input[type="text"],
.modal-card input[type="number"],
.modal-card input[type="email"],
.modal-card input[type="tel"],
.modal-card input[type="url"],
.modal-card select,
.modal-card textarea {
    background-color: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 6px !important;
    color: #f8fafc !important;
    font-size: 0.88rem !important;
    padding: 8px 12px !important;
    outline: none !important;
}

.modal-card input[type="text"]:focus,
.modal-card input[type="number"]:focus,
.modal-card input[type="email"]:focus,
.modal-card input[type="tel"]:focus,
.modal-card input[type="url"]:focus,
.modal-card select:focus,
.modal-card textarea:focus {
    border-color: var(--accent-emerald) !important;
    box-shadow: 0 0 0 2px var(--accent-emerald-glow) !important;
}

/* Suppliers Table Clickable Row Hover Style */
#suppliers-tbody tr {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#suppliers-tbody tr:hover {
    background-color: rgba(16, 185, 129, 0.08) !important;
}

/* Contract & Appendix Card Glassmorphic Styling */
.contract-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.2s ease;
}

.contract-card:hover {
    border-color: var(--accent-emerald);
}

.contract-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.appendix-list-container {
    margin-top: 10px;
    padding-left: 22px;
    border-left: 2px dashed rgba(16, 185, 129, 0.3);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.appendix-card {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

.appendix-card::before {
    content: "└─";
    position: absolute;
    left: -18px;
    top: 14px;
    color: var(--accent-emerald);
    font-weight: 700;
    font-size: 0.85rem;
}

.expiry-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.expiry-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.expiry-badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.expiry-badge.expired {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.contract-progress-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.contract-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s ease;
}

.contract-progress-fill.active { background: #34d399; }
.contract-progress-fill.warning { background: #fbbf24; }
.contract-progress-fill.expired { background: #f87171; }






/* Table Input & Select Standard Glassmorphism Styling */
.supplier-subtab-table td input,
.supplier-subtab-table td select,
.grid-table td input,
.grid-table td select,
.data-table td input,
.data-table td select {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 6px !important;
    color: #fff !important;
    padding: 6px 10px !important;
    height: 36px !important;
    font-size: 0.88rem !important;
    outline: none !important;
}

.supplier-subtab-table td input:focus,
.supplier-subtab-table td select:focus,
.grid-table td input:focus,
.grid-table td select:focus,
.data-table td input:focus,
.data-table td select:focus {
    border-color: var(--accent-emerald) !important;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.3) !important;
}

/* Import Financial Allocation 3-Column Grid */
#panel-import-financials {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 16px !important;
    margin-bottom: 24px !important;
}

#panel-import-financials.hidden {
    display: none !important;
}


.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-close-modal:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
