@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-base: #f3f6fb;
    --bg-mesh-a: rgba(79, 70, 229, 0.1);
    --bg-mesh-b: rgba(14, 165, 233, 0.08);
    --bg-mesh-c: rgba(16, 185, 129, 0.08);
    --bg-mesh-d: rgba(168, 85, 247, 0.06);

    --text-primary: #0f172a;
    --text-muted: #475569;

    --panel-bg: #ffffff;
    --card-bg: #ffffff;
    --border-soft: rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.08);
}

html.dark {
    --bg-base: #0a1020;
    --bg-mesh-a: rgba(99, 102, 241, 0.14);
    --bg-mesh-b: rgba(14, 165, 233, 0.1);
    --bg-mesh-c: rgba(16, 185, 129, 0.08);
    --bg-mesh-d: rgba(168, 85, 247, 0.08);

    --text-primary: #e2e8f0;
    --text-muted: #94a3b8;

    --panel-bg: #0f172a;
    --card-bg: #1e293b;
    --border-soft: rgba(148, 163, 184, 0.22);
    --shadow-soft: 0 14px 34px rgba(2, 6, 23, 0.5);
    --shadow-card: 0 10px 28px rgba(2, 6, 23, 0.45);
}

/* Default: Light Theme */
body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Panels & cards — solid surfaces (Windows/Edge safe) */
.glass-panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
}

.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-card);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.glass-card:hover {
    background: var(--card-bg);
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
}

/* Background Mesh - Light */
.bg-mesh {
    background-color: var(--bg-base);
    background-image:
        radial-gradient(at 0% 0%, var(--bg-mesh-a) 0px, transparent 50%),
        radial-gradient(at 100% 0%, var(--bg-mesh-b) 0px, transparent 50%),
        radial-gradient(at 100% 100%, var(--bg-mesh-c) 0px, transparent 55%),
        radial-gradient(at 0% 100%, var(--bg-mesh-d) 0px, transparent 55%);
}

/* ================= DARK MODE OVERRIDES ================= */
.dark body {
    background-color: var(--bg-base);
    color: var(--text-primary);
}

.dark .glass-panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
}

.dark .glass-card {
    background: var(--card-bg);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-card);
}

html.dark .glass-card:hover {
    background: var(--card-bg);
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: 0 14px 32px rgba(2, 6, 23, 0.45);
}

.dark .bg-mesh {
    background-color: var(--bg-base);
    background-image:
        radial-gradient(at 0% 0%, var(--bg-mesh-a) 0px, transparent 50%),
        radial-gradient(at 100% 0%, var(--bg-mesh-b) 0px, transparent 50%),
        radial-gradient(at 100% 100%, var(--bg-mesh-c) 0px, transparent 55%),
        radial-gradient(at 0% 100%, var(--bg-mesh-d) 0px, transparent 55%);
}

/* Dark mode form/control normalization (Safari + native controls) */
html.dark {
    color-scheme: dark;
}

.dark input,
.dark select,
.dark textarea {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
    border-color: rgba(148, 163, 184, 0.32) !important;
}

.dark input::placeholder,
.dark textarea::placeholder {
    color: #94a3b8 !important;
}

.dark option {
    background-color: #0f172a;
    color: #e2e8f0;
}

/* Table-specific dark mode fixes (independent from Tailwind runtime scan) */
.dark #tasks-table-body tr {
    background-color: rgba(15, 23, 42, 0.58) !important;
}

.dark #tasks-table-body tr:hover {
    background-color: rgba(30, 41, 59, 0.78) !important;
}

.dark #tasks-table-body td,
.dark #tasks-table-body span,
.dark #tasks-table-body button {
    color: #e2e8f0;
}

.dark #tasks-table-body .text-slate-500,
.dark #tasks-table-body .text-slate-600,
.dark #tasks-table-body .text-slate-700 {
    color: #cbd5e1 !important;
}

.dark #tasks-per-page,
.dark #tasks-prev-page,
.dark #tasks-next-page {
    background-color: #1e293b !important;
    border-color: rgba(148, 163, 184, 0.3) !important;
    color: #e2e8f0 !important;
}

.dark #tasks-page-indicator,
.dark #tasks-pagination-info {
    color: #94a3b8 !important;
}

/* Remaining white surfaces on tasks page */
.dark #tasks-table-body tr .bg-slate-100,
.dark #tasks-table-body tr button.bg-slate-100 {
    background-color: #1e293b !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
    color: #e2e8f0 !important;
}

html.dark #tasks-table-body tr td {
    border-color: rgba(148, 163, 184, 0.22) !important;
}

/* Top header + sidebar profile (solid colors for Windows/Edge) */
html {
    color-scheme: light;
}

html.dark {
    color-scheme: dark;
}

.app-top-header {
    background-color: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
}

html.dark .app-top-header {
    background-color: #0f172a;
    border-color: #334155;
    box-shadow: 0 1px 0 rgba(2, 6, 23, 0.45);
}

.app-top-header-title {
    color: #0f172a;
}

html.dark .app-top-header-title {
    color: #f8fafc;
}

.app-header-icon-btn {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

.app-header-icon-btn:hover {
    background-color: #eef2ff;
    border-color: #a5b4fc;
    color: #312e81;
}

html.dark .app-header-icon-btn {
    background-color: #1e293b;
    border-color: #475569;
    color: #cbd5e1;
}

html.dark .app-header-icon-btn:hover {
    background-color: #334155;
    border-color: #6366f1;
    color: #e0e7ff;
}

html.dark #notification-badge {
    box-shadow: 0 0 0 2px #0f172a;
}

.app-notification-dropdown {
    background-color: #ffffff;
    border-color: #e2e8f0;
    color: #0f172a;
}

html.dark .app-notification-dropdown {
    background-color: #0f172a;
    border-color: #475569;
    color: #e2e8f0;
}

.app-notification-dropdown-header {
    border-bottom: 1px solid #e2e8f0;
}

.app-notification-dropdown-title {
    color: #0f172a;
    font-weight: 700;
}

.app-notification-mark-all {
    color: #4338ca;
    font-weight: 600;
}

.app-notification-mark-all:hover {
    color: #312e81;
    text-decoration: underline;
}

html.dark .app-notification-dropdown-header {
    border-bottom-color: #334155;
}

html.dark .app-notification-dropdown-title {
    color: #f8fafc;
}

html.dark .app-notification-mark-all {
    color: #a5b4fc;
}

html.dark .app-notification-mark-all:hover {
    color: #c7d2fe;
}

.app-notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.625rem;
    border-radius: 0.75rem;
    border: 1px solid transparent;
    background-color: #f8fafc;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.app-notification-item:hover {
    background-color: #eef2ff;
    border-color: #c7d2fe;
}

.app-notification-item--unread {
    background-color: #eef2ff;
    border-color: #c7d2fe;
}

.app-notification-item-dot {
    width: 0.5rem;
    height: 0.5rem;
    margin-top: 0.375rem;
    border-radius: 9999px;
    flex-shrink: 0;
    background-color: transparent;
}

.app-notification-item--unread .app-notification-item-dot {
    background-color: #4f46e5;
}

.app-notification-item-text {
    font-size: 0.75rem;
    line-height: 1.35;
    color: #1e293b;
    font-weight: 500;
}

.app-notification-item-time {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.625rem;
    color: #64748b;
}

.app-notification-empty {
    font-size: 0.75rem;
    color: #64748b;
    text-align: center;
    padding: 1rem 0;
}

html.dark .app-notification-item {
    background-color: #1e293b;
}

html.dark .app-notification-item:hover {
    background-color: #334155;
    border-color: #475569;
}

html.dark .app-notification-item--unread {
    background-color: #1e1b4b;
    border-color: #4338ca;
}

html.dark .app-notification-item--unread .app-notification-item-dot {
    background-color: #818cf8;
}

html.dark .app-notification-item-text {
    color: #f1f5f9;
}

html.dark .app-notification-item-time {
    color: #94a3b8;
}

html.dark .app-notification-empty {
    color: #94a3b8;
}

/* Sidebar navigation */
.app-sidebar {
    background-color: #ffffff;
    border-right: 1px solid #e2e8f0;
    box-shadow: var(--shadow-soft);
}

html.dark .app-sidebar {
    background-color: #0f172a;
    border-right-color: #334155;
}

.app-nav-link {
    color: #334155;
}

.app-nav-link:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.app-nav-link-active {
    background-color: #eef2ff !important;
    color: #4338ca !important;
    font-weight: 600;
}

html.dark .app-nav-link {
    color: #cbd5e1;
}

html.dark .app-nav-link:hover {
    background-color: #1e293b;
    color: #f8fafc;
}

html.dark .app-nav-link-active {
    background-color: #1e1b4b !important;
    color: #a5b4fc !important;
}

.app-sidebar-profile {
    background-color: #f8fafc;
    border-color: #e2e8f0;
    color: #0f172a;
}

html.dark .app-sidebar-profile {
    background-color: #1e293b;
    border-color: #475569;
    color: #f1f5f9;
}

.app-sidebar-profile-email {
    color: #64748b;
}

html.dark .app-sidebar-profile-email {
    color: #94a3b8;
}

.app-sidebar-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 700;
}

.app-sidebar-profile-btn {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    color: #334155;
}

.app-sidebar-profile-btn:hover {
    background-color: #eef2ff;
    border-color: #c7d2fe;
    color: #312e81;
}

html.dark .app-sidebar-profile-btn {
    background-color: #0f172a;
    border-color: #475569;
    color: #e2e8f0;
}

html.dark .app-sidebar-profile-btn:hover {
    background-color: #1e293b;
    border-color: #6366f1;
    color: #e0e7ff;
}

/* Legacy sidebar slate overrides (other nav items) */
.dark #sidebar .bg-slate-100:not(.app-sidebar-profile):not(.app-sidebar-profile-btn) {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
}

.dark #sidebar .text-slate-500,
.dark #sidebar .text-slate-600,
.dark #sidebar .text-slate-700 {
    color: #cbd5e1 !important;
}

/* Kanban dynamic card text fixes */
.dark .kanban-card-title {
    color: #f1f5f9 !important;
}

.dark .kanban-card-desc {
    color: #cbd5e1 !important;
}

.dark .kanban-card-assignee,
.dark .kanban-card-date {
    color: #cbd5e1 !important;
}

.dark .kanban-card-icon {
    color: #cbd5e1 !important;
}

.dark .kanban-card-icon:hover {
    color: #ffffff !important;
}

/* Global text contrast fixes for dark mode */
.dark main .text-slate-900 {
    color: #f8fafc !important;
}

.dark main .text-slate-800 {
    color: #e2e8f0 !important;
}

.dark main .text-slate-700 {
    color: #cbd5e1 !important;
}

.dark main .text-slate-600 {
    color: #b6c2d2 !important;
}

.dark main .text-slate-500 {
    color: #94a3b8 !important;
}

.dark main .text-slate-400 {
    color: #94a3b8 !important;
}

/* Generic fallback for elements without explicit dark classes */
.dark main h1,
.dark main h2,
.dark main h3,
.dark main h4,
.dark main h5,
.dark main h6 {
    color: #e2e8f0;
}

/* Dashboard dynamic rows readability */
.dark .dashboard-my-task-row {
    background-color: rgba(30, 41, 59, 0.82) !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
}

.dark .dashboard-my-task-title {
    color: #f1f5f9 !important;
}

.dark .dashboard-my-task-date {
    color: #cbd5e1 !important;
}

.dark .dashboard-my-task-priority {
    color: #fbbf24 !important;
}

.dark .dashboard-my-task-meta .text-slate-500 {
    color: #cbd5e1 !important;
}

.dark .dashboard-activity-row {
    background-color: rgba(30, 41, 59, 0.82) !important;
    border-color: rgba(148, 163, 184, 0.24) !important;
}

.dark .dashboard-activity-row p {
    color: #cbd5e1 !important;
}

.dark .dashboard-activity-row span {
    color: #94a3b8 !important;
}

.dark .dashboard-status-badge {
    background-color: #334155 !important;
    color: #e2e8f0 !important;
}

/* Inbox — solid colors for Windows / Edge (avoid opacity + blanket overrides) */
#inbox-list-panel {
    color-scheme: light;
}

html.dark #inbox-list-panel {
    color-scheme: dark;
}

.inbox-mail-row--unread {
    background-color: #eef2ff;
    border-color: #c7d2fe;
}

.inbox-mail-row--read {
    background-color: #ffffff;
    border-color: #e2e8f0;
}

.inbox-mail-row--assigned-mine {
    background-color: #ecfdf5;
    border-color: #6ee7b7;
}

.inbox-mail-row--assigned-other {
    background-color: #fffbeb;
    border-color: #fcd34d;
}

html.dark .inbox-mail-row--unread {
    background-color: #1e1b4b;
    border-color: #4338ca;
}

html.dark .inbox-mail-row--read {
    background-color: #1e293b;
    border-color: #475569;
}

html.dark .inbox-mail-row--assigned-mine {
    background-color: #064e3b;
    border-color: #059669;
}

html.dark .inbox-mail-row--assigned-other {
    background-color: #451a03;
    border-color: #b45309;
}

#inbox-list .inbox-mail-row p,
#inbox-list .inbox-mail-row span {
    color: #334155;
}

html.dark #inbox-list .inbox-mail-row p,
html.dark #inbox-list .inbox-mail-row span {
    color: #e2e8f0;
}

#inbox-list .inbox-mail-row .text-slate-500,
#inbox-list .inbox-mail-row .text-slate-600,
#inbox-list .inbox-mail-row .text-slate-700,
#inbox-list .inbox-mail-row .text-slate-800 {
    color: #475569;
}

html.dark #inbox-list .inbox-mail-row .text-slate-500,
html.dark #inbox-list .inbox-mail-row .text-slate-600,
html.dark #inbox-list .inbox-mail-row .text-slate-700,
html.dark #inbox-list .inbox-mail-row .text-slate-800 {
    color: #cbd5e1;
}

.inbox-assignee-select {
    appearance: auto;
    -webkit-appearance: menulist;
    background-color: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
    min-height: 2.25rem;
}

html.dark .inbox-assignee-select {
    background-color: #0f172a;
    color: #e2e8f0;
    border-color: #475569;
}

.inbox-assignee-select option {
    background-color: #ffffff;
    color: #0f172a;
}

html.dark .inbox-assignee-select option {
    background-color: #0f172a;
    color: #e2e8f0;
}

#inbox-list .inbox-row-main:hover {
    background-color: #f1f5f9;
}

html.dark #inbox-list .inbox-row-main:hover {
    background-color: #334155;
}

#inbox-list .inbox-row-main--active {
    outline: 1px solid #818cf8;
    outline-offset: 1px;
    background-color: #f8fafc;
}

html.dark #inbox-list .inbox-row-main--active {
    outline-color: #6366f1;
    background-color: #334155;
}

#inbox-list .inbox-delete-btn {
    background-color: #fff1f2;
    color: #be123c;
    border-color: #fecdd3;
}

#inbox-list .inbox-delete-btn:hover {
    background-color: #ffe4e6;
    color: #9f1239;
}

html.dark #inbox-list .inbox-delete-btn {
    background-color: #7f1d1d;
    color: #fecdd3;
    border-color: #fb7185;
}

html.dark #inbox-list .inbox-delete-btn:hover {
    background-color: #991b1b;
    color: #ffe4e6;
}

/* FullCalendar theme */
#full-calendar .fc {
    font-family: 'Outfit', sans-serif;
}

#full-calendar .fc-toolbar-title {
    font-size: 1.05rem;
    font-weight: 700;
}

#full-calendar .fc-button {
    border-radius: 0.6rem !important;
    border: 1px solid rgba(148, 163, 184, 0.28) !important;
    background: rgba(241, 245, 249, 0.85) !important;
    color: #334155 !important;
    text-transform: none !important;
    box-shadow: none !important;
}

#full-calendar .fc-button-active {
    background: rgba(99, 102, 241, 0.18) !important;
    color: #4f46e5 !important;
}

#full-calendar .fc-theme-standard td,
#full-calendar .fc-theme-standard th,
#full-calendar .fc-theme-standard .fc-scrollgrid {
    border-color: rgba(148, 163, 184, 0.26) !important;
}

#full-calendar .fc-daygrid-day-number {
    color: #334155;
}

#full-calendar .fc-col-header-cell-cushion {
    color: #475569;
}

#full-calendar .fc-list-day-cushion {
    background: rgba(241, 245, 249, 0.8) !important;
}

#full-calendar .fc-list-event:hover td {
    background: rgba(99, 102, 241, 0.08) !important;
}

.dark #full-calendar .fc-button {
    background: #1e293b !important;
    color: #cbd5e1 !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
}

.dark #full-calendar .fc-button-active {
    background: rgba(99, 102, 241, 0.28) !important;
    color: #e0e7ff !important;
}

.dark #full-calendar .fc-toolbar-title,
.dark #full-calendar .fc-col-header-cell-cushion,
.dark #full-calendar .fc-daygrid-day-number,
.dark #full-calendar .fc-list-day-text,
.dark #full-calendar .fc-list-day-side-text {
    color: #cbd5e1 !important;
}

.dark #full-calendar .fc-theme-standard td,
.dark #full-calendar .fc-theme-standard th,
.dark #full-calendar .fc-theme-standard .fc-scrollgrid {
    border-color: rgba(148, 163, 184, 0.2) !important;
}

.dark #full-calendar .fc-list-day-cushion {
    background: rgba(30, 41, 59, 0.72) !important;
}

.dark #full-calendar .fc-list-event td,
.dark #full-calendar .fc-list-table td {
    background: rgba(15, 23, 42, 0.55) !important;
    color: #e2e8f0 !important;
}

.dark #full-calendar .fc-list-event:hover td {
    background: rgba(51, 65, 85, 0.62) !important;
}

#full-calendar .calendar-company-event {
    border-width: 1px !important;
    border-style: solid !important;
    border-radius: 0.45rem !important;
    padding: 0.1rem 0.25rem !important;
}

#full-calendar .calendar-company-event .calendar-month-item {
    line-height: 1.25;
}

#calendar-sorted-list button + button {
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

html.dark #calendar-sorted-list button + button {
    border-top-color: rgba(51, 65, 85, 0.8);
}

#full-calendar .calendar-day-disabled {
    background: rgba(148, 163, 184, 0.08);
}

#full-calendar .calendar-day-disabled .fc-daygrid-day-number {
    opacity: 0.45;
}

#full-calendar .calendar-day-disabled .fc-daygrid-day-events {
    opacity: 0.55;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.05);
}

.dark ::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Kanban Drag & Drop Styles */
.sortable-ghost {
    opacity: 0.4;
    transform: scale(0.95);
    background: rgba(99, 102, 241, 0.1) !important;
    border: 2px dashed rgba(99, 102, 241, 0.4) !important;
}

.sortable-chosen {
    transform: rotate(2deg);
}

.sortable-drag {
    opacity: 0.9;
}

/* Tab Transitions */
.tab-content {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tab-content.active {
    display: block;
    opacity: 1;
    animation: fadeIn 0.4s ease-out;
}

/* Neon Glows */
.glow-primary {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

.glow-success {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}

/* Pulse for active tasks */
@keyframes softPulse {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

.pulse-primary {
    animation: softPulse 2s infinite;
}

/* ========== Site-wide Windows / Edge readability ========== */

/* Light mode: stronger text on white surfaces */
main .text-slate-400 {
    color: #64748b;
}

main .text-slate-500 {
    color: #475569;
}

main .text-slate-600 {
    color: #334155;
}

main .text-slate-700 {
    color: #1e293b;
}

main .text-slate-800 {
    color: #0f172a;
}

main input:not([type="checkbox"]):not([type="radio"]),
main select,
main textarea {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

html.dark main input:not([type="checkbox"]):not([type="radio"]),
html.dark main select,
html.dark main textarea {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
    border-color: #475569 !important;
}

main input::placeholder,
main textarea::placeholder {
    color: #64748b;
}

/* Dashboard dynamic blocks — light */
.dashboard-activity-row {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
}

.dashboard-activity-row p {
    color: #1e293b;
}

.dashboard-activity-row span {
    color: #64748b;
}

.dashboard-my-task-row {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
}

.dashboard-my-task-title {
    color: #0f172a;
}

.dashboard-my-task-date {
    color: #64748b;
}

.dashboard-activity-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.dashboard-activity-icon--success {
    background-color: #ecfdf5;
    color: #047857;
}

.dashboard-activity-icon--warning {
    background-color: #fffbeb;
    color: #b45309;
}

.dashboard-activity-icon--info {
    background-color: #eef2ff;
    color: #4338ca;
}

html.dark .dashboard-activity-icon--success {
    background-color: #064e3b;
    color: #6ee7b7;
}

html.dark .dashboard-activity-icon--warning {
    background-color: #451a03;
    color: #fcd34d;
}

html.dark .dashboard-activity-icon--info {
    background-color: #1e1b4b;
    color: #a5b4fc;
}

.dashboard-status-badge--todo {
    background-color: #f1f5f9;
    color: #334155;
}

.dashboard-status-badge--progress {
    background-color: #fffbeb;
    color: #b45309;
}

.dashboard-status-badge--review {
    background-color: #eef2ff;
    color: #4338ca;
}

.dashboard-status-badge--done {
    background-color: #ecfdf5;
    color: #047857;
}

html.dark .dashboard-status-badge--todo {
    background-color: #334155;
    color: #e2e8f0;
}

html.dark .dashboard-status-badge--progress {
    background-color: #451a03;
    color: #fcd34d;
}

html.dark .dashboard-status-badge--review {
    background-color: #1e1b4b;
    color: #a5b4fc;
}

html.dark .dashboard-status-badge--done {
    background-color: #064e3b;
    color: #6ee7b7;
}

/* Kanban columns */
.kanban-column-panel {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
}

html.dark .kanban-column-panel {
    background-color: #1e293b;
    border-color: #475569;
}

.kanban-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
}

html.dark .kanban-card {
    background-color: #1e293b;
    border-color: #475569;
}

/* Modals */
.app-modal-overlay {
    background-color: rgba(15, 23, 42, 0.45);
}

html.dark .app-modal-overlay {
    background-color: rgba(2, 6, 23, 0.65);
}

.app-modal-panel {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    color: #0f172a;
}

html.dark .app-modal-panel {
    background-color: #0f172a;
    border-color: #475569;
    color: #e2e8f0;
}

/* Stat icon chips (dashboard) */
.stat-icon-chip--indigo {
    background-color: #eef2ff;
    color: #4338ca;
}

.stat-icon-chip--amber {
    background-color: #fffbeb;
    color: #b45309;
}

.stat-icon-chip--emerald {
    background-color: #ecfdf5;
    color: #047857;
}

.stat-icon-chip--rose {
    background-color: #fff1f2;
    color: #be123c;
}

html.dark .stat-icon-chip--indigo {
    background-color: #1e1b4b;
    color: #a5b4fc;
}

html.dark .stat-icon-chip--amber {
    background-color: #451a03;
    color: #fcd34d;
}

html.dark .stat-icon-chip--emerald {
    background-color: #064e3b;
    color: #6ee7b7;
}

html.dark .stat-icon-chip--rose {
    background-color: #4c0519;
    color: #fda4af;
}

/* FullCalendar — solid buttons (light) */
#full-calendar .fc-button {
    background: #f8fafc !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
}

#full-calendar .fc-button-active {
    background: #eef2ff !important;
    color: #4338ca !important;
}

#full-calendar .fc-list-day-cushion {
    background: #f1f5f9 !important;
}

/* ========== Tables, labels, badges (Windows — Tailwind dark: may not apply) ========== */

.app-data-table thead tr,
.glass-panel table thead tr,
.glass-card table thead tr {
    background-color: #f1f5f9 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.app-data-table thead th,
.glass-panel table thead tr th,
.glass-card table thead tr th {
    color: #334155 !important;
    font-weight: 600 !important;
}

.app-data-table tbody,
.glass-panel table tbody,
.glass-card table tbody {
    color: #1e293b;
}

.app-table-footer {
    background-color: #ffffff !important;
    border-top: 1px solid #e2e8f0 !important;
    color: #475569 !important;
}

.app-table-footer span,
.app-table-footer label {
    color: #475569 !important;
}

.app-table-footer select,
.app-table-footer button {
    background-color: #ffffff !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
}

.app-table-footer button:hover:not(:disabled) {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

html.dark .app-data-table thead tr,
html.dark .glass-panel table thead tr,
html.dark .glass-card table thead tr {
    background-color: #1e293b !important;
    border-bottom-color: #475569 !important;
}

html.dark .app-data-table thead th,
html.dark .glass-panel table thead tr th,
html.dark .glass-card table thead tr th {
    color: #e2e8f0 !important;
}

html.dark .app-data-table tbody,
html.dark .glass-panel table tbody,
html.dark .glass-card table tbody {
    color: #e2e8f0;
}

html.dark .app-table-footer {
    background-color: #1e293b !important;
    border-top-color: #475569 !important;
    color: #cbd5e1 !important;
}

html.dark .app-table-footer span,
html.dark .app-table-footer label {
    color: #cbd5e1 !important;
}

html.dark .app-table-footer select,
html.dark .app-table-footer button {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
    border-color: #475569 !important;
}

html.dark #tasks-table-body tr {
    background-color: #0f172a !important;
}

html.dark #tasks-table-body tr:hover {
    background-color: #1e293b !important;
}

/* Form labels */
.form-label,
label.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155 !important;
    margin-bottom: 0.25rem;
}

html.dark .form-label,
html.dark label.form-label {
    color: #cbd5e1 !important;
}

/* Company cards */
.company-iban-badge {
    display: inline-block;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    padding: 0.125rem 0.5rem;
    font-size: 0.625rem;
    border-radius: 0.375rem;
    background-color: #eef2ff;
    color: #312e81;
    border: 1px solid #c7d2fe;
}

html.dark .company-iban-badge {
    background-color: #1e1b4b;
    color: #e0e7ff;
    border-color: #4338ca;
}

.btn-card-edit {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    background-color: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}

.btn-card-edit:hover {
    background-color: #e0e7ff;
    color: #312e81;
}

.btn-card-delete {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    background-color: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
}

.btn-card-delete:hover {
    background-color: #ffe4e6;
    color: #9f1239;
}

html.dark .btn-card-edit {
    background-color: #1e1b4b;
    color: #a5b4fc;
    border-color: #4338ca;
}

html.dark .btn-card-delete {
    background-color: #4c0519;
    color: #fda4af;
    border-color: #fb7185;
}

/* Proforma company panel */
.proforma-company-panel {
    padding: 1rem;
    border-radius: 0.75rem;
    background-color: #eef2ff;
    border: 1px solid #c7d2fe;
}

.proforma-company-panel h3 {
    color: #3730a3 !important;
    font-weight: 600;
}

.proforma-company-panel > p,
.proforma-company-panel .text-xs {
    color: #475569 !important;
}

.proforma-company-panel label {
    color: #334155 !important;
    font-weight: 500;
}

html.dark .proforma-company-panel {
    background-color: #1e1b4b;
    border-color: #4338ca;
}

html.dark .proforma-company-panel h3 {
    color: #c7d2fe !important;
}

html.dark .proforma-company-panel > p,
html.dark .proforma-company-panel .text-xs {
    color: #cbd5e1 !important;
}

html.dark .proforma-company-panel label {
    color: #e2e8f0 !important;
}

/* Filter section title */
.filter-section-title {
    color: #0f172a !important;
    font-weight: 600;
}

html.dark .filter-section-title {
    color: #f1f5f9 !important;
}

/* Secondary action button (Temizle etc.) */
.btn-secondary-neutral {
    background-color: #f1f5f9 !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
    font-weight: 500;
}

.btn-secondary-neutral:hover {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
}

html.dark .btn-secondary-neutral {
    background-color: #334155 !important;
    color: #e2e8f0 !important;
    border-color: #475569 !important;
}

/* Task table body rows */
#tasks-table-body tr.tasks-table-row {
    background-color: #ffffff !important;
}

#tasks-table-body tr.tasks-table-row:hover {
    background-color: #f8fafc !important;
}

#tasks-table-body tr.tasks-table-row--mine {
    background-color: #eef2ff !important;
}

#tasks-table-body td {
    color: #1e293b;
}

#tasks-table-body .text-slate-500 {
    color: #64748b !important;
}

#tasks-table-body .text-slate-700,
#tasks-table-body .text-slate-800 {
    color: #1e293b !important;
}

.table-action-btn {
    padding: 0.5rem;
    border-radius: 0.5rem;
    background-color: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
}

.table-action-btn:hover {
    background-color: #eef2ff !important;
    color: #4338ca !important;
}

html.dark #tasks-table-body tr.tasks-table-row {
    background-color: #0f172a !important;
}

html.dark #tasks-table-body tr.tasks-table-row:hover {
    background-color: #1e293b !important;
}

html.dark #tasks-table-body tr.tasks-table-row--mine {
    background-color: #1e1b4b !important;
}

html.dark #tasks-table-body td,
html.dark #tasks-table-body .text-slate-700,
html.dark #tasks-table-body .text-slate-800 {
    color: #e2e8f0 !important;
}

html.dark .table-action-btn {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

/* App buttons — visible on Windows (Tailwind opacity/dark: unreliable) */
.app-btn-primary {
    background-color: #4f46e5 !important;
    color: #ffffff !important;
    border: 1px solid #4338ca !important;
    font-weight: 600;
}

.app-btn-primary:hover:not(:disabled) {
    background-color: #4338ca !important;
    color: #ffffff !important;
}

.app-btn-secondary {
    background-color: #ffffff !important;
    color: #334155 !important;
    border: 1px solid #94a3b8 !important;
    font-weight: 600;
}

.app-btn-secondary:hover:not(:disabled) {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #64748b !important;
}

.app-btn-secondary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

html.dark .app-btn-secondary {
    background-color: #475569 !important;
    color: #f8fafc !important;
    border-color: #94a3b8 !important;
}

html.dark .app-btn-secondary:hover:not(:disabled) {
    background-color: #64748b !important;
    color: #ffffff !important;
    border-color: #cbd5e1 !important;
}

.app-btn-filter-active {
    background-color: #d1fae5 !important;
    color: #047857 !important;
    border: 1px solid #6ee7b7 !important;
    font-weight: 600;
}

html.dark .app-btn-filter-active {
    background-color: #064e3b !important;
    color: #6ee7b7 !important;
    border-color: #059669 !important;
}

.inbox-toolbar {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

html.dark .inbox-toolbar {
    background-color: #1e293b !important;
    border-bottom-color: #475569 !important;
}

.inbox-toolbar h2 {
    color: #0f172a !important;
}

html.dark .inbox-toolbar h2 {
    color: #f8fafc !important;
}

#inbox-list-panel .inbox-pagination {
    background-color: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
}

html.dark #inbox-list-panel .inbox-pagination {
    background-color: #1e293b !important;
    border-top-color: #475569 !important;
}

#inbox-list-panel .inbox-pagination button {
    background-color: #ffffff !important;
    color: #334155 !important;
    border: 1px solid #94a3b8 !important;
    font-weight: 500;
}

html.dark #inbox-list-panel .inbox-pagination button {
    background-color: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #64748b !important;
}

#inbox-list-panel .inbox-pagination #inbox-page-info {
    color: #475569 !important;
}

html.dark #inbox-list-panel .inbox-pagination #inbox-page-info {
    color: #cbd5e1 !important;
}

/* ===== App shell — responsive / düşük çözünürlük ===== */
.app-shell {
    max-width: 100vw;
}

.app-main {
    min-width: 0;
}

.app-sidebar-width {
    width: 16rem;
    max-width: 16rem;
}

.app-top-header-bar {
    height: 4.5rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (max-width: 1366px) {
    .app-sidebar-width {
        width: 13.5rem;
        max-width: 13.5rem;
    }

    #sidebar .h-20 {
        height: 3.75rem;
        padding-left: 0.875rem;
        padding-right: 0.875rem;
    }

    #sidebar nav {
        padding: 0.625rem;
    }

    #sidebar .nav-link {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        font-size: 0.8125rem;
    }

    #sidebar .nav-link i {
        font-size: 0.875rem;
    }

    #sidebar .text-xl {
        font-size: 1.05rem;
    }

    .app-top-header-bar {
        height: 3.75rem;
    }

    .app-main-content {
        padding: 0.75rem !important;
    }
}

@media (max-width: 1280px) {
    .app-sidebar-width {
        width: 12.5rem;
        max-width: 12.5rem;
    }

    #sidebar .w-10.h-10 {
        width: 2rem;
        height: 2rem;
    }

    #sidebar .p-4.border-t {
        padding: 0.625rem;
    }

    .app-sidebar-profile .w-10.h-10,
    .app-sidebar-avatar-fallback {
        width: 2rem !important;
        height: 2rem !important;
        font-size: 0.75rem;
    }
}

@media (min-width: 1024px) {
    .app-top-header-bar {
        height: 5rem;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* ===== Takvim sayfası responsive ===== */
.calendar-page {
    max-width: 100%;
    overflow: hidden;
}

.calendar-page-controls {
    min-width: 0;
}

.calendar-grid-scroll {
    -webkit-overflow-scrolling: touch;
}

#full-calendar .fc-toolbar {
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem !important;
}

#full-calendar .fc-toolbar-chunk {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

#full-calendar .fc-daygrid-day-frame {
    min-height: 4.5rem;
}

#full-calendar .calendar-month-item {
    font-size: 0.6875rem;
    line-height: 1.2;
    overflow: hidden;
}

#full-calendar .calendar-month-item .truncate {
    max-width: 100%;
}

#full-calendar .fc-daygrid-event {
    margin-top: 1px !important;
    margin-bottom: 1px !important;
}

.calendar-sorted-list button {
    min-width: 0;
}

@media (max-width: 1366px) {
    #full-calendar .fc-toolbar-title {
        font-size: 0.9375rem;
    }

    #full-calendar .fc-button {
        padding: 0.2rem 0.45rem !important;
        font-size: 0.75rem !important;
    }

    #full-calendar .fc-col-header-cell-cushion,
    #full-calendar .fc-daygrid-day-number {
        font-size: 0.75rem;
        padding: 0.25rem !important;
    }

    #full-calendar .fc-daygrid-day-frame {
        min-height: 3.75rem;
    }

    #full-calendar .calendar-month-item {
        font-size: 0.625rem;
    }

    .calendar-card-table {
        min-width: 640px !important;
        font-size: 0.8125rem;
    }
}

@media (max-width: 1280px) {
    .calendar-card-table .calendar-col-company,
    .calendar-card-table .calendar-col-order {
        display: none;
    }

    .calendar-card-table {
        min-width: 520px !important;
    }

    #full-calendar .fc-daygrid-day-frame {
        min-height: 3.25rem;
    }
}

@media (max-width: 1024px) {
    .calendar-card-table .calendar-col-status {
        display: none;
    }

    .calendar-card-table {
        min-width: 420px !important;
    }

    .calendar-grid.min-w-\[640px\] {
        min-width: 580px;
    }
}

@media (max-height: 800px) {
    .app-top-header-bar {
        height: 3.5rem;
    }

    .calendar-sorted-list {
        max-height: 10rem !important;
    }

    #full-calendar .fc-daygrid-day-frame {
        min-height: 3rem;
    }
}
