/* =============================
   HOME TAB SPECIFIC STYLES
   ============================= */

.home-main-layout {
    display: flex;
    height: calc(100vh - 120px);
    gap: 24px;
    background: linear-gradient(120deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(44,62,80,0.08);
    padding: 24px;
}

.home-main-layout .left-panels {
    display: flex;
    flex-direction: column;
    width: 320px;
    min-width: 220px;
    max-width: 400px;
    gap: 0; /* Removed gap between panels */
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(44,62,80,0.06);
    padding: 0 0 16px 0;
}

.home-main-layout .quickstats-panel,
.home-main-layout .upcoming-tasks-panel {
    background: transparent;
    box-shadow: 0 4px 24px rgba(44,62,80,0.08);
    border-radius: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    position: relative; /* For absolute positioning of buttons */
}

/* Make quickstats panel auto-size to content */
.home-main-layout .quickstats-panel {
    flex: 0 0 auto;
}

/* Make tasks panel fill remaining space */
.home-main-layout .upcoming-tasks-panel {
    flex: 1 1 0;
}

.home-main-layout .quickstats-panel .stat-cards {
    padding: 12px 12px 0 12px; /* Reduced from 16px 16px 0 16px */
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px; /* Reduced from 12px */
}

/* Header styles inherited from headers.css */

/* Task button styling within header */
.home-main-layout .section-header .btn.primary.small {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-left: auto;
    width: auto !important;
    min-width: auto !important;
    max-width: fit-content !important;
    flex-shrink: 0;
    white-space: nowrap;
}
.home-main-layout .section-header .btn.primary.small:hover {
    background: #217dbb;
}

/* Ensure no white line under Tasks header text */
.home-main-layout .section-header h3 {
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* Additional override for Tasks header specifically */
.home-main-layout .upcoming-tasks-panel .section-header {
    border-bottom: none !important;
    padding: 16px 16px 8px 16px; /* Add padding to tasks header */
    border-top: 1px solid #e9ecef; /* Add subtle separator line */
    margin: 0; /* Remove any margin */
}

.home-main-layout .upcoming-tasks-panel .section-header h3 {
    border-bottom: none !important;
    text-decoration: none !important;
}

.home-main-layout .upcoming-tasks-panel .task-management-controls {
    padding: 0 16px 8px 16px; /* Reduced top padding since header has separation */
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.home-main-layout .upcoming-tasks-list {
    padding: 0 16px 16px 16px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.home-main-layout .calendar-panel {
    flex: 1 1 0;
    min-width: 0;
    background: #fff;
    border-radius: 8px;
    margin: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.10);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: visible;
    padding: 0;
    position: relative; /* For consistency */
}

.home-main-layout .cash-forecast-panel {
    flex: 0 0 300px;
    margin: 0 16px 16px 16px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 240px;
}

.home-main-layout .cash-forecast-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: rgba(248, 250, 252, 0.9);
}

.home-main-layout .cash-forecast-header h3 {
    margin: 0;
    color: #0f172a;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.home-main-layout .cash-forecast-header p {
    margin: 4px 0 0 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
}

.home-main-layout .cash-forecast-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(110px, 1fr));
    gap: 8px;
    min-width: 360px;
}

.home-main-layout .cash-forecast-kpi {
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}

.home-main-layout .cash-forecast-kpi .kpi-label {
    display: block;
    color: #64748b;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 3px;
}

.home-main-layout .cash-forecast-kpi strong {
    color: #0f172a;
    font-size: 14px;
}

.home-main-layout .cash-forecast-kpi strong.cash-negative,
.home-main-layout .cash-forecast-table .cash-negative {
    color: #b91c1c;
}

.home-main-layout .cash-forecast-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.home-main-layout .cash-forecast-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
}

.home-main-layout .cash-forecast-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f1f5f9;
    color: #334155;
    text-align: right;
    padding: 9px 10px;
    border-bottom: 1px solid #cbd5e1;
    font-weight: 800;
    white-space: nowrap;
}

.home-main-layout .cash-forecast-table th:first-child,
.home-main-layout .cash-forecast-table th:last-child {
    text-align: left;
}

.home-main-layout .cash-forecast-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e2e8f0;
    text-align: right;
    color: #1f2937;
    white-space: nowrap;
}

.home-main-layout .cash-forecast-table td:first-child,
.home-main-layout .cash-forecast-table td:last-child {
    text-align: left;
}

.home-main-layout .cash-forecast-table tr:hover td {
    background: #f8fafc;
}

.home-main-layout .cash-forecast-table .forecast-warning {
    color: #92400e;
    white-space: normal;
    min-width: 220px;
}

.home-main-layout .cash-forecast-table .forecast-ok {
    color: #15803d;
}

@media (max-width: 1320px) {
    .home-main-layout .cash-forecast-header {
        flex-direction: column;
    }

    .home-main-layout .cash-forecast-kpis {
        width: 100%;
        min-width: 0;
    }
}

/* Calendar panel styling - header handled by unified system */

/* Calendar container needs to fill remaining space */
.home-main-layout .calendar-container {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0 16px 4px 16px;
    height: 100%;
    overflow: hidden;
}

/* Main calendar needs to fill all available space */
.home-main-layout #main-calendar {
    flex: 1 1 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

/* FullCalendar specific height adjustments */
.home-main-layout .fc {
    height: 100% !important;
    min-height: 0;
    overflow: hidden !important;
}

.home-main-layout .fc-view-harness {
    min-height: 0;
    height: 100% !important;
}

/* Target the internal scroller to prevent its scrollbars */
.home-main-layout .fc-scroller {
    overflow: hidden !important;
    height: 100% !important;
}

/* Allow time grid views to scroll naturally */
.home-main-layout .fc-timegrid-body .fc-scroller,
.home-main-layout .fc-timegrid .fc-scroller {
    overflow: auto !important;
    max-height: 65vh;
}

.home-main-layout .fc-daygrid {
    height: 100% !important;
}

.home-main-layout .fc-scrollgrid {
    height: 100% !important;
}

.home-main-layout .fc-scrollgrid-sync-table {
    height: 100% !important;
}

/* Force FullCalendar day cells to expand to fill height */
.home-main-layout .fc-daygrid-body {
    height: 100% !important;
}

.home-main-layout .fc-daygrid-body-balanced .fc-daygrid-body-shrinker {
    height: 100% !important;
}

.home-main-layout .fc-daygrid-body-natural .fc-scrollgrid-sync-inner {
    height: 100% !important;
}

.home-main-layout .fc-scrollgrid-sync-table tbody {
    height: 100% !important;
}

.home-main-layout .fc-daygrid-day-frame {
    min-height: 0 !important;
    height: 100% !important;
}

.home-main-layout .fc-daygrid-day-top {
    height: 100% !important;
}

/* Reduce event sizes to fit more items */
.home-main-layout .fc-daygrid-day-events {
    margin-top: 2px;
    min-height: 0;
    max-height: 32px;
    overflow: hidden;
}

.home-main-layout .fc-daygrid-event-harness {
    margin-top: 2px;
}

.home-main-layout .fc-daygrid-event,
.home-main-layout .fc-timegrid-event {
    border-radius: 4px;
}

.home-main-layout .fc-daygrid-event {
    padding: 2px 4px;
    font-size: 11px;
    line-height: 1.1;
}

.home-main-layout .fc-daygrid-event .fc-event-title,
.home-main-layout .fc-daygrid-event .fc-event-time {
    font-size: 11px;
    line-height: 1.1;
}

.home-main-layout .fc-timegrid-event .fc-event-title,
.home-main-layout .fc-timegrid-event .fc-event-time {
    font-size: 11px;
    line-height: 1.1;
}

.home-main-layout .fc-timegrid-slot-label {
    font-size: 10px;
}

 .home-main-layout .calendar-controls-row {
    display: flex;
    align-items: center;
     justify-content: flex-start;
    gap: 12px;
    margin: 10px 0 6px 0;
    padding: 0 12px;
    flex-shrink: 0;
}

.home-main-layout .calendar-view-controls {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    position: relative;
    z-index: 10;
}

/* Calendar header navigation */
.home-main-layout .calendar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0;
    flex-shrink: 0;
    background: none;
    margin-left: auto;
    margin-right: auto;
}

.home-main-layout .calendar-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2c3e50;
    background: linear-gradient(90deg, #f8f9fa 60%, #e9ecef 100%);
    border-radius: 18px;
    padding: 4px 16px;
    box-shadow: 0 2px 8px rgba(44,62,80,0.08);
    letter-spacing: 0.5px;
    text-align: center;
    min-width: 120px;
    margin: 0 8px;
    display: inline-block;
    transition: background 0.2s, color 0.2s;
}

.home-main-layout .calendar-header .nav-btn {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #3498db;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(44,62,80,0.10);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    outline: none;
}
.home-main-layout .calendar-header .nav-btn:hover, .home-main-layout .calendar-header .nav-btn:focus {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(52,152,219,0.18);
}

/* Custom calendar grid (no third-party) */
.home-main-layout .custom-calendar {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.home-main-layout .calendar-grid {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.home-main-layout .calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    border: 1px solid #e1e5ea;
    border-bottom: none;
    background: #f9fbfd;
    flex: 0 0 auto;
}

.home-main-layout .calendar-weekday {
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    padding: 6px 4px;
    color: #2c3e50;
    border-right: 1px solid #e1e5ea;
}

.home-main-layout .calendar-weekday:last-child {
    border-right: none;
}

.home-main-layout .calendar-cells {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, minmax(0, 1fr));
    flex: 1 1 0;
    min-height: 0;
    border: 1px solid #e1e5ea;
}

.home-main-layout .week-cells {
    grid-template-rows: repeat(1, minmax(0, 1fr));
}

.home-main-layout .calendar-cell {
    border-right: 1px solid #e1e5ea;
    border-bottom: 1px solid #e1e5ea;
    padding: 4px 6px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.home-main-layout .calendar-cell:nth-child(7n) {
    border-right: none;
}

.home-main-layout .calendar-cell:last-child,
.home-main-layout .calendar-cell:nth-last-child(-n + 7) {
    border-bottom: none;
}

.home-main-layout .calendar-cell.outside-month {
    background: #f6f7f9;
    color: #9aa3ad;
}

.home-main-layout .calendar-cell.selected {
    outline: 2px solid #3498db;
    outline-offset: -2px;
    box-shadow: inset 0 0 0 1px rgba(52, 152, 219, 0.2);
}

.home-main-layout .calendar-date {
    font-size: 11px;
    font-weight: 600;
    color: inherit;
    margin-bottom: 4px;
}

.home-main-layout .calendar-events {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-height: 0;
    overflow: hidden;
    max-height: calc(100% - 18px);
}

.home-main-layout .calendar-event {
    font-size: 11px;
    color: #fff;
    padding: 2px 4px;
    border-radius: 4px;
    height: 16px;
    line-height: 16px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.home-main-layout .calendar-event[title^="💰"],
.home-main-layout .calendar-event.cash-forecast-event {
    font-weight: 800;
    letter-spacing: -0.01em;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.24), 0 1px 4px rgba(15,23,42,0.16);
}

.home-main-layout .calendar-more {
    font-size: 10px;
    color: #6c7a89;
}

.home-main-layout .day-view {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
}

.home-main-layout .day-view-header {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.home-main-layout .day-view-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: auto;
}

.home-main-layout .calendar-empty {
    font-size: 12px;
    color: #8b94a3;
}

/* Home calendar detail modals */
.home-calendar-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.55);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.home-calendar-modal.active {
    opacity: 1;
    visibility: visible;
}

.home-calendar-modal .home-calendar-modal-container {
    width: 520px;
    max-width: 92vw;
    height: auto;
    max-height: 85vh;
}

.home-calendar-modal .project-modal-body {
    padding: 18px 22px;
}

.home-cash-forecast-detail-modal .cash-forecast-detail-card {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.38);
    border: 1px solid rgba(226, 232, 240, 0.9);
    overflow: hidden;
}

.cash-forecast-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    color: #fff;
    background: linear-gradient(135deg, #0f766e 0%, #134e4a 100%);
}

.cash-forecast-detail-header h3 {
    margin: 4px 0 0;
    font-size: 20px;
    letter-spacing: -0.02em;
}

.cash-forecast-detail-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.84;
}

.cash-forecast-detail-close {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255,255,255,0.32);
    border-radius: 999px;
    color: #fff;
    background: rgba(255,255,255,0.12);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.cash-forecast-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 18px 20px 8px;
}

.cash-forecast-warning-row {
    border-color: #f59e0b;
    background: #fffbeb;
}

.cash-forecast-source-section {
    padding: 8px 20px 20px;
}

.cash-forecast-source-section h4 {
    margin: 8px 0 10px;
    color: #0f172a;
    font-size: 14px;
}

.cash-forecast-source-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    margin-bottom: 8px;
}

.cash-forecast-source-row strong,
.cash-forecast-source-row span {
    display: block;
}

.cash-forecast-source-row strong {
    color: #0f172a;
    font-size: 13px;
}

.cash-forecast-source-row span {
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
}

.cash-forecast-source-money {
    flex: 0 0 auto;
    text-align: right;
    font-weight: 800;
    white-space: nowrap;
}

.home-calendar-event-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.home-calendar-event-list .calendar-event {
    padding: 8px 10px;
    border-radius: 8px;
    height: auto;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.home-calendar-event-list .calendar-event-title {
    font-weight: 600;
    font-size: 13px;
}

.home-calendar-event-list .calendar-event-sub {
    font-size: 11px;
    opacity: 0.85;
}

.calendar-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 18px;
}

.calendar-detail-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    background: #f9fbfd;
    font-size: 12px;
}

.calendar-detail-row span {
    font-size: 11px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-detail-row strong {
    color: #2c3e50;
    font-weight: 600;
    font-size: 13px;
}

.calendar-detail-row.full {
    grid-column: 1 / -1;
}

@media (max-width: 700px) {
    .calendar-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Modern Calendar View Buttons */
.home-main-layout .view-btn {
    position: relative;
    padding: 12px 20px;
    border: none;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    min-width: 80px;
    text-align: center;
    letter-spacing: 0.5px;
    user-select: none;
    transform: translateY(0);
}

.home-main-layout .view-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.home-main-layout .view-btn:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f1f3f4 100%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    color: #343a40;
}

.home-main-layout .view-btn:hover::before {
    left: 100%;
}

.home-main-layout .view-btn.active {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(52, 152, 219, 0.3);
    transform: translateY(-1px);
}

.home-main-layout .view-btn.active::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.home-main-layout .view-btn.active:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f618d 100%);
    box-shadow: 0 6px 24px rgba(52, 152, 219, 0.4);
    transform: translateY(-3px);
    color: #ffffff;
}

.home-main-layout .view-btn:active {
    transform: translateY(0) scale(0.98);
    transition: transform 0.1s ease;
}

/* Dashboard Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    height: 100%;
}

/* Stats Panel */
.stats-panel {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stats-panel h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 18px;
}

.stat-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    border-left: 4px solid #28a745;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card.urgent {
    border-left-color: #dc3545;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Upcoming Tasks Section */
.upcoming-tasks-section {
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.upcoming-tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.upcoming-tasks-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 16px;
}

.task-management-controls {
    display: flex;
    gap: 8px;
}

.upcoming-tasks-list {
    max-height: none;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.upcoming-task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 8px;
    background: #f8f9fa;
}

.task-info {
    flex: 1;
}

.task-title {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.task-project {
    font-size: 12px;
    color: #6c757d;
}

.task-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.task-date {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.task-date.task-overdue {
    color: #dc3545;
    font-weight: bold;
}

.task-actions {
    display: flex;
    gap: 4px;
}

.btn-icon {
    background: none;
    border: none;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    color: #6c757d;
    font-size: 12px;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #e9ecef;
    color: #333;
}

/* HOME TAB CALENDAR UI POLISH & CLARITY */
.home-main-layout .fc {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: transparent;
}
.home-main-layout .fc-toolbar-title {
    color: #2c3e50;
    font-weight: 600;
}
.home-main-layout .fc-button-primary {
    background-color: #3498db;
    border-color: #3498db;
}
.home-main-layout .fc-button-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}
.home-main-layout .fc-event {
    border-radius: 4px;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    margin: 1px;
    font-size: 12px;
}

.home-main-layout .fc-event-title {
    font-weight: 500;
}

.home-main-layout .fc-daygrid-event {
    white-space: normal;
    align-items: normal;
}

.home-main-layout .fc-daygrid-event-harness {
    margin-top: 1px;
}

/* ==============================================
   MODERN QUICKSTATS STYLING
   ============================================== */

.home-main-layout .quickstats-body {
    padding: 12px; /* Reduced from 16px */
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px; /* Reduced from 12px */
}

.home-main-layout .quickstat-item.modern-stat {
    display: flex;
    align-items: center;
    gap: 10px; /* Reduced from 12px */
    padding: 12px; /* Reduced from 16px */
    border-radius: 8px; /* Reduced from 10px */
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.home-main-layout .quickstat-item.modern-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.home-main-layout .quickstat-item.projects-stat {
    background: linear-gradient(135deg, #4a5ac7 0%, #5e3885 100%);
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.home-main-layout .quickstat-item.deadlines-stat {
    background: linear-gradient(135deg, #e876ea 0%, #d63447 100%);
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.home-main-layout .quickstat-item.tasks-stat {
    background: linear-gradient(135deg, #2e86c1 0%, #148e9e 100%);
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.home-main-layout .quickstat-item.financial-stat {
    background: linear-gradient(135deg, #27ae60 0%, #16a085 100%);
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.home-main-layout .stat-icon {
    font-size: 20px; /* Reduced from 24px */
    width: 32px; /* Reduced from 40px */
    height: 32px; /* Reduced from 40px */
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    border-radius: 6px; /* Reduced from 8px */
    flex-shrink: 0;
}

.home-main-layout .stat-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.home-main-layout .stat-value {
    font-size: 18px; /* Reduced from 20px */
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 2px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.home-main-layout .stat-label {
    font-size: 11px; /* Reduced from 12px */
    opacity: 1;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.home-main-layout .quickstat-item.modern-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.home-main-layout .quickstat-item.modern-stat:hover::before {
    left: 100%;
}

/* Schedule Filters Above Calendar */
.home-main-layout .calendar-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    padding: 10px 12px;
    margin: 0 12px 8px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.home-main-layout .calendar-filters .flex-center {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 0;
    min-width: 150px;
}

.home-main-layout .calendar-filters .filter-label {
    font-size: 12px;
    color: #2c3e50;
    white-space: nowrap;
}

.home-main-layout .calendar-filters .filter-select {
    width: 100%;
    min-width: 0;
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 12px;
    background: #fff;
}

@media (max-width: 1200px) {
    .home-main-layout .calendar-filters {
        flex-wrap: wrap;
        row-gap: 8px;
    }
    .home-main-layout .calendar-filters .flex-center {
        flex: 1 1 220px;
    }
}

.schedule-filters {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 8px 12px; /* Reduced from 15px */
    margin-bottom: 12px; /* Reduced from 20px */
    border: 1px solid #dee2e6;
}

.filter-controls {
    display: flex;
    gap: 6px; /* Reduced from 10px */
    flex-wrap: wrap;
    align-items: center;
}

.filter-select,
.date-input {
    padding: 6px 10px; /* Reduced from 8px 12px */
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px; /* Reduced from 14px */
    background: white;
    min-width: 120px; /* Reduced from 140px */
}

.filter-select:focus,
.date-input:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.1);
}

/* Task management panel */
.task-management-panel {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.task-management-panel h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 18px;
}

/* No Tasks Message */
.no-tasks {
    text-align: center;    padding: 20px;
    color: #6c757d;
    font-style: italic;
}

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

@media (max-width: 900px) {
    #home-tab .dashboard-grid {
        flex-direction: column;
        height: auto;
    }
    #home-tab .stats-panel, #home-tab .calendar-panel {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin-right: 0;
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 4px; /* Reduced gap for mobile */
    }
    
    .filter-select,
    .date-input {
        min-width: auto;
        width: 100%;
        padding: 5px 8px; /* Smaller padding on mobile */
        font-size: 12px; /* Smaller font on mobile */
    }
    
    .schedule-filters {
        padding: 6px 8px; /* Even smaller padding on mobile */
        margin-bottom: 8px;
    }
    
    .upcoming-tasks-list {
        max-height: 150px;
    }
    
    .upcoming-task-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .stat-cards {
        grid-template-columns: 1fr;
    }
    
    .home-main-layout .quickstats-body {
        padding: 8px; /* Smaller padding on mobile */
        gap: 6px;
    }
    
    .home-main-layout .quickstat-item.modern-stat {
        padding: 10px; /* Smaller padding on mobile */
        gap: 8px;
    }
    
    .home-main-layout .stat-icon {
        width: 28px; /* Smaller icon on mobile */
        height: 28px;
        font-size: 18px;
    }
    
    .home-main-layout .stat-value {
        font-size: 16px; /* Smaller text on mobile */
    }
    
    .home-main-layout .stat-label {
        font-size: 10px; /* Smaller label on mobile */
    }
}

/* Legacy unified header styles cleaned up - now handled by headers.css */

/* --- Calendar Header Modernization --- */
#home-tab .calendar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0;
    flex-shrink: 0;
    background: none;
}

#home-tab .calendar-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2c3e50;
    background: linear-gradient(90deg, #f8f9fa 60%, #e9ecef 100%);
    border-radius: 18px;
    padding: 4px 16px;
    box-shadow: 0 2px 8px rgba(44,62,80,0.08);
    letter-spacing: 0.5px;
    text-align: center;
    min-width: 120px;
    margin: 0 8px;
    display: inline-block;
    transition: background 0.2s, color 0.2s;
}

#home-tab .calendar-header .nav-btn {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #3498db;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(44,62,80,0.10);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    outline: none;
}
#home-tab .calendar-header .nav-btn:hover, #home-tab .calendar-header .nav-btn:focus {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(52,152,219,0.18);
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

.modal-content {
    background-color: #fefefe;
    margin: auto; /* Centered by flex, but auto margin helps */
    padding: 25px 30px; /* Reverted to original padding */
    border: 1px solid #b0b0b0;
    width: 90%;
    max-width: 550px;
    border-radius: 10px;
    box-shadow: 0 0 12px rgba(0,0,0,0.2); /* Applied 12px shadow */
    position: relative;
    pointer-events: auto; /* Ensure content area is interactive */
    animation: fadeInModal 0.3s ease-out;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Form group styling */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: calc(100% - 22px); /* Adjust for padding and border */
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

.form-group textarea {
    resize: vertical; /* Allow vertical resizing */
    min-height: 80px;
}

.task-item .delete-task-btn {
    background: none;
    border: none;
    color: #ff0000;
    cursor: pointer;
    font-size: 1.2em;
    padding: 0 5px;
    margin-left: auto; /* Pushes the button to the right */
    visibility: hidden; /* Hidden by default */
}

.task-item:hover .delete-task-btn {
    visibility: visible; /* Show on hover */
}

.task-item {
    display: flex; /* Enable flexbox for alignment */
    align-items: center; /* Vertically align items in the center */
    justify-content: space-between; /* Distribute space */
}

.task-details {
    flex-grow: 1; /* Allow task details to take up available space */
}

/* Add Task Modal Styles */
#add-task-modal {
    display: none; /* Initially hidden, JS will toggle this */
    position: fixed; /* Overlay the whole screen */
    z-index: 1050; /* High z-index to be on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Enable scroll if content is too long */
    background-color: rgba(0,0,0,0.4); /* Dim background */
    pointer-events: auto; /* Ensure modal itself is interactive */
    align-items: center; /* Vertical centering for the modal content */
    justify-content: center; /* Horizontal centering for the modal content */
}

/* Override display property when modal is shown by JS */
#add-task-modal.show-modal {
    display: flex !important; /* Use flex for centering */
}

#add-task-modal .modal-content {
    background-color: #fefefe;
    margin: auto; /* Centered by flex, but auto margin helps */
    padding: 25px 30px; /* Reverted to original padding */
    border: 1px solid #b0b0b0;
    width: 90%;
    max-width: 550px;
    border-radius: 10px;
    box-shadow: 0 0 12px rgba(0,0,0,0.2); /* Applied 12px shadow */
    position: relative;
    pointer-events: auto; /* Ensure content area is interactive */
    animation: fadeInModal 0.3s ease-out;
}

@keyframes fadeInModal {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

#add-task-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

#add-task-modal .modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
    font-weight: 600;
}

#add-task-modal .close-button {
    color: #888;
    font-size: 32px;
    font-weight: bold;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

#add-task-modal .close-button:hover,
#add-task-modal .close-button:focus {
    color: #333;
    text-decoration: none;
    cursor: pointer;
}

#add-task-modal .form-group {
    margin-bottom: 18px;
}

#add-task-modal .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #454545;
    font-size: 14px;
}

#add-task-modal .form-group input[type="text"],
#add-task-modal .form-group input[type="date"],
#add-task-modal .form-group select,
#add-task-modal .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    pointer-events: auto !important; /* Ensure inputs are always interactive */
}

#add-task-modal .form-group input[type="text"]:focus,
#add-task-modal .form-group input[type="date"]:focus,
#add-task-modal .form-group select:focus,
#add-task-modal .form-group textarea:focus {
    border-color: #2c5aa0;
    box-shadow: 0 0 0 2px rgba(44, 90, 160, 0.2);
    outline: none;
}

#add-task-modal .form-group textarea {
    min-height: 90px;
    resize: vertical;
}

#add-task-modal button[type="submit"] {
    background-color: #2c5aa0; /* Main theme color */
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.1s;
    display: block;
    width: 100%;
    margin-top: 10px;
}

#add-task-modal button[type="submit"]:hover {
    background-color: #1e3c72; /* Darker shade */
}

/* Upcoming tasks body - ensure it takes remaining space */
.home-main-layout .upcoming-tasks-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 16px 16px 16px;
}

.home-main-layout .upcoming-tasks-body .empty-state {
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

.home-main-layout .upcoming-tasks-body .task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.home-main-layout .upcoming-tasks-body .task-item:hover {
    background: #e9ecef;
    border-color: #3498db;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.home-main-layout .upcoming-tasks-body .task-details {
    flex: 1;
    min-width: 0;
}

.home-main-layout .upcoming-tasks-body .task-title {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 4px;
    font-size: 14px;
}

.home-main-layout .upcoming-tasks-body .task-meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: #6c757d;
}

.home-main-layout .upcoming-tasks-body .task-project {
    font-weight: 500;
}

.home-main-layout .upcoming-tasks-body .task-due {
    color: #e74c3c;
    font-weight: 500;
}

.home-main-layout .upcoming-tasks-body .delete-task-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.2s ease;
}

.home-main-layout .upcoming-tasks-body .task-item:hover .delete-task-btn {
    opacity: 1;
}

.home-main-layout .upcoming-tasks-body .delete-task-btn:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #c82333;
}
