/* ============================================
   管理后台样式 v7（三级模型：机库→任务→架次）
   ============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
    background: #f0f4f8;
    color: #1e293b;
    padding: 16px;
    min-width: 860px;
    padding-bottom: 80px;
}
.dashboard { max-width: 1400px; margin: 0 auto; }

/* ============================================
   渐变头部
   ============================================ */
.header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    color: white;
    padding: 24px 36px;
    border-radius: 14px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header h1 { font-size: 24px; font-weight: 700; margin-bottom: 4px; letter-spacing: 1px; }
.header .subtitle { font-size: 13px; opacity: 0.85; }
.header-right { display: flex; align-items: center; gap: 16px; }
.header-right a {
    color: #bfdbfe;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.15s;
}
.header-right a:hover { color: #fff; }

/* ============================================
   Section 卡片
   ============================================ */
.section {
    background: white;
    border-radius: 14px;
    padding: 20px 22px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
}
.section-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 16px;
    padding-left: 12px;
    border-left: 4px solid #2563eb;
}

/* ============================================
   工具栏
   ============================================ */
.toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.admin-info { font-size: 13px; color: #64748b; }
.admin-info span { font-weight: 600; color: #1e3a5f; }

/* ============================================
   按钮
   ============================================ */
.btn {
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.15s;
    font-family: inherit;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #e2e8f0; color: #475569; }
.btn-secondary:hover { background: #cbd5e1; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }

/* ============================================
   表单元素
   ============================================ */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 6px;
    font-weight: 600;
}
.form-input,
input[type="text"],
input[type="date"],
input[type="time"],
select {
    padding: 7px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    color: #1e293b;
    transition: border-color 0.2s, box-shadow 0.2s;
    color-scheme: light;
    font-family: inherit;
}
.form-input:focus,
input[type="text"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* ============================================
   钉钉配置
   ============================================ */
.dingtalk-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ding-input { flex: 1; }

/* ============================================
   机库卡片
   ============================================ */
.hangar-list { display: flex; flex-direction: column; gap: 16px; }

.hangar-card {
    background: white;
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}
.hangar-card.hangar-flying { border-color: #f59e0b; box-shadow: 0 2px 12px rgba(245, 158, 11, 0.15); }

.hangar-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 2px solid #f1f5f9;
    flex-wrap: wrap;
}
.hangar-name-input {
    font-size: 16px;
    font-weight: 700;
    color: #1e3a5f;
    min-width: 200px;
    flex: 1;
    border: none;
    background: transparent;
    padding: 4px 0;
}
.hangar-name-input:focus {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 4px 10px;
    background: #fff;
    outline: none;
}

/* ============================================
   任务卡片（嵌套在机库内）
   ============================================ */
.task-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
}
.task-card:last-child { margin-bottom: 0; }

.task-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}
.task-header label {
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
    font-weight: 600;
}
.task-date-input { width: 130px; }
.task-airspace-input { width: 110px; }
.task-time-input { width: 85px; }

.airspace-quick-btns {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.airspace-quick-btn {
    padding: 3px 10px;
    border: 1px solid #93c5fd;
    background: #fff;
    color: #1e40af;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.airspace-quick-btn:hover {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

/* ============================================
   架次行
   ============================================ */
.sortie-list { display: flex; flex-direction: column; gap: 8px; }

.sortie-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    flex-wrap: wrap;
}
.sortie-row.sortie-pending  { border-left: 4px solid #94a3b8; }
.sortie-row.sortie-flying   { border-left: 4px solid #f59e0b; background: #fffbeb; }
.sortie-row.sortie-finished { border-left: 4px solid #10b981; background: #f0fdf4; }
.sortie-row.sortie-abnormal { border-left: 4px solid #ef4444; background: #fef2f2; }

.sortie-num {
    display: inline-block;
    min-width: 56px;
    text-align: center;
    background: #475569;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    flex-shrink: 0;
}
.sortie-row.sortie-pending  .sortie-num { background: #94a3b8; }
.sortie-row.sortie-flying   .sortie-num { background: #f59e0b; }
.sortie-row.sortie-finished .sortie-num { background: #10b981; }
.sortie-row.sortie-abnormal .sortie-num { background: #ef4444; }

.sortie-row label { font-size: 11px; color: #64748b; white-space: nowrap; font-weight: 600; }
.sortie-input { width: 80px; }
.sortie-input-sm { width: 55px; }

.time-range {
    display: flex;
    align-items: center;
    gap: 4px;
}
.time-range .time-sep {
    font-size: 14px;
    color: #64748b;
    font-weight: 600;
}

.status-select { width: 95px; font-weight: 600; }
.status-select.status-pending   { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.status-select.status-flying    { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.status-select.status-finished  { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.status-select.status-abnormal  { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

/* ============================================
   弹窗
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}
.modal-box {
    background: white;
    border-radius: 14px;
    padding: 28px 32px;
    width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 20px;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* ============================================
   Toast & 保存栏
   ============================================ */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e3a5f;
    color: #fff;
    padding: 10px 28px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.toast.show { opacity: 1; }
.toast.error { background: #ef4444; }

.save-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: white;
    padding: 12px 24px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    z-index: 100;
}
.save-bar-hint {
    font-size: 13px;
    color: #94a3b8;
}

.empty-tip {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
    font-size: 14px;
}

/* ============================================
   滚动条
   ============================================ */
::-webkit-scrollbar       { height: 6px; width: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
