:root {
    /* Softer, more complex gradient similar to the reference image */
    /* Multilayered mesh gradient simulation */
    --bg-gradient: radial-gradient(at 0% 0%, hsla(28, 100%, 74%, 1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, hsla(189, 100%, 56%, 1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsla(340, 100%, 76%, 1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, hsla(22, 100%, 77%, 1) 0px, transparent 50%),
        linear-gradient(135deg, #f6d365, #fda085);

    --glass-bg: rgba(255, 255, 255, 0.65);
    /* More transparent */
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-blur: blur(25px);
    /* Stronger blur */
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);

    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --primary-color: #0071e3;
    --radius-lg: 24px;
    /* Rounder corners */
    --radius-md: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
    background: #f6d365;
    /* Fallback */
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    background-size: 200% 200%;
    animation: gradientMove 15s ease infinite;
    color: var(--text-primary);
    min-height: 100vh;
    margin: 0;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Navbar - Floating Island Style */
.navbar {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 2rem;
    /* More spacing */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary) !important;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 15px;
}

.nav-links a {
    color: var(--text-primary) !important;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 99px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(0, 0, 0, 0.05);
    color: #000 !important;
    transform: scale(1.02);
}

/* Container */
.main-content {
    max-width: 1200px !important;
    margin: 40px auto;
    padding: 0 20px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    padding: 10px 0;
}

/* Cards */
.card,
.chart-container,
.settings-card,
.widget-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-lg) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--card-shadow);
    padding: 30px;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

h1,
h2,
h3 {
    letter-spacing: -0.5px;
}

/* Buttons */
.btn,
button[type="submit"] {
    background: #1d1d1f !important;
    color: white !important;
    border-radius: 99px !important;
    padding: 12px 30px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Inputs form fix */
.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
}

input,
select {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid transparent !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

input:focus,
select:focus {
    background: #fff !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Calendar Grid Adjustments */
.calendar-grid {
    gap: 10px !important;
}

.day-card {
    background: rgba(255, 255, 255, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    font-weight: 500;
}

.day-card.active {
    background: #0071e3 !important;
    /* Apple Blue */
    color: white !important;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}


/* Dropdown Menu Fix */
.dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding-bottom: 20px;
    /* Invisible bridge area to keep hover active */
    margin-bottom: -20px;
    /* Compensate for layout */
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    min-width: 180px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    z-index: 2000;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    overflow: hidden;
    margin-top: -10px;
    /* Overlap slightly with the bridge area */
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeIn 0.2s ease;
}

.dropdown-content a {
    color: var(--text-primary) !important;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-radius: 0;
    margin: 0;
    font-weight: 500;
}

.dropdown-content a:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Navigation Styles */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 12px;
    left: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(40px);
    -webkit-backdrop-filter: saturate(180%) blur(40px);
    border: 1.5px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    padding: 8px 12px;
    padding-bottom: max(8px, calc(8px + env(safe-area-inset-bottom)));
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12),
        0 4px 16px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    min-height: 64px;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    will-change: transform;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #86868b;
    font-size: 0.65rem;
    font-weight: 500;
    gap: 5px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    width: 64px;
    padding: 8px 6px;
    border-radius: 16px;
    position: relative;
}

.nav-item i {
    font-size: 1.5rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.nav-item.active {
    color: #d4a373;
    background: rgba(212, 163, 115, 0.12);
}

.nav-item.active i {
    transform: scale(1.1);
    filter: drop-shadow(0 2px 4px rgba(212, 163, 115, 0.3));
}

.nav-item:active {
    transform: scale(0.95);
}

/* Mobile Responsiveness */
/* Dashhboard Layout Classes */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.dashboard-header h1 {
    margin: 0;
}

.dashboard-header .btn {
    width: auto !important;
    text-decoration: none;
}

.stats-grid,
.dashboard-row {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.stats-grid .dashboard-card,
.dashboard-row .dashboard-card {
    flex: 1;
}

.stat-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0;
    line-height: 1;
}

.card-footer {
    margin-top: 20px;
}

.card-link {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    transition: opacity 0.2s;
}

.card-link:hover {
    opacity: 0.8;
}

.quick-actions-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.action-link {
    text-decoration: none;
    color: #4b5563;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: color 0.2s;
}

.action-link:hover {
    color: var(--primary-color);
}

.data-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.data-list li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.data-list li:last-child {
    border-bottom: none;
}

.data-list li strong {
    color: #374151;
    font-size: 1rem;
}

.data-list li small {
    color: var(--text-secondary);
}

.time-badge {
    font-weight: 700;
    color: var(--primary-color);
    display: inline-block;
    width: 50px;
    font-size: 0.95rem;
}

.client-name {
    color: #374151;
    font-weight: 600;
    font-size: 1rem;
}

.service-name {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.empty-state {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.empty-state-centered {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    min-height: 100px;
}

/* Specific Page Fixes */
.main-content {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Desktop styles for navigation visibility */
.desktop-nav {
    display: flex !important;
}

.mobile-bottom-nav {
    display: none !important;
}

/* Mobile Responsiveness & PWA Polish */
@media (max-width: 768px) {

    /* Global Resets for Mobile */
    body {
        padding: 0 !important;
        padding-bottom: 100px !important;
        /* Space for bottom nav */
        font-size: 16px;
    }

    .main-content {
        margin: 0 auto !important;
        padding: 20px !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    .navbar {
        display: none !important;
    }

    .navbar .brand {
        font-size: 1.2rem;
    }

    .navbar .nav-links {
        display: none !important;
        /* Hide links in top bar on mobile */
    }

    /* Hide Desktop Nav explicitly */
    .desktop-nav .nav-links {
        display: none !important;
    }

    /* Show Mobile Nav */
    .mobile-bottom-nav {
        display: flex !important;
    }

    /* Dashboard Header Mobile */
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        margin-bottom: 30px;
    }

    .dashboard-header .btn {
        width: fit-content !important;
        padding: 10px 25px !important;
    }

    /* Stack All Grids */
    .stats-grid,
    .dashboard-row {
        flex-direction: column !important;
        gap: 20px !important;
        margin-bottom: 20px !important;
    }

    /* Card Adjustments */
    .dashboard-card {
        padding: 0 !important;
    }

    .card-header {
        padding: 16px 20px !important;
    }

    .card-body {
        padding: 20px !important;
    }

    /* Typography */
    h1 {
        font-size: 1.8rem !important;
    }
}

/* Support Classes for Refactored Templates */
.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 10px 0;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.list-group {
    list-style: none;
    padding: 0;
}

.list-group li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
}

.list-group li:last-child {
    border-bottom: none;
}

.empty-state {
    color: #999;
    text-align: center;
    padding: 20px;
}

.highlight {
    font-weight: bold;
    color: var(--primary-color);
}

/* Calendar Specifics */
.calendar-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.calendar-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.day-header {
    text-align: center;
    font-size: 0.8rem;
    color: #888;
    padding-bottom: 5px;
}

.day-card {
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    background: #f9f9f9;
    transition: transform 0.2s;
}

.day-card.today {
    background: #e8f0fe;
    border: 1px solid #d4a373;
}

.day-card.active {
    background: var(--primary-color) !important;
    color: white !important;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.appointments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.btn-icon {
    font-size: 1.5rem;
    color: #555;
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .calendar-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .calendar-grid {
        width: 100%;
    }

    .month-title {
        text-align: center;
        margin: 10px 0;
    }
}

/* Table Styles */
.styled-table {
    width: 100%;
    text-align: left;
    border-collapse: collapse;
}

.styled-table th {
    padding: 10px;
    border-bottom: 2px solid #eee;
    font-weight: 600;
    color: var(--text-secondary);
}

.styled-table td {
    padding: 10px;
    border-bottom: 1px solid #f9f9f9;
}

.badge {
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.text-muted {
    color: #6b7280;
    font-size: 0.9rem;
}

/* Global Modal Styles for Mobile */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 10px;
    }

    .modal-overlay.open {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .modal {
        padding: 18px !important;
        border-radius: 18px !important;
        width: 92% !important;
        max-width: 380px !important;
        margin: 0 auto !important;
        position: relative !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
    }

    .modal h2 {
        font-size: 1.3rem !important;
        margin-bottom: 15px !important;
    }

    .modal h3 {
        font-size: 1.1rem !important;
    }

    .modal .form-group {
        margin-bottom: 12px !important;
    }

    .modal .form-group label {
        font-size: 0.85rem !important;
        margin-bottom: 6px !important;
    }

    .modal input,
    .modal select,
    .modal textarea {
        padding: 10px !important;
        font-size: 0.9rem !important;
    }

    .modal .btn,
    .modal button[type="submit"] {
        padding: 12px 20px !important;
        font-size: 0.95rem !important;
    }

    .modal-close {
        font-size: 1.3rem !important;
        top: 12px !important;
        right: 15px !important;
    }

    /* Mobile App-Style Animations */

    /* Smooth modal animations */
    .modal-overlay {
        animation: fadeIn 0.2s ease-out;
    }

    .modal-overlay.open .modal {
        animation: slideUpBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    /* Card and list item animations */
    .dashboard-card,
    .client-list,
    .stat-box {
        animation: fadeInUp 0.5s ease-out;
        animation-fill-mode: both;
    }

    .dashboard-card:nth-child(1) {
        animation-delay: 0.05s;
    }

    .dashboard-card:nth-child(2) {
        animation-delay: 0.1s;
    }

    .dashboard-card:nth-child(3) {
        animation-delay: 0.15s;
    }

    /* Touch feedback animations */
    .btn,
    .filter-tab,
    .nav-item,
    .client-list-item,
    .stat-box,
    .fab-btn,
    button {
        -webkit-tap-highlight-color: transparent;
        transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .btn:active,
    button:active {
        transform: scale(0.96) !important;
    }

    .filter-tab:active {
        transform: scale(0.95);
        opacity: 0.8;
    }

    .client-list-item:active {
        background: #f9fafb;
        transform: scale(0.98);
    }

    .stat-box:active {
        transform: translateY(-1px) scale(0.98);
    }

    /* Smooth page transitions */
    .main-content {
        animation: fadeIn 0.3s ease-out;
    }

    /* Input focus animations */
    input:focus,
    select:focus,
    textarea:focus {
        transform: scale(1.01);
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* FAB button pulse */
    .fab-btn {
        animation: fadeBounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .fab-btn:active {
        transform: scale(0.9) !important;
    }

    /* Search bar animation */
    .search-bar-container {
        animation: fadeInDown 0.4s ease-out;
    }

    /* Navigation animations */
    .mobile-bottom-nav {
        animation: slideUpSmooth 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* Keyframe Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUpBounce {
    from {
        opacity: 0;
        transform: translateY(100px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideUpSmooth {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes fadeBounceIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Global Desktop Animations & Interactions */
.dashboard-card,
.stat-box,
.client-card,
.appointment-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-card:hover,
.stat-box:hover,
.card:hover,
.client-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12) !important;
}

.btn,
button,
.action-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover,
button:hover,
.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active,
button:active,
.action-btn:active {
    transform: translateY(0);
}

/* Input focus animations */
input:focus,
select:focus,
textarea:focus {
    transform: scale(1.01);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 0 3px rgba(212, 163, 115, 0.1);
}

/* Table row hover */
.styled-table tbody tr {
    transition: all 0.2s ease;
}

.styled-table tbody tr:hover {
    background: #f9fafb;
    transform: scale(1.01);
}

/* Smooth page load */
.main-content {
    opacity: 1;
}

.container {
    opacity: 1;
}

/* Icon buttons */
.btn-icon,
.action-icon-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-icon:hover,
.action-icon-btn:hover {
    transform: scale(1.1);
}

/* Links */
a {
    transition: color 0.2s ease;
}

/* Filter tabs */
.filter-tab {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-tab:hover {
    transform: translateY(-2px);
}

.filter-tab.active {
    transform: translateY(0);
}

/* Client list items */
.client-list-item {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.client-list-item:hover {
    background: #f9fafb;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* FORCE VISIBILITY FOR DASHBOARD WIDGETS - Fix for caching/animation issues */
.data-list,
.data-list li,
.stat-container,
.stat-number,
.dashboard-card,
.card-body,
.card-header {
    opacity: 1 !important;
    visibility: visible !important;
    animation: none !important;
    transition: none !important;
    display: block !important;
}

.data-list li {
    display: flex !important;
}