/* ============================================
   顽星旅行社系统 - 全局样式
   主色调：深蓝色 #1e3a5f
   ============================================ */

:root {
    --primary-color: #1e3a5f;
    --primary-dark: #162b47;
    --primary-light: #2c4f7c;
    --sidebar-width: 220px;
    --topbar-height: 60px;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f6f9;
    color: #333;
}

/* ============ 登录页面 ============ */
.login-body {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c4f7c 50%, #3a6ea5 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-wrapper {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px 35px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    font-size: 48px;
    color: var(--primary-color);
    display: block;
    margin-bottom: 10px;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.login-subtitle {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 0;
}

.login-btn {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 10px;
    font-size: 16px;
}

.login-btn:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    color: #adb5bd;
}

/* ============ 整体布局 ============ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ============ 左侧导航栏 ============ */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-color);
    color: #fff;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* 侧边栏滚动条样式（WebKit 内核） */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.5);
}



.sidebar-brand {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    background-color: var(--primary-dark);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand i {
    font-size: 24px;
}

.sidebar-nav {
    padding: 20px 0;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}


.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 25px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-item.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-left-color: #ffc107;
    font-weight: 600;
}

/* ============ 产品库子菜单 ============ */
.nav-group {
    position: relative;
}

.nav-toggle {
    cursor: pointer;
    justify-content: flex-start;
}

.nav-arrow {
    margin-left: auto;
    font-size: 14px !important;
    width: auto !important;
    transition: transform 0.3s;
}

.nav-toggle.active .nav-arrow {
    transform: rotate(180deg);
}

.nav-submenu {
    display: none;
    background-color: var(--primary-dark);
    padding: 5px 0;
}

.nav-submenu.show {
    display: block;
}

.nav-subitem {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 25px 11px 55px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-size: 14px;
}

.nav-subitem i {
    font-size: 16px;
    width: 18px;
    text-align: center;
}

.nav-subitem:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-subitem.active {
    background-color: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-left-color: #ffc107;
    font-weight: 600;
}

/* ============ 主内容区 ============ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}


/* ============ 顶部栏 ============ */
.topbar {
    height: var(--topbar-height);
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.topbar-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    text-align: right;
    line-height: 1.3;
}

.user-name {
    display: block;
    font-weight: 600;
    color: var(--primary-color);
}

.user-role {
    display: block;
    font-size: 12px;
    color: #6c757d;
}

/* ============ 内容区域 ============ */
.content-area {
    padding: 20px;
    flex: 1;
}

/* ============ 卡片 ============ */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    color: var(--primary-color);
}

/* ============ 表格 ============ */
.table thead th {
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 500;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}

/* 表格行 hover 效果 */
.table-hover tbody tr:hover {
    background-color: rgba(30, 58, 95, 0.05);
}

/* 价格右对齐 */
.price-cell {
    font-family: "Consolas", "Courier New", monospace;
    font-weight: 600;
    color: #c0392b;
    white-space: nowrap;
}

/* ============ 详情页 ============ */

.detail-item {
    display: flex;
    flex-direction: column;
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    height: 100%;
}

.detail-label {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

/* ============ 按钮 ============ */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ============ 分页 ============ */
.pagination .page-link {
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ============ 表单 ============ */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.2rem rgba(30, 58, 95, 0.15);
}

/* ============ 响应式 ============ */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }

    .sidebar-brand span,
    .nav-item span,
    .nav-subitem span {
        display: none;
    }

    .nav-item {
        justify-content: center;
        padding: 14px 0;
    }

    /* 折叠后子菜单项居中显示图标 */
    .nav-subitem {
        justify-content: center;
        padding: 11px 0;
    }

    .nav-arrow {
        display: none;
    }

    .main-content {
        margin-left: 60px;
    }

    /* 顶部栏与内容区在窄屏下更紧凑 */
    .topbar {
        padding: 0 12px;
    }

    .topbar-title {
        font-size: 15px;
    }

    .user-info {
        display: none;
    }

    .content-area {
        padding: 12px;
    }

    /* 表格在窄屏下允许横向滚动 */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
}


/* ============ 报价单：步骤条 ============ */
.step-item {
    position: relative;
    padding: 10px 0;
}

.step-circle {
    width: 36px;
    height: 36px;
    line-height: 36px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    font-weight: bold;
    margin: 0 auto 6px;
    transition: all 0.3s;
}

.step-label {
    font-size: 13px;
    color: #6c757d;
}

.step-item.active .step-circle {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(30, 58, 95, 0.15);
}

.step-item.active .step-label {
    color: var(--primary-color);
    font-weight: bold;
}

.step-item.done .step-circle {
    background: #28a745;
    color: #fff;
}

.step-item.done .step-label {
    color: #28a745;
}

/* 步骤之间的连接线 */
.step-item::after {
    content: '';
    position: absolute;
    top: 28px;
    right: -50%;
    width: 100%;
    height: 2px;
    background: #e9ecef;
    z-index: 0;
}

.step-item:last-child::after {
    display: none;
}

.step-item.done::after {
    background: #28a745;
}

.step-circle {
    position: relative;
    z-index: 1;
}

/* ============ 报价单：价格单元格 ============ */
.price-cell {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* 利润正负颜色 */
.text-profit {
    color: #28a745;
    font-weight: bold;
}

.text-loss {
    color: #dc3545;
    font-weight: bold;
}

/* 报价单明细表格 */
#itemsTable input[type="number"] {
    text-align: right;
}

/* 报价单状态徽章 */
.badge {
    font-weight: 500;
}

/* ============ 订单管理 ============ */
/* 订单状态徽章颜色 */
.bg-purple-subtle {
    background-color: #e6e0f8;
}
.text-purple-emphasis {
    color: #6f42c1;
}

/* 订单步骤表单 */
.step-panel .card-header {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* 步骤导航 */
#stepNav .nav-link {
    color: #6c757d;
    border-radius: 8px;
}
#stepNav .nav-link.active {
    background-color: var(--primary-color);
    color: #fff;
}

/* 出团通知内容 */
.notice-content {
    font-size: 0.9rem;
    line-height: 1.7;
    word-break: break-word;
}
.notice-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
}
.notice-content table th,
.notice-content table td {
    border: 1px solid #dee2e6;
    padding: 6px 10px;
}
.notice-content table th {
    background-color: #f8f9fa;
}

/* 订单明细表格 */
#itemsTable .form-control-sm,
#itemsTable .form-select-sm {
    min-width: 60px;
}

/* ============ 研学业务模块 ============ */
/* 研学方案行程明细表格 */
#tourForm #itemsTable .form-control-sm,
#tourForm #itemsTable .form-select-sm {
    min-width: 70px;
}

/* 研学方案详情 - 行程按天分组 */
.study-day-block {
    border-left: 3px solid var(--primary-color);
    padding-left: 12px;
    margin-bottom: 16px;
}

/* 研学状态徽章 */
.badge.fs-6 {
    font-size: 0.9rem;
    padding: 0.45em 0.8em;
}

/* 研学表单区块标题 */
.study-section-title {
    font-weight: 600;
    color: var(--primary-color);
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 6px;
    margin-bottom: 14px;
}

/* 研学详情信息卡片 */
.study-info-table th {
    width: 110px;
    background-color: #f8f9fa;
    font-weight: 600;
}

/* 研学方案表单 - 行程明细表头 */
#tourForm #itemsTable thead th {
    background-color: #f8f9fa;
    font-size: 0.85rem;
    white-space: nowrap;
}


