/* =====================
   RESET & BASE
   ===================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #0f1b30;
    --sidebar-text: #d6e2f5;
    --sidebar-text-muted: #7e93b8;
    --sidebar-active-bg: rgba(59, 130, 246, 0.22);
    --sidebar-hover-bg: rgba(59, 130, 246, 0.12);

    --color-primary: #3b82f6;
    --color-primary-dark: #2563eb;
    --color-primary-light: #60a5fa;
    --color-success: #10b981;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
    --color-blue: #3b82f6;
    --color-cyan: #06b6d4;
    --color-neutral: #94a3b8;

    --bg: #f8f8f8;
    --bg-card: #ffffff;
    --border: #e5e5e5;
    --text: #111827;
    --text-muted: #6b7280;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
}

html, body {
    height: 100%;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

/* =====================
   LAYOUT
   ===================== */
.layout {
    display: flex;
    min-height: 100vh;
}

.main-content {
    width: 100%;
    max-width: 1200px;
    margin-left: var(--sidebar-width);
    margin-right: auto;
    min-height: 100vh;
    padding: 32px 36px;
}

/* =====================
   SIDEBAR
   ===================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    transition: width 0.2s ease;
}

.sidebar-header {
    padding: 20px 16px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    background: var(--color-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
}

.sidebar-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.sidebar-subtitle {
    font-size: 12px;
    color: var(--sidebar-text-muted);
}

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
}

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

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    color: var(--sidebar-text);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.nav-link:hover {
    background: var(--sidebar-hover-bg);
}

.nav-link.active {
    background: var(--sidebar-active-bg);
    color: #fff;
    font-weight: 500;
}

.nav-link-disabled {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    color: var(--sidebar-text-muted);
    font-size: 14px;
    cursor: not-allowed;
    opacity: 0.5;
}

.nav-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 12px 4px;
}

.nav-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sidebar-text-muted);
    padding: 0 10px 6px;
}

.nav-list-soon {
    opacity: 0.6;
}

.sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-collapse-btn {
    width: 100%;
    background: none;
    border: none;
    font-family: inherit;
}

/* =====================
   SIDEBAR COLLAPSED STATE
   ===================== */
body.sidebar-collapsed .sidebar {
    width: 60px;
}

body.sidebar-collapsed .sidebar .nav-text {
    display: none;
}

body.sidebar-collapsed .sidebar-brand {
    justify-content: center;
}

body.sidebar-collapsed .nav-link,
body.sidebar-collapsed .nav-link-disabled {
    justify-content: center;
    padding: 9px 0;
}

body.sidebar-collapsed .nav-icon {
    width: auto;
}

body.sidebar-collapsed .main-content {
    margin-left: 60px;
    /* max-width не меняется — контент той же ширины, лишь сдвигается влево */
}


.sidebar-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    background: var(--sidebar-bg);
    color: #fff;
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    font-size: 20px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 90;
}

/* =====================
   PAGE HEADER
   ===================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.page-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* =====================
   BUTTONS
   ===================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s, transform 0.1s;
    white-space: nowrap;
}

.btn:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-dark);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: #eef2f6;
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover:not(:disabled) {
    background: var(--bg);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 13px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    padding: 0;
}

.btn-icon:hover {
    background: var(--bg);
    color: var(--text);
}

.btn-icon-danger:hover {
    background: #fef2f2;
    color: var(--color-danger);
    border-color: #fecaca;
}

/* =====================
   BADGES
   ===================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.badge-blue {
    background: #eff6ff;
    color: var(--color-blue);
    border: 1px solid #bfdbfe;
}

.badge-green {
    background: #f0fdf4;
    color: var(--color-success);
    border: 1px solid #bbf7d0;
}

.badge-key {
    background: #fefce8;
    color: #a16207;
    border: 1px solid #fde68a;
}

.badge-additional {
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.badge-goal {
    background: #eff6ff;
    color: var(--color-primary);
    border: 1px solid #bfdbfe;
}

/* =====================
   GOALS
   ===================== */
.goals-section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-count {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 14px;
}

.collapsible {
    border: none;
}

.collapsible-header {
    cursor: pointer;
    user-select: none;
    padding: 8px 0;
    list-style: none;
}

.collapsible-header::-webkit-details-marker {
    display: none;
}

.collapsible-header .collapse-icon {
    transition: transform 0.2s;
    font-size: 16px;
}

details[open] .collapse-icon {
    transform: rotate(90deg);
}

.goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.goal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.goal-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.goal-card-completed {
    opacity: 0.8;
}

.goal-card-abandoned {
    opacity: 0.6;
}

.goal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.goal-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.goal-description {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.current-milestone {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--color-primary);
    background: #eff6ff;
    border-radius: 6px;
    padding: 6px 10px;
}

.goal-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
}

.progress-label {
    display: flex;
    align-items: center;
    gap: 4px;
}

.progress-value {
    font-weight: 500;
    color: var(--text);
}

.progress-bar-wrapper {
    height: 6px;
    background: #f0f0f0;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
    min-width: 2px;
}

.progress-bar-green {
    background: var(--color-success);
}

.progress-bar-blue {
    background: var(--color-neutral);
}

.goal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.goal-deadline {
    display: flex;
    align-items: center;
    gap: 4px;
}

.progress-dates-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

.status-completed {
    background: #f0fdf4;
    color: var(--color-success);
}

.status-paused {
    background: #fefce8;
    color: var(--color-warning);
}

.status-abandoned {
    background: #fef2f2;
    color: var(--color-danger);
}

.reflection-block {
    display: flex;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    background: #fefce8;
    border-radius: 8px;
    padding: 8px 12px;
    border-left: 3px solid var(--color-warning);
}

/* =====================
   ACHIEVEMENTS
   ===================== */
.filters-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.filter-btn:hover {
    background: var(--bg);
    color: var(--text);
}

.filter-btn.active {
    background: var(--color-primary);
    color: #fff;
    font-weight: 500;
}

.filter-btn-success.active {
    background: var(--color-success);
}

.filter-btn-failure.active {
    background: var(--color-danger);
}

.year-group {
    margin-bottom: 32px;
}

.year-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.achievement-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.achievement-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.achievement-stripe {
    width: 4px;
    flex-shrink: 0;
}

.achievement-success .achievement-stripe {
    background: var(--color-success);
}

.achievement-failure .achievement-stripe {
    background: var(--color-danger);
}

.achievement-body {
    flex: 1;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.achievement-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.achievement-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.achievement-type-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.achievement-type-success {
    color: var(--color-success);
}

.achievement-type-failure {
    color: var(--color-danger);
}

.achievement-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.achievement-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.achievement-date {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.achievement-description {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

.lesson-block {
    display: flex;
    gap: 10px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 12px;
}

.lesson-icon {
    color: var(--color-warning);
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.lesson-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #92400e;
    margin-bottom: 4px;
}

.lesson-text {
    font-size: 13px;
    color: #78350f;
    line-height: 1.5;
}

/* =====================
   EMPTY STATE
   ===================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 32px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 14px;
    max-width: 360px;
}

/* =====================
   MESSAGES
   ===================== */
.messages-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    border: 1px solid;
}

.message-success {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.message-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.message-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.message-info {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

.message-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    padding: 2px;
    line-height: 1;
}

.message-close:hover {
    opacity: 1;
}

/* =====================
   FORMS
   ===================== */
.form-page {
    max-width: 640px;
}

.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.form-label-optional {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 12px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.form-error {
    font-size: 12px;
    color: var(--color-danger);
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.form-actions-right {
    display: flex;
    gap: 10px;
}

/* Radio toggle (type / weight switches) */
.radio-toggle {
    display: flex;
    gap: 8px;
}

.radio-toggle-option {
    flex: 1;
    text-align: center;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    color: var(--text-muted);
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.radio-toggle-option input {
    display: none;
}

.radio-toggle-option.checked {
    border-color: var(--color-primary);
    background: #eff6ff;
    color: var(--color-primary);
    font-weight: 500;
}

.radio-toggle-option.checked-success {
    border-color: var(--color-success);
    background: #f0fdf4;
    color: var(--color-success);
}

.radio-toggle-option.checked-danger {
    border-color: var(--color-danger);
    background: #fef2f2;
    color: var(--color-danger);
}

.lesson-field-wrap {
    transition: opacity 0.2s, max-height 0.2s;
    overflow: hidden;
}

/* Image upload */
.image-upload-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.image-thumb {
    position: relative;
    width: 84px;
    height: 84px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-thumb-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* =====================
   CATEGORIES
   ===================== */
.hidden {
    display: none !important;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.category-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    flex-wrap: wrap;
}

.category-row-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.category-row-name {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.category-row-actions {
    display: flex;
    gap: 4px;
}

.category-row-form {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.category-row-form .form-input {
    flex: 1;
}

.category-row-form input[type="color"] {
    flex: 0 0 50px;
    padding: 2px;
    height: 36px;
}

.form-link {
    font-size: 12px;
    color: var(--color-primary);
    margin-left: 8px;
}

/* =====================
   DROPDOWN MENU
   ===================== */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    min-width: 170px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    padding: 6px;
    z-index: 50;
    display: none;
    flex-direction: column;
    gap: 2px;
}

.dropdown.open .dropdown-menu {
    display: flex;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text);
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--bg);
}

.dropdown-item-danger {
    color: var(--color-danger);
}

.dropdown-item-danger:hover {
    background: #fef2f2;
}

/* =====================
   GOAL CARD EXTRAS
   ===================== */
.goal-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.milestone-toggle {
    font-size: 12px;
    color: var(--color-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    padding: 0;
}

.milestone-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 0;
    border-top: 1px solid var(--border);
}

.milestone-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 4px 0;
}

.milestone-item.is-completed .milestone-item-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.milestone-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: none;
    color: transparent;
    font-size: 12px;
    padding: 0;
}

.milestone-check:hover {
    border-color: var(--color-success);
    color: var(--color-success);
}

.milestone-item.is-completed .milestone-check {
    background: var(--color-success);
    border-color: var(--color-success);
    color: #fff;
}

.milestone-item-title {
    flex: 1;
}

.milestone-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 2px;
    flex-shrink: 0;
}

.milestone-remove:hover {
    color: var(--color-danger);
}

.milestone-add-form {
    display: flex;
    gap: 6px;
    padding-top: 6px;
}

.milestone-add-form .form-input {
    padding: 6px 10px;
    font-size: 13px;
}

/* =====================
   MILESTONE SETUP PAGE
   ===================== */
.milestone-setup-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.milestone-setup-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.milestone-order-btns {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.milestone-order-btns button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 1px;
}

.milestone-order-btns button:hover {
    color: var(--color-primary);
}

/* =====================
   MODAL
   ===================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 20px;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

/* =====================
   ACHIEVEMENTS GRID
   ===================== */
.year-switcher {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.year-switch-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
}

.year-switch-btn:hover {
    background: var(--bg);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.year-switch-label {
    font-size: 18px;
    font-weight: 700;
    min-width: 64px;
    text-align: center;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
}

.month-cell {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 150px;
}

.month-cell-current {
    border: 2px solid var(--color-primary);
    background: #eff6ff;
}

.month-cell-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.month-cell-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.month-cell-count {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
    background: var(--bg-card);
    border-radius: 999px;
    padding: 1px 7px;
}

.month-cell-empty {
    color: var(--text-muted);
    font-size: 18px;
    text-align: center;
    padding: 16px 0;
}

.month-cell-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.15s;
}

.kanban-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.kanban-card-stripe {
    width: 4px;
    flex-shrink: 0;
}

.kanban-card.achievement-success .kanban-card-stripe {
    background: var(--color-success);
}

.kanban-card.achievement-failure .kanban-card-stripe {
    background: var(--color-danger);
}

.kanban-card-body {
    flex: 1;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.kanban-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
}

.kanban-card-date {
    font-size: 11px;
    color: var(--text-muted);
}

.kanban-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.kanban-card-badges .badge {
    font-size: 10px;
    padding: 2px 7px;
}

/* =====================
   COLOR & ICON PICKERS
   ===================== */
.color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
}

.color-option {
    display: inline-flex;
    margin: 0;
    cursor: pointer;
}

.color-option .color-dot {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: transform 0.1s, box-shadow 0.1s;
}

.color-option .color-dot:hover {
    transform: scale(1.15);
}

.color-option input:checked + .color-dot {
    border-color: #fff;
    box-shadow: 0 0 0 2px var(--text);
}

.icon-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
}

.icon-option {
    display: inline-flex;
    margin: 0;
    cursor: pointer;
}

.icon-option .icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 20px;
    color: var(--text);
    transition: all 0.15s;
    background: var(--bg-card);
}

.icon-option .icon-box:hover {
    border-color: var(--color-primary-light);
}

.icon-option input:checked + .icon-box {
    border-color: var(--color-primary);
    background: #eff6ff;
    color: var(--color-primary);
}

.category-edit-expanded {
    width: 100%;
    padding: 4px 0;
}

/* =====================
   RESPONSIVE
   ===================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.visible {
        display: block;
    }

    .sidebar-toggle {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 60px 16px 24px;
    }

    .goals-grid {
        grid-template-columns: 1fr;
    }

    .achievements-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}
