:root {
    --bg: #f6f4ea;
    --bg-accent: #dbe2c7;
    --surface: rgba(255, 255, 255, 0.84);
    --surface-strong: #ffffff;
    --border: rgba(42, 56, 43, 0.10);
    --text: #233129;
    --muted: #6f7b70;
    --primary: #7a9a63;
    --primary-dark: #5f7e4d;
    --secondary: #eef0e3;
    --warning-bg: #f4ecd0;
    --warning-text: #8f6e1f;
    --success-bg: #e3ecdc;
    --success-text: #4c6840;
    --shadow: 0 18px 50px rgba(35, 49, 41, 0.08);
    --shadow-soft: 0 10px 30px rgba(35, 49, 41, 0.06);
    --radius: 24px;
}

html, body {
    min-height: 100%;
}

body {
    font-family: "Open Sans", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(205, 218, 174, 0.72), transparent 32%),
        radial-gradient(circle at top right, rgba(243, 239, 221, 0.95), transparent 30%),
        linear-gradient(180deg, #faf8f1 0%, var(--bg) 48%, #eeecdf 100%);
}

h1,
h2,
h3,
.page-hero h1,
.page-hero h2,
.section-title,
.navbar-brand span {
    font-family: "Merriweather", serif;
}

.app-shell {
    position: relative;
}

.app-shell::before {
    content: "";
    position: fixed;
    inset: auto -10vw -18rem auto;
    width: 28rem;
    height: 28rem;
    border-radius: 50%;
    background: rgba(205, 218, 174, 0.40);
    filter: blur(40px);
    pointer-events: none;
    z-index: 0;
}

.navbar {
    background: rgba(35, 49, 41, 0.84) !important;
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 1080;
}

.navbar-brand {
    font-weight: 800;
    letter-spacing: 0.03em;
}

.navbar .dropdown-menu {
    min-width: 18rem;
    max-height: 24rem;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background-color: #223027 !important;
    background-image: none !important;
    opacity: 1 !important;
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.30);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.navbar .dropdown-item {
    color: #f6f8f4;
    border-radius: 12px;
    padding: 0.7rem 0.85rem;
}

.navbar .dropdown-item-text {
    color: #dfe7de;
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus,
.navbar .dropdown-item.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
}

.navbar .dropdown-header {
    color: #b7c6b7;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.navbar .dropdown-header .btn-link {
    color: #eef3ed;
    font-size: 0.72rem;
    letter-spacing: normal;
    text-transform: none;
}

.navbar .dropdown-header .btn-link:hover {
    color: #fff;
}

.navbar .dropdown-divider {
    border-top-color: rgba(255, 255, 255, 0.10);
}

.search-trigger {
    min-width: auto;
    padding-inline: 0.75rem;
}

.project-switcher {
    min-width: auto;
    padding-inline: 0.85rem;
}

.unread-switcher {
    min-width: auto;
    padding-inline: 0.75rem;
}

.unread-switcher-active {
    color: #fff;
    border-color: rgba(194, 62, 62, 0.55);
    background: linear-gradient(135deg, #c23e3e, #dd6a4f);
    box-shadow: 0 10px 24px rgba(194, 62, 62, 0.28);
}

.unread-switcher-active:hover,
.unread-switcher-active:focus {
    color: #fff;
    border-color: rgba(194, 62, 62, 0.65);
    background: linear-gradient(135deg, #b23535, #d05d42);
}

.project-case-input {
    min-width: 16rem;
}

.project-inline-name {
    min-width: min(100%, 32rem);
}

.project-inline-meta-input {
    min-width: 14rem;
    max-width: 18rem;
}

.inline-meta-display {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.focus-panel-overdue {
    border: 1px solid rgba(182, 42, 42, 0.18);
    background: linear-gradient(145deg, rgba(255, 242, 242, 0.96), rgba(255, 233, 233, 0.92));
    box-shadow: 0 12px 28px rgba(182, 42, 42, 0.10);
}

.focus-panel-overdue .section-title,
.focus-panel-overdue .fw-semibold,
.focus-panel-overdue .text-muted {
    color: #8e1f1f !important;
}

.badge-overdue-count {
    background: #b62a2a;
    color: #fff;
}

.page-wrap {
    position: relative;
}

.app-container {
    max-width: 1800px;
}

.page-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding: 1.4rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: calc(var(--radius) + 2px);
    background: linear-gradient(145deg, rgba(255,255,255,0.92), rgba(248,246,238,0.82));
    box-shadow: var(--shadow-soft);
}

.page-hero h1,
.page-hero h2 {
    letter-spacing: -0.03em;
}

.dashboard-hero {
    align-items: center;
}

.dashboard-hero-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
    min-width: 22rem;
}

.dashboard-hero-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

.dashboard-hero-stat {
    min-width: 8.5rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(22, 49, 38, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.55);
    text-align: left;
}

.dashboard-hero-label {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.dashboard-hero-value {
    margin-top: 0.25rem;
    font-family: "Merriweather", serif;
    font-size: 1.45rem;
    line-height: 1;
}

.dashboard-hero-stat-overdue {
    background: linear-gradient(145deg, rgba(255, 243, 243, 0.96), rgba(255, 234, 234, 0.9));
    border-color: rgba(182, 42, 42, 0.14);
}

.page-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary);
}

.page-eyebrow::before {
    content: "";
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), #a8bc76);
    box-shadow: 0 0 0 6px rgba(122, 154, 99, 0.12);
}

.card,
.modal-content {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.card-footer,
.list-group-item,
.modal-header,
.modal-footer {
    border-color: var(--border);
    background: transparent;
}

.modal {
    z-index: 1060;
}

.modal-backdrop {
    z-index: 1055;
    background: rgba(18, 31, 25, 0.30);
}

.modal-backdrop.show {
    opacity: 1;
}

.btn {
    border-radius: 999px;
    font-weight: 700;
    padding-inline: 1rem;
}

.btn .bi,
.navbar-brand .bi {
    line-height: 1;
}

.btn-link {
    color: #345642;
}

.btn-link:hover,
.btn-link:focus {
    color: #243e30;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #96b26b);
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(122, 154, 99, 0.20);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #6c8a57, #89a761);
    border-color: transparent;
}

.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-success {
    border-color: rgba(22, 49, 38, 0.14);
    color: var(--text);
    background: rgba(255, 255, 255, 0.6);
}

.form-control,
.form-select {
    min-height: 3rem;
    border-radius: 16px;
    border-color: rgba(22, 49, 38, 0.12);
    background: rgba(255, 255, 255, 0.82);
}

textarea.form-control {
    min-height: auto;
}

.form-control:focus,
.form-check-input:focus {
    border-color: rgba(122, 154, 99, 0.45);
    box-shadow: 0 0 0 0.25rem rgba(122, 154, 99, 0.12);
}

.badge {
    border-radius: 999px;
    padding: 0.5rem 0.8rem;
    font-weight: 700;
}

.badge-status-open {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.badge-status-completed {
    background: var(--success-bg);
    color: var(--success-text);
}

.badge-hours-required {
    background: rgba(178, 102, 16, 0.12);
    color: #9a5b12;
    border: 1px solid rgba(178, 102, 16, 0.18);
}

.badge-work-status-not_started {
    background: rgba(111, 123, 112, 0.14);
    color: #5d695f;
    border: 1px solid rgba(111, 123, 112, 0.20);
}

.badge-work-status-started {
    background: rgba(72, 126, 79, 0.14);
    color: #3d6b43;
    border: 1px solid rgba(72, 126, 79, 0.20);
}

.badge-work-status-paused {
    background: rgba(164, 124, 45, 0.16);
    color: #8b6a22;
    border: 1px solid rgba(164, 124, 45, 0.22);
}

.badge-priority-high {
    background: rgba(194, 62, 62, 0.14);
    color: #a93030;
    border: 1px solid rgba(194, 62, 62, 0.20);
}

.badge-priority-medium {
    background: rgba(70, 112, 175, 0.14);
    color: #355f99;
    border: 1px solid rgba(70, 112, 175, 0.20);
}

.badge-priority-low {
    background: rgba(99, 137, 107, 0.14);
    color: #4e7656;
    border: 1px solid rgba(99, 137, 107, 0.20);
}

.badge-hours-total {
    background: rgba(122, 154, 99, 0.14);
    color: var(--primary-dark);
    border: 1px solid rgba(122, 154, 99, 0.18);
}

.todo-hours-field {
    max-width: 11rem;
}

.todo-top-assignees {
    max-width: 42rem;
}

.todo-meta-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 0.75rem;
}

.todo-meta-inline span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.42rem 0.7rem;
    border: 1px solid rgba(22, 49, 38, 0.07);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
    color: var(--muted);
    font-size: 0.92rem;
}

.todo-meta-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.todo-save-cta {
    min-width: 10rem;
    padding-inline: 1.25rem;
    box-shadow: 0 12px 26px rgba(122, 154, 99, 0.24);
}

.todo-assignee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, max-content));
    gap: 0.55rem;
    align-items: start;
}

.todo-assignee-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.8rem;
    white-space: nowrap;
}

.todo-assignee-pill .form-check-input {
    margin-top: 0;
    flex: 0 0 auto;
}

.todo-assignee-pill .form-check-label {
    white-space: nowrap;
    line-height: 1.1;
}

.project-completed-card,
.todo-completed-row {
    opacity: 0.52;
}

.todo-completed-row .fw-semibold {
    font-weight: 700;
}

.completed-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.completed-toggle[aria-expanded="true"] .collapse-chevron {
    transform: rotate(180deg);
}

.collapse-chevron {
    transition: transform 0.2s ease;
}

.meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.meta-line span,
.meta-line div {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
}

.section-title {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.soft-panel {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.58);
    padding: 0.95rem 1rem;
}

.comment-box {
    white-space: pre-wrap;
}

.comment-card {
    border: 1px solid rgba(22, 49, 38, 0.08);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(243,247,244,0.88));
}

.activity-card {
    border: 1px solid rgba(22, 49, 38, 0.08);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(246, 248, 241, 0.92), rgba(239, 244, 236, 0.88));
}

.comment-mention-wrap {
    position: relative;
}

.mention-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.08rem 0.45rem;
    border-radius: 999px;
    background: rgba(122, 154, 99, 0.16);
    color: var(--primary-dark);
    font-weight: 700;
}

.admin-log-line {
    padding: 0.4rem 0;
    border-top: 1px solid rgba(22, 49, 38, 0.08);
    word-break: break-word;
}

.admin-log-line:first-child {
    border-top: 0;
    padding-top: 0;
}

.dashboard-todo-link {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18rem;
}

.dashboard-project-link {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18rem;
}

.mention-autocomplete {
    position: absolute;
    left: 0;
    right: auto;
    top: calc(100% - 2.35rem);
    min-width: 14rem;
    max-width: min(20rem, 100%);
    padding: 0.4rem;
    border: 1px solid rgba(22, 49, 38, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 40px rgba(35, 49, 41, 0.12);
    z-index: 30;
}

.mention-option {
    display: block;
    width: 100%;
    padding: 0.65rem 0.8rem;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    text-align: left;
    font-weight: 600;
}

.mention-option:hover,
.mention-option.active {
    background: rgba(122, 154, 99, 0.12);
    color: var(--primary-dark);
}

.todo-inline-display {
    cursor: pointer;
    border-radius: 12px;
    transition: background-color 0.15s ease;
}

.todo-inline-display:hover {
    background: rgba(122, 154, 99, 0.08);
}

.list-group-item {
    padding-block: 1rem;
}

.empty-state {
    padding: 2.25rem;
    text-align: center;
    color: var(--muted);
}

.alert {
    border: 0;
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
}

.text-muted,
.small,
.form-text {
    color: var(--muted) !important;
}

@media (max-width: 768px) {
    .page-hero {
        padding: 1.15rem;
    }

    .dashboard-hero-side {
        min-width: 0;
        width: 100%;
        align-items: stretch;
    }

    .dashboard-hero-stats {
        justify-content: stretch;
    }

    .dashboard-hero-stat {
        flex: 1 1 100%;
    }

    .project-switcher {
        min-width: 0;
    }
}
