:root {
    /* Color Palette - Dark Mode Premium */
    --bg-app: #0f172a;
    /* Slate 900 */
    --bg-panel: #1e293b;
    /* Slate 800 */
    --bg-card: #1e293b;
    --bg-hover: #334155;
    /* Slate 700 */

    --text-main: #f8fafc;
    /* Slate 50 */
    --text-muted: #94a3b8;
    /* Slate 400 */
    --text-dim: #64748b;
    /* Slate 500 */

    --primary: #3b82f6;
    /* Blue 500 */
    --primary-hover: #2563eb;
    /* Blue 600 */
    --primary-glow: rgba(59, 130, 246, 0.5);

    --success: #10b981;
    /* Emerald 500 */
    --success-glow: rgba(16, 185, 129, 0.5);

    --danger: #ef4444;
    /* Red 500 */
    --danger-glow: rgba(239, 68, 68, 0.5);

    --warning: #f59e0b;
    /* Amber 500 */

    --border: #334155;
    /* Slate 700 */
    --border-light: #475569;
    /* Slate 600 */

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

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 15px rgba(0, 0, 0, 0.3);

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

    --sidebar-width: 260px;
    --header-height: 70px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 50;
    transition: transform 0.3s ease;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border);
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.025em;
}

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

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background-color: var(--bg-hover);
    color: var(--text-main);
}

.nav-item.active {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

.nav-icon {
    margin-right: 0.75rem;
    width: 20px;
    height: 20px;
}

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

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    max-width: 1600px;
    /* Prevent too wide on large screens */
}

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

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}

.page-subtitle {
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-light);
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-value {
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0.5rem 0 0;
    color: var(--text-main);
}

.metric-trend {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
}

.trend-up {
    color: var(--success);
}

.trend-down {
    color: var(--danger);
}

.trend-neutral {
    color: var(--text-muted);
}

/* Charts Section */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Tables */
.table-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.925rem;
}

th {
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem 1.5rem;
    text-align: left;
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

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

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

/* Badges & Indicators */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

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

.badge-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

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

.badge-info {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
    display: inline-block;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(59, 130, 246, 0.4);
}

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

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--text-muted);
    background-color: var(--bg-hover);
}

/* Utilities */
.text-success {
    color: var(--success) !important;
}

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

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

.text-muted {
    color: var(--text-muted) !important;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .mobile-toggle {
        display: flex !important;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 40;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
}

/* 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;
}

/* Mobile close button - hide on desktop */
.mobile-close {
    display: none;
}

@media (max-width: 768px) {
    .mobile-close {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        color: var(--text-muted);
        cursor: pointer;
        padding: 0.5rem;
        border-radius: var(--radius-md);
        transition: all 0.2s ease;
    }

    .mobile-close:hover {
        background-color: var(--bg-hover);
        color: var(--text-main);
    }

    .sidebar-header {
        justify-content: space-between;
    }
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(59, 130, 246, 0.4);
}

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

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--text-muted);
    background-color: var(--bg-hover);
}

/* Utilities */
.text-success {
    color: var(--success) !important;
}

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

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

.text-muted {
    color: var(--text-muted) !important;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .mobile-toggle {
        display: flex !important;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 40;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
}

/* 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;
}

/* Mobile close button - hide on desktop */
.mobile-close {
    display: none;
}

@media (max-width: 768px) {
    .mobile-close {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        color: var(--text-muted);
        cursor: pointer;
        padding: 0.5rem;
        border-radius: var(--radius-md);
        transition: all 0.2s ease;
    }

    .mobile-close:hover {
        background-color: var(--bg-hover);
        color: var(--text-main);
    }

    .sidebar-header {
        justify-content: space-between;
    }
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(59, 130, 246, 0.4);
}

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

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--text-muted);
    background-color: var(--bg-hover);
}

/* Utilities */
.text-success {
    color: var(--success) !important;
}

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

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

.text-muted {
    color: var(--text-muted) !important;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .mobile-toggle {
        display: flex !important;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 40;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
}

/* 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;
}

/* Mobile close button - hide on desktop */
.mobile-close {
    display: none;
}

@media (max-width: 768px) {
    .mobile-close {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        color: var(--text-muted);
        cursor: pointer;
        padding: 0.5rem;
        border-radius: var(--radius-md);
        transition: all 0.2s ease;
    }

    .mobile-close:hover {
        background-color: var(--bg-hover);
        color: var(--text-main);
    }

    .sidebar-header {
        justify-content: space-between;
    }
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.925rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

@media (max-width: 768px) {
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

small.text-muted {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
}

/* Custom Number Input */
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;
}

.number-input-group {
    display: flex;
    align-items: center;
    background: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.25rem;
    width: fit-content;
    transition: all 0.2s ease;
}

.number-input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.number-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-panel);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
    line-height: 1;
}

.number-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}

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

.number-input-field {
    width: 60px;
    border: none;
    background: transparent;
    text-align: center;
    color: var(--text-main);
    font-weight: 600;
    font-size: 1rem;
    padding: 0 0.5rem;
}

.number-input-field:focus {
    outline: none;
}

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

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

.animate-slide-down {
    animation: slideDown 0.3s ease-out forwards;
}

.hidden {
    display: none !important;
}

.d-flex {
    display: flex;
}

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

/* Custom Floating Dropdown - Popover Style */
.custom-select-container {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.925rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.custom-select-trigger:hover {
    border-color: var(--border-light);
    background-color: var(--bg-hover);
}

.custom-select-container.open .custom-select-trigger {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.custom-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 100%;
    background-color: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.98);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 6px;
}

.custom-select-container.open .custom-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.custom-option {
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-main);
    font-size: 0.9rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    margin-bottom: 2px;
}

.custom-option:last-child {
    margin-bottom: 0;
}

.custom-option:hover {
    background-color: var(--bg-hover);
    color: var(--primary);
}

.custom-option.selected {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    font-weight: 600;
}

.custom-arrow {
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3e%3c/path%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.custom-select-container.open .custom-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

.native-select-hidden {
    display: none;
}

/* Custom Dialog (Shadcn-like) */
.custom-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease-in-out;
}

.custom-dialog-overlay.open {
    opacity: 1;
    visibility: visible;
}

.custom-dialog {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: 0.75rem;
    /* radius-lg */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 32rem;
    /* max-w-lg */
    padding: 1.5rem;
    transform: scale(0.95);
    transition: all 0.2s ease-in-out;
    position: relative;
}

.custom-dialog-overlay.open .custom-dialog {
    transform: scale(1);
}

.dialog-header {
    margin-bottom: 1rem;
}

.dialog-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.dialog-description {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Custom Toast (Shadcn-like) */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    /* Allow clicks through container */
}

.custom-toast {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    /* radius-md */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-width: 300px;
    pointer-events: auto;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.toast-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.toast-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

.toast-description {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    background-color: var(--bg-hover);
    color: var(--text-main);
}


/* Disabled State for Custom Select */
.custom-select-container.disabled {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

.custom-select-container.disabled .custom-select-trigger {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

/* Disabled State for Inputs */
.form-control:disabled {
    background-color: var(--bg-secondary);
    opacity: 0.6;
    cursor: not-allowed;
}

/* Disabled Number Input Group */
.number-input-group.disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* Shadcn UI Style Select */
.shadcn-select {
    background-color: #09090b;
    color: #e4e4e7;
    border: 1px solid #27272a;
    border-radius: 6px;
    padding: 0.5rem 2.5rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    outline: none;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1rem;
    cursor: pointer;
    min-width: 160px;
}

.shadcn-select:hover {
    border-color: #52525b;
    background-color: #18181b;
}

.shadcn-select:focus {
    border-color: #e4e4e7;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

/* Manual Trade Highlight */
.row-action-needed {
    background-color: rgba(245, 158, 11, 0.1) !important;
    /* Amber-500 with low opacity */
    border-left: 3px solid #f59e0b !important;
}

.row-action-needed:hover {
    background-color: rgba(245, 158, 11, 0.15) !important;
}

/* Premium Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.2s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.modal-content {
    background: #18181b;
    /* Zinc-900 */
    border: 1px solid #27272a;
    border-radius: 8px;
    width: 100%;
    max-width: 420px;
    margin: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #27272a;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #f4f4f5;
    margin: 0;
}

.btn-close {
    background: transparent;
    border: none;
    color: #71717a;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-close:hover {
    background: #27272a;
    color: #e4e4e7;
}

.modal-body {
    padding: 1.5rem;
}

.trade-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    background: #27272a;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.label {
    font-size: 0.75rem;
    color: #a1a1aa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.value {
    font-size: 0.95rem;
    font-weight: 500;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #d4d4d8;
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: #09090b;
    border: 1px solid #27272a;
    border-radius: 6px;
    color: #e4e4e7;
    font-size: 0.925rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: #52525b;
    box-shadow: 0 0 0 2px rgba(39, 39, 42, 0.5);
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #27272a;
    background: #18181b;
    border-radius: 0 0 8px 8px;
}

/* Modals / Dialogs (Shadcn Style) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease-out;
}

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

.modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.show .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    margin-bottom: 1rem;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 0.25rem 0;
}

.modal-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 300px;
    pointer-events: auto;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

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

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

.toast-error,
.toast-destructive {
    border-left: 4px solid var(--danger);
}

.toast-warning {
    border-left: 4px solid var(--warning);
}


/* Utility Keyframes needed for Admin UI */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

/* Missing Utility Classes */
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    height: auto;
}

.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.font-medium {
    font-weight: 500;
}

.font-bold {
    font-weight: 700;
}

.uppercase {
    text-transform: uppercase;
}

.tracking-wide {
    letter-spacing: 0.025em;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.w-8 {
    width: 2rem;
}

.h-8 {
    height: 2rem;
}

.rounded-full {
    border-radius: 9999px;
}

.flex {
    display: flex;
}

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

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.bg-muted\/20 {
    background-color: rgba(148, 163, 184, 0.2);
}

.hover\:bg-muted\/20:hover {
    background-color: rgba(148, 163, 184, 0.2);
}

.border-b {
    border-bottom: 1px solid var(--border);
}

/* Avatar Gradients */
.bg-gradient-to-br {
    background: linear-gradient(to bottom right, var(--primary-glow), rgba(59, 130, 246, 0.1));
}

/* Status Colors */
.text-emerald-500 {
    color: #10b981;
}

.bg-emerald-500\/10 {
    background-color: rgba(16, 185, 129, 0.1);
}

.border-emerald-500\/20 {
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.text-amber-500 {
    color: #f59e0b;
}

.bg-amber-500\/10 {
    background-color: rgba(245, 158, 11, 0.1);
}

.border-amber-500\/20 {
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.group:hover .group-hover\:text-primary {
    color: var(--primary);
}

.inline-flex {
    display: inline-flex;
}

.rounded-md {
    border-radius: var(--radius-md);
}

.transition-colors {
    transition: color 0.15s ease-in-out;
}

/* Ghost Buttons (Shadcn Style) */
.btn-ghost {
    background-color: transparent;
    color: var(--text-main);
}

.btn-ghost:hover {
    background-color: var(--bg-hover);
}

.btn-ghost-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-ghost-success:hover {
    background-color: rgba(16, 185, 129, 0.2);
}

.btn-ghost-destructive {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}


/* Badges (Shadcn Style) */
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0.125rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

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

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

.badge-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}

/* Dot Indicator */
.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 6px;
}

.badge-dot.success {
    background-color: #10b981;
}

.badge-dot.warning {
    background-color: #f59e0b;
}

.badge-dot.danger {
    background-color: #ef4444;
}

.badge-dot.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .5;
    }
}