/* ============================================
   NanoSolarX Property Manager - Main Styles
   Fomantic UI Customization with Light/Dark Mode
   ============================================ */

/* CSS Variables for Theming */
:root {
    /* Light Theme (default) */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f3f5;
    --text-primary: #1a1a2e;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --border-color: #e9ecef;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --sidebar-bg: #ffffff;
    --sidebar-hover: #f8f9fa;
    --sidebar-active: #fff5eb;
    --accent-color: #f97316;
    --accent-hover: #ea580c;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --input-border: #d1d5db;
}

[data-theme="dark"], .dark-mode {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #3d2a1a;
    --card-bg: #1e293b;
    --input-bg: #334155;
    --input-border: #475569;
}

/* Global Styles */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Login Screen */
#login-screen {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

#login-screen .ui.segment {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px var(--shadow-color);
    padding: 2.5rem;
}

#login-screen .logo-container {
    margin-bottom: 1rem;
}

#login-screen .logo-container i {
    font-size: 3rem;
}

#login-screen h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

#login-screen .subtitle {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

#login-screen .demo-accounts {
    margin-top: 1rem;
}

#login-screen .demo-accounts .ui.label {
    cursor: pointer;
    margin: 0.25rem;
}

#login-screen .demo-accounts .ui.label:hover {
    background: var(--accent-color);
    color: white;
}

/* Sidebar */
#sidebar {
    width: 260px !important;
    background: var(--sidebar-bg) !important;
    border-right: 1px solid var(--border-color) !important;
    display: flex !important;
    flex-direction: column;
    position: fixed !important;
    height: 100vh;
    z-index: 1000;
    transition: all 0.3s ease;
}

#sidebar.collapsed {
    width: 70px !important;
}

#sidebar.collapsed .brand-text,
#sidebar.collapsed .property-header span,
#sidebar.collapsed .property-header small,
#sidebar.collapsed .nav-item span,
#sidebar.collapsed .nav-label {
    display: none;
}

#sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 1rem !important;
}

#sidebar.collapsed .nav-item i {
    margin: 0 !important;
}

/* Brand Item */
.brand-item {
    padding: 1rem !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.brand-header i.building {
    font-size: 1.5rem;
}

.brand-text {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.brand-text strong {
    font-size: 1.1rem;
    color: var(--text-primary);
}

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

/* Property Selector */
.property-item {
    padding: 0.75rem 1rem !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.property-header {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    background: var(--bg-tertiary);
}

.property-header:hover {
    background: var(--sidebar-hover);
}

#current-property-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

#current-property-address {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.property-header .dropdown.icon {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Navigation Section */
.nav-section {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 1rem 1.25rem 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-item {
    display: flex !important;
    align-items: center;
    padding: 0.75rem 1.25rem !important;
    color: var(--text-secondary) !important;
    border-radius: 0 !important;
    margin: 2px 0.5rem !important;
    border-radius: 8px !important;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: var(--sidebar-hover) !important;
    color: var(--text-primary) !important;
}

.nav-item.active {
    background: var(--sidebar-active) !important;
    color: var(--accent-color) !important;
}

.nav-item i {
    width: 24px;
    margin-right: 0.75rem !important;
    font-size: 1.1rem;
}

.nav-item span {
    font-size: 0.9rem;
}

/* Bottom Menu */
.bottom-menu {
    border-top: 1px solid var(--border-color);
    padding: 0.5rem;
}

/* Main Content */
#main-content {
    margin-left: 260px;
    min-height: 100vh;
    background: var(--bg-primary);
    transition: margin-left 0.3s ease;
}

#sidebar.collapsed ~ #main-content {
    margin-left: 70px;
}

/* Top Bar */
#top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#sidebar-toggle {
    background: transparent !important;
    color: var(--text-secondary) !important;
}

#sidebar-toggle:hover {
    color: var(--text-primary) !important;
}

/* Search */
#global-search {
    position: relative;
}

#global-search .ui.input {
    width: 300px;
}

#global-search input {
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: 8px !important;
}

#global-search input::placeholder {
    color: var(--text-muted);
}

.search-shortcut {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.top-bar-right .ui.button {
    background: transparent !important;
    color: var(--text-secondary) !important;
}

.top-bar-right .ui.button:hover {
    color: var(--text-primary) !important;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    font-size: 0.65rem;
    padding: 2px 5px;
    border-radius: 10px;
}

.user-avatar {
    cursor: pointer;
}

.user-avatar i {
    color: var(--text-secondary);
}

/* Content Area */
#content-area {
    padding: 1.5rem;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.page-header-left h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.page-header-left .subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.page-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* View Toggle */
.view-toggle {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 4px;
}

.view-toggle .ui.button {
    background: transparent !important;
    color: var(--text-secondary) !important;
    padding: 0.5rem !important;
    margin: 0 !important;
    border-radius: 6px !important;
}

.view-toggle .ui.button.active {
    background: var(--bg-secondary) !important;
    color: var(--accent-color) !important;
    box-shadow: 0 1px 3px var(--shadow-color);
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
}

/* System Card */
.system-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.system-card:hover {
    box-shadow: 0 4px 12px var(--shadow-color);
    transform: translateY(-2px);
}

.system-card.needs-attention {
    border-left: 4px solid var(--danger-color);
}

.system-card.warning {
    border-left: 4px solid var(--warning-color);
}

.system-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.system-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.system-icon.hvac { background: #fef3c7; color: #d97706; }
.system-icon.electrical { background: #fce7f3; color: #db2777; }
.system-icon.plumbing { background: #dbeafe; color: #2563eb; }
.system-icon.security { background: #fef3c7; color: #d97706; }
.system-icon.pool { background: #cffafe; color: #0891b2; }
.system-icon.other { background: #e0e7ff; color: #4f46e5; }

.system-info {
    flex: 1;
}

.system-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 2px;
}

.system-category {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.system-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
}

.system-status.operational {
    background: #d1fae5;
    color: #059669;
}

.system-status.warning {
    background: #fef3c7;
    color: #d97706;
}

.system-status.needs-attention {
    background: #fee2e2;
    color: #dc2626;
}

.system-description {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.75rem;
    line-height: 1.4;
}

.system-dates {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.system-dates i {
    margin-right: 0.25rem;
}

/* List View */
.list-view .system-card {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
}

.list-view .system-card-header {
    flex: 1;
}

.list-view .system-description {
    display: none;
}

.list-view .system-dates {
    margin-top: 0;
    margin-left: auto;
}

/* Compact View */
.compact-view .cards-grid {
    grid-template-columns: 1fr;
}

.compact-view .system-card {
    padding: 0.75rem 1rem;
}

.compact-view .system-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
}

.compact-view .system-description,
.compact-view .system-dates {
    display: none;
}

/* Forms in Dark Mode */
.dark-mode .ui.form input,
.dark-mode .ui.form select,
.dark-mode .ui.form textarea {
    background: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: var(--text-primary) !important;
}

.dark-mode .ui.form .field > label {
    color: var(--text-primary);
}

.dark-mode .ui.modal {
    background: var(--card-bg);
}

.dark-mode .ui.modal > .header {
    background: var(--card-bg);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.dark-mode .ui.modal > .content {
    background: var(--card-bg);
    color: var(--text-primary);
}

.dark-mode .ui.modal > .actions {
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

/* Dropdowns in Dark Mode */
.dark-mode .ui.dropdown .menu {
    background: var(--card-bg);
    border-color: var(--border-color);
}

.dark-mode .ui.dropdown .menu > .item {
    color: var(--text-primary) !important;
    border-color: var(--border-color);
}

.dark-mode .ui.dropdown .menu > .item:hover {
    background: var(--sidebar-hover) !important;
}

/* Orange Button */
.ui.orange.button {
    background: var(--accent-color) !important;
}

.ui.orange.button:hover {
    background: var(--accent-hover) !important;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
}

.toast {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 12px var(--shadow-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

.toast.success { border-left: 4px solid var(--success-color); }
.toast.error { border-left: 4px solid var(--danger-color); }
.toast.warning { border-left: 4px solid var(--warning-color); }
.toast.info { border-left: 4px solid #3b82f6; }

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

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Segment in Dark Mode */
.dark-mode .ui.segment {
    background: var(--card-bg);
    border-color: var(--border-color);
}

/* Table in Dark Mode */
.dark-mode .ui.table {
    background: var(--card-bg);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.dark-mode .ui.table thead th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.dark-mode .ui.table td {
    border-color: var(--border-color);
}

.dark-mode .ui.table tr:hover {
    background: var(--sidebar-hover) !important;
}

/* Statistics */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
}

.stat-card .label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    #sidebar {
        transform: translateX(-100%);
    }
    
    #sidebar.visible {
        transform: translateX(0);
    }
    
    #main-content {
        margin-left: 0 !important;
    }
    
    #global-search .ui.input {
        width: 200px;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .search-shortcut {
        display: none;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Fragment Specific Styles */
.fragment-container {
    animation: fadeIn 0.2s ease;
}

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

/* Chat Interface (AI Assistant, WhatsApp) */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.chat-message {
    display: flex;
    margin-bottom: 1rem;
}

.chat-message.outgoing {
    flex-direction: row-reverse;
}

.chat-message .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0.75rem;
}

.chat-message .bubble {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: var(--bg-tertiary);
}

.chat-message.outgoing .bubble {
    background: var(--accent-color);
    color: white;
}

.chat-input {
    display: flex;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    gap: 0.75rem;
}

.chat-input input {
    flex: 1;
}

/* Additional Theme Variables */
:root {
    --hover-bg: rgba(0, 0, 0, 0.04);
    --text-color: var(--text-primary);
    --bg-color: var(--bg-primary);
}

[data-theme="dark"] {
    --hover-bg: rgba(255, 255, 255, 0.08);
    --text-color: var(--text-primary);
    --bg-color: var(--bg-primary);
}

/* Stat Cards for Dashboard */
.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    text-align: center;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
}

.stat-card .label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Dashboard Alerts */
.alerts-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.alerts-section h4 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
}

.alert-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: var(--bg-tertiary);
}

.alert-item.high {
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid var(--danger-color);
}

.alert-item.medium {
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid var(--warning-color);
}

.alert-item.low {
    background: rgba(16, 185, 129, 0.1);
    border-left: 3px solid var(--success-color);
}

.alert-item i {
    margin-right: 0.75rem;
}

/* Occupancy Chart Container */
.chart-container {
    position: relative;
    height: 200px;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Upcoming Services */
.upcoming-list {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.upcoming-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.upcoming-item:last-child {
    border-bottom: none;
}

.upcoming-item:hover {
    background: var(--hover-bg);
}

.upcoming-item .date {
    width: 60px;
    text-align: center;
    padding-right: 1rem;
    border-right: 1px solid var(--border-color);
    margin-right: 1rem;
}

.upcoming-item .date .day {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.upcoming-item .date .month {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.upcoming-item .details {
    flex: 1;
}

.upcoming-item .title {
    font-weight: 600;
    color: var(--text-primary);
}

.upcoming-item .meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Service List */
.service-list .item.service-item {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.service-item .service-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
}

.service-item .content .header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.service-item .content .meta span {
    margin-right: 1rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 10000;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px var(--shadow-color);
    margin-top: 0.5rem;
    animation: slideIn 0.3s ease;
}

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

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

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

.toast.info {
    border-left: 4px solid #3b82f6;
}

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

/* Responsive Adjustments */
@media (max-width: 768px) {
    .messaging-layout,
    .ai-chat-layout {
        grid-template-columns: 1fr;
    }
    
    .conversations-panel,
    .ai-sidebar {
        display: none;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .page-header-right {
        width: 100%;
    }
    
    .view-controls {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .systems-grid {
        grid-template-columns: 1fr;
    }
}

/* Fomantic UI Dark Mode Overrides */
[data-theme="dark"] .ui.segment {
    background: var(--card-bg);
    border-color: var(--border-color);
    box-shadow: none;
}

[data-theme="dark"] .ui.form .field > label {
    color: var(--text-primary);
}

[data-theme="dark"] .ui.input input,
[data-theme="dark"] .ui.form input,
[data-theme="dark"] .ui.form textarea,
[data-theme="dark"] .ui.form select {
    background: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-primary);
}

[data-theme="dark"] .ui.dropdown {
    background: var(--input-bg);
    border-color: var(--input-border);
}

[data-theme="dark"] .ui.dropdown .menu {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .ui.dropdown .menu > .item {
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .ui.dropdown .menu > .item:hover {
    background: var(--hover-bg);
}

[data-theme="dark"] .ui.table {
    background: var(--card-bg);
    color: var(--text-primary);
}

[data-theme="dark"] .ui.table thead th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

[data-theme="dark"] .ui.table td {
    border-color: var(--border-color);
}

[data-theme="dark"] .ui.modal {
    background: var(--card-bg);
}

[data-theme="dark"] .ui.modal > .header {
    background: var(--card-bg);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .ui.modal > .content {
    background: var(--card-bg);
    color: var(--text-primary);
}

[data-theme="dark"] .ui.modal > .actions {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .ui.placeholder .line,
[data-theme="dark"] .ui.placeholder .image.header:after,
[data-theme="dark"] .ui.placeholder .image:after {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .ui.cards > .card,
[data-theme="dark"] .ui.card {
    background: var(--card-bg);
    box-shadow: none;
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .ui.card > .content {
    border-color: var(--border-color);
}

[data-theme="dark"] .ui.list .item {
    color: var(--text-primary);
}
