/* =========================================================
   custom_dashboard.css — 全站自定义样式（登录页除外）
   ---------------------------------------------------------
   主题色变量 (--login-* / --color-*) 定义在 custom_login.css，
   本文件直接引用它们（layout.php 先加载 login 再加载本文件）。

   章节顺序：
     1.  全局背景
     2.  顶栏 Header（logo / 标题 / 项目切换器）
     3.  侧边栏 Sidebar
     4.  页面头部标签 Page header
     5.  列表 / 卡片 / 提示 / 搜索框
     6.  顶栏注入组件（视图切换 / 过滤）
     7.  项目概览仪表盘（KPI + 标签页）
     8.  看板 Kanban board
     9.  任务【编辑】弹窗表单布局 (.task-form-*)
     10. 任务【新建】弹窗表单布局 (.custom-task-form-*)
     11. 弹窗通用外观（所有 #modal-box）

   约定：弹窗样式只在本文件里改；task_creation/show.php 不再内联 <style>。
   ========================================================= */

/* custom_dashboard.css */

/* Global Dashboard Background */
body {
    background: var(--login-bg) !important;
    color: var(--login-text-color) !important;
}

/* Header & Title Stack Restructuring */
.header-left {
    display: flex;
    align-items: center;
}

.header-left .logo {
    font-size: 32px;
    margin-right: 15px;
    line-height: 1;
}

.header-titles-stack {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.header-titles-stack .title {
    font-size: 15px;
    font-weight: 600;
    color: var(--login-text-color);
    margin-bottom: 2px;
    line-height: 1;
}

/* Custom Board Selector */
.custom-board-selector {
    margin: 0;
    line-height: 1;
}

.custom-board-selector .board-selector-btn {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px; /* Match standard dropdown shapes better */
    background: rgba(255, 255, 255, 0.5) !important;
    color: #333 !important;
    font-size: 13px;
    border: 1px solid rgba(0,0,0,0.15);
    text-decoration: none;
    transition: all 0.2s;
    width: 140px; /* Fixed width to align with menu */
    box-sizing: border-box;
    text-align: left;
}

.custom-board-selector .board-selector-btn i.fa-caret-down {
    float: right;
    margin-top: 2px;
}

.custom-board-selector .board-selector-btn:hover {
    background: rgba(0, 0, 0, 0.05) !important;
}

ul.custom-board-selector-menu {
    overflow: hidden !important; /* Strictly no scrollbars */
    border-radius: 6px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
    border: 1px solid rgba(0,0,0,0.15) !important;
    background: #fff !important;
    padding: 4px 0 !important;
    width: 140px !important; /* Fixed width to match button */
    min-width: 140px !important; 
    margin-top: 8px !important; /* Increased spacing to prevent overlap */
    white-space: nowrap !important; /* Prevent text wrapping so it shrinks to fit */
}

/* Fix Kanboard native li hover nesting */
ul.custom-board-selector-menu li {
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
}

ul.custom-board-selector-menu li:hover {
    background: transparent !important;
}

/* Style the links inside the dropdown beautifully */
ul.custom-board-selector-menu li a {
    padding: 8px 12px !important; /* More compact vertically */
    color: #333 !important;
    text-decoration: none !important;
    display: block !important;
    font-size: 13px !important; /* Slightly smaller font */
    transition: background 0.2s, color 0.2s !important;
    border-radius: 0 !important; /* Override default Kanboard link styling if needed */
    box-sizing: border-box !important;
    width: 100% !important;
}

ul.custom-board-selector-menu li a:hover {
    background: var(--login-btn-bg) !important;
    color: var(--login-btn-text) !important;
}

/* Custom divider */
ul.custom-board-selector-menu li hr {
    margin: 4px 0 !important;
    border-top: 1px solid rgba(0,0,0,0.08) !important;
    border-bottom: none !important;
}

/* Sidebar restructuring */
.sidebar-container {
    display: flex;
    margin-top: 20px;
}

.sidebar {
    border-right: none !important;
    width: 160px; /* Slimmer fixed width, no longer 250px */
    padding-right: 20px;
}

.sidebar ul {
    border: none !important;
}

.sidebar ul li {
    margin-bottom: 5px;
    border-radius: 12px;
    transition: all 0.2s ease;
    border-left: none !important;
}

.sidebar ul li:hover, .sidebar ul li.active {
    background: rgba(255, 224, 102, 0.15) !important;
    border-left: none !important;
}

.sidebar ul li a {
    position: relative;
    display: block;
    padding: 10px 0; /* Remove horizontal padding so text centers relative to the full width */
    color: var(--login-text-color) !important;
    font-weight: 500;
    text-align: center;
    border-radius: 8px;
}

.sidebar ul li a i {
    position: absolute;
    left: 15px; /* Fixed position on the left */
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    text-align: center;
    margin: 0; /* Remove previous margins */
}

.sidebar-text {
    display: inline-block;
    width: 5em; /* Exactly 5 characters wide */
    text-align: center; /* Center the text inside the 5-char block */
    margin: 0 auto; /* Center the block inside the a tag */
}

.sidebar ul li.active a {
    color: #f39c12 !important;
    font-weight: 600;
}

/* Page Header links */
.page-header {
    border-bottom: 1px solid var(--login-icon-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.page-header ul {
    border: none !important;
}
.page-header ul li {
    margin-right: 10px !important;
}
.page-header ul li a {
    border-radius: 50px;
    padding: 6px 15px;
    transition: all 0.2s;
    color: var(--login-text-color) !important;
}
.page-header ul li a:hover {
    background: rgba(255, 224, 102, 0.2);
}

/* Cards and Tables (Overview) */
.sidebar-content .table-list {
    background: var(--login-card-bg);
    border-radius: 16px;
    box-shadow: var(--login-shadow);
    border: none !important;
    overflow: hidden;
    margin-top: 15px;
}

.table-list-header {
    background: var(--login-input-bg) !important;
    border: none !important;
    padding: 15px 20px !important;
    color: var(--login-text-color);
}

.table-list-row {
    border: none !important;
    border-bottom: 1px solid var(--login-icon-color) !important;
    padding: 15px 20px !important;
    transition: background 0.2s;
    background: var(--login-card-bg);
}

.table-list-row:hover {
    background: var(--login-input-bg) !important;
}

.table-list-row:last-child {
    border-bottom: none !important;
}

/* Empty state */
.alert {
    border-radius: 12px;
    padding: 20px !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.alert-info {
    background: rgba(255, 224, 102, 0.15) !important;
    color: #d35400 !important;
    text-align: center;
    font-weight: 500;
}

/* Filter bar / Search */
.filter-box {
    background: var(--login-card-bg);
    border-radius: 50px;
    box-shadow: var(--login-shadow);
    padding: 5px 20px;
    display: flex;
    align-items: center;
    border: 1px solid var(--login-icon-color);
}

.filter-box .form-input-group {
    flex-grow: 1;
}

.filter-box input[type="text"] {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    width: 100%;
    color: var(--login-input-text);
}

/* Header general styling */
header {
    background: var(--login-card-bg) !important;
    box-shadow: var(--login-shadow);
    padding: 12px 15px !important;
    border-bottom: none !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-right: 20px;
    font-size: 1.8em; /* Enlarge logo */
}

.title-container {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    font-size: 1.5em; /* Enlarge title */
    font-weight: 500;
}

.menus-container {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-size: 1.2em; /* Enlarge buttons */
    gap: 10px; /* Add spacing between buttons if they don't have it */
}

.header-center-description {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    font-size: 15px; /* Enlarge info text */
    color: #666;
    margin: 0 0 0 15px; /* Stick close to title container */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 40px; /* Prevent header stretching */
    font-weight: normal; /* Override title font weight */
}

.header-center-description hr {
    display: inline-block;
    width: 1px;
    height: 12px;
    margin: 0 10px;
    background: #ccc;
    border: none;
    vertical-align: middle;
}

.header-center-description p, .header-center-description strong, .header-center-description em {
    display: inline;
    margin: 0 5px;
}

.header-center-description ul, .header-center-description ol {
    display: inline;
    padding: 0;
    margin: 0 5px;
    list-style: none;
}

.header-center-description li {
    display: inline;
    margin-right: 8px;
}



/* Stylings for injected Project Header components */
.menus-container .dropdown-component {
    margin-right: 10px;
    font-size: 14px;
}

.menus-container .views-switcher-component {
    margin-right: 15px;
}

.menus-container .views-switcher-component ul.views {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 8px;
}

.menus-container .views-switcher-component ul.views li {
    background: transparent;
    border: none;
    margin: 0;
}

.menus-container .views-switcher-component ul.views li a {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: normal;
    color: #555;
    background: rgba(0,0,0,0.04);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.menus-container .views-switcher-component ul.views li.active a,
.menus-container .views-switcher-component ul.views li:hover a {
    background: var(--color-primary);
    color: white;
}

.menus-container .views-switcher-component ul.views li.active a i,
.menus-container .views-switcher-component ul.views li:hover a i {
    color: white;
}

.filter-box-component form {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
}

.filter-box-component .input-addon-item {
    background: transparent;
    border: none;
}

.filter-box-component .input-addon-field {
    border-radius: 20px;
    padding: 4px 12px;
    border: 1px solid #ccc;
    font-size: 13px;
    width: 200px;
    transition: width 0.3s;
}

.filter-box-component .input-addon-field:focus {
    width: 250px;
    outline: none;
    border-color: var(--color-primary);
}
/* =========================================================
   Project Overview Dashboard Redesign
   ========================================================= */

/* Main Container padding */
.project-overview-dashboard {
    padding: 20px 30px;
}

/* --- KPI Cards Row --- */
.dashboard-kpi-row {
    margin-bottom: 20px;
}

.dashboard-kpi-row .project-overview-columns {
    display: flex;
    gap: 15px;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
}

.dashboard-kpi-row .project-overview-column {
    flex: 1;
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-kpi-row .project-overview-column:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.dashboard-kpi-row .project-overview-column strong {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 6px;
}

.dashboard-kpi-row .project-overview-column small {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

/* --- Pure CSS Tabs Layout --- */
.tab-radio {
    display: none;
}

.dashboard-tabs-header {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 8px;
}

.dashboard-tabs-header .tab-btn {
    flex: 1;
    text-align: center;
    background: transparent;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: block;
}

.dashboard-tabs-header .tab-btn:hover {
    background: #f5f5f5;
    color: #333;
}

/* Radio button active states mapping to labels */
#tab-desc:checked ~ .dashboard-tabs-header [for="tab-desc"],
#tab-attach:checked ~ .dashboard-tabs-header [for="tab-attach"],
#tab-info:checked ~ .dashboard-tabs-header [for="tab-info"],
#tab-act:checked ~ .dashboard-tabs-header [for="tab-act"] {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.dashboard-tabs-content .tab-pane {
    display: none;
}

/* Radio button active states mapping to panes */
#tab-desc:checked ~ .dashboard-tabs-content .pane-desc,
#tab-attach:checked ~ .dashboard-tabs-content .pane-attach,
#tab-info:checked ~ .dashboard-tabs-content .pane-info,
#tab-act:checked ~ .dashboard-tabs-content .pane-act {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Card Styles (Replaced details with div) --- */
.dashboard-tabs-content .accordion-section {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.05);
    overflow: hidden;
    margin-bottom: 0;
}

.dashboard-tabs-content .accordion-section .accordion-content {
    padding: 25px;
}

.project-overview-dashboard .accordion-content > .panel {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

/* Styling specific content inside cards */
.project-overview-dashboard .accordion-content ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.project-overview-dashboard .accordion-content ul li {
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
    color: #555;
}

.project-overview-dashboard .accordion-content ul li:last-child {
    border-bottom: none;
}

.project-overview-dashboard .accordion-content ul li strong {
    color: #222;
}

/* Activity feed timeline style */
.project-overview-dashboard .activity-event {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #eee;
}

.project-overview-dashboard .activity-event:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.project-overview-dashboard .activity-date {
    font-size: 12px;
    color: #999;
}

@media (max-width: 900px) {
    .dashboard-kpi-row .project-overview-columns {
        flex-direction: column;
    }
    
    .dashboard-tabs-header {
        flex-wrap: wrap;
    }
}

/* =========================================================
   Kanban Board Redesign
   ========================================================= */

/* Main Board Container */
#board {
    border-collapse: separate !important;
    border-spacing: 15px 0 !important;
    margin: 10px 0 !important; /* Removed side margin so 100% width fits perfectly */
    background: transparent !important;
    width: 100% !important;
    table-layout: fixed !important;
}

/* Column Headers */
.board-column-header {
    background-color: #f4f5f7 !important;
    border: none !important;
    border-radius: 8px 8px 0 0 !important;
    padding: 15px !important;
}

/* Column Body */
.board-column {
    background-color: #f4f5f7 !important;
    border: none !important;
    border-radius: 0 0 8px 8px !important;
    padding: 0 10px 15px 10px !important;
    vertical-align: top;
}

/* Remove default column borders */
.board-column-header th, .board-column td {
    border: none !important;
}

/* Header Flexbox Layout */
.board-column-expanded-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
}

.board-column-title {
    font-weight: 700;
    font-size: 15px;
    color: #333;
    flex: 1;
    text-align: left;
    margin-left: 8px;
}

/* Task Count Badge */
.board-column-header-task-count {
    background: #e0e4e8;
    color: #555;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
}

/* Task Cards */
.task-board {
    background-color: #ffffff !important;
    border-top: none !important;
    border-right: none !important;
    border-bottom: none !important;
    border-left-width: 4px !important;
    border-left-style: solid !important;
    border-radius: 6px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    padding: 12px 15px !important;
    margin-bottom: 12px !important;
    margin-top: 0 !important;
    transition: transform 0.2s, box-shadow 0.2s;
}

.task-board:hover {
    box-shadow: 0 3px 8px rgba(0,0,0,0.15) !important;
    transform: translateY(-2px);
}

/* Typography inside Tasks */
.task-board-header {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}

.task-board-header a {
    color: #888 !important;
    font-weight: 500;
}

.task-board-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 4px;
}

.task-board-title a {
    color: #222 !important;
}

.task-board-title a:hover {
    color: var(--color-primary) !important;
    text-decoration: none;
}

/* Clean up add button */
.board-add-icon {
    color: var(--color-primary) !important;
    font-size: 16px;
    opacity: 0.8;
}

.board-add-icon:hover {
    opacity: 1;
}

/* =========================================================
   9. 任务【编辑】弹窗 — 表单布局 (.task-form-*)
   对应模板：app/Template/task_modification/show.php
   （结构与第 10 节的新建任务弹窗相似，但类名不同；将来可考虑合并成一套）
   ========================================================= */

/* Use CSS Grid for the form container */
.task-form-container {
    display: grid !important;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
}

/* Make columns fill their grid cells */
.task-form-main-column,
.task-form-secondary-column {
    width: 100% !important;
    float: none !important;
}

/* Bottom area spans across all columns */
.task-form-bottom {
    grid-column: 1 / -1;
    margin-top: 15px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

/* Labels */
.task-form-container label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
    margin-top: 12px;
}

/* Inputs, Selects, Textareas */
.task-form-container input[type="text"],
.task-form-container input[type="number"],
.task-form-container input[type="password"],
.task-form-container select,
.task-form-container textarea {
    width: 100% !important;
    padding: 10px 12px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
    font-size: 14px;
    color: #333;
    transition: all 0.2s ease !important;
    background-color: #fff !important;
}

/* Focus states for inputs */
.task-form-container input[type="text"]:focus,
.task-form-container input[type="number"]:focus,
.task-form-container input[type="password"]:focus,
.task-form-container select:focus,
.task-form-container textarea:focus {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(52, 104, 192, 0.1) !important;
    outline: none !important;
}

/* Checkboxes */
.task-form-bottom label {
    display: inline-block;
    margin-top: 0;
    margin-right: 15px;
    font-weight: 500;
}

/* Primary Button in Form */
.task-form-bottom .btn-blue {
    padding: 10px 24px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    margin-right: 10px;
}

/* Markdown Editor Toolbar */
.text-editor-toolbar {
    background-color: #f9f9f9;
    border: 1px solid #d1d5db;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    padding: 6px 10px;
}

.text-editor-write-mode {
    margin-top: 0 !important;
}

.text-editor-write-mode textarea {
    border-radius: 0 0 6px 6px !important;
    border-top: none !important;
}

/* =========================================================
   10. 任务【新建】弹窗 — 表单布局 (.custom-task-form-*)
   对应模板：app/Template/task_creation/show.php
   （以前这段是内联在 show.php 里的，现统一搬到这里维护）
   ========================================================= */

.custom-task-form-container {
    display: flex;
    gap: 12px;
    align-items: stretch;
    max-width: 100%;
    box-sizing: border-box;
}
.custom-task-form-main { flex: 34; min-width: 0; }
.custom-task-form-secondary { flex: 42; min-width: 0; }
.custom-task-form-tertiary { flex: 24; min-width: 0;
    display: flex;
    flex-direction: column;
    font-size: 0; /* 消除子元素之间的 inline 空白间隙 */
}
.custom-task-form-secondary > *,
.custom-task-form-tertiary > * { font-size: 14px; }

/* 并排布局 & 拼接组件 */
.form-row-top {
    display: flex;
    align-items: flex-start;
    width: 100%;
}
.form-row-gap {
    gap: 15px;
}
.form-col {
    flex: 1;
    min-width: 0;
}
.joined-input-group {
    display: flex;
    width: 100%;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    align-items: stretch;
    box-sizing: border-box;
}
.joined-input-group .form-col {
    flex: 1;
    min-width: 0;
    margin: 0;
}
.joined-input-group .form-col:first-child {
    border-right: 1px solid #ccc;
}
/* 剥除原生边框，使其融合为一个整体组件 (增加权重以覆盖 #modal-box 样式) */
#modal-box .joined-input-group select,
#modal-box .joined-input-group input,
#modal-box .joined-input-group .color-picker-select,
#modal-box .joined-input-group .select2-container--default .select2-selection--single,
#modal-box .joined-input-group .select2-selection {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    height: 38px !important;
    width: 100% !important;
    margin: 0 !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    outline: none !important;
}
#modal-box .joined-input-group .color-picker-select {
    display: flex;
    align-items: center;
    padding-left: 10px !important;
}

/* 附件区域对齐与编辑器高度 */
.text-editor textarea {
    height: 380px !important;
    resize: none !important;
    overflow-y: auto;
}
.text-editor textarea::-webkit-scrollbar {
    width: 8px;
}
.text-editor textarea::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}
.text-editor textarea::-webkit-scrollbar-track {
    background-color: #f5f5f5;
}

.attachment-area-wrapper {
    display: flex;
    flex-direction: column;
    margin-top: 84px; /* 精确下移以对齐标签栏顶部 */
    flex-grow: 1; /* 自动撑满剩余高度，让底部严丝合缝地对齐 */
    height: auto !important; /* 放弃硬编码高度，改用弹性盒子自动对齐 */
    border: 1px dashed #ccc;
    border-radius: 8px;
    background: #fafafa;
}
.form-col-selectors {
    flex: 1;
}
.form-col-assignee {
    flex: 1;
}

/* 附件区域占据剩余高度 */
.attachment-area-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    margin-top: 15px;
    border: 1px dashed #ccc;
    border-radius: 8px;
    background: #fafafa;
    min-height: 250px;
}
.attachment-area-title {
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 600;
    color: #444;
    border-bottom: 1px solid #eee;
}
.custom-attachments-content {
    flex-grow: 1;
}
/* 覆盖默认的内联样式和 49% 宽度，让附件框纵向铺满 */
.custom-task-form-secondary .task-form-bottom-column {
    width: 100% !important;
    display: block !important;
    margin: 0 !important;
    flex-grow: 1;
    position: relative;
}
.custom-task-form-secondary .task-form-bottom-column:first-child {
    border-bottom: 1px dashed #ccc;
}
.custom-task-form-secondary .dropzone {
    height: 100%;
    min-height: 120px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}
#screenshot-zone {
    height: 100%;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-actions-wrapper { margin-top: auto; padding-top: 15px; display: flex; flex-direction: column; gap: 15px; }

/* 复选框样式按钮化 */
.checkbox-group label {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 14px !important;
    font-weight: normal;
    background: #fff;
    cursor: pointer;
    box-sizing: border-box;
    width: 100%;
}
.checkbox-group input[type="checkbox"] {
    margin: 0 10px 0 0 !important;
}

.submit-buttons-wrapper { margin-top: auto; display: flex; justify-content: flex-end; gap: 10px; align-items: center; flex-wrap: wrap; }
.submit-buttons-wrapper .btn {
    padding: 8px 20px;
    font-size: 14px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
}
#modal-box .submit-buttons-wrapper .btn-cancel {
    border: 1px solid #ccc !important;
    background: #fff !important;
    color: #333 !important;
}
#modal-box .submit-buttons-wrapper .btn-cancel:hover {
    background: #f5f5f5 !important;
}
.submit-buttons-wrapper .btn-blue {
    background: #007bff;
    color: #fff;
    border: 1px solid #007bff;
}
.submit-buttons-wrapper .btn-blue:hover {
    background: #0056b3;
}

.custom-task-form-container label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 4px;
    margin-top: 8px;
}
.custom-task-form-container input[type="text"],
.custom-task-form-container input[type="number"],
.custom-task-form-container input[type="password"],
.custom-task-form-container select,
.custom-task-form-container textarea {
    width: 100%;
    max-width: 100%;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 14px;
    color: #333;
    transition: all 0.2s ease;
    background-color: #fff;
}
.custom-task-form-container input[type="text"]:focus,
.custom-task-form-container input[type="number"]:focus,
.custom-task-form-container input[type="password"]:focus,
.custom-task-form-container select:focus,
.custom-task-form-container textarea:focus {
    border-color: var(--color-primary, #3468C0);
    box-shadow: 0 0 0 3px rgba(52, 104, 192, 0.1);
    outline: none;
}
/* 横向滚动条根因修复（标注图问题①）：
   Kanboard 核心给 markdown 编辑器写死了 .text-editor textarea{width:700px}，
   放进三列网格后这 700px 会把整张表撑到约 1440px，于是 #modal-box（核心设了
   overflow:auto）冒出横向滚动条。这里把编辑器/预览区强制改成 100%，让它随所在列
   自适应——从根上消除溢出，而不是把内容裁掉。 */
.custom-task-form-container .text-editor,
.custom-task-form-container .text-editor textarea,
.custom-task-form-container .text-editor .text-editor-preview-area,
.task-form-container .text-editor,
.task-form-container .text-editor textarea,
.task-form-container .text-editor .text-editor-preview-area {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}
/* 把网格锁死在父容器宽度内，配合各列 min-width:0，fr 轨道只在可用宽度里分配 */
.custom-task-form-container,
.task-form-container { width: 100%; min-width: 0; box-sizing: border-box; }
.custom-task-form-container *,
.task-form-container * { box-sizing: border-box; }

/* 核心给日期/数字/参考等字段写死了 150px 等小宽度，让它们填满所在列，列更整齐 */
.custom-task-form-container input.form-datetime,
.custom-task-form-container input.form-date,
.custom-task-form-container input.form-numeric,
.custom-task-form-container input.form-input-small,
.custom-task-form-container input.form-input-large,
.task-form-container input.form-datetime,
.task-form-container input.form-date,
.task-form-container input.form-numeric,
.task-form-container input.form-input-small,
.task-form-container input.form-input-large {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* 收掉那条“幽灵”横向滚动条：强制无视子元素溢出 */
#modal-box { overflow-x: hidden !important; overflow-y: auto !important; }

/* =========================================================
   11. 弹窗通用外观（所有 #modal-box：新建 / 编辑 / 其它弹窗共用）
   ========================================================= */

/* Overlay: Glassmorphism effect & Positioning */
#modal-overlay {
    background: rgba(0, 0, 0, 0.45) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    transition: opacity 0.3s ease;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding-top: 20vh !important; /* 整体位置偏下 */
    padding-bottom: 5vh !important; /* 保证底部不会贴死，留出滚动空间 */
    overflow-y: auto !important;
}

/* Modal Container */
#modal-box {
    margin: 0 !important; /* 移除 Kanboard 默认的上边距 */
    flex-shrink: 0 !important; /* 防止在小屏幕下被挤压变形 */
    box-sizing: border-box !important;
    width: 950px !important;
    max-width: 95vw !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 36px rgba(0,0,0,0.15) !important;
    border: none !important;
    background: #ffffff !important;
    padding: 20px 25px !important;
    animation: modalSlideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

/* Modal Header */
#modal-box .page-header {
    border-bottom: 1px solid #eaeaea !important;
    padding-bottom: 10px !important;
    margin-bottom: 15px !important;
}

#modal-box .page-header h2 {
    font-size: 22px !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
    margin: 0 !important;
}

/* Generic Form Elements inside Modal (catching everything) */
#modal-box input[type="text"],
#modal-box input[type="password"],
#modal-box input[type="email"],
#modal-box input[type="number"],
#modal-box select,
#modal-box textarea {
    width: 100% !important;
    max-width: 100% !important;
    padding: 6px 10px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
    font-size: 14px !important;
    color: #333 !important;
    transition: all 0.2s ease !important;
    background-color: #fff !important;
    margin-top: 2px !important;
    margin-bottom: 6px !important;
}

#modal-box input:focus,
#modal-box select:focus,
#modal-box textarea:focus {
    border-color: var(--color-primary, #3468C0) !important;
    box-shadow: 0 0 0 3px rgba(52, 104, 192, 0.15) !important;
    outline: none !important;
}

/* Labels */
#modal-box label {
    display: block; /* 移除 !important，允许 JS 隐藏 label */
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #555 !important;
    margin-bottom: 2px !important;
    margin-top: 6px !important;
}

/* 特殊的类，用于 JS 隐藏 label 强行覆盖 */
#modal-box label.hide-placeholder-label {
    display: none !important;
}

/* Buttons inside Modal */
#modal-box .btn {
    padding: 10px 20px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    border: none !important;
    cursor: pointer !important;
}

#modal-box .btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
}

#modal-box .btn-blue {
    background: var(--color-primary, #3468C0) !important;
    color: white !important;
}

#modal-box .btn-blue:hover {
    background: #2a56a0 !important; /* Slightly darker on hover */
}

#modal-box .btn-red {
    background: #e74c3c !important;
    color: white !important;
}

#modal-box .btn-red:hover {
    background: #c0392b !important;
}

/* Cancel Links */
#modal-box .form-actions a {
    color: #888 !important;
    text-decoration: none !important;
    margin-left: 15px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}

#modal-box .form-actions a:hover {
    color: #333 !important;
}

/* Fix close button at top right */
#modal-close-button {
    color: #999 !important;
    font-size: 24px !important;
    line-height: 1 !important;
    transition: color 0.2s !important;
    top: 18px !important;
    right: 25px !important;
}

#modal-close-button:hover {
    color: #333 !important;
}

/* Fix color picker dropdown menu positioning & transparency */
#select-dropdown-menu {
    background: #fff !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2) !important;
    border: 1px solid #e2e8f0 !important;
    z-index: 99999 !important;
    margin-top: 4px !important;
}
.select-dropdown-input-container #select-dropdown-menu {
    top: 100% !important;
    left: 0 !important;
    min-width: 100% !important;
}

/* =========================================================
   12. 任务详情页 UI 优化 (Task View)
   ========================================================= */

/* 1. 左侧侧边栏 (Sidebar) 现代化 */
#task-view .sidebar {
    background-color: #f8fafc !important;
    border-right: 1px solid #e2e8f0 !important;
    padding: 20px 15px !important;
    border-radius: 12px 0 0 12px;
}

#task-view .sidebar > ul > li {
    margin-bottom: 4px !important;
}

#task-view .sidebar > ul > li > a {
    display: flex !important;
    align-items: center !important;
    padding: 10px 14px !important;
    color: #475569 !important;
    font-weight: 500 !important;
    text-align: left !important;
}

#task-view .sidebar > ul > li > a i {
    position: static !important;
    transform: none !important;
    margin-right: 10px !important;
    color: #64748b;
}

#task-view .sidebar > ul > li > a .sidebar-text {
    width: auto !important;
    text-align: left !important;
}

#task-view .sidebar > ul > li:hover, 
#task-view .sidebar > ul > li.active {
    background: transparent !important; /* Remove old yellow hover */
}

#task-view .sidebar > ul > li > a:hover {
    background-color: #f1f5f9 !important;
    color: #1e293b !important;
}

#task-view .sidebar > ul > li.active > a {
    background-color: #e0f2fe !important;
    color: #0284c7 !important;
    font-weight: 600 !important;
}

#task-view .sidebar > ul > li.active > a i {
    color: #0284c7 !important;
}

#task-view .sidebar-title h2 {
    font-size: 12px !important;
    text-transform: uppercase !important;
    color: #94a3b8 !important;
    letter-spacing: 0.05em !important;
    margin-top: 20px !important;
    margin-bottom: 8px !important;
    padding-left: 14px !important;
    border-bottom: none !important;
    font-weight: 700 !important;
}

/* 2. 顶部元数据框 (黄框重构) */
#task-summary .task-summary-container {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 20px 25px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03) !important;
    position: relative;
    overflow: hidden;
    margin-bottom: 25px !important;
}

/* 左侧彩色提示线 - 缩小颜色面积 */
#task-summary .task-summary-container[class*="color-"] {
    border-left-width: 5px !important;
}
#task-summary .task-summary-container.color-yellow { border-left-color: #f59e0b !important; }
#task-summary .task-summary-container.color-blue { border-left-color: #3b82f6 !important; }
#task-summary .task-summary-container.color-green { border-left-color: #10b981 !important; }
#task-summary .task-summary-container.color-purple { border-left-color: #8b5cf6 !important; }
#task-summary .task-summary-container.color-red { border-left-color: #ef4444 !important; }
#task-summary .task-summary-container.color-orange { border-left-color: #f97316 !important; }
#task-summary .task-summary-container.color-grey { border-left-color: #64748b !important; }
#task-summary .task-summary-container.color-brown { border-left-color: #78350f !important; }
#task-summary .task-summary-container.color-deep_orange { border-left-color: #ea580c !important; }
#task-summary .task-summary-container.color-dark_grey { border-left-color: #334155 !important; }
#task-summary .task-summary-container.color-pink { border-left-color: #ec4899 !important; }
#task-summary .task-summary-container.color-teal { border-left-color: #14b8a6 !important; }
#task-summary .task-summary-container.color-cyan { border-left-color: #06b6d4 !important; }
#task-summary .task-summary-container.color-lime { border-left-color: #84cc16 !important; }
#task-summary .task-summary-container.color-light_green { border-left-color: #22c55e !important; }
#task-summary .task-summary-container.color-light_blue { border-left-color: #0ea5e9 !important; }

#task-summary h2 {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin-bottom: 20px !important;
}

/* 元数据排版重塑: 改为上下结构 */
#task-summary .task-summary-columns {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 30px !important;
}

#task-summary .task-summary-column {
    flex: 1 !important;
}

#task-summary .task-summary-column ul.no-bullet {
    padding-left: 0 !important;
    margin: 0 !important;
}

#task-summary .task-summary-column ul.no-bullet li {
    display: flex !important;
    flex-direction: column !important;
    margin-bottom: 16px !important;
    line-height: 1.4 !important;
}

#task-summary .task-summary-column ul.no-bullet li strong {
    font-size: 12px !important;
    color: #64748b !important;
    font-weight: 500 !important;
    margin-bottom: 4px !important;
    text-transform: capitalize !important;
}

#task-summary .task-summary-column ul.no-bullet li span {
    font-size: 14px !important;
    color: #0f172a !important;
    font-weight: 600 !important;
}

#task-summary .task-summary-column ul.no-bullet li small {
    margin-top: 8px !important;
}
#task-summary .task-summary-column ul.no-bullet li small a {
    color: #3b82f6 !important;
    text-decoration: none !important;
    font-size: 13px !important;
    font-weight: 500 !important;
}

/* 3. 折叠面板 (Accordions) 视觉升级 */
.accordion-section {
    margin-top: 25px !important;
    background: #ffffff !important;
    border-radius: 10px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02) !important;
    overflow: hidden !important;
}

.accordion-title {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    padding: 16px 20px !important;
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    cursor: pointer !important;
    list-style: none !important; /* 隐藏浏览器原生三角 */
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
}

/* 隐藏 Safari 原生三角 */
.accordion-title::-webkit-details-marker {
    display: none !important;
}

/* 自定义右侧箭头 */
.accordion-title::before {
    content: "\f105" !important; /* FontAwesome fa-angle-right */
    font-family: FontAwesome !important;
    display: inline-block !important;
    width: 24px !important;
    transition: transform 0.2s ease !important;
    color: #94a3b8 !important;
    font-size: 18px !important;
}

details[open] > .accordion-title::before {
    transform: rotate(90deg) !important;
}

.accordion-content {
    padding: 20px !important;
}
