/* =====================================================
   AutoProject - 凹凸品牌风格样式
   遵循 UI 规范 v1.0
   ===================================================== */

/* ---------- CSS 变量 ---------- */
:root {
    --primary: #165dff;
    --primary-hover: #1452e6;
    --primary-light: rgba(22, 93, 255, 0.08);
    --primary-glow: rgba(22, 93, 255, 0.15);
    --background: #f5f7fa;
    --foreground: #0f172a;
    --card: #ffffff;
    --muted: #475569;
    --success: #00b42a;
    --warning: #ff7d00;
    --danger: #f53f3f;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-blue: 0 4px 6px -1px rgba(59, 130, 246, 0.5);
    --font-sans: "Geist Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    --transition-spring: transform 0.6s spring-out(100, 20), box-shadow 0.6s spring-out(100, 20), opacity 0.6s spring-out(100, 20);
}

/* ---------- Reset ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background:
        radial-gradient(circle at 20% 20%, rgba(230, 237, 255, 1) 0, transparent 25%),
        radial-gradient(circle at 80% 0%, rgba(220, 235, 255, 1) 0, transparent 25%),
        var(--background);
    color: var(--slate-700);
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ---------- 布局 ---------- */
body {
    display: flex;
    min-height: 100vh;
}

/* ---------- 左边栏 ---------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 240px;
    background: var(--card);
    border-right: 1px solid var(--slate-100);
    display: flex;
    flex-direction: column;
    z-index: 40;
    transition: transform 0.3s spring-out(80, 18);
}

.sidebar-header {
    padding: 20px 20px 16px;
}

.sidebar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--foreground);
    text-decoration: none;
}

.sidebar-brand i {
    font-size: 26px;
    color: var(--primary);
}

.sidebar-brand:hover {
    text-decoration: none;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 12px 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--slate-600);
    text-decoration: none;
    transition: transform 0.3s spring-out(200, 25), color 0.3s spring-out(200, 25), background 0.3s spring-out(200, 25);
}

.sidebar-link:hover {
    color: var(--primary);
    background: var(--primary-light);
    text-decoration: none;
    transform: translateX(2px);
}

.sidebar-link.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

.sidebar-link i {
    font-size: 20px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--slate-50);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--slate-500);
}

.sidebar-user i {
    font-size: 24px;
}

/* ---------- 移动端遮罩 ---------- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(2px);
}

/* ---------- 移动端顶栏 ---------- */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--slate-100);
    position: sticky;
    top: 0;
    z-index: 20;
}

.mobile-brand {
    font-size: 16px;
    font-weight: 600;
    color: var(--foreground);
}

/* ---------- 右主区 ---------- */
.main-wrapper {
    flex: 1;
    margin-left: 240px;
    min-width: 0;
}

.main-content {
    max-width: 1152px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    padding: 64px 0 40px;
    text-align: center;
}

.hero-content {
    position: relative;
    max-width: 640px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: 36px;
    font-weight: 600;
    color: var(--slate-900);
    letter-spacing: -0.025em;
    line-height: 1.2;
    margin-bottom: 16px;
    animation: fadeSlideUp 0.6s spring-out(100, 20) both;
}

.hero-content p {
    font-size: 16px;
    color: var(--slate-600);
    line-height: 1.6;
    margin-bottom: 32px;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeSlideUp 0.6s spring-out(100, 20) 0.08s both;
}

.hero-content .btn-primary {
    animation: fadeSlideUp 0.6s spring-out(100, 20) 0.16s both;
}

/* ---------- Section ---------- */
.section {
    margin-top: 64px;
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-title {
    font-size: 30px;
    font-weight: 600;
    color: var(--slate-900);
    letter-spacing: -0.025em;
}

.section-count {
    font-size: 14px;
    color: var(--slate-500);
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 24px 0 8px;
    font-size: 14px;
    color: var(--slate-500);
}

.breadcrumb a {
    color: var(--slate-500);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb i {
    font-size: 12px;
}

.breadcrumb span {
    color: var(--slate-700);
    font-weight: 500;
}

/* ---------- 详情头部 ---------- */
.detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 0 32px;
    flex-wrap: wrap;
}

.detail-header-left {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.detail-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.detail-icon i {
    font-size: 28px;
    color: var(--primary);
}

.detail-info {
    min-width: 0;
}

.detail-info h1 {
    font-size: 30px;
    font-weight: 600;
    color: var(--slate-900);
    letter-spacing: -0.025em;
    line-height: 1.2;
    word-break: break-word;
}

.detail-info > p {
    margin-top: 8px;
    font-size: 16px;
    color: var(--slate-600);
    line-height: 1.6;
}

.detail-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    font-size: 14px;
    color: var(--slate-500);
    flex-wrap: wrap;
}

.detail-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.detail-meta i {
    font-size: 16px;
}

.detail-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ---------- 按钮 ---------- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--radius-full);
    background: var(--primary);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-blue);
    transition: transform 0.3s spring-out(200, 25), box-shadow 0.3s spring-out(200, 25);
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(59, 130, 246, 0.5);
    text-decoration: none;
}

.btn-primary:active {
    transform: scale(0.95);
}

.btn-primary:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn-primary i {
    font-size: 20px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--radius-full);
    border: 1px solid var(--slate-200);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--slate-700);
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.3s spring-out(200, 25), border-color 0.3s spring-out(200, 25), color 0.3s spring-out(200, 25);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: scale(0.95);
}

.btn-secondary i {
    font-size: 20px;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    color: var(--slate-500);
    background: transparent;
    border: 1px dashed var(--slate-200);
    cursor: pointer;
    transition: transform 0.3s spring-out(200, 25), color 0.3s spring-out(200, 25), border-color 0.3s spring-out(200, 25);
}

.btn-ghost:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.btn-ghost.small {
    padding: 6px 10px;
    font-size: 12px;
}

.btn-ghost.danger {
    color: var(--danger);
    border-color: var(--danger);
}

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

.btn-ghost i {
    font-size: 16px;
}

.btn-icon-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    background: transparent;
    color: var(--slate-500);
    cursor: pointer;
    transition: transform 0.3s spring-out(200, 25), color 0.3s spring-out(200, 25), background 0.3s spring-out(200, 25);
}

.btn-icon-only:hover {
    color: var(--danger);
    background: rgba(245, 63, 63, 0.06);
    transform: translateY(-1px);
}

.btn-icon-only i {
    font-size: 20px;
}

.btn-icon-only.small {
    width: 32px;
    height: 32px;
}

.btn-icon-only.small i {
    font-size: 16px;
}

.btn-icon-only.tiny {
    width: 24px;
    height: 24px;
}

.btn-icon-only.tiny i {
    font-size: 14px;
}

/* ---------- 表单 ---------- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--slate-700);
    margin-bottom: 8px;
}

.required {
    color: var(--danger);
}

.form-input {
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--slate-200);
    background: #fff;
    padding: 10px 16px;
    font-size: 14px;
    font-family: var(--font-sans);
    color: var(--slate-700);
    transition: border-color 0.3s spring-out(200, 25), box-shadow 0.3s spring-out(200, 25);
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input::placeholder {
    color: var(--slate-500);
}

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

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 256 256'%3E%3Cpath fill='%2364748b' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.file-input-hidden {
    display: none;
}

.file-upload-zone {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-list-text {
    font-size: 13px;
    color: var(--slate-500);
}

/* ---------- 卡片 ---------- */
.card-hover {
    transition: transform 0.6s spring-out(100, 20), box-shadow 0.6s spring-out(100, 20);
}

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

/* ---------- 项目卡片网格 ---------- */
.project-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 640px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .project-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero-content h1 {
        font-size: 42px;
    }

    .section-title {
        font-size: 36px;
    }
}

.project-card {
    display: flex;
    align-items: center;
    gap: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--slate-100);
    background: var(--card);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    text-decoration: none;
    color: inherit;
    animation: fadeSlideUp 0.6s spring-out(100, 20) both;
}

.project-card:nth-child(1) { animation-delay: 0s; }
.project-card:nth-child(2) { animation-delay: 0.06s; }
.project-card:nth-child(3) { animation-delay: 0.12s; }
.project-card:nth-child(4) { animation-delay: 0.18s; }
.project-card:nth-child(5) { animation-delay: 0.24s; }
.project-card:nth-child(6) { animation-delay: 0.30s; }

.project-card:hover {
    text-decoration: none;
    border-color: var(--primary);
}

.project-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.project-card-icon i {
    font-size: 24px;
    color: var(--primary);
}

.project-card-body {
    flex: 1;
    min-width: 0;
}

.project-card-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--slate-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-card-desc {
    font-size: 14px;
    color: var(--slate-500);
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--slate-500);
}

.meta-item i {
    font-size: 16px;
}

.project-card-arrow {
    color: var(--slate-300);
    flex-shrink: 0;
}

.project-card-arrow i {
    font-size: 20px;
}

/* ---------- 版本时间轴 ---------- */
.version-timeline {
    position: relative;
    padding-left: 0;
}

.version-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding-bottom: 8px;
}

.version-item:last-child {
    padding-bottom: 0;
}

.version-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.version-dot i {
    font-size: 18px;
    color: var(--primary);
}

.version-line {
    position: absolute;
    left: 19px;
    top: 44px;
    bottom: 4px;
    width: 2px;
    background: var(--slate-200);
}

.version-item:last-child .version-line {
    display: none;
}

.version-card {
    display: block;
    flex: 1;
    margin-left: 16px;
    margin-bottom: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--slate-100);
    background: var(--card);
    box-shadow: var(--shadow-sm);
    padding: 20px 24px;
    text-decoration: none;
    color: inherit;
    animation: fadeSlideUp 0.6s spring-out(100, 20) both;
}

.version-card:nth-child(1) { animation-delay: 0s; }
.version-card:nth-child(2) { animation-delay: 0.06s; }
.version-card:nth-child(3) { animation-delay: 0.12s; }

.version-card:hover {
    text-decoration: none;
    border-color: var(--primary);
}

.version-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.version-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-mono);
}

.version-badge.large {
    padding: 6px 16px;
    font-size: 15px;
}

.version-date {
    font-size: 13px;
    color: var(--slate-500);
}

.version-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--slate-800);
    margin-bottom: 4px;
}

.version-card-desc {
    font-size: 14px;
    color: var(--slate-500);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.version-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--slate-50);
}

.version-card-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.version-card-link i {
    font-size: 14px;
}

/* ---------- 需求卡片 ---------- */
.requirement-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.requirement-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--slate-100);
    background: var(--card);
    box-shadow: var(--shadow-sm);
    padding: 20px 24px;
    animation: fadeSlideUp 0.6s spring-out(100, 20) both;
}

.requirement-card:nth-child(1) { animation-delay: 0s; }
.requirement-card:nth-child(2) { animation-delay: 0.06s; }
.requirement-card:nth-child(3) { animation-delay: 0.12s; }
.requirement-card:nth-child(4) { animation-delay: 0.18s; }
.requirement-card:nth-child(5) { animation-delay: 0.24s; }

.req-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.req-card-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.req-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--slate-800);
    word-break: break-word;
}

.req-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.req-card-desc {
    font-size: 14px;
    color: var(--slate-500);
    line-height: 1.6;
    margin-top: 10px;
}

.req-card-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--slate-50);
}

/* 优先级徽章 */
.priority-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}

.priority-low {
    background: #f1f5f9;
    color: #64748b;
}

.priority-medium {
    background: #eff6ff;
    color: #3b82f6;
}

.priority-high {
    background: #fff7ed;
    color: #f97316;
}

.priority-urgent {
    background: #fef2f2;
    color: #ef4444;
}

/* 状态选择器 */
.status-select {
    padding: 5px 28px 5px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--slate-200);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 256 256'%3E%3Cpath fill='%2364748b' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: border-color 0.3s spring-out(200, 25);
}

.status-pending {
    background-color: #f8fafc;
    color: #64748b;
}

.status-in_progress {
    background-color: #eff6ff;
    color: #2563eb;
}

.status-completed {
    background-color: #f0fdf4;
    color: #16a34a;
}

.status-cancelled {
    background-color: #f1f5f9;
    color: #94a3b8;
}

/* 附件 */
.attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--slate-50);
}

.attachment-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: var(--slate-50);
    font-size: 13px;
}

.attachment-item i {
    font-size: 16px;
    color: var(--slate-500);
}

.attachment-name {
    color: var(--slate-700);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-name:hover {
    color: var(--primary);
}

.attachment-size {
    color: var(--slate-500);
    font-size: 12px;
    white-space: nowrap;
}

.req-upload-area {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--slate-50);
}

/* ---------- Requirements Page ---------- */
.req-filters {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.req-filter-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.req-tabs {
    display: flex;
    gap: 0;
    background: var(--slate-100);
    border-radius: var(--radius-full);
    padding: 3px;
}

.req-tab {
    padding: 7px 18px;
    border: none;
    border-radius: var(--radius-full);
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--slate-500);
    cursor: pointer;
    transition: all 0.25s spring-out(200, 25);
}

.req-tab.active {
    background: #fff;
    color: var(--slate-900);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.req-version-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: var(--slate-100);
    color: var(--slate-600);
    font-size: 12px;
    font-weight: 500;
    margin-left: 8px;
}

.req-scope-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: #eff6ff;
    color: #3b82f6;
    font-size: 12px;
    font-weight: 500;
    margin-left: 8px;
}

.req-card-depts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.dept-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    background: #eff6ff;
    color: #3b82f6;
    font-size: 12px;
    font-weight: 500;
}

.req-more-link {
    text-align: center;
    padding: 12px;
}

.req-more-link a {
    color: var(--slate-500);
    font-size: 13px;
}

.req-more-link a:hover {
    color: var(--primary);
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: var(--slate-50);
    font-size: 13px;
    color: var(--slate-700);
    cursor: pointer;
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: var(--slate-100);
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--primary);
}

.status-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.status-tag.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-tag.status-in_progress {
    background: #dbeafe;
    color: #1e40af;
}

.status-tag.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.status-tag.status-cancelled {
    background: #f1f5f9;
    color: #64748b;
}

/* ---------- 空状态 ---------- */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--slate-500);
}

.empty-state i {
    font-size: 48px;
    color: var(--slate-300);
    margin-bottom: 16px;
    display: block;
}

.empty-state p {
    font-size: 15px;
}

/* ---------- 弹窗 ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s spring-out(80, 18) both;
}

.modal-panel {
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--radius-xl);
    background: var(--card);
    box-shadow: var(--shadow-xl);
    padding: 28px;
    animation: modalIn 0.3s spring-out(80, 18) both;
}

.modal-panel.has-preview {
    max-width: 800px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--slate-900);
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--slate-500);
    transition: transform 0.3s spring-out(200, 25), color 0.3s spring-out(200, 25), background 0.3s spring-out(200, 25);
}

.modal-close:hover {
    color: var(--slate-700);
    background: var(--slate-50);
    transform: scale(1.1);
}

.modal-close i {
    font-size: 20px;
}

/* ---------- Confirm Dialog ---------- */
.confirm-body {
    text-align: center;
    padding: 8px 0;
}

.confirm-message {
    font-size: 14px;
    color: var(--slate-600);
    margin: 0 0 24px 0;
    line-height: 1.6;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-actions .btn-primary,
.confirm-actions .btn-ghost {
    min-width: 100px;
    justify-content: center;
}

/* Upload confirm list */
.upload-confirm-list {
    max-height: 240px;
    overflow-y: auto;
    text-align: left;
    margin-bottom: 12px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
}

.upload-confirm-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    border-bottom: 1px solid var(--slate-100);
}

.upload-confirm-item:last-child {
    border-bottom: none;
}

.upload-confirm-item i {
    font-size: 16px;
    color: var(--slate-400);
    flex-shrink: 0;
}

.upload-confirm-name {
    flex: 1;
    color: var(--slate-700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-confirm-size {
    color: var(--slate-400);
    font-size: 12px;
    flex-shrink: 0;
}

.upload-confirm-summary {
    font-size: 13px;
    color: var(--slate-500);
    margin-bottom: 8px;
}

/* ---------- Toast ---------- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    background: var(--slate-900);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.4s spring-out(80, 18) both;
    pointer-events: auto;
}

.toast.success {
    background: #16a34a;
}

.toast.error {
    background: #dc2626;
}

.toast i {
    font-size: 20px;
}

/* ---------- 动画关键帧 ---------- */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(24px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes springOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

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

    .mobile-header {
        display: flex;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .main-content {
        padding: 0 16px 64px;
    }

    .hero {
        padding: 40px 0 24px;
    }

    .hero-content h1 {
        font-size: 28px;
    }

    .section {
        margin-top: 40px;
    }

    .section-title {
        font-size: 24px;
    }

    .detail-header {
        flex-direction: column;
    }

    .detail-header-right {
        width: 100%;
    }

    .detail-header-right .btn-primary {
        flex: 1;
    }

    .detail-info h1 {
        font-size: 22px;
    }

    .version-card {
        margin-left: 12px;
        padding: 16px;
    }

    .requirement-card {
        padding: 16px;
    }

    .modal-panel {
        padding: 20px;
    }

    .project-card {
        padding: 16px;
    }
}

/* ========================================================
   登录页
   ======================================================== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 20%, rgba(230, 237, 255, 1) 0, transparent 25%),
        radial-gradient(circle at 80% 0%, rgba(220, 235, 255, 1) 0, transparent 25%),
        var(--background);
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: var(--radius-xl);
    background: var(--card);
    box-shadow: var(--shadow-xl);
    padding: 40px 36px;
    animation: modalIn 0.5s spring-out(80, 18) both;
}

.login-card-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-card-header i {
    font-size: 48px;
    color: var(--primary);
    display: block;
    margin-bottom: 12px;
}

.login-card-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--slate-900);
}

.login-card-header p {
    font-size: 14px;
    color: var(--slate-500);
    margin-top: 4px;
}

.login-submit {
    width: 100%;
    margin-top: 8px;
}

.login-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
}

/* ========================================================
   版本树 (project page)
   ======================================================== */
.version-tree {
    padding: 8px;
}

.vt-item {
    /* margin-left applied inline */;
}

.vt-folder {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    color: var(--slate-700);
    transition: transform 0.2s spring-out(200, 25), background 0.2s spring-out(200, 25);
    user-select: none;
}

.vt-folder:hover {
    background: var(--slate-50);
    transform: translateX(2px);
}

.vt-folder.open .vt-caret {
    transform: rotate(90deg);
}

.vt-caret {
    font-size: 14px !important;
    color: var(--slate-500);
    transition: transform 0.2s spring-out(200, 25);
}

.vt-folder > .ph-git-branch {
    font-size: 18px;
    color: var(--branch-color, var(--primary));
}

.vt-caret-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex-shrink: 0;
}

.vt-caret-wrap:hover {
    background: rgba(0, 0, 0, 0.06);
}

.vt-number {
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--branch-color, var(--primary));
    font-size: 14px;
}

.vt-title {
    color: var(--slate-700);
    font-weight: 500;
    flex: 1;
}

.vt-meta {
    font-size: 12px;
    color: var(--slate-500);
    white-space: nowrap;
}

.vt-children {
    /* visible by default, toggled via JS */;
}

.vt-leaf {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--slate-700);
    cursor: pointer;
    transition: transform 0.2s spring-out(200, 25), background 0.2s spring-out(200, 25);
}

.vt-leaf:hover {
    background: var(--slate-50);
    transform: translateX(2px);
}

.vt-leaf > .ph-git-commit {
    font-size: 18px;
    color: var(--branch-color, var(--slate-400));
}

/* ========================================================
   文件树
   ======================================================== */
.version-upload-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.file-tree {
    border-radius: var(--radius-lg);
    border: 1px solid var(--slate-100);
    background: var(--card);
    padding: 12px;
}

.tree-folder-root {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--slate-100);
}

.tree-root-label {
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--slate-500);
    font-size: 13px;
}

.tree-dl-btn {
    color: var(--primary) !important;
    opacity: 0;
    transition: opacity 0.2s spring-out(200, 25);
}

.tree-folder:hover .tree-dl-btn,
.tree-file:hover .tree-dl-btn {
    opacity: 1;
}
.tree-folder {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    color: var(--slate-700);
    transition: transform 0.2s spring-out(200, 25), background 0.2s spring-out(200, 25);
    user-select: none;
}

.tree-folder:hover {
    background: var(--slate-50);
    transform: translateX(2px);
}

.tree-folder i {
    font-size: 18px;
}

.folder-caret {
    color: var(--slate-500);
    font-size: 14px !important;
    transition: transform 0.2s spring-out(200, 25);
}

.tree-folder.open .folder-caret {
    transform: rotate(90deg);
}

.tree-children {
    /* visible by default, toggled via JS */;
}

.tree-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: transform 0.2s spring-out(200, 25), background 0.2s spring-out(200, 25);
}

.tree-file:hover {
    background: var(--slate-50);
    transform: translateX(2px);
}

.tree-file i {
    font-size: 18px;
    color: var(--slate-500);
}

.tree-name {
    flex: 1;
    color: var(--slate-700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}

.tree-name:hover {
    color: var(--primary);
    text-decoration: underline;
}

.tree-size {
    font-size: 12px;
    color: var(--slate-500);
    white-space: nowrap;
}

/* Tree toolbar & checkboxes */
.tree-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--slate-100);
}

.tree-toolbar-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.tree-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.file-preview-link {
    cursor: pointer;
}

.file-status-tag {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.file-status-tag.status-added {
    background: #e8f8ef;
    color: #00B42A;
}

.file-status-tag.status-modified {
    background: #fff7e6;
    color: #F7A100;
}

.file-status-tag.status-deleted {
    background: #ffece8;
    color: #F53F3F;
}

.file-status-tag.status-renamed {
    background: #f0f0ff;
    color: #722ED1;
}

.renamed-from {
    font-size: 11px;
    color: var(--slate-400);
    text-decoration: line-through;
    flex-shrink: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
}

.tree-file:hover .tree-dl-btn {
    opacity: 1;
}

.tree-file.deleted {
    opacity: 0.55;
}

.tree-file.deleted .tree-name {
    text-decoration: line-through;
}

.tree-deleted-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--slate-200);
}

.tree-deleted-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--slate-500);
    padding: 4px 12px;
    margin-bottom: 4px;
}

.tree-deleted-header i {
    font-size: 16px;
}

/* ========================================================
   Version select dropdowns
   ======================================================== */
.version-select-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.version-select-prefix {
    font-weight: 700;
    font-family: var(--font-mono);
    font-size: 18px;
    color: var(--primary);
    margin-right: 2px;
}

.version-select-dot {
    font-weight: 700;
    font-size: 16px;
    color: var(--slate-400);
}

.version-select {
    width: 72px;
    text-align: center;
    padding: 10px 4px;
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 600;
}

.form-hint {
    margin-top: 6px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ========================================================
   File preview
   ======================================================== */
.preview-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--slate-50);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    border-bottom: 1px solid var(--slate-100);
    margin: -24px -24px 16px -24px;
}

.preview-name {
    font-weight: 500;
    color: var(--slate-700);
    display: flex;
    align-items: center;
    gap: 6px;
}

.preview-size {
    font-size: 12px;
    color: var(--slate-500);
}

.preview-content {
    background: var(--slate-50);
    border: 1px solid var(--slate-100);
    border-radius: var(--radius-sm);
    padding: 16px;
    max-height: 60vh;
    overflow: auto;
    font-size: 13px;
    font-family: var(--font-mono);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
}

.preview-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--slate-500);
    margin-top: 8px;
}

/* Diff display */
.diff-stats {
    display: flex;
    gap: 8px;
    font-size: 12px;
    font-family: var(--font-mono);
    font-weight: 600;
}

.diff-added-count {
    color: #00B42A;
}

.diff-removed-count {
    color: #F53F3F;
}

/* Full-file diff view */
.fulldiff-container {
    border: 1px solid var(--slate-100);
    border-radius: var(--radius-sm);
    overflow: auto;
    max-height: 60vh;
}

.fulldiff-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    font-family: var(--font-mono);
    line-height: 1.6;
}

.fulldiff-table td {
    padding: 1px 4px;
    vertical-align: top;
}

.fulldiff-ln {
    width: 48px;
    min-width: 48px;
    text-align: right;
    color: var(--slate-400);
    user-select: none;
    background: var(--slate-50);
    padding-right: 8px !important;
}

.fulldiff-sign {
    width: 20px;
    min-width: 20px;
    text-align: center;
    user-select: none;
    font-weight: 700;
}

.fulldiff-line {
    white-space: pre-wrap;
    word-break: break-all;
    padding-left: 8px !important;
}

.fulldiff-added {
    background: #e6f9ee;
}

.fulldiff-added .fulldiff-ln {
    background: #c8f0d4;
}

.fulldiff-sign-added {
    background: #b7ebc8;
    color: #00B42A;
}

.fulldiff-removed {
    background: #ffede8;
}

.fulldiff-removed .fulldiff-ln {
    background: #ffdbd4;
}

.fulldiff-sign-removed {
    background: #ffcfc6;
    color: #F53F3F;
}

/* ========================================================
   管理表格
   ======================================================== */
.mgmt-table-wrapper {
    border-radius: var(--radius-lg);
    border: 1px solid var(--slate-100);
    background: var(--card);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.mgmt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.mgmt-table thead {
    background: var(--slate-50);
}

.mgmt-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--slate-600);
    font-size: 13px;
    border-bottom: 1px solid var(--slate-100);
    white-space: nowrap;
}

.mgmt-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--slate-50);
    color: var(--slate-700);
    vertical-align: middle;
}

.mgmt-table tbody tr:last-child td {
    border-bottom: none;
}

.mgmt-table tbody tr:hover {
    background: var(--slate-50);
}

.mgmt-username {
    font-weight: 600;
    color: var(--slate-800);
}

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

.text-muted {
    color: var(--slate-500);
    font-size: 13px;
}

/* ========================================================
   角色标签 + 部门标签
   ======================================================== */
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.role-admin {
    background: var(--primary-light);
    color: var(--primary);
}

.role-user {
    background: #f1f5f9;
    color: #64748b;
}

.role-badge-small {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary);
}

.dept-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.dept-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 12px;
    background: #f1f5f9;
    color: #475569;
}

.dept-tag-head {
    background: #fef9e7;
    color: #b45309;
}

.dept-tag-head i {
    font-size: 11px;
}

.project-card-depts {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* ========================================================
   侧边栏用户信息
   ======================================================== */
.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    margin: -2px -8px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
}
.sidebar-user-info:hover {
    background: var(--slate-100);
}

.sidebar-user-avatar i {
    font-size: 28px;
    color: var(--slate-400);
}

.sidebar-user-detail {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-username {
    font-size: 14px;
    font-weight: 500;
    color: var(--slate-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    color: var(--slate-400) !important;
}

.logout-btn:hover {
    color: var(--danger) !important;
    background: rgba(245, 63, 63, 0.06);
}

/* ========================================================
   复选框列表 + 部门卡片
   ======================================================== */
.checkbox-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--slate-200);
    font-size: 13px;
    color: var(--slate-600);
    cursor: pointer;
    transition: transform 0.2s spring-out(200, 25), border-color 0.2s spring-out(200, 25);
    user-select: none;
}

.checkbox-label:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--primary);
}

.dept-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 640px) {
    .dept-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.dept-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--slate-100);
    background: var(--card);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    animation: fadeSlideUp 0.6s spring-out(100, 20) both;
}

.dept-card:nth-child(1) { animation-delay: 0s; }
.dept-card:nth-child(2) { animation-delay: 0.06s; }
.dept-card:nth-child(3) { animation-delay: 0.12s; }
.dept-card:nth-child(4) { animation-delay: 0.18s; }

.dept-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.dept-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dept-card-icon i {
    font-size: 20px;
    color: var(--primary);
}

.dept-card-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--slate-800);
}

.dept-card-info p {
    font-size: 13px;
    color: var(--slate-500);
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dept-card-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--slate-500);
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--slate-50);
}

.dept-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.dept-card-meta i {
    font-size: 16px;
}

.dept-card-actions {
    display: flex;
    gap: 8px;
}

/* ---------- Assignee badges ---------- */

.assignee-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.assignee-badge i {
    font-size: 14px;
}

/* ---------- Member chips ---------- */

.member-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 0;
}

.member-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--slate-100);
    color: var(--foreground);
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 13px;
}

.member-chip i {
    font-size: 14px;
}

.member-chip.dept-chip {
    background: var(--primary-light);
    color: var(--primary);
}

.chip-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--slate-400);
    padding: 0;
    display: inline-flex;
    align-items: center;
    margin-left: 2px;
}

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

/* ========================================================
   Version split layout (files left | requirements right)
   ======================================================== */
.version-split {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 24px;
    align-items: stretch;
    max-height: calc(100vh - 220px);
    min-height: 500px;
}

.version-split-left {
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    border: 1px solid var(--slate-100);
    border-radius: var(--radius-lg);
    background: var(--card);
}

.version-split-left > .section-header {
    flex-shrink: 0;
    padding: 10px 14px;
    border-bottom: 1px solid var(--slate-100);
    background: var(--slate-50);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.version-split-left > .version-upload-bar {
    flex-shrink: 0;
    padding: 8px 14px;
    border-bottom: 1px solid var(--slate-100);
    margin-bottom: 0;
}

.version-split-left .file-tree {
    overflow-y: auto;
    flex: 1;
}

.version-split-left > .empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--slate-100);
    border-radius: var(--radius-lg);
    background: var(--card);
}

.version-split-right {
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    gap: 12px;
}

/* Old flat #req-list rules removed -- now managed by .split-section */

.version-split-right .requirement-card {
    margin-bottom: 8px;
}

.version-split-right .requirement-card .req-card-header {
    flex-wrap: wrap;
    gap: 6px;
}

.version-split-right .requirement-card .req-card-left {
    flex: 1;
    min-width: 0;
}

.version-split-right .requirement-card .req-card-title {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.version-split-right .requirement-card .req-card-actions {
    flex-shrink: 0;
}

.version-split-right .requirement-card .status-select {
    font-size: 12px;
    padding: 2px 8px;
}

.version-split-right .requirement-card .req-card-footer {
    flex-wrap: wrap;
    gap: 4px;
    font-size: 12px;
}

.version-split-right .requirement-card .req-card-footer .btn-ghost.small {
    font-size: 11px;
    padding: 2px 6px;
}

@media (max-width: 960px) {
    .version-split {
        grid-template-columns: 1fr;
        max-height: none;
    }
    .version-split-left,
    .version-split-right {
        max-height: none;
        overflow: visible;
        height: auto;
    }
    .version-split-left .file-tree {
        overflow-y: visible;
    }
}

/* Split section layout (requirements top, upload logs bottom) */
.split-section {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 1px solid var(--slate-100);
    border-radius: var(--radius-lg);
    background: var(--card);
    overflow: hidden;
}

.split-section-top {
    flex: 4;
    min-height: 180px;
}

.split-section-bottom {
    flex: 5;
    min-height: 200px;
}

.split-section-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--slate-100);
    flex-shrink: 0;
    background: var(--slate-50);
}

.split-section-header .section-title {
    font-size: 14px;
}

.split-section-header .section-count {
    font-size: 12px;
}

.split-section-body {
    overflow-y: auto;
    flex: 1;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
}

.split-section-body .empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border: none;
    min-height: 120px;
    color: var(--slate-400);
}

.split-section-footer {
    padding: 8px 14px;
    border-top: 1px solid var(--slate-100);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--slate-50);
}

.log-page-info {
    font-size: 12px;
    color: var(--slate-500);
    min-width: 50px;
    text-align: center;
}

/* Upload log cards */
.upload-log-card {
    padding: 10px 0;
    border-bottom: 1px solid var(--slate-50);
}

.upload-log-card:last-child {
    border-bottom: none;
}

.log-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--slate-600);
    flex-wrap: wrap;
}

.log-card-header .log-user {
    font-weight: 600;
    color: var(--slate-800);
}

.log-card-header .log-time {
    color: var(--slate-400);
}

.log-card-header .log-file-count {
    color: var(--primary);
}

.log-card-desc {
    margin-top: 6px;
    font-size: 12px;
    color: var(--slate-500);
    padding: 6px 8px;
    background: var(--slate-50);
    border-radius: 6px;
    line-height: 1.5;
}

.log-card-files {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.log-file-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    padding: 2px 6px;
    background: var(--slate-100);
    color: var(--slate-600);
    border-radius: 4px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.log-file-item i {
    font-size: 13px;
    flex-shrink: 0;
}

/* Status log table */
.status-log-table-wrap {
    max-height: 360px;
    overflow-y: auto;
}

.status-log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.status-log-table th {
    text-align: left;
    padding: 8px 12px;
    font-weight: 600;
    color: var(--slate-500);
    border-bottom: 1px solid var(--slate-100);
    font-size: 12px;
    text-transform: uppercase;
}

.status-log-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--slate-50);
    color: var(--slate-700);
}

.status-log-table td .status-tag {
    font-size: 12px;
}

.status-tag.status-none {
    background: var(--slate-100);
    color: var(--slate-500);
}

/* ==================== Work Schedule ==================== */

.schedule-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.schedule-presets {
    display: flex;
    gap: 4px;
    background: var(--slate-100);
    border-radius: var(--radius-lg);
    padding: 4px;
}

.preset-btn {
    border-radius: var(--radius-md) !important;
}

.preset-btn.active {
    background: #fff !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    color: var(--primary) !important;
}

.schedule-custom-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.schedule-day-group {
    margin-bottom: 24px;
}

.schedule-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--slate-50);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.schedule-day-header.overdue {
    background: #fef2f2;
    color: var(--danger);
}

.schedule-day-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 14px;
}

.today-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
    background: var(--primary);
    color: #fff;
}

.schedule-day-count {
    font-size: 12px;
    color: var(--slate-500);
}

.schedule-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    margin-bottom: 6px;
    background: #fff;
    transition: box-shadow 0.15s, border-color 0.15s;
    cursor: pointer;
}

.schedule-item:hover {
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border-color: var(--primary);
}

.schedule-item.priority-urgent-border {
    border-left: 3px solid var(--danger);
}

.schedule-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.schedule-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.schedule-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--slate-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-item-meta {
    font-size: 12px;
    color: var(--slate-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-item-right {
    flex-shrink: 0;
    margin-left: 12px;
}

.schedule-item-overdue {
    background: #fff5f5;
    border-color: #fecaca;
}

.schedule-alert-section {
    margin-bottom: 24px;
    border: 1px solid #fecaca;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.schedule-alert-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fef2f2;
    font-weight: 600;
    font-size: 14px;
    color: var(--danger);
}

.schedule-alert-header i {
    font-size: 18px;
}

.schedule-alert-section .schedule-items {
    padding: 8px;
}

/* ==================== View Toggle ==================== */

.view-toggle {
    display: inline-flex;
    background: var(--slate-100);
    border-radius: var(--radius-lg);
    padding: 3px;
    gap: 2px;
}

.view-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 30px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--slate-400);
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s;
}

.view-toggle-btn.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.view-toggle-btn:hover:not(.active) {
    color: var(--slate-600);
}

/* ==================== Jelly View ==================== */

.jelly-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    padding: 4px 0;
}

.jelly-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px 22px;
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,0.5);
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                border-color 0.25s ease;
    overflow: hidden;
}

.jelly-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 22px;
    background: radial-gradient(ellipse at top left,
        rgba(255,255,255,0.6) 0%,
        rgba(255,255,255,0.15) 50%,
        transparent 100%);
    pointer-events: none;
    z-index: 1;
}

.jelly-card::after {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 60%;
    height: 60%;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(255,255,255,0.5) 0%,
        transparent 70%);
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

.jelly-card > * {
    position: relative;
    z-index: 2;
}

/* Priority-based jelly colors */
.jelly-urgent {
    background: linear-gradient(135deg,
        rgba(244, 63, 94, 0.18) 0%,
        rgba(251, 113, 133, 0.12) 40%,
        rgba(255, 228, 230, 0.25) 100%);
    box-shadow: 0 4px 20px rgba(244, 63, 94, 0.12),
                0 1px 3px rgba(244, 63, 94, 0.08);
    border-color: rgba(244, 63, 94, 0.2);
}

.jelly-high {
    background: linear-gradient(135deg,
        rgba(249, 115, 22, 0.18) 0%,
        rgba(251, 146, 60, 0.12) 40%,
        rgba(255, 237, 213, 0.25) 100%);
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.12),
                0 1px 3px rgba(249, 115, 22, 0.08);
    border-color: rgba(249, 115, 22, 0.2);
}

.jelly-medium {
    background: linear-gradient(135deg,
        rgba(59, 130, 246, 0.18) 0%,
        rgba(96, 165, 250, 0.12) 40%,
        rgba(219, 234, 254, 0.25) 100%);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.12),
                0 1px 3px rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
}

.jelly-low {
    background: linear-gradient(135deg,
        rgba(16, 185, 129, 0.16) 0%,
        rgba(52, 211, 153, 0.10) 40%,
        rgba(209, 250, 229, 0.22) 100%);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.10),
                0 1px 3px rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.18);
}

/* Completed/cancelled are more muted */
.jelly-card.jelly-completed,
.jelly-card.jelly-cancelled {
    opacity: 0.55;
    filter: grayscale(0.15);
}

/* Hover: bouncy spring effect */
.jelly-card:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.10),
                0 4px 12px rgba(0, 0, 0, 0.06);
}

.jelly-card:active {
    transform: translateY(-2px) scale(1.01);
    transition: transform 0.1s ease;
}

/* Jelly card wobble animation on first appear */
@keyframes jellyPopIn {
    0%   { transform: scale(0.85); opacity: 0; }
    50%  { transform: scale(1.04); opacity: 1; }
    70%  { transform: scale(0.97); }
    85%  { transform: scale(1.01); }
    100% { transform: scale(1); opacity: 1; }
}

.jelly-card.animate-in {
    animation: jellyPopIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

.jelly-priority-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
    box-shadow: 0 0 8px currentColor;
}

.jelly-priority-dot.urgent { color: #e11d48; background: #e11d48; }
.jelly-priority-dot.high   { color: #ea580c; background: #ea580c; }
.jelly-priority-dot.medium { color: #2563eb; background: #2563eb; }
.jelly-priority-dot.low    { color: #059669; background: #059669; }

.jelly-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.78);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.jelly-status-mini {
    flex-shrink: 0;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    white-space: nowrap;
}

.jelly-status-mini.pending     { background: rgba(100, 116, 139, 0.15); color: #475569; }
.jelly-status-mini.in_progress { background: rgba(59, 130, 246, 0.15);  color: #2563eb; }
.jelly-status-mini.completed   { background: rgba(16, 185, 129, 0.15); color: #059669; }
.jelly-status-mini.cancelled   { background: rgba(0, 0, 0, 0.06);       color: #94a3b8; }

.jelly-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.45);
}

.jelly-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.jelly-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.jelly-meta-item i {
    font-size: 13px;
    opacity: 0.65;
}

.jelly-meta-item.overdue {
    color: #e11d48;
    font-weight: 500;
}

.jelly-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.jelly-deadline {
    font-size: 12px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    gap: 4px;
}

.jelly-deadline.overdue {
    color: #e11d48;
}

.jelly-assignees {
    display: flex;
    gap: 2px;
}

.jelly-assignee-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.5);
    background: rgba(255,255,255,0.5);
    border: 1px solid rgba(0,0,0,0.06);
}

/* Responsive */
@media (max-width: 640px) {
    .jelly-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
    }
    .jelly-card {
        padding: 14px 16px;
        border-radius: 18px;
    }
    .jelly-card::before {
        border-radius: 18px;
    }
}

/* Reminder rows in requirement form */
.reminder-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.reminder-label {
    font-size: 13px;
    color: var(--slate-500);
    white-space: nowrap;
}
.reminder-add-btn {
    margin-top: 4px;
    color: var(--blue-600) !important;
}
.reminder-remove-btn {
    color: var(--slate-400) !important;
    padding: 4px 6px !important;
}
.reminder-remove-btn:hover {
    color: var(--danger) !important;
}
.jelly-assign-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px dashed var(--slate-300);
    background: transparent;
    color: var(--slate-400);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: auto;
}
.jelly-assign-btn:hover {
    border-color: var(--blue-500);
    color: var(--blue-500);
    background: var(--blue-50);
}

/* ---------- File tree department tag ---------- */
.file-dept-tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 500;
    color: var(--primary);
    background: var(--primary-light);
    margin-left: 6px;
    flex-shrink: 0;
}

/* ==================== Deadline Display ==================== */

.deadline-meta {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.deadline-meta.deadline-overdue {
    color: var(--danger) !important;
}

.deadline-meta.deadline-imminent,
.deadline-meta.deadline-today {
    color: var(--warning) !important;
}

.deadline-meta.deadline-tomorrow {
    color: #d97706 !important;
}

.deadline-relative-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 2px;
    animation: fadeSlideUp 0.3s ease;
}

.deadline-relative-badge.deadline-overdue {
    background: #fef2f2;
    color: var(--danger);
}

.deadline-relative-badge.deadline-imminent,
.deadline-relative-badge.deadline-today {
    background: #fff7ed;
    color: var(--warning);
}

.deadline-relative-badge.deadline-tomorrow {
    background: #fffbeb;
    color: #d97706;
}

.deadline-relative-badge.deadline-soon {
    background: var(--primary-light);
    color: var(--primary);
}

.deadline-relative-badge.deadline-week {
    background: var(--slate-100);
    color: var(--slate-600);
}

.deadline-relative-badge.deadline-normal {
    background: var(--slate-100);
    color: var(--slate-500);
}

/* ==================== Deadline Time Block ==================== */

.deadline-time-block {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
    vertical-align: middle;
}

.deadline-time-block.deadline-overdue {
    background: #fef2f2;
    color: var(--danger);
}

.deadline-time-block.deadline-imminent,
.deadline-time-block.deadline-today {
    background: #fff7ed;
    color: var(--warning);
}

.deadline-time-block.deadline-tomorrow {
    background: #fffbeb;
    color: #d97706;
}

.deadline-time-block.deadline-soon {
    background: var(--primary-light);
    color: var(--primary);
}

.deadline-time-block.deadline-week {
    background: var(--slate-100);
    color: var(--slate-600);
}

.deadline-time-block.deadline-normal {
    background: var(--slate-100);
    color: var(--slate-500);
}

/* ==================== Flatpickr Theme Overrides ==================== */

.flatpickr-calendar {
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-xl) !important;
    font-family: var(--font-sans) !important;
    overflow: hidden;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange,
.flatpickr-day.selected:focus,
.flatpickr-day.startRange:focus,
.flatpickr-day.endRange:focus,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover,
.flatpickr-day.selected.prevMonthDay,
.flatpickr-day.startRange.prevMonthDay,
.flatpickr-day.endRange.prevMonthDay,
.flatpickr-day.selected.nextMonthDay,
.flatpickr-day.startRange.nextMonthDay,
.flatpickr-day.endRange.nextMonthDay {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}

.flatpickr-day.inRange,
.flatpickr-day.prevMonthDay.inRange,
.flatpickr-day.nextMonthDay.inRange {
    background: var(--primary-light) !important;
    border-color: var(--primary-light) !important;
    box-shadow: none !important;
}

.flatpickr-day.today {
    border-color: var(--primary) !important;
}

.flatpickr-day.today:hover,
.flatpickr-day.today:focus {
    background: var(--primary) !important;
    color: #fff !important;
}

.flatpickr-months .flatpickr-month {
    color: var(--foreground) !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    color: var(--foreground) !important;
    font-weight: 600;
}

span.flatpickr-weekday {
    color: var(--slate-500) !important;
    font-weight: 600;
}

.flatpickr-time input {
    font-family: var(--font-sans);
}

.flatpickr-time input:hover,
.flatpickr-time input:focus {
    background: var(--primary-light) !important;
}

.flatpickr-time .numInputWrapper span.arrowUp:after {
    border-bottom-color: var(--primary) !important;
}

.flatpickr-time .numInputWrapper span.arrowDown:after {
    border-top-color: var(--primary) !important;
}

/* ==================== Calendar Month View ==================== */

.schedule-calendar {
    border-radius: var(--radius-lg);
    border: 1px solid var(--slate-100);
    background: var(--card);
    overflow: hidden;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--slate-100);
}

.calendar-month-label {
    font-size: 18px;
    font-weight: 600;
    color: var(--foreground);
    min-width: 160px;
    text-align: center;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 8px 12px;
    background: var(--slate-50);
    border-bottom: 1px solid var(--slate-100);
}

.calendar-weekdays span {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--slate-500);
    padding: 4px 0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 4px 8px;
}

.cal-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    min-height: 56px;
}

.cal-cell:hover {
    background: var(--slate-50);
}

.cal-cell-empty {
    cursor: default;
}

.cal-today {
    background: #dcfce7;
    box-shadow: inset 0 0 0 2px #22c55e;
}

.cal-today .cal-day-num {
    color: #16a34a;
    font-weight: 700;
}

.cal-weekend .cal-day-num {
    color: var(--slate-400);
}

.cal-day-num {
    font-size: 14px;
    font-weight: 500;
    color: var(--slate-700);
    line-height: 1;
}

.cal-has-items {
    background: #eff6ff;
}

.cal-has-overdue {
    background: #fef2f2;
}

.cal-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.cal-has-overdue .cal-badge {
    background: var(--danger);
}

.cal-selected {
    box-shadow: inset 0 0 0 2px var(--primary);
    background: var(--primary-light);
}

.calendar-day-detail {
    border-top: 1px solid var(--slate-100);
    max-height: 360px;
    overflow-y: auto;
    padding: 16px;
}

.cal-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--slate-100);
}

.cal-detail-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--foreground);
    display: flex;
    align-items: center;
    gap: 6px;
}

.cal-detail-items .schedule-item {
    cursor: pointer;
}

@media (max-width: 768px) {
    .calendar-grid {
        gap: 1px;
        padding: 2px 4px;
    }
    .cal-cell {
        min-height: 40px;
    }
    .cal-day-num {
        font-size: 12px;
    }
    .cal-badge {
        min-width: 14px;
        height: 14px;
        font-size: 9px;
        top: 2px;
        right: 2px;
    }
    .calendar-header {
        padding: 12px 8px;
    }
    .calendar-month-label {
        font-size: 15px;
        min-width: 120px;
    }
}

/* ==================== Schedule Layout (Left Calendar + Right Requirements) ==================== */

.schedule-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    align-items: start;
}

.schedule-left {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-self: center;
}

.schedule-calendar-panel {
    border-radius: var(--radius-lg);
    border: 1px solid var(--slate-200);
    background: var(--card);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.schedule-calendar-panel .calendar-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--slate-100);
}

.schedule-calendar-panel .calendar-month-label {
    font-size: 15px;
    font-weight: 600;
    min-width: 130px;
}

.schedule-calendar-panel .calendar-weekdays {
    padding: 6px 12px;
    background: var(--slate-50);
    border-bottom: 1px solid var(--slate-100);
}

.schedule-calendar-panel .calendar-weekdays span {
    font-size: 11px;
}

.schedule-calendar-panel .calendar-grid {
    padding: 6px 10px 10px;
}

.schedule-calendar-panel .cal-cell {
    min-height: 46px;
    border-radius: var(--radius-sm);
}

.schedule-calendar-panel .cal-day-num {
    font-size: 13px;
}

.schedule-calendar-panel .cal-badge {
    min-width: 16px;
    height: 16px;
    font-size: 10px;
    top: 3px;
    right: 3px;
}

/* Calendar range selection styles */

.cal-range-start,
.cal-range-end,
.cal-range-single {
    background: var(--primary-light) !important;
    border-radius: var(--radius-sm);
}

.cal-range-start .cal-day-num,
.cal-range-end .cal-day-num,
.cal-range-single .cal-day-num {
    color: var(--primary);
    font-weight: 700;
}

.cal-range-start {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.cal-range-end {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.cal-in-range {
    background: #eff6ff !important;
    border-radius: 0;
}

.cal-in-range .cal-day-num {
    color: var(--primary);
}

.calendar-range-hint {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    font-size: 12px;
    color: var(--slate-500);
    background: var(--card);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
}

.calendar-range-hint i {
    font-size: 13px;
    vertical-align: -1px;
}

.calendar-range-hint .btn-ghost.tiny {
    font-size: 11px;
    color: var(--primary);
    cursor: pointer;
}

/* ==================== Requirements Panel ==================== */

.schedule-requirements-panel {
    min-width: 0;
}

.schedule-requirements-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--slate-100);
}

.schedule-requirements-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.schedule-requirements-title h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--foreground);
}

.schedule-requirements-title .section-count {
    font-size: 13px;
    color: var(--slate-500);
}

.schedule-requirements-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.schedule-requirements-list {
    min-height: 300px;
}

.schedule-requirements-list .schedule-alert-section {
    margin-bottom: 16px;
}

.schedule-requirements-list .schedule-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ==================== Schedule Deadline Tag ==================== */

.schedule-deadline {
    font-size: 12px;
}

.schedule-deadline.deadline-overdue {
    color: var(--danger);
}

.schedule-deadline.deadline-imminent,
.schedule-deadline.deadline-today {
    color: var(--warning);
}

/* ==================== Responsive ==================== */

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

    .schedule-left {
        gap: 10px;
    }

    .schedule-calendar-panel .cal-cell {
        min-height: 40px;
    }

    .schedule-requirements-title h3 {
        font-size: 17px;
    }
}
