:root {
    /* Corporate Color Palette - Simple, Trustworthy */
    --primary-color: #0f172a;
    /* Dark Navy for key interactions */
    --primary-hover: #1e293b;
    --accent-color: #2563eb;
    /* Royal Blue for calls to action */
    --bg-body: #f8fafc;
    /* Very light cool gray */
    --bg-card: #ffffff;
    --text-main: #1e293b;
    /* Slate 800 */
    --text-sub: #64748b;
    /* Slate 500 */
    --border-color: #e2e8f0;
    /* Slate 200 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 8px;
    /* Standard radius, less rounded than before */
    
    /* Weather Gradient Light */
    --weather-hero-bg: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    --weather-hero-text: #1e3a8a;
    --weather-current-icon: #2563eb;
}

/* Dark Mode Variables */
body.dark-mode {
    --primary-color: #f8fafc;
    /* Invert */
    --primary-hover: #e2e8f0;
    --bg-body: #0f172a;
    /* Slate 900 */
    --bg-card: #1e293b;
    /* Slate 800 */
    --text-main: #f1f5f9;
    /* Slate 100 */
    --text-sub: #94a3b8;
    /* Slate 400 */
    --border-color: #334155;
    /* Slate 700 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);

    /* Weather Gradient Dark */
    --weather-hero-bg: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    --weather-hero-text: #e0f2fe;
    --weather-current-icon: #60a5fa;
}

body.dark-mode .app-header {
    background: #1e293b;
    border-bottom-color: #334155;
}

body.dark-mode .header-dropdown-menu {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

body.dark-mode .dropdown-item:hover {
    background: var(--bg-body);
}

body.dark-mode .weather-col {
    background: #334155;
    border-color: #475569;
}

body.dark-mode .weather-col.today {
    background: #1e40af;
    /* Darker blue */
    border-color: #1e3a8a;
}

body.dark-mode .current-weather-hero {
    background: var(--weather-hero-bg);
    color: var(--weather-hero-text);
}

body.dark-mode .current-icon {
    color: var(--weather-current-icon);
}

body.dark-mode .dropdown-item.logout-red:hover {
    background: rgba(239, 68, 68, 0.1);
}

body.dark-mode .app-footer {
    background: #1e293b;
    border-top-color: #334155;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    padding-bottom: 2rem;
    line-height: 1.5;
}

/* Header - Clean Corporate Style */
.app-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

@media (max-width: 600px) {
    .app-header {
        padding: 0.8rem 1rem;
    }

    .date-display {
        display: none;
        /* Hide date on small screens */
    }
}

/* Footer Styles */
.app-footer {
    background: white;
    padding: 1.5rem;
    text-align: center;
    color: var(--text-sub);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.logo i {
    font-size: 1.25rem;
    color: var(--text-main);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.date-display {
    font-size: 0.85rem;
    color: var(--text-sub);
    font-weight: 500;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Header Dropdown */
.header-dropdown-container {
    position: relative;
}

.header-dropdown-menu {
    position: absolute;
    top: 50px;
    right: 0;
    width: 260px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 0.5rem 0;
    display: none;
    z-index: 1000;
    transform-origin: top right;
    animation: dropdownFadeIn 0.2s ease-out;
}

.header-dropdown-menu.active {
    display: block;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }

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

.dropdown-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-sub);
    margin-top: 0.2rem;
}

.dropdown-list {
    list-style: none;
    padding: 0.5rem;
    margin: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: background 0.2s;
    cursor: pointer;
}

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

.dropdown-item i {
    font-size: 1.1rem;
    color: var(--text-sub);
}

.dropdown-item.logout-red {
    color: #ef4444;
}

.dropdown-item.logout-red:hover {
    background: #fef2f2;
}

.dropdown-item.logout-red i {
    color: #ef4444;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

/* Toggle Switch */
.theme-toggle-item {
    justify-content: space-between;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--accent-color);
}

input:checked+.slider:before {
    transform: translateX(16px);
}

/* Layout */
/* Layout */
.dashboard-container {
    max-width: 1200px;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: max-width 0.3s ease, margin 0.3s ease, padding 0.3s ease;
}

/* Full Width Layout for Calendar */
.dashboard-container.full-width {
    max-width: 100%;
    margin: 0;
    padding: 0;
    height: calc(100vh - 73px);
    /* Approx Header Height */
    gap: 0;
}

.dashboard-container.full-width #calendar-view {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1rem 2rem;
}

.dashboard-container.full-width .calendar-layout {
    flex: 1;
    height: 100%;
    overflow: hidden;
    padding-top: 1rem;
}

.dashboard-container.full-width .calendar-main-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dashboard-container.full-width .fc {
    height: 100%;
    border-radius: 8px;
    /* Keep radius but maybe larger? */
}

.main-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.5rem;
    align-items: stretch;
}

/* Cards - Flat, Clean, Bordered */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, fill 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease, transform 0.2s ease;
}

/* Headers within Cards */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h3 i {
    color: var(--text-sub);
}

/* Badges */
.badge {
    background: #ef4444;
    /* Red for importance */
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Notification List */
.notification-card {
    height: 100%;
}

.notification-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    /* Removing gap for a list-group feel */
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.notification-item:hover {
    background: var(--bg-body);
    margin: 0 -1.25rem;
    padding: 1rem 1.25rem;
}

.icon-box {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Notification Colors - Trusted Business Colors */
.icon-box.warning {
    background: #fef3c7;
    color: #d97706;
}

.icon-box.info {
    background: #dbeafe;
    color: #2563eb;
}

.icon-box.success {
    background: #dcfce7;
    color: #16a34a;
}

.notification-item .title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: var(--text-main);
}

.notification-item .sender {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-sub);
}

.notification-item .time {
    font-size: 0.75rem;
    color: var(--text-sub);
    margin-left: auto;
}

.notification-item .desc {
    font-size: 0.85rem;
    color: var(--text-main);
    margin-top: 0.5rem;
    line-height: 1.5;
}

/* Right Column */
.right-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.upper-widgets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Adjust cards in upper widgets for compact space */
.upper-widgets .card {
    padding: 1rem;
}

/* Cleaning Record Widget - Compact */
.cleaning-card {
    display: flex;
    flex-direction: column;
}

.cleaning-card .card-header {
    margin-bottom: 0.5rem;
}

.cleaning-card .card-header h3 {
    font-size: 0.9rem;
}

.cleaning-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.cleaning-item {
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
}

.label-text {
    font-size: 0.85rem;
}

.save-btn {
    padding: 0.5rem;
    font-size: 0.85rem;
}

.cleaning-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.cleaning-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s, fill 0.2s, opacity 0.2s, box-shadow 0.2s, filter 0.2s, transform 0.2s;
    border: 1px solid transparent;
}

.cleaning-item:hover {
    background: var(--bg-body);
    border-color: var(--border-color);
}

.cleaning-item input[type="checkbox"] {
    display: none;
}

.custom-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    position: relative;
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1), fill 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-card);
}

body.dark-mode .custom-checkbox {
    border-color: #475569;
    background: var(--bg-card);
}

.cleaning-item:hover .custom-checkbox {
    border-color: var(--accent-color);
}

.cleaning-item input:checked+.custom-checkbox {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.cleaning-item input:checked+.custom-checkbox::after {
    content: '';
    position: absolute;
    top: 45%;
    left: 50%;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -50%) rotate(45deg);
    animation: checkmark 0.2s ease-in-out forwards;
}

@keyframes checkmark {
    0% {
        height: 0;
        opacity: 0;
    }

    100% {
        height: 9px;
        opacity: 1;
    }
}

.label-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
}

/* Save Button */
.save-btn {
    width: 100%;
    padding: 0.8rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), fill 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.2);
    overflow: hidden;
    max-height: 60px;
    opacity: 1;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.3);
}

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

/* Hidden State */
.save-btn.hidden {
    display: none;
}

/* Success State (Applied via JS) */
.save-btn.success {
    background: #10b981;
    /* Emerald 500 */
    pointer-events: none;
    animation: pulse 0.5s;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* Weather Card - Interactive */
.weather-card {
    background: var(--bg-card);
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

.weather-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.weather-content {
    /* Replaces old layout */
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 0.5rem;
    /* Space for settings button */
}

.weather-row {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
}

.weather-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.8rem 0.5rem;
    background: var(--bg-body);
    /* Slate 50 or dark equivalent */
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}

/* Make "Today" slightly prominent */
.weather-col.today {
    background: #f0f9ff;
    /* Sky 50 */
    border-color: #e0f2fe;
    /* Sky 100 */
}

.weather-col:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.day-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-sub);
    letter-spacing: 0.05em;
}

.weather-icon-sm {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin: 0.2rem 0;
}

.temp-range {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.max-temp {
    color: var(--text-main);
    font-size: 1rem;
}

.min-temp {
    color: var(--text-sub);
    font-size: 0.8rem;
    font-weight: 400;
}

.weather-location-row {
    font-size: 0.8rem;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    justify-content: center;
    margin-top: -0.2rem;
}

/* Weather Modal Overlay */
.weather-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    /* Dimmed background */
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, fill 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease, transform 0.3s ease;
}

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

/* Weather Modal Content */
.weather-popup-modal {
    background: var(--bg-card);
    padding: 3rem;
    /* Increased from 1.5rem */
    min-height: 80vh;
    /* Huge vertical size */
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 95%;
    /* Slightly wider on mobile */
    max-width: 1150px;
    /* Increased 15% from 1000px */
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Bouncy zoom */
    user-select: none;
    /* Prevent text selection */
    -webkit-user-select: none;
}

.weather-modal-overlay.active .weather-popup-modal {
    transform: scale(1);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.8rem;
}

.popup-title-group {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.popup-header h4 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}

.popup-location-name {
    font-size: 0.75rem;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.close-popup {
    background: var(--bg-body);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-sub);
    transition: background 0.2s;
}

.close-popup:hover {
    background: var(--border-color);
    color: var(--text-main);
}

body.dark-mode .hourly-item:first-child {
    background: #1e3a8a;
    border-color: #3b82f6;
}

.section-title {
    font-size: 0.8rem;
    color: var(--text-sub);
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

/* Current Weather Hero */
.current-weather-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--weather-hero-bg);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    color: var(--weather-hero-text);
}

.current-main {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.current-icon {
    font-size: 3.5rem;
    color: var(--weather-current-icon);
}

.current-temp-group {
    display: flex;
    flex-direction: column;
}

.current-temp {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

.current-desc {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.8;
}

.current-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem 2rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.detail-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.6;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Hourly Forecast (Horizontal Scroll) */
.hourly-forecast-section {
    margin-bottom: 1.5rem;
}

.hourly-scroll-container {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding: 0.3rem 0.3rem 0.5rem 0.3rem;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    /* Snap to each item */
    scroll-behavior: smooth;
    cursor: grab;
}

.hourly-scroll-container.active {
    cursor: grabbing;
    scroll-behavior: auto;
    scroll-snap-type: none;
}

.hourly-scroll-container::-webkit-scrollbar {
    height: 4px;
}

.hourly-scroll-container::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 0 1rem;
        margin: 1rem auto;
        gap: 1rem;
    }

    .main-grid {
        grid-template-columns: 1fr;
    }

    .upper-widgets {
        grid-template-columns: 1fr;
    }

    .app-header {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }

    .logo {
        font-size: 1rem;
    }

    .current-temp {
        font-size: 2.5rem;
    }

    .current-icon {
        font-size: 2.5rem;
    }

    .weather-popup-modal {
        padding: 1.5rem;
        width: 100%;
        height: 100%;
        max-width: 100%;
        border-radius: 0;
        transform: none;
    }

    .current-details-grid {
        gap: 0.5rem 1rem;
    }
}

.hourly-item:first-child {
    background: var(--bg-body);
    /* Highlight current hour */
    border-color: var(--border-color);
}

.hourly-time {
    font-size: 0.75rem;
    color: var(--text-sub);
}

.hourly-icon {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.hourly-temp {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

/* Weekly Forecast (Grid Layout) */
.weekly-forecast-list {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    /* Force 7 columns (1 row) */
    gap: 0.5rem;
    /* Reduced gap to fit */
    margin-top: 2rem;
    min-width: 0;
    /* Prevent overflow issues */
}

.weekly-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.5rem;
    /* Tighter padding */
    background: var(--bg-body);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1), fill 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
    /* Allow shrinking */
}

.weekly-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    background: var(--bg-card);
    border-color: var(--accent-color);
}

body.dark-mode .weekly-item:hover {
    border-color: #60a5fa;
}

.week-day {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.week-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin: 0.5rem 0;
}

.week-temp {
    display: flex;
    gap: 0.5rem;
    font-size: 1.1rem;
    margin-top: 0.5rem;
    width: auto;
    /* Reset width */
    text-align: center;
    justify-content: center;
}

.week-temp .high {
    font-weight: 700;
    color: var(--text-main);
}

.week-temp .low {
    color: var(--text-sub);
    font-weight: 500;
}

.settings-btn {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-sub);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s, fill 0.2s, opacity 0.2s, box-shadow 0.2s, filter 0.2s, transform 0.2s;
    z-index: 10;
    /* Ensure above content if overlapping */
}

.settings-btn:hover {
    background: var(--bg-body);
    color: var(--text-main);
}



/* Schedule Card */
.schedule-card {
    flex: 1;
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.schedule-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.schedule-time {
    min-width: 50px;
    text-align: right;
    border-right: 2px solid transparent;
    padding-right: 0.8rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Color coding by border instead of full background */
.schedule-item.event-meeting .schedule-time {
    border-color: #3b82f6;
}

/* Blue */
.schedule-item.event-work .schedule-time {
    border-color: #10b981;
}

/* Green */
.schedule-item.event-personal .schedule-time {
    border-color: #f59e0b;
}

/* Orange */

.time-start {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.time-end {
    font-size: 0.75rem;
    color: var(--text-sub);
}

.schedule-info {
    flex: 1;
}

.schedule-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: var(--text-main);
}

.schedule-meta {
    font-size: 0.75rem;
    color: var(--text-sub);
    display: flex;
    gap: 0.8rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Schedule Skeleton Loader */
.schedule-skeleton .schedule-item {
    pointer-events: none;
}

.schedule-skeleton .skeleton-time {
    border-right-color: var(--border-color);
}

.skeleton-box {
    background: #e2e8f0;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.skeleton-box::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.4) 50%,
            rgba(255, 255, 255, 0) 100%);
    animation: skeleton-loading 1.5s infinite linear;
}

@keyframes skeleton-loading {
    0% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(50%);
    }
}

body.dark-mode .skeleton-box {
    background: #334155;
}

.schedule-item.skeleton-item {
    pointer-events: none;
    /* remove fixed height */
}

.schedule-skeleton-time {
    border-right-color: var(--border-color);
}


.skeleton-date-box {
    width: 36px;
    height: 12px;
    margin-bottom: 4px;
    margin-left: auto;
    border-radius: 2px;
}

.skeleton-time-box {
    width: 45px;
    height: 15px;
    margin-left: auto;
    border-radius: 2px;
}

.skeleton-title-box {
    width: 60%;
    height: 15px;
    margin-top: 2px;
    margin-bottom: 2px;
    border-radius: 2px;
}

.skeleton-meta-box {
    width: 40%;
    height: 12px;
    margin-top: 5px;
    border-radius: 2px;
}


.view-all-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-sub);
    font-size: 0.75rem;
    padding: 0.2rem 0.8rem;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s, fill 0.2s, opacity 0.2s, box-shadow 0.2s, filter 0.2s, transform 0.2s;
    text-decoration: none;
}

.view-all-btn:hover {
    background: var(--bg-body);
    color: var(--text-main);
    border-color: var(--accent-color);
}

/* Quick Actions */
.quick-actions {
    margin-top: 2rem;
}

.quick-actions h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}

@media (max-width: 900px) {
    .actions-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 600px) {
    .actions-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 400px) {
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.action-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s, fill 0.2s, opacity 0.2s, box-shadow 0.2s, filter 0.2s, transform 0.2s;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    /* Added for <a> tags */
    width: 100%;
    /* Ensure it takes full grid width */
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.icon-circle {
    width: 40px;
    height: 40px;
    background: var(--bg-body);
    color: var(--text-sub);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s, fill 0.2s, opacity 0.2s, box-shadow 0.2s, filter 0.2s, transform 0.2s;
}

body.dark-mode .icon-circle {
    background: #334155;
    color: var(--text-main);
}

/* Specific Tool Colors */
.icon-hr {
    background: rgba(26, 115, 232, 0.1);
    color: #1a73e8;
    /* Google Blue */
}

body.dark-mode .icon-hr {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.icon-turno {
    background: rgba(30, 142, 62, 0.1);
    color: #1e8e3e;
    /* Corporate Green */
}

body.dark-mode .icon-turno {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

/* CRM Red */
.icon-crm {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

body.dark-mode .icon-crm {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.action-btn:hover .icon-circle {
    background: #dbeafe;
    /* Light blue bg */
    color: var(--accent-color);
}

body.dark-mode .action-btn:hover .icon-circle {
    background: #1e3a8a;
    color: #60a5fa;
}

.action-icon-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.action-btn span {
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
}

/* Calendar Specific Page Styles */
/* Enhanced Main Calendar Styles are below in the new section */


.back-nav {
    margin-bottom: 1.5rem;
}

.back-nav a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-sub);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.back-nav a:hover {
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 900px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .upper-widgets {
        flex-direction: column;
    }
}

/* Utility Views */
.hidden-view {
    display: none !important;
}

.hidden {
    display: none !important;
}

/* Weather Modal Premium Enhancements - Refined Proportions */
.weather-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px) saturate(180%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.weather-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.weather-popup-modal {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    width: 90%;
    max-width: 780px;
    padding: 1.8rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    color: #1e293b;
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Dynamic Weather Themes */
.weather-popup-modal.theme-sunny { background: linear-gradient(135deg, rgba(235, 244, 255, 0.95) 0%, rgba(219, 234, 254, 0.9) 100%); }
.weather-popup-modal.theme-cloudy { background: linear-gradient(135deg, rgba(241, 245, 249, 0.95) 0%, rgba(226, 232, 240, 0.9) 100%); }
.weather-popup-modal.theme-rainy { background: linear-gradient(135deg, rgba(224, 231, 255, 0.95) 0%, rgba(199, 210, 254, 0.9) 100%); }
.weather-popup-modal.theme-snowy { background: linear-gradient(135deg, rgba(248, 250, 252, 0.95) 0%, rgba(241, 245, 249, 0.9) 100%); }
.weather-popup-modal.theme-thunder { background: linear-gradient(135deg, rgba(238, 242, 255, 0.95) 0%, rgba(199, 210, 254, 0.9) 100%); }

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.popup-title-group h4 {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(to right, #1e293b, #475569);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.01em;
}

.popup-location-name {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
    margin-top: 0.2rem;
}

.header-actions button {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.5);
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* Current Weather Hero */
.current-weather-hero {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.hero-bg-icon {
    position: absolute;
    right: -20px;
    bottom: -30px;
    font-size: 9rem;
    color: rgba(255, 255, 255, 0.2);
    z-index: -1;
    filter: blur(2px);
}

.current-main {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.current-main .current-icon {
    font-size: 3.5rem;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
}

.current-main .current-temp {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    color: #0f172a;
}

.current-main .current-cond {
    font-size: 1rem;
    font-weight: 600;
    color: #475569;
    margin-top: 0.4rem;
}

.current-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.detail-item {
    background: rgba(255, 255, 255, 0.6);
    padding: 0.6rem 1rem;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.detail-item .label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
}

.detail-item .value {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

/* Sections */
.section-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: #475569;
    margin-bottom: 1rem;
}

/* Hourly Scroll */
.hourly-scroll-container {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1.2rem;
}

.hourly-item {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.8rem 0.6rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 60px;
}

.hourly-item .h-time { font-size: 0.7rem; }
.hourly-item i { font-size: 1.4rem; }
.hourly-item .h-temp { font-size: 0.95rem; }

/* Weekly List */
.weekly-forecast-list {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.8rem;
    margin-top: 0.8rem;
}

.weekly-item {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 14px;
    padding: 1rem 0.6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.weekly-item .week-day { font-size: 0.75rem; }
.weekly-item .week-icon { font-size: 1.8rem; margin: 0.4rem 0; }
.weekly-item .week-temp { font-size: 0.8rem; }

/* Area Picker Redesign */
.area-picker-section {
    padding: 1rem 0;
    animation: fadeIn 0.4s ease-out;
}

.area-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 1rem;
    max-height: 450px;
    padding-bottom: 1rem;
}

.area-item-btn {
    padding: 1rem 0.5rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 14px;
    font-weight: 600;
    color: #475569;
    transition: all 0.2s;
}

.area-item-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.2);
}

/* Animations */
.hidden { display: none !important; }

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .weather-popup-modal {
        padding: 1.5rem;
        width: 95%;
        border-radius: 20px;
    }

    .current-weather-hero {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 2rem;
        padding: 1.5rem;
    }

    .current-main {
        flex-direction: column;
        gap: 1rem;
    }

    .current-main .current-temp { font-size: 3.5rem; }

    .current-details-grid {
        width: 100%;
        grid-template-columns: 1fr 1fr;
    }

    .weekly-forecast-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 480px) {
    .area-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .weekly-forecast-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Weather Widget Placeholder / Simple Style */
.weather-main {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.5rem;
}

.weather-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.temp-box {
    display: flex;
    flex-direction: column;
}

.temperature {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-main);
}

.condition {
    font-size: 0.9rem;
    color: var(--text-sub);
    font-weight: 500;
}