body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #090d16;
    color: #f1f5f9;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

#page-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header-container {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

header {
    background-color: #111827b3;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #1f2937;
    position: relative;
    z-index: 2;
}

.logo-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: #10b981;
}

.logo-name img {
    height: 1em;
    width: auto;
}

.header-btn-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#canvas1 {
    position: fixed;
    top: 0; 
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #090d16;
    z-index: 0;
}

main {
    max-width: 500px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1rem;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: #111827b3;
    border: 1px solid #1f2937;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    margin-bottom: 1.5rem;
}

.auth-tabs {
    display: flex;
    background: #0b0f19b3;
    border-bottom: 1px solid #1f2937;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: #6b7280;
    padding: 1rem;
    cursor: pointer;
    font-weight: 600;
}

.tab-btn.active {
    color: #10b981;
    background: #111827b3;
    border-bottom: 2px solid #10b981;
}

.auth-form {
    padding: 1.5rem;
}

.auth-toggle-link {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.85rem;
    color: #9ca3af;
    cursor: pointer;
    text-decoration: underline;
}
.auth-toggle-link:hover {
    color: #10b981;
}

.input-group { margin-bottom: 1.25rem; }
.input-group label { display: block; font-size: 0.85rem; color: #9ca3af; margin-bottom: 0.4rem; }
.input-group input, .form-select {
    width: 100%; padding: 0.75rem; background: #1f2937; border: 1px solid #374151;
    border-radius: 6px; color: #fff; box-sizing: border-box; font-size: 1rem;
}
.input-group input:focus, .form-select:focus { outline: none; border-color: #10b981; }

.price-input-container, .amount-input-container { display: flex; gap: 0.5rem; }
.quick-helpers { display: flex; gap: 0.25rem; }
.btn-pill {
    background: #374151; border: none; color: #d1d5db; padding: 0 0.75rem;
    border-radius: 6px; cursor: pointer; font-weight: bold;
}
.btn-pill:hover { background: #4b5563; color: #fff; }

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] { -moz-appearance: textfield; }

.btn {
    background: #10b981; color: #062016; padding: 0.4rem 1rem;
    border-radius: 6px; font-weight: bold; border: none; cursor: pointer; font-size: 0.95rem;
}
.btn:hover { background: #34d399; }
.btn-block { width: 100%; padding: 0.75rem; font-size: 1rem; }
.btn-secondary {
    background: transparent; border: 1px solid #10b981; color: #10b981;
    padding: 0.4rem 1rem; border-radius: 6px; cursor: pointer; font-size: 0.95rem;
    font-weight: bold;
}
.btn-secondary:hover { border-color: #34d399; color: #34d399; }

#nav-btn-logout:hover { border-color: #ef4444; color: #ef4444; }

.share-card {
    background: #1e1b4bb3; border: 1px solid #312e81; padding: 0.75rem 1rem; box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    border-radius: 8px; margin-bottom: 1.5rem; display: flex; flex-direction: column; gap: 0.2rem;
}
.share-label { font-size: 0.75rem; color: #818cf8; font-weight: 600; }
#share-link-input {
    background: transparent; border: none; color: #c084fc; font-family: monospace;
    font-size: 0.85rem; width: 100%; cursor: pointer; outline: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .stats-grid { grid-template-columns: 1fr; }
}

.stat-card {
    flex: 1; background: #111827b3; border: 1px solid #1f2937;
    padding: 1rem; border-radius: 10px; text-align: center;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}
.stat-title { display: block; font-size: 0.8rem; color: #9ca3af; text-transform: uppercase; }
.stat-value { font-size: 1.5rem; font-weight: 800; color: #fff; display: block; margin-top: 0.25rem; }

.heatmap-container {
    background: #111827b3; border: 1px solid #1f2937; border-radius: 12px;
    padding: 1.25rem; margin-bottom: 1.5rem; box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}
.heatmap-header { font-size: 0.9rem; color: #9ca3af; margin-bottom: 0.75rem; font-weight: 600; }

.months-row {
    display: flex; font-size: 0.7rem; color: #6b7280;
    margin-bottom: 0.25rem; height: 15px; position: relative; padding-left: 24px;
}
.month-label { position: absolute; transform: translateX(-50%); }
.heatmap-grid-wrapper { display: flex; gap: 8px; }

.days-column {
    display: flex; flex-direction: column; justify-content: space-between;
    font-size: 0.65rem; color: #6b7280; padding: 2px 0; height: 74px; width: 16px;
}
.heatmap-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 8px); gap: 3px; flex-grow: 1; }
.heat-square { width: 8px; height: 8px; background-color: #1f2937; border-radius: 1.5px; transition: background-color 0.3s ease, transform 0.1s ease; }
.heat-square:hover { transform: scale(1.3); z-index: 10; cursor: pointer; }

#repartition-legend { display: flex; flex-wrap: nowrap; justify-content: space-between; gap: 4px; font-size: 0.7rem; padding: 2px 0; overflow: hidden; }
.legend-item { display: inline-flex; align-items: center; gap: 4px; min-width: 0; flex: 1 1 auto; }
.legend-square { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.legend-label { color: #9ca3af; text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-value { color: #fff; font-weight: 700; flex-shrink: 0; }

.timeline-card {
    background: #111827b3; border: 1px solid #1f2937; border-radius: 8px; margin-bottom: 0.75rem; 
    display: flex; align-items: stretch; overflow: hidden; cursor: pointer; position: relative;
    transition: background-color 0.2s ease, transform 0.1s ease; box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}
.timeline-card:hover { background-color: #1f2937b3; transform: translateY(-1px); }
.timeline-card:active { transform: translateY(0); }
.card-accent { width: 5px; flex-shrink: 0; }

.design-weed { background-color: #10b981; }
.design-hash { background-color: #b45309; }
.design-bho { background-color: #f59e0b; }
.design-rosin { background-color: #ec4899; }
.design-cbd { background-color: #3b82f6; }

.timeline-body { padding: 0.75rem 1rem; flex: 1; display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; justify-content: center; }
.timeline-row { display: flex; justify-content: space-between; align-items: center; }
.item-strain { color: #f8fafc; font-size: 1rem; }
.item-amount { color: #10b981; font-weight: 700; font-size: 1.1rem; }
.details-row { font-size: 0.8rem; color: #9ca3af; }
.item-time { color: #6b7280; }

.btn-delete-entry {
    background: transparent; border: none; color: #4b5563; font-size: 1.35rem; line-height: 1; cursor: pointer;
    padding: 0 1.25rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    border-top-right-radius: 7px; border-bottom-right-radius: 7px; z-index: 5; transition: color 0.15s ease, background-color 0.15s ease;
}
.btn-delete-entry:hover { color: #ef4444; background-color: rgba(239, 68, 68, 0.15); }

.empty-state { text-align: center; padding: 2rem; color: #6b7280; font-size: 0.9rem; }
.error-msg { background: #451a03; border: 1px solid #78350f; color: #f87171; padding: 0.75rem; text-align: center; font-size: 0.9rem; }
.capitalize { text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.5px; }
.hidden { display: none !important; }
footer { text-align: center; padding: 2rem; font-size: 0.8rem; color: #4b5563; margin-top: auto; position: relative; z-index: 2; }

#timeline-tab-content { padding: 1.5rem; max-height: 480px; overflow-y: auto; }
#timeline-tab-content .timeline-card:last-child { margin-bottom: 0; }