:root {
    --bg1: #1e0f2a;
    --bg2: #4b197f;
    --card: rgba(255, 255, 255, 0.95);
    --muted: #bfaed6;
    --accent: #a76bff;
    --glass: rgba(255, 255, 255, 0.06);
    --shadow: 0 6px 18px rgba(9, 6, 23, 0.45);
    --success: #6ce3b1;
}

* {
    box-sizing: border-box;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
}

html,
body,
#app {
    height: 100%
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg1) 0%, var(--bg2) 100%);
    color: #f6f3ff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding: 20px;
}

.app {
    display: flex;
    gap: 18px;
    max-width: 1200px;
    margin: 0 auto;
    background: transparent;
}

/* Sidebar */
.sidebar {
    width: 220px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    border-radius: 14px;
    padding: 18px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 720px;
    backdrop-filter: blur(6px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px
}

.logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff2, #fff1);
    color: #fff;
    font-weight: 700;
    color: var(--bg1);
    font-size: 18px;
}

.brand-text {
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.2px
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px
}

.nav-btn {
    background: transparent;
    border: 0;
    color: var(--muted);
    padding: 10px;
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
    font-size: 15px;
}

.nav-btn.active {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02)
}

.sidebar-footer {
    color: var(--muted);
    font-size: 12px;
    text-align: center;
    margin-top: 10px
}

/* Main */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.search input {
    padding: 10px 14px;
    border-radius: 10px;
    border: 0;
    background: var(--glass);
    color: #fff;
    min-width: 280px;
    outline: none;
}

.profile .user {
    background: rgba(255, 255, 255, 0.06);
    padding: 8px 12px;
    border-radius: 12px
}

/* Views */
.views {
    background: transparent;
    padding: 6px
}

.view {
    display: none
}

.view.active {
    display: block
}

h2 {
    margin: 6px 0 14px 0;
    color: #fff
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.card {
    background: var(--card);
    color: #221;
    padding: 14px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.card h3 {
    margin: 0 0 8px 0;
    color: #3b1b4b
}

.mini-list {
    display: flex;
    flex-direction: column;
    gap: 8px
}

.mini-list .item {
    background: linear-gradient(180deg, #fff, #fff);
    padding: 8px;
    border-radius: 8px;
    font-size: 14px;
    color: #2b1630
}

.panel {
    display: flex;
    gap: 16px
}

.left-col {
    flex: 0.5;
    display: flex;
    flex-direction: column;
    gap: 10px
}

.right-col {
    flex: 0.5
}

textarea,
input,
select {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 0;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    outline: none
}

.list {
    display: flex;
    flex-direction: column;
    gap: 8px
}

.list .list-item {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    padding: 10px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
}

.list .meta {
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px
}

/* small controls */
.btn {
    padding: 8px 12px;
    border-radius: 10px;
    border: 0;
    background: linear-gradient(90deg, var(--accent), #7e4bff);
    color: #fff;
    cursor: pointer;
}

.btn.ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.06)
}

.btn.small {
    padding: 6px 8px;
    font-size: 13px
}

/* balance */
.balance {
    font-weight: 800;
    font-size: 20px;
    color: #2b1630;
    background: linear-gradient(90deg, #fff, #fff);
    padding: 10px;
    border-radius: 10px;
    text-align: center
}

/* calendar */
.calendar-panel {
    background: var(--card);
    padding: 12px;
    border-radius: 12px;
    box-shadow: var(--shadow)
}

.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px
}

.cal-month {
    font-weight: 700;
    color: #3b1b4b
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px
}

.cal-day {
    min-height: 90px;
    padding: 8px;
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cal-day .date {
    font-size: 13px;
    color: var(--muted)
}

.cal-day .badge {
    background: var(--accent);
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 12px;
    color: #fff
}

/* footer */
.footer {
    text-align: center;
    color: var(--muted);
    margin-top: 14px
}

/* responsive */
@media (max-width:980px) {
    .app {
        flex-direction: column;
        padding: 12px
    }

    .sidebar {
        width: 100%;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 10px
    }

    .brand-text {
        display: none
    }

    .main {
        width: 100%
    }

    .cards-grid {
        grid-template-columns: 1fr
    }
}

/* --- FIX: Change Focused Input Background from White to Dark --- */

textarea:focus,
input:focus,
select:focus {
    /* Set a very dark background to contrast with the existing white text. 
       We use !important to guarantee this overrides the conflicting light background. */
    background: #020302 !important;

    /* Optional: If you want a subtle highlight, keep a light border */
    border: 1px solid rgba(255, 255, 255, 0.1) !important;

    /* Ensure no ugly default focus outline appears */
    outline: none !important;

    /* IMPORTANT: Remove any conflicting 'color' rules if they exist elsewhere.
       Do NOT set a color here, so the text remains light (white). */
}

/* CSS Class for Completed Items */
.completed-item {
    /* Add the strike-through line */
    text-decoration: line-through;

    /* Optional: Make the text slightly transparent to indicate completion */
    opacity: 0.6;

    /* Optional: Change the color to a muted gray */
    color: var(--muted);
}