:root {
    --primary: #D75A20;          /* Sacred Saffron/Orange */
    --primary-strong: #7B1B1B;   /* Deep Vermilion/Maroon */
    --secondary: #E3A839;        /* Warm Gold/Turmeric */
    --surface: #FCF9F3;          /* Soft Cream/Sandalwood */
    --surface-elevated: #ffffff; /* Bright White */
    --background: #F6EFE2;       /* Sandalwood/Temple Stone */
    --background-soft: #EADCBF;  /* Warm Sandalwood Ochre */
    --text: #2A1F1B;             /* Charcoal/Earth Brown */
    --muted: #7E6C65;            /* Terracotta Brown */
    --border: #E6DCBF;           /* Light Ochre/Gold border */
    --success: #2D6B3E;          /* Sacred Tulsi Green */
    --warning: #B7741D;
    --error: #A83A3A;
    --info: #4D6A8B;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 18px 48px rgba(60, 40, 20, 0.08);
    --shadow-soft: 0 10px 24px rgba(60, 40, 20, 0.05);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text);
    background: linear-gradient(145deg, var(--background), #f9f5ef);
    line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
input, select, textarea {
    width: 100%; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-elevated); padding: 12px 14px; color: var(--text);
}
label { display: grid; gap: 8px; font-weight: 600; color: var(--muted); }

.page-shell, .topbar, .footer {
    max-width: 1200px; margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

.topbar {
    padding-top: 20px;
    padding-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: sticky;
    top: 0;
    background: rgba(244, 239, 232, 0.86);
    backdrop-filter: blur(10px);
    z-index: 10;
}
.brand-block {
    display: flex; align-items: center; gap: 14px;
}
.brand-mark {
    width: 48px; height: 48px; border-radius: 50%; display: block; object-fit: cover;
    box-shadow: var(--shadow-soft);
}
.eyebrow {
    text-transform: uppercase; letter-spacing: 0.16em; margin: 0 0 6px; font-size: 0.7rem; font-weight: 700; color: var(--muted);
}
.brand-block h1 {
    margin: 0; font-size: 1.2rem;
}
.topnav {
    display: flex; gap: 12px; flex-wrap: wrap;
}
.nav-link {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 600;
    transition: all 0.2s ease;
}
.nav-link.active, .nav-link:hover {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-soft);
}

.page-shell {
    padding-top: 12px;
    padding-bottom: 48px;
}
.hero, .panel, .card, .stat-card, .pill, .table-wrap, .task-row {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.hero {
    padding: 30px;
    display: grid;
    gap: 24px;
    grid-template-columns: 1.4fr 0.8fr;
    margin-bottom: 24px;
}
.hero-compact { grid-template-columns: 1.2fr 0.8fr; }
.hero h2 {
    font-size: clamp(1.9rem, 2.5vw, 3rem);
    line-height: 1.15;
    margin: 0 0 10px;
}
.lede { margin: 0; color: var(--muted); font-size: 1.05rem; }
.hero-actions {
    display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px;
}
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 18px; border-radius: 999px; border: 1px solid transparent; font-weight: 700;
    cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-strong)); color: white; box-shadow: var(--shadow-soft); }
.btn-secondary { background: var(--surface-elevated); color: var(--primary); border-color: var(--border); }
.btn-small { padding: 10px 14px; font-size: 0.9rem; }

.mini-stats {
    margin-top: 20px; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px;
}
.mini-stats div {
    background: rgba(217, 90, 32, 0.05); border: 1px solid rgba(217, 90, 32, 0.12); border-radius: 14px; padding: 14px 12px;
    display: grid; gap: 6px;
}
.mini-stats strong { font-size: 1.2rem; }
.mini-stats span { color: var(--muted); font-size: 0.85rem; }

.panel { padding: 22px; }
.panel h3 { margin-top: 0; }
.metric-list { display: grid; gap: 12px; }
.metric {
    display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border);
}
.metric:last-child { border-bottom: 0; }
.metric span { color: var(--muted); }
.metric strong { font-size: 0.92rem; } 

.section-block { margin-top: 28px; }
.section-heading {
    display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px;
}
.section-heading h3 { margin: 0; font-size: clamp(1.25rem, 2vw, 1.75rem); }
.inline-heading { margin-bottom: 16px; }
.toolbar {
    display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
    margin-bottom: 18px;
}
.search-box {
    min-width: min(100%, 340px);
    display: grid; gap: 8px;
    color: var(--muted); font-weight: 600;
}
.chip-group { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
    border: 1px solid var(--border); background: var(--surface-elevated); color: var(--muted); border-radius: 999px;
    padding: 8px 14px; cursor: pointer; font-weight: 600;
}
.chip.is-active {
    background: var(--primary); color: white; border-color: var(--primary);
}

.card-grid {
    display: grid; gap: 20px; grid-template-columns: repeat(3, minmax(0, 1fr));
}
.card {
    padding: 20px;
}
.card-header, .card-footer {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.card-header { margin-bottom: 16px; }
.card-body h4 { margin: 0 0 8px; font-size: 1.35rem; }
.card-body p { margin: 0; color: var(--muted); }
.badge {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 999px; background: rgba(217, 90, 32, 0.08); color: var(--primary); font-size: 0.85rem; font-weight: 700;
}
.badge-soft { background: rgba(217, 90, 32, 0.08); }
.status-dot {
    width: 11px; height: 11px; border-radius: 50%; display: inline-block;
}
.status-dot.sun { background: #d9a45c; }
.status-dot.sage { background: #7ca17a; }
.status-dot.mist { background: #8eb3c7; }

.mini-progress {
    display: grid; gap: 8px; width: 100%;
}
.mini-progress label { color: var(--muted); font-size: 0.8rem; }
.progress-bar {
    background: #ece4da; border-radius: 999px; overflow: hidden; height: 8px;
}
.progress-bar span {
    display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--secondary));
}
.card-footer { margin-top: 16px; align-items: end; }
.footer-actions { display: flex; gap: 8px; }

.info-grid, .layout-two, .design-grid, .stat-grid {
    display: grid; gap: 20px;
}
.info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.layout-two { grid-template-columns: 1.4fr 0.9fr; }
.stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.task-row {
    display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 16px; margin-top: 12px;
}
.task-main { display: grid; gap: 8px; }
.task-side { display: flex; align-items: center; gap: 10px; }
.mini-label { color: var(--muted); font-weight: 700; }
.stack-form { display: grid; gap: 14px; }
.stack-form textarea { resize: vertical; min-height: 110px; }
.status-pill {
    display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 6px 10px; background: #eef2f6; color: var(--info); font-size: 0.8rem; font-weight: 700;
}
.status-pill.success { background: rgba(47, 122, 77, 0.12); color: var(--success); }
.status-pill.warning { background: rgba(183, 116, 29, 0.12); color: var(--warning); }

.activity-list {
    display: grid; gap: 12px;
}
.activity-item {
    display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: 0; }
.activity-item span { color: var(--muted); }

.admin-panel { padding-top: 6px; }
.table-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.table-wrap {
    overflow: auto;
    background: var(--surface);
}
table {
    width: 100%; border-collapse: collapse; min-width: 720px;
}
th, td {
    text-align: left; padding: 16px 18px; border-bottom: 1px solid var(--border);
}
th {
    font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.table-button {
    border: 1px solid var(--border); background: var(--surface-elevated); border-radius: 10px; padding: 8px 10px; cursor: pointer;
}

.stat-card {
    padding: 22px 20px;
    display: grid; gap: 8px;
}
.stat-card h3 { margin: 0; font-size: 2rem; }
.stat-card p { margin: 0; color: var(--muted); }

.design-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.breakpoint-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.breakpoint-list span {
    padding: 8px 10px; border-radius: 999px; background: rgba(217, 90, 32, 0.08); color: var(--primary); font-weight: 700; font-size: 0.82rem;
}

.text-link { color: var(--primary); font-weight: 700; }

.modal {
    position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 30;
}
.modal.is-open { display: flex; }
.modal-backdrop {
    position: absolute; inset: 0; background: rgba(19, 20, 21, 0.45);
}
.modal-panel {
    position: relative; width: min(92vw, 460px); background: var(--surface-elevated); padding: 28px 24px; border-radius: 20px; border: 1px solid var(--border); box-shadow: var(--shadow);
}
.modal-close {
    position: absolute; right: 16px; top: 12px; border: 0; background: transparent; font-size: 2rem; cursor: pointer; color: var(--muted);
}
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 18px; }

.footer {
    padding-top: 16px; padding-bottom: 52px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

@media (max-width: 900px) {
    .hero, .hero-compact, .layout-two, .design-grid, .info-grid, .stat-grid, .card-grid { grid-template-columns: 1fr; }
    .topbar { flex-direction: column; align-items: flex-start; }
    .toolbar { align-items: flex-start; }
    .search-box { width: 100%; }
}

@media (max-width: 640px) {
    .page-shell, .topbar, .footer { padding-left: 16px; padding-right: 16px; }
    .hero, .card, .panel, .stat-card { padding: 18px 16px; }
    .hero-actions, .footer-actions, .table-actions { flex-wrap: wrap; }
    .mini-stats { grid-template-columns: 1fr; }
    .task-row { flex-direction: column; align-items: flex-start; }
}

/* Profile Layout & Entry Styling */
.profile-layout {
    display: grid;
    gap: 36px;
    grid-template-columns: 1fr 2fr;
    align-items: start;
}
.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.profile-main {
    display: flex;
    flex-direction: column;
}

.entry-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}
.entry-card {
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.entry-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    margin-bottom: 14px;
}
.entry-header strong {
    font-size: 1.15rem;
    color: var(--primary-strong);
}
.entry-header span {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 500;
}
.entry-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.entry-progress {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text);
}
.entry-note {
    margin: 4px 0 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text);
    background: rgba(230, 220, 191, 0.15);
    border-left: 3px solid var(--secondary);
    padding: 8px 12px;
    border-radius: 4px;
}
.entry-image {
    max-width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 12px;
    border: 1px solid var(--border);
}
.entry-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
    border-top: 1px dashed var(--border);
    padding-top: 14px;
}

/* Clickable title link hover micro-interactions */
.card-title-link, .task-title-link, .entry-title-link {
    transition: color 0.2s ease;
}
.card-title-link:hover, .task-title-link:hover, .entry-title-link:hover {
    color: var(--primary);
}

@media (max-width: 900px) {
    .profile-layout {
        grid-template-columns: 1fr;
    }
}

/* Row-based Entry styling */
.entry-list-rows {
    display: flex;
    flex-direction: column;
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-elevated);
}
.entry-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s ease;
}
.entry-row:last-child {
    border-bottom: 0;
}
.entry-row:hover {
    background-color: rgba(230, 220, 191, 0.15);
}
.entry-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.entry-main strong {
    font-size: 1.05rem;
    color: var(--text);
}
.entry-date {
    font-size: 0.85rem;
    color: var(--muted);
}
.entry-details {
    flex: 2;
    display: flex;
    align-items: center;
    gap: 16px;
}
.entry-count {
    background: rgba(217, 90, 32, 0.08);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}
.entry-note-preview {
    font-size: 0.9rem;
    color: var(--muted);
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}
.entry-side {
    display: flex;
    align-items: center;
    gap: 16px;
}
.entry-image-preview-btn {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: underline;
    white-space: nowrap;
}
.entry-image-preview-btn:hover {
    color: var(--primary-strong);
}

@media (max-width: 768px) {
    .entry-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
    }
    .entry-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
    }
    .entry-note-preview {
        -webkit-line-clamp: 2;
    }
    .entry-side {
        width: 100%;
        justify-content: space-between;
        border-top: 1px dashed var(--border);
        padding-top: 10px;
    }
}

.entry-note-text {
    font-size: 0.92rem;
    color: var(--text);
    display: inline-block;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

