/* ══════════════════════════════════════════════════════════════
   CONDEPI DASHBOARD UI v2.0 — Premium Condo Management System
   Clean design, zero generic overrides, commercial-grade CSS
   ══════════════════════════════════════════════════════════════ */

/* ─── CSS Variables ─── */
:root {
    --cdash-accent: #10b981;
    --cdash-accent-rgb: 16, 185, 129;
    --cdash-sidebar-w: 68px;
    --cdash-sidebar-w-open: 260px;
    --cdash-topbar-h: 60px;
    --cdash-radius: 14px;
    --cdash-radius-sm: 8px;
    --cdash-transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Dark Theme ─── */
[data-theme="dark"] {
    --cdash-bg: #0c1222;
    --cdash-bg-raised: #141d30;
    --cdash-bg-card: #182035;
    --cdash-bg-topbar: rgba(20, 29, 48, 0.85);
    --cdash-text: #e8ecf1;
    --cdash-text-dim: #8894a8;
    --cdash-border: rgba(255, 255, 255, 0.06);
    --cdash-glow: 0 0 40px rgba(var(--cdash-accent-rgb), 0.08);
    --cdash-shadow-card: 0 2px 12px rgba(0, 0, 0, 0.25);
    --cdash-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.35);
}

/* ─── Light Theme ─── */
[data-theme="light"] {
    --cdash-bg: #f4f6fa;
    --cdash-bg-raised: #ffffff;
    --cdash-bg-card: #ffffff;
    --cdash-bg-topbar: rgba(255, 255, 255, 0.85);
    --cdash-text: #1a1f36;
    --cdash-text-dim: #6b7a99;
    --cdash-border: rgba(0, 0, 0, 0.06);
    --cdash-glow: 0 0 40px rgba(var(--cdash-accent-rgb), 0.06);
    --cdash-shadow-card: 0 1px 4px rgba(0, 0, 0, 0.06);
    --cdash-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.1);
}

/* ═══════════════════════════════════
   GLOBAL — only cdash-active body
   ═══════════════════════════════════ */
body.cdash-active {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    background: var(--cdash-bg) !important;
    color: var(--cdash-text) !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Page body wrapper — the main content push */
body.cdash-active .cdash-page-wrap {
    margin-left: var(--cdash-sidebar-w);
    padding: calc(var(--cdash-topbar-h) + 28px) 28px 28px;
    min-height: 100vh;
    transition: margin-left var(--cdash-transition);
}

/* ═══════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════ */
.cdash-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--cdash-sidebar-w);
    height: 100vh;
    background: var(--cdash-bg-raised);
    border-right: 1px solid var(--cdash-border);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    transition: width var(--cdash-transition);
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.cdash-sidebar:hover {
    width: var(--cdash-sidebar-w-open);
    box-shadow: var(--cdash-shadow-hover);
}

/* Logo */
.cdash-sidebar__logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
    height: var(--cdash-topbar-h);
    border-bottom: 1px solid var(--cdash-border);
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
}

.cdash-sidebar__logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--cdash-accent), color-mix(in srgb, var(--cdash-accent) 70%, #000));
    color: #fff;
    font-size: 20px;
}

.cdash-sidebar__logo-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--cdash-text);
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.2s ease 0.05s, transform 0.2s ease 0.05s;
}

.cdash-sidebar:hover .cdash-sidebar__logo-text {
    opacity: 1;
    transform: none;
}

.cdash-sidebar__logo-text strong {
    font-weight: 700;
    color: var(--cdash-accent);
}

/* Dividers */
.cdash-sidebar__divider {
    padding: 16px 18px 6px;
    overflow: hidden;
    white-space: nowrap;
}

.cdash-sidebar__divider span {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--cdash-text-dim);
    opacity: 0;
    transition: opacity 0.2s ease 0.05s;
}

.cdash-sidebar:hover .cdash-sidebar__divider span {
    opacity: 0.7;
}

.cdash-sidebar__divider::after {
    content: '';
    display: block;
    height: 1px;
    background: var(--cdash-border);
    margin-top: 6px;
}

.cdash-sidebar:hover .cdash-sidebar__divider::after {
    opacity: 0;
}

/* Nav */
.cdash-sidebar__nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    scrollbar-width: thin;
    scrollbar-color: var(--cdash-border) transparent;
}

.cdash-sidebar__link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-radius: var(--cdash-radius-sm);
    color: var(--cdash-text-dim);
    text-decoration: none !important;
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    transition: all 0.15s ease;
    position: relative;
}

.cdash-sidebar__link i {
    font-size: 22px;
    min-width: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
}

.cdash-sidebar__link span {
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.2s ease 0.05s, transform 0.2s ease 0.05s;
}

.cdash-sidebar:hover .cdash-sidebar__link span {
    opacity: 1;
    transform: none;
}

.cdash-sidebar__link:hover {
    background: color-mix(in srgb, var(--cdash-accent) 8%, transparent);
    color: var(--cdash-text);
}

.cdash-sidebar__link:hover i {
    color: var(--cdash-accent);
}

/* Active state */
.cdash-sidebar__link--active {
    background: color-mix(in srgb, var(--cdash-accent) 12%, transparent) !important;
    color: var(--cdash-accent) !important;
}

.cdash-sidebar__link--active i {
    color: var(--cdash-accent) !important;
}

.cdash-sidebar__link--active::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 22px;
    border-radius: 0 4px 4px 0;
    background: var(--cdash-accent);
}

/* Sidebar Footer */
.cdash-sidebar__footer {
    padding: 14px;
    border-top: 1px solid var(--cdash-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.cdash-palette {
    display: flex;
    gap: 7px;
    justify-content: center;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.25s ease, max-height 0.25s ease;
}

.cdash-sidebar:hover .cdash-palette {
    opacity: 1;
    max-height: 36px;
}

.cdash-palette__dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    outline: none;
    padding: 0;
}

.cdash-palette__dot:hover {
    transform: scale(1.3);
}

.cdash-palette__dot--active {
    border-color: var(--cdash-text) !important;
    box-shadow: 0 0 0 3px rgba(var(--cdash-accent-rgb), 0.25);
    transform: scale(1.15);
}

.cdash-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 36px;
    border-radius: var(--cdash-radius-sm);
    border: 1px solid var(--cdash-border);
    background: transparent;
    cursor: pointer;
    color: var(--cdash-text-dim);
    font-size: 20px;
    transition: all 0.15s ease;
    padding: 0;
}

.cdash-theme-toggle:hover {
    color: var(--cdash-accent);
    border-color: var(--cdash-accent);
}

[data-theme="light"] .cdash-theme-toggle .bxs-sun {
    display: none;
}

[data-theme="light"] .cdash-theme-toggle .bxs-moon {
    display: inline-flex;
}

[data-theme="dark"] .cdash-theme-toggle .bxs-sun {
    display: inline-flex;
}

[data-theme="dark"] .cdash-theme-toggle .bxs-moon {
    display: none;
}

/* ═══════════════════════════════════
   TOP BAR
   ═══════════════════════════════════ */
.cdash-topbar {
    position: fixed;
    top: 0;
    left: var(--cdash-sidebar-w);
    right: 0;
    height: var(--cdash-topbar-h);
    background: var(--cdash-bg-topbar);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--cdash-border);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    transition: left var(--cdash-transition);
}

.cdash-topbar__menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--cdash-text);
    font-size: 24px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
}

.cdash-topbar__user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cdash-topbar__avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid color-mix(in srgb, var(--cdash-accent) 50%, transparent);
}

.cdash-topbar__greeting {
    font-size: 14px;
    color: var(--cdash-text-dim);
}

.cdash-topbar__greeting strong {
    color: var(--cdash-text);
    font-weight: 600;
}

.cdash-topbar__logout {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--cdash-radius-sm);
    color: var(--cdash-text-dim);
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--cdash-border);
    transition: all 0.15s ease;
}

.cdash-topbar__logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

.cdash-topbar__logout i {
    font-size: 18px;
}

/* ═══════════════════════════════════
   CUSTOM FOOTER
   ═══════════════════════════════════ */
.cdash-footer {
    margin-left: var(--cdash-sidebar-w);
    padding: 20px 28px;
    text-align: center;
    font-size: 12.5px;
    color: var(--cdash-text-dim);
    border-top: 1px solid var(--cdash-border);
    transition: margin-left var(--cdash-transition);
}

.cdash-footer a {
    color: var(--cdash-accent);
    text-decoration: none;
}

/* Hide Elementor footer/header */
body.cdash-active header.elementor-location-header,
body.cdash-active .elementor-location-header,
body.cdash-active [data-elementor-type="header"],
body.cdash-active footer.elementor-location-footer,
body.cdash-active .elementor-location-footer,
body.cdash-active [data-elementor-type="footer"] {
    display: none !important;
}

/* ═══════════════════════════════════
   DASHBOARD HOME
   ═══════════════════════════════════ */
.cdash-home {
    max-width: 1000px;
    margin: 0 auto;
}

.cdash-home__welcome {
    margin-bottom: 28px;
}

.cdash-home__welcome h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--cdash-text);
    margin: 0 0 6px;
    line-height: 1.35;
}

.cdash-home__welcome p {
    font-size: 15px;
    color: var(--cdash-text-dim);
    margin: 0;
}

.cdash-wave {
    display: inline-block;
    animation: cdash-wave 1.8s ease-in-out 0.5s infinite;
    transform-origin: 70% 70%;
}

@keyframes cdash-wave {

    0%,
    60%,
    100% {
        transform: rotate(0);
    }

    10%,
    30% {
        transform: rotate(14deg);
    }

    20% {
        transform: rotate(-8deg);
    }

    40% {
        transform: rotate(-4deg);
    }

    50% {
        transform: rotate(10deg);
    }
}

/* Cards grid */
.cdash-home__cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.cdash-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--cdash-bg-card);
    border: 1px solid var(--cdash-border);
    border-radius: var(--cdash-radius);
    padding: 22px 20px;
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: var(--cdash-shadow-card);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.cdash-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(135deg, rgba(var(--cdash-accent-rgb), 0.05), transparent 50%);
    transition: opacity 0.2s ease;
}

.cdash-card:hover::before {
    opacity: 1;
}

.cdash-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--cdash-shadow-hover);
    border-color: rgba(var(--cdash-accent-rgb), 0.3);
}

.cdash-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--card-color, var(--cdash-accent)) 12%, transparent);
    color: var(--card-color, var(--cdash-accent));
    font-size: 24px;
    flex-shrink: 0;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.cdash-card:hover .cdash-card__icon {
    background: var(--card-color, var(--cdash-accent));
    color: #fff;
    transform: scale(1.05);
}

.cdash-card__info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.cdash-card__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--cdash-text-dim);
}

.cdash-card__value {
    font-size: 22px;
    font-weight: 700;
    color: var(--cdash-text);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cdash-card__desc {
    font-size: 12px;
    color: var(--cdash-text-dim);
    margin-top: 1px;
}

/* Admin Section */
.cdash-home__admin {
    background: var(--cdash-bg-card);
    border: 1px solid var(--cdash-border);
    border-radius: var(--cdash-radius);
    padding: 22px 24px;
    box-shadow: var(--cdash-shadow-card);
}

.cdash-home__admin h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--cdash-text-dim);
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cdash-home__admin h3 i {
    color: var(--cdash-accent);
    font-size: 16px;
}

.cdash-home__admin-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cdash-admin-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--cdash-radius-sm);
    background: color-mix(in srgb, var(--cdash-accent) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--cdash-accent) 15%, transparent);
    color: var(--cdash-text) !important;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.cdash-admin-link:hover {
    background: color-mix(in srgb, var(--cdash-accent) 15%, transparent);
    border-color: var(--cdash-accent);
    transform: translateY(-1px);
}

.cdash-admin-link i {
    font-size: 17px;
    color: var(--cdash-accent);
}

/* ═══════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════ */
.cdash-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cdash-bg);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.cdash-login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--cdash-accent-rgb), 0.12), transparent 70%);
    top: -200px;
    right: -200px;
}

.cdash-login-page::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--cdash-accent-rgb), 0.08), transparent 70%);
    bottom: -150px;
    left: -150px;
}

.cdash-login-box {
    width: 100%;
    max-width: 420px;
    background: var(--cdash-bg-card);
    border: 1px solid var(--cdash-border);
    border-radius: 20px;
    padding: 48px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    text-align: center;
}

.cdash-login-box__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.cdash-login-box__logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--cdash-accent), color-mix(in srgb, var(--cdash-accent) 70%, #000));
    color: #fff;
    font-size: 28px;
}

.cdash-login-box__logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--cdash-text);
}

.cdash-login-box__logo-text span {
    color: var(--cdash-accent);
}

.cdash-login-box__subtitle {
    font-size: 14px;
    color: var(--cdash-text-dim);
    margin-bottom: 32px;
}

.cdash-login-box .login-form label {
    display: block;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--cdash-text-dim);
    margin-bottom: 6px;
    margin-top: 16px;
}

.cdash-login-box .login-form input[type="text"],
.cdash-login-box .login-form input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--cdash-bg);
    border: 1px solid var(--cdash-border);
    border-radius: var(--cdash-radius-sm);
    color: var(--cdash-text);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.15s ease;
    box-sizing: border-box;
}

.cdash-login-box .login-form input:focus {
    outline: none;
    border-color: var(--cdash-accent);
    box-shadow: 0 0 0 3px rgba(var(--cdash-accent-rgb), 0.15);
}

.cdash-login-box .login-form .login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0 4px;
    font-size: 13px;
    color: var(--cdash-text-dim);
}

.cdash-login-box .login-form input[type="submit"] {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--cdash-accent), color-mix(in srgb, var(--cdash-accent) 80%, #000));
    color: #fff;
    border: none;
    border-radius: var(--cdash-radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-top: 22px;
}

.cdash-login-box .login-form input[type="submit"]:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--cdash-accent-rgb), 0.3);
}

.cdash-login-box__error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--cdash-radius-sm);
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #f87171;
    text-align: left;
}

/* ═══════════════════════════════════
   OVERLAY
   ═══════════════════════════════════ */
.cdash-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cdash-overlay--visible {
    opacity: 1;
    visibility: visible;
}

/* ═══════════════════════════════════
   WP ADMIN BAR OFFSET
   ═══════════════════════════════════ */
body.cdash-active.admin-bar .cdash-sidebar {
    top: 32px;
    height: calc(100vh - 32px);
}

body.cdash-active.admin-bar .cdash-topbar {
    top: 32px;
}

body.cdash-active.admin-bar .cdash-page-wrap {
    padding-top: calc(var(--cdash-topbar-h) + 32px + 28px);
}

/* ═══════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════ */
@media (max-width: 1100px) {
    .cdash-home__cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .cdash-sidebar {
        transform: translateX(-100%);
        width: var(--cdash-sidebar-w-open) !important;
    }

    .cdash-sidebar.cdash-sidebar--open {
        transform: translateX(0);
        box-shadow: var(--cdash-shadow-hover);
    }

    .cdash-sidebar.cdash-sidebar--open .cdash-sidebar__link span,
    .cdash-sidebar.cdash-sidebar--open .cdash-sidebar__logo-text {
        opacity: 1;
        transform: none;
    }

    .cdash-sidebar.cdash-sidebar--open .cdash-palette {
        opacity: 1;
        max-height: 36px;
    }

    .cdash-sidebar.cdash-sidebar--open .cdash-sidebar__divider span {
        opacity: 0.7;
    }

    .cdash-topbar {
        left: 0 !important;
    }

    .cdash-topbar__menu-btn {
        display: flex !important;
    }

    .cdash-page-wrap,
    body.cdash-active .cdash-page-wrap {
        margin-left: 0 !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .cdash-footer {
        margin-left: 0 !important;
    }

    .cdash-home__cards {
        grid-template-columns: 1fr;
    }

    .cdash-home__welcome h1 {
        font-size: 22px;
    }

    .cdash-login-box {
        padding: 36px 28px;
    }
}

/* ═══════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════ */
@keyframes cdash-fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cdash-home {
    animation: cdash-fadeUp 0.5s ease;
}

.cdash-card {
    animation: cdash-fadeUp 0.5s ease backwards;
}

.cdash-card:nth-child(1) {
    animation-delay: 0.05s;
}

.cdash-card:nth-child(2) {
    animation-delay: 0.1s;
}

.cdash-card:nth-child(3) {
    animation-delay: 0.15s;
}

.cdash-card:nth-child(4) {
    animation-delay: 0.2s;
}

.cdash-card:nth-child(5) {
    animation-delay: 0.25s;
}

.cdash-card:nth-child(6) {
    animation-delay: 0.3s;
}