/* =====================================================================
   Doodle Expenses — Notebook & Sticker theme
   --------------------------------------------------------------------
   A warm, hand-crafted aesthetic with paper textures, washi-tape
   accents, marker-style underlines and soft sticker shadows.
   ===================================================================== */

:root {
    /* Paper palette */
    --paper:        #fdf8ee;
    --paper-warm:   #f8efd9;
    --paper-edge:   #ead9b5;
    --ink:          #2a2438;
    --ink-soft:     #5a4f6a;
    --muted:        #8a7d96;

    /* Accents (sticker pop) */
    --pop-mint:     #a8e6cf;
    --pop-peach:    #ffb5a7;
    --pop-lemon:    #ffe066;
    --pop-lilac:    #c8b6ff;
    --pop-sky:      #a0d8f1;
    --pop-rose:     #ffafcc;
    --pop-sage:     #cde4c8;

    --primary:      #6c5ce7;
    --primary-deep: #5346c4;
    --success:      #2bb673;
    --warning:      #e8a33c;
    --danger:       #e0535d;
    --info:         #3b82c4;

    --radius-sm:    10px;
    --radius:       18px;
    --radius-lg:    26px;
    --radius-xl:    32px;

    /* Sticker shadow — slight 3D pop with warm undertone */
    --shadow-sticker: 4px 5px 0 rgba(42, 36, 56, 0.12), 0 12px 24px -12px rgba(42, 36, 56, 0.18);
    --shadow-card:    0 1px 0 rgba(42, 36, 56, 0.06), 0 14px 28px -18px rgba(42, 36, 56, 0.18);
    --shadow-deep:    0 30px 60px -30px rgba(108, 92, 231, 0.35);
}

/* ---------------------------------------------------------------------
   Reset & global
   --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Patrick Hand', 'Bradley Hand', 'Comic Sans MS', 'Segoe Print', 'Marker Felt', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
    color: var(--ink);
    background-color: var(--paper);
    background-image:
        radial-gradient(circle at 20% 18%, rgba(168, 230, 207, 0.45) 0%, transparent 38%),
        radial-gradient(circle at 82% 12%, rgba(255, 224, 102, 0.40) 0%, transparent 32%),
        radial-gradient(circle at 78% 88%, rgba(255, 181, 167, 0.38) 0%, transparent 36%),
        radial-gradient(circle at 12% 90%, rgba(200, 182, 255, 0.40) 0%, transparent 38%),
        repeating-linear-gradient(0deg, transparent 0px, transparent 30px, rgba(178, 158, 132, 0.08) 30px, rgba(178, 158, 132, 0.08) 31px);
    min-height: 100vh;
    line-height: 1.5;
    font-size: 16px;
    letter-spacing: 0.2px;
}

/* Subtle paper grain overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(circle at 4px 4px, rgba(60, 40, 20, 0.05) 1px, transparent 1px);
    background-size: 6px 6px;
    opacity: 0.55;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-style: wavy; text-underline-offset: 4px; }
button { font-family: inherit; }
img, svg { max-width: 100%; }

h1, h2, h3, h4 {
    font-family: 'Patrick Hand', 'Caveat', 'Bradley Hand', cursive;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 0.4em;
    letter-spacing: 0.5px;
}
h1 { font-size: clamp(2rem, 4vw, 2.6rem); }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 0.6em; }
.muted { color: var(--muted); font-size: 0.95rem; }

.icon { width: 22px; height: 22px; flex-shrink: 0; }
.brand-icon { width: 28px; height: 28px; }
.button-icon { width: 18px; height: 18px; margin-right: 6px; }
.nav-icon { width: 22px; height: 22px; }
.hero-icon { width: 22px; height: 22px; }

/* =====================================================================
   App shell
   ===================================================================== */
.page-root { position: relative; z-index: 1; }

.app-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    gap: 0;
}

/* --- Sidebar -------------------------------------------------------- */
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 18px;
    z-index: 5;
}

.sidebar-inner {
    height: 100%;
    background-color: #fffaf0;
    background-image:
        linear-gradient(180deg, rgba(255, 224, 102, 0.18) 0%, rgba(200, 182, 255, 0.10) 100%),
        repeating-linear-gradient(0deg, transparent 0 28px, rgba(60, 40, 20, 0.05) 28px 29px);
    border: 2px dashed var(--paper-edge);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sticker);
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
}

/* washi tape on top of sidebar */
.sidebar-inner::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 32px;
    width: 70px;
    height: 22px;
    background: repeating-linear-gradient(45deg, var(--pop-peach) 0 6px, #ffd4c8 6px 12px);
    transform: rotate(-3deg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    border-radius: 2px;
    opacity: 0.85;
}
.sidebar-inner::after {
    content: '';
    position: absolute;
    top: -8px;
    right: 28px;
    width: 54px;
    height: 22px;
    background: repeating-linear-gradient(45deg, var(--pop-mint) 0 6px, #c0eedd 6px 12px);
    transform: rotate(4deg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    border-radius: 2px;
    opacity: 0.85;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 6px 14px;
    border-bottom: 2px dashed var(--paper-edge);
    color: inherit;
}
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 48px; height: 48px;
    background: var(--pop-lemon);
    border: 2px solid var(--ink);
    border-radius: 14px;
    display: grid; place-items: center;
    box-shadow: 3px 3px 0 var(--ink);
    transform: rotate(-4deg);
    color: var(--ink);
}
.brand-stack { display: flex; flex-direction: column; line-height: 1.1; }
.brand-stack strong { font-size: 1.25rem; }
.brand-stack span { font-size: 0.78rem; color: var(--muted); }

.nav-list { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 14px;
    color: var(--ink-soft);
    font-size: 1rem;
    transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
    border: 2px solid transparent;
    position: relative;
}
.nav-link:hover {
    background: rgba(108, 92, 231, 0.10);
    color: var(--primary-deep);
    text-decoration: none;
    transform: translateX(2px);
}
.nav-link.active {
    background: var(--pop-lemon);
    border: 2px solid var(--ink);
    color: var(--ink);
    box-shadow: 3px 3px 0 var(--ink);
    transform: rotate(-1deg);
}
.nav-link.active::before {
    content: '';
    position: absolute;
    left: -6px; top: 50%;
    transform: translateY(-50%);
    width: 6px; height: 60%;
    background: var(--primary);
    border-radius: 4px;
}

.sidebar-footer {
    padding-top: 12px;
    border-top: 2px dashed var(--paper-edge);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(168, 230, 207, 0.40);
    border: 2px solid var(--ink);
    border-radius: 14px;
    box-shadow: 2px 2px 0 var(--ink);
    transform: rotate(0.5deg);
}
.user-avatar {
    width: 36px; height: 36px;
    background: var(--pop-rose);
    border: 2px solid var(--ink);
    border-radius: 50%;
    display: grid; place-items: center;
    color: var(--ink);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.1; }
.user-meta strong { font-size: 1rem; }
.user-meta span { font-size: 0.75rem; color: var(--ink-soft); }

.logout-button {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px;
    background: var(--pop-peach);
    border: 2px solid var(--ink);
    border-radius: 14px;
    color: var(--ink);
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 2px 2px 0 var(--ink);
    transition: transform 0.15s ease;
}
.logout-button:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.logout-button:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }

/* --- Main ----------------------------------------------------------- */
.main {
    padding: 32px clamp(20px, 4vw, 48px) 60px;
    max-width: 1280px;
    width: 100%;
}

/* Hero */
.hero {
    position: relative;
    background: linear-gradient(135deg, #fff7d6 0%, #ffe1cc 50%, #d8c8ff 100%);
    border: 2px solid var(--ink);
    border-radius: var(--radius-xl);
    padding: 26px 30px;
    box-shadow: 5px 5px 0 var(--ink), var(--shadow-deep);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 5px 5px, rgba(42, 36, 56, 0.10) 1.2px, transparent 1.5px);
    background-size: 12px 12px;
    opacity: 0.45;
    pointer-events: none;
}
.hero-copy { position: relative; z-index: 1; max-width: 60ch; }
.hero-copy h1 {
    margin-bottom: 6px;
    text-shadow: 2px 2px 0 rgba(255,255,255,0.5);
}
.hero-copy h1::after {
    content: '';
    display: block;
    height: 8px;
    width: 200px;
    background: var(--pop-lemon);
    margin-top: -10px;
    margin-left: 4px;
    transform: skewX(-8deg);
    border-radius: 6px;
    opacity: 0.7;
}
.hero-copy p { font-size: 1.05rem; color: var(--ink-soft); }
.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.7);
    border: 1.5px dashed var(--ink);
    border-radius: 999px;
    padding: 4px 14px;
    font-size: 0.85rem;
    color: var(--ink);
    margin-bottom: 14px;
}
.hero-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.85);
    border: 2px solid var(--ink);
    border-radius: 18px;
    padding: 12px 18px;
    box-shadow: 3px 3px 0 var(--ink);
    transform: rotate(2deg);
    position: relative;
    z-index: 1;
}
.hero-meta strong { display: block; font-size: 1rem; }
.hero-meta span { font-size: 0.85rem; color: var(--muted); }
.hero-emoji {
    width: 44px; height: 44px;
    background: var(--pop-rose);
    border: 2px solid var(--ink);
    border-radius: 12px;
    display: grid; place-items: center;
    color: var(--ink);
}
.hero-decor {
    position: absolute;
    color: rgba(108, 92, 231, 0.25);
    pointer-events: none;
}
.hero-decor--left { left: -12px; bottom: -16px; transform: rotate(-15deg); }
.hero-decor--right { right: 200px; top: 12px; transform: rotate(20deg); color: rgba(255, 181, 167, 0.6); }
.hero-decor .decor { width: 70px; height: 70px; }

.app-foot {
    margin-top: 40px;
    text-align: center;
    color: var(--muted);
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* =====================================================================
   Content grid & panels
   ===================================================================== */
.content-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.panel {
    position: relative;
    background: #fffaf0;
    border: 2px solid var(--ink);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    box-shadow: var(--shadow-sticker);
}

.panel--note {
    background:
        repeating-linear-gradient(0deg, #fffaf0 0 28px, #fff 28px 30px);
}
.panel--accent { background: linear-gradient(135deg, #fff5dc 0%, #ffe6d0 100%); }
.panel--mint   { background: linear-gradient(135deg, #e6faef 0%, #d8f3ea 100%); }
.panel--rose   { background: linear-gradient(135deg, #ffeaf2 0%, #ffd5e0 100%); }
.panel--sky    { background: linear-gradient(135deg, #e3f4ff 0%, #d0e9fc 100%); }
.panel--lilac  { background: linear-gradient(135deg, #f0eaff 0%, #ddd0ff 100%); }

.panel--tape::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 28px;
    width: 80px;
    height: 18px;
    background: repeating-linear-gradient(45deg, var(--pop-mint) 0 6px, #c0eedd 6px 12px);
    transform: rotate(-2deg);
    border-radius: 2px;
    opacity: 0.9;
    box-shadow: 0 2px 3px rgba(0,0,0,0.08);
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.panel-head h2 { margin-bottom: 4px; }
.section-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 14px; }

.split-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.stack { display: flex; flex-direction: column; gap: 14px; }
.inline-fields { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

/* =====================================================================
   Stats / cards
   ===================================================================== */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.stats-five { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.stat-card {
    background: #fff;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: 3px 3px 0 var(--ink);
    position: relative;
    transition: transform 0.15s ease;
}
.stat-card:nth-child(4n+1) { transform: rotate(-0.7deg); }
.stat-card:nth-child(4n+2) { transform: rotate(0.6deg); }
.stat-card:nth-child(4n+3) { transform: rotate(-0.4deg); }
.stat-card:nth-child(4n)   { transform: rotate(0.9deg); }
.stat-card:hover { transform: translate(-1px, -2px) rotate(0); box-shadow: 5px 5px 0 var(--ink); }

.stat-card::after {
    content: '';
    position: absolute;
    top: -8px; right: 14px;
    width: 32px; height: 14px;
    background: repeating-linear-gradient(45deg, var(--pop-lemon) 0 4px, #ffd866 4px 8px);
    transform: rotate(8deg);
    border-radius: 2px;
    opacity: 0.85;
    box-shadow: 0 2px 3px rgba(0,0,0,0.08);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.stat-value {
    font-family: 'Patrick Hand', 'Bradley Hand', cursive;
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.1;
}
.stat-note {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.amount-positive { color: var(--success); }
.amount-negative { color: var(--danger); }

/* Action tiles */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}
.action-tile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px 22px 26px;
    border-radius: var(--radius);
    border: 2px solid var(--ink);
    box-shadow: 4px 4px 0 var(--ink);
    color: var(--ink);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    overflow: hidden;
}
.action-tile:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--ink);
    text-decoration: none;
}
.action-tile h3 { margin-top: 4px; margin-bottom: 0; }
.action-tile p { font-size: 0.92rem; color: var(--ink-soft); margin-bottom: 0; }
.action-tile .brand-icon { color: var(--ink); }

.tile-mint   { background: linear-gradient(135deg, #d4f6e2 0%, #b8ecd0 100%); }
.tile-peach  { background: linear-gradient(135deg, #ffd9cc 0%, #ffb5a7 100%); }
.tile-lemon  { background: linear-gradient(135deg, #fff0a8 0%, #ffe066 100%); }
.tile-lilac  { background: linear-gradient(135deg, #e8dcff 0%, #c8b6ff 100%); }
.tile-sky    { background: linear-gradient(135deg, #d0eafd 0%, #a0d8f1 100%); }
.tile-rose   { background: linear-gradient(135deg, #ffd4e3 0%, #ffafcc 100%); }

.action-tile::before {
    content: '';
    position: absolute;
    top: -8px; left: 18px;
    width: 70px; height: 16px;
    background: rgba(255, 255, 255, 0.7);
    transform: rotate(-3deg);
    border-radius: 2px;
    box-shadow: 0 2px 3px rgba(0,0,0,0.06);
    opacity: 0.85;
}

/* =====================================================================
   Forms
   ===================================================================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px 18px;
}
.field-full { grid-column: 1 / -1; }
.field-stack { display: flex; flex-direction: column; gap: 6px; }

label {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: var(--ink);
    font-weight: 600;
}

input[type="text"], input[type="password"], input[type="number"],
input[type="email"], input[type="date"], input[type="time"],
input[type="month"], input[type="search"], select, textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--ink);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font-family: inherit;
    font-size: 1rem;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    box-shadow: inset 0 0 0 0 transparent;
}
textarea { min-height: 96px; resize: vertical; }

input:focus, select:focus, textarea:focus {
    outline: none;
    box-shadow: 3px 3px 0 var(--primary);
    transform: translate(-1px, -1px);
    border-color: var(--primary);
}

select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232a2438' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.button, .button-secondary, .button-danger, .button-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 20px;
    border-radius: 14px;
    border: 2px solid var(--ink);
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
    color: var(--ink);
}
.button {
    background: var(--pop-lemon);
    box-shadow: 3px 3px 0 var(--ink);
}
.button-secondary {
    background: #fff;
    box-shadow: 3px 3px 0 var(--ink);
}
.button-danger {
    background: var(--pop-peach);
    box-shadow: 3px 3px 0 var(--ink);
}
.button-ghost {
    background: transparent;
    border: 2px dashed var(--ink);
    box-shadow: none;
}
.button:hover, .button-secondary:hover, .button-danger:hover {
    transform: translate(-1px, -2px);
    box-shadow: 5px 5px 0 var(--ink);
    text-decoration: none;
}
.button:active, .button-secondary:active, .button-danger:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--ink);
}
.button-ghost:hover { background: rgba(108, 92, 231, 0.08); text-decoration: none; }

.button-icon { width: 18px; height: 18px; }

/* Messages */
.message {
    padding: 12px 16px;
    border-radius: 14px;
    border: 2px solid var(--ink);
    box-shadow: 3px 3px 0 var(--ink);
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.message.success { background: var(--pop-mint); }
.message.error   { background: var(--pop-peach); }
.message.info    { background: var(--pop-sky); }
.message.warning { background: var(--pop-lemon); }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #fff;
    border: 2px solid var(--ink);
    border-radius: 999px;
    font-size: 0.85rem;
    box-shadow: 2px 2px 0 var(--ink);
}
.badge-success { background: var(--pop-mint); }
.badge-warning { background: var(--pop-lemon); }
.badge-danger  { background: var(--pop-peach); }
.badge-sky     { background: var(--pop-sky); }
.badge-lilac   { background: var(--pop-lilac); }

/* Tone groups for split forms */
.tone-danger, .tone-success, .tone-info {
    background: #fff;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: 3px 3px 0 var(--ink);
    position: relative;
}
.tone-danger  { background: linear-gradient(135deg, #ffe7e1 0%, #ffd0c5 100%); }
.tone-success { background: linear-gradient(135deg, #dcf6e8 0%, #b8ecd0 100%); }
.tone-info    { background: linear-gradient(135deg, #d8eaff 0%, #b9d8f5 100%); }

/* =====================================================================
   Tables
   ===================================================================== */
.table-wrap {
    border-radius: var(--radius);
    border: 2px solid var(--ink);
    overflow-x: auto;
    background: #fff;
    box-shadow: 3px 3px 0 var(--ink);
}
table { width: 100%; border-collapse: collapse; }
thead th {
    background: var(--pop-lemon);
    border-bottom: 2px solid var(--ink);
    text-align: left;
    padding: 12px 14px;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
tbody td {
    padding: 12px 14px;
    border-bottom: 1.5px dashed rgba(42, 36, 56, 0.18);
    font-size: 0.98rem;
}
tbody tr:nth-child(even) td { background: rgba(255, 224, 102, 0.10); }
tbody tr:hover td { background: rgba(108, 92, 231, 0.08); }
tbody tr:last-child td { border-bottom: 0; }

.flow-stack { display: flex; flex-direction: column; gap: 4px; }
.flow-chip {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1.5px solid var(--ink);
    font-size: 0.8rem;
    background: #fff;
}
.flow-debit { background: var(--pop-peach); }
.flow-credit { background: var(--pop-mint); }

/* =====================================================================
   Login / Register
   ===================================================================== */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
}
.login-shell {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: min(960px, 100%);
    background: #fffaf0;
    border: 2.5px solid var(--ink);
    border-radius: var(--radius-xl);
    box-shadow: 8px 8px 0 var(--ink), 0 30px 50px -30px rgba(0,0,0,0.4);
    overflow: hidden;
    position: relative;
}
.login-shell::before {
    content: '';
    position: absolute;
    top: -14px; left: 60px;
    width: 120px; height: 26px;
    background: repeating-linear-gradient(45deg, var(--pop-rose) 0 8px, #ffc6d6 8px 16px);
    transform: rotate(-3deg);
    box-shadow: 0 3px 5px rgba(0,0,0,0.08);
    border-radius: 2px;
    opacity: 0.92;
    z-index: 2;
}
.login-form-side {
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.login-brand-block {
    display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
}
.login-brand-mark {
    width: 60px; height: 60px;
    background: var(--pop-lemon);
    border: 2px solid var(--ink);
    border-radius: 16px;
    display: grid; place-items: center;
    box-shadow: 4px 4px 0 var(--ink);
    transform: rotate(-4deg);
    color: var(--ink);
}
.login-form-side h1 { margin-bottom: 6px; font-size: 2rem; }
.login-form-side h1::after {
    content: '';
    display: block;
    height: 8px;
    width: 120px;
    background: var(--pop-mint);
    margin-top: -8px;
    margin-left: 4px;
    transform: skewX(-12deg);
    border-radius: 4px;
    opacity: 0.7;
}
.login-subtitle { color: var(--ink-soft); margin-bottom: 24px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.login-input-wrap input { padding-left: 44px; }
.login-icon {
    position: absolute;
    left: 14px;
    color: var(--muted);
    width: 20px; height: 20px;
    pointer-events: none;
}
.login-footer-note {
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.login-brand-side {
    background: linear-gradient(160deg, var(--primary) 0%, #4f3fc4 60%, #3520a8 100%);
    color: #fff;
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.login-brand-side::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 4px 4px, rgba(255,255,255,0.08) 1px, transparent 1.5px);
    background-size: 14px 14px;
    pointer-events: none;
}
.login-brand-side::after {
    content: '✦  ★  ✧  ✦';
    position: absolute;
    top: 22px; right: 22px;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.5);
    letter-spacing: 6px;
}
.login-brand-side h2 { color: #fff; font-size: 1.7rem; }
.login-brand-side p { color: rgba(255,255,255,0.85); margin-bottom: 22px; }
.login-feature-list { display: flex; flex-direction: column; gap: 14px; }
.login-feature {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: rgba(255,255,255,0.10);
    padding: 12px;
    border: 1.5px dashed rgba(255,255,255,0.4);
    border-radius: 14px;
}
.login-feature-mark {
    width: 38px; height: 38px;
    background: var(--pop-lemon);
    border-radius: 12px;
    display: grid; place-items: center;
    color: var(--ink);
    border: 2px solid var(--ink);
    flex-shrink: 0;
}
.login-feature strong { color: #fff; display: block; }
.login-feature span { color: rgba(255,255,255,0.78); font-size: 0.88rem; }

@media (max-width: 760px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-brand-side { display: none; }
}

/* =====================================================================
   Mobile / responsive
   ===================================================================== */
.mobile-nav-button {
    display: none;
    position: fixed;
    top: 16px; left: 16px;
    z-index: 30;
    width: 44px; height: 44px;
    background: var(--pop-lemon);
    border: 2px solid var(--ink);
    border-radius: 12px;
    box-shadow: 3px 3px 0 var(--ink);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(42, 36, 56, 0.45);
    z-index: 4;
}
.sidebar-overlay.is-open { display: block; }

@media (max-width: 980px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        width: 280px;
        transition: left 0.25s ease;
    }
    .sidebar.is-open { left: 0; }
    .mobile-nav-button { display: inline-flex; }
    .main { padding-top: 70px; }
}

/* =====================================================================
   Misc utilities
   ===================================================================== */
.text-center { text-align: center; }
.divider {
    height: 0;
    border: 0;
    border-top: 2px dashed var(--paper-edge);
    margin: 16px 0;
}

/* Empty-state doodle */
.empty {
    text-align: center;
    padding: 28px 18px;
    color: var(--muted);
    font-size: 1rem;
}
.empty .icon { width: 48px; height: 48px; margin-bottom: 10px; color: var(--ink-soft); }

/* Bar mini-chart for budget vs actual */
.bar-line {
    height: 12px;
    border-radius: 999px;
    background: rgba(42,36,56,0.10);
    overflow: hidden;
    border: 1.5px solid var(--ink);
    position: relative;
}
.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--pop-mint), var(--success));
    transition: width 0.4s ease;
}
.bar-fill.over { background: linear-gradient(90deg, var(--pop-peach), var(--danger)); }

/* Repeatable input rows */
.line-row {
    display: grid;
    grid-template-columns: minmax(160px, 2fr) minmax(160px, 1.5fr) minmax(110px, 1fr) auto;
    gap: 10px;
    align-items: end;
    padding: 10px;
    border: 1.5px dashed var(--paper-edge);
    border-radius: 14px;
    background: #fff;
    margin-bottom: 8px;
}

@media (max-width: 720px) {
    .line-row { grid-template-columns: 1fr; }
}

/* Print friendly */
@media print {
    body::before, .sidebar, .mobile-nav-button, .actions { display: none !important; }
    .main { padding: 0; }
    .panel { box-shadow: none; }
}
