:root {
    /* Brand Colors */
    --st-primary: #f7541d;
    --st-primary-hover: #e04515;
    --st-dark: #111111;
    --st-light: #ffffff;

    /* Light Mode Variables */
    --st-bg: #f8f8f8;
    --st-surface: rgba(255, 255, 255, 0.8);
    --st-surface-solid: #ffffff;
    --st-text: #111111;
    --st-text-muted: #666666;
    --st-border: rgba(17, 17, 17, 0.1);
    --st-glass-bg: rgba(255, 255, 255, 0.8);
    --st-glass-border: rgba(255, 255, 255, 0.5);
    --st-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
    --st-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);
    --st-radius-sm: 12px;
    --st-radius-md: 18px;
    --st-radius-lg: 24px;
    --st-font-main: 'Figtree', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-theme-mode="dark"] {
    /* Dark Mode Variables */
    --st-bg: #0a0a0a;
    --st-surface: rgba(17, 17, 17, 0.8);
    --st-surface-solid: #111111;
    --st-text: #ffffff;
    --st-text-muted: #a0a0a0;
    --st-border: rgba(255, 255, 255, 0.1);
    --st-glass-bg: rgba(17, 17, 17, 0.8);
    --st-glass-border: rgba(255, 255, 255, 0.08);
    --st-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    --st-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6);
}

/* Global Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
    touch-action: pan-y;
    background-color: var(--st-bg);
    color: var(--st-text);
    font-family: var(--st-font-main);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Components */
.st-glass {
    background: var(--st-glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--st-glass-border);
}

.st-card {
    background-color: var(--st-surface-solid);
    border-radius: var(--st-radius-md);
    border: 1px solid var(--st-border);
    box-shadow: var(--st-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden; /* Restored for general cards */
}

/* Explicitly allow overflow for cards containing tables or actions */
.st-card.allow-overflow {
    overflow: visible !important;
}

.st-card:hover {
    box-shadow: var(--st-shadow-lg);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--st-text);
}

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

/* Form Elements */
.form-control, .form-select, textarea {
    background-color: var(--st-surface-solid) !important;
    color: var(--st-text) !important;
    border: 1px solid var(--st-border) !important;
    font-family: var(--st-font-main);
    padding: 0.75rem 1rem;
    border-radius: var(--st-radius-sm);
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--st-primary) !important;
    box-shadow: 0 0 0 4px rgba(247, 84, 29, 0.15) !important;
    outline: none;
}

input::placeholder, textarea::placeholder {
    color: var(--st-text-muted);
    opacity: 0.6;
}

/* Table Styles */
.table {
    width: 100%;
    margin-bottom: 3rem !important;
    color: var(--st-text);
    background-color: transparent;
}

.table-responsive {
    overflow: visible !important;
}

.table thead th {
    background-color: var(--st-bg) !important;
    border-bottom: 1px solid var(--st-border) !important;
    color: var(--st-text-muted) !important;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem;
}

.table tbody td {
    background-color: var(--st-surface-solid) !important;
    color: var(--st-text) !important;
    border-bottom: 1px solid var(--st-border) !important;
    padding: 1rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover td {
    background-color: rgba(247, 84, 29, 0.02) !important;
}

/* Buttons */
.st-btn-primary {
    background-color: var(--st-primary);
    color: white !important;
    border: none;
    padding: 12px 24px;
    border-radius: var(--st-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

.btn-light {
    background-color: var(--st-bg);
    border: 1px solid var(--st-border);
    color: var(--st-text);
    border-radius: var(--st-radius-sm);
    font-weight: 600;
}

/* Table Search & Sort UI */
.st-table-search {
    position: relative;
    max-width: 300px;
}
.st-table-search i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--st-text-muted);
}
.st-table-search input {
    padding-left: 40px !important;
    border-radius: 100px !important;
}

.table thead th i {
    font-size: 0.8rem;
    margin-left: 5px;
    opacity: 0.5;
}

/* Pagination */
.pagination-apple .page-link {
    border: none;
    background: var(--st-surface-solid);
    color: var(--st-text);
    border-radius: 10px !important;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    box-shadow: var(--st-shadow);
}

.pagination-apple .page-item.active .page-link {
    background: var(--st-primary) !important;
    color: white !important;
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-gap: 20px;
}

/* Mobile Enhancements & Card Reflow */
@media (max-width: 768px) {
    .table-responsive { overflow-x: hidden !important; }
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr {
        margin-bottom: 1.5rem;
        background: var(--st-surface-solid);
        border: 1px solid var(--st-border) !important;
        border-radius: var(--st-radius-md);
        padding: 1rem;
        box-shadow: var(--st-shadow);
    }
    .table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 0.75rem 0 !important;
        border-bottom: 1px solid var(--st-border) !important;
    }
    .table td:last-child { border-bottom: none !important; }
    .table td::before {
        content: attr(data-label);
        font-weight: 700;
        text-align: left;
        text-transform: uppercase;
        font-size: 0.7rem;
        color: var(--st-text-muted);
    }

    /* Mobile Button Refinements */
    .st-btn-primary, .btn {
        padding: 10px 20px !important;
        font-size: 0.85rem !important;
    }
    
    .avatar-circle {
        width: 48px !important;
        height: 48px !important;
        font-size: 1rem !important;
    }
}

/* Specific Dark Mode Overrides for 3rd Party / Hardcoded colors */
[data-theme-mode="dark"] .bg-light,
[data-theme-mode="dark"] .bg-white {
    background-color: var(--st-surface-solid) !important;
}

[data-theme-mode="dark"] .form-control {
    background-color: #1a1a1a !important;
}

[data-theme-mode="dark"] .table-hover tbody tr:hover td {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Utility */
.font-monospace { font-family: 'SF Mono', SFMono-Regular, ui-monospace, monospace; }

pre, code {
    font-family: 'SF Mono', SFMono-Regular, ui-monospace, monospace;
    color: var(--st-text);
}

.st-pre {
    background-color: var(--st-bg) !important;
    color: var(--st-text) !important;
    border: 1px solid var(--st-border);
    padding: 1.25rem;
    border-radius: var(--st-radius-sm);
    font-size: 0.85rem;
    line-height: 1.5;
}

[data-theme-mode="dark"] .st-pre {
    background-color: #1a1a1a !important;
}
.tracking-tight { letter-spacing: -0.025em; }
.cursor-pointer { cursor: pointer; }
.object-fit-cover { object-fit: cover; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Brand Utility Classes */
.bg-primary-transparent { background-color: rgba(247, 84, 29, 0.1) !important; }
.text-primary { color: var(--st-primary) !important; }
.bg-primary { background-color: var(--st-primary) !important; }
.border-primary { border-color: var(--st-primary) !important; }
.btn-primary { background-color: var(--st-primary) !important; border-color: var(--st-primary) !important; }
.btn-primary:hover { background-color: var(--st-primary-hover) !important; border-color: var(--st-primary-hover) !important; }

