/* 管理后台布局 - Modern Clinical Admin */

/* 整体布局 */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 220px;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    background:
        linear-gradient(180deg, #101827 0%, #172033 54%, #111827 100%);
    color: #fff;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 12px 0 30px rgba(16, 24, 40, 0.12);
    z-index: 200;
}

.sidebar .logo {
    height: 72px;
    line-height: 72px;
    padding: 0 22px;
    font-size: 17px;
    font-weight: 750;
    letter-spacing: 0.2px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

.sidebar .logo::before {
    content: "";
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 10px;
    border-radius: 50%;
    background: #46d5a8;
    box-shadow: 0 0 0 6px rgba(70, 213, 168, 0.12);
    vertical-align: middle;
}

.sidebar .menu {
    padding: 16px 12px;
}

.sidebar .menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 14px;
    margin-bottom: 6px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.68);
    font-weight: 500;
    transition: all 0.18s ease;
}

.sidebar .menu-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar .menu-item.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(36, 107, 253, 0.95), rgba(60, 130, 255, 0.88));
    box-shadow: 0 12px 24px rgba(36, 107, 253, 0.22);
}

.sidebar .menu-item span:first-child {
    width: 22px;
    text-align: center;
    font-size: 16px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 220px;
    min-height: 100vh;
}

/* 顶部栏 */
.header {
    height: 68px;
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid rgba(229, 233, 240, 0.9);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(14px);
}

.header .breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #667085;
    font-size: 14px;
}

.header .breadcrumb span:last-child {
    color: #172033;
    font-weight: 650;
}

.header .breadcrumb a {
    font-weight: 600;
}

.header .user-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header .user-info .username {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #f2f5f9;
    color: #344054;
    font-weight: 600;
}

.header .user-info .username::before {
    content: "";
    width: 7px;
    height: 7px;
    margin-right: 8px;
    border-radius: 50%;
    background: #19a974;
}

.header .user-info .logout-btn {
    color: #e5484d;
    cursor: pointer;
    font-weight: 600;
    padding: 7px 10px;
    border-radius: 10px;
    transition: all 0.16s ease;
}

.header .user-info .logout-btn:hover {
    background: #fff1f1;
}

/* 内容区域 */
.content {
    padding: 28px;
}

/* 统计卡片网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 22px;
}

/* 图表容器 */
.chart-container {
    height: 350px;
    margin-top: 20px;
}

/* 登录页 */
.login-wrapper,
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 20%, rgba(36, 107, 253, 0.14), transparent 30%),
        radial-gradient(circle at 80% 10%, rgba(25, 169, 116, 0.12), transparent 28%),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.login-card {
    position: relative;
    width: 420px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 24px;
    padding: 44px;
    box-shadow:
        0 24px 70px rgba(16, 24, 40, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(18px);
}

.login-card::before {
    content: "";
    position: absolute;
    left: 44px;
    top: 28px;
    width: 38px;
    height: 5px;
    border-radius: 999px;
    background: linear-gradient(90deg, #246bfd, #46d5a8);
}

.login-card h1 {
    margin-top: 18px;
    margin-bottom: 10px;
    color: #172033;
    font-size: 25px;
    font-weight: 780;
    letter-spacing: -0.6px;
    text-align: left;
}

.login-card .subtitle {
    text-align: left;
    color: #667085;
    margin-bottom: 30px;
}

.login-form .form-group {
    margin-bottom: 18px;
}

.login-form .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #475467;
    font-weight: 600;
}

.login-form .form-group input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #d8dee9;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: #172033;
    transition: all 0.16s ease;
}

.login-form .form-group input:focus {
    border-color: rgba(36, 107, 253, 0.7);
    box-shadow: 0 0 0 4px rgba(36, 107, 253, 0.09);
    outline: none;
}

.login-form .submit-btn {
    width: 100%;
    height: 46px;
    margin-top: 8px;
    background: #172033;
    color: #fff;
    border: none;
    border-radius: 13px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 14px 30px rgba(23, 32, 51, 0.20);
}

.login-form .submit-btn:hover {
    transform: translateY(-1px);
    background: #0f172a;
    box-shadow: 0 18px 36px rgba(23, 32, 51, 0.26);
}

.login-form .submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.error-message {
    background: #fff1f1;
    border: 1px solid rgba(229, 72, 77, 0.18);
    color: #c83237;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 18px;
    text-align: left;
    font-weight: 600;
}

/* 详情页 */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}

.detail-header h1 {
    color: #172033;
    font-size: 24px;
    font-weight: 760;
    letter-spacing: -0.5px;
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section h3 {
    color: #172033;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef1f6;
    font-size: 16px;
    font-weight: 700;
    position: relative;
}

.detail-section h3::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 52px;
    height: 2px;
    border-radius: 999px;
    background: #246bfd;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.detail-item {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #eef1f6;
    border-radius: 12px;
}

.detail-item .label {
    width: 100px;
    color: #667085;
    font-weight: 600;
}

.detail-item .value {
    flex: 1;
    color: #172033;
    font-weight: 550;
    word-break: break-all;
}

/* 页面内 select */
.card-header select,
select {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #d8dee9;
    border-radius: 10px;
    background: #fff;
    color: #344054;
}

/* 让简单柱状图更贴底 */
#dailyChart,
#trendChart {
    display: flex;
    align-items: flex-end;
    padding-top: 20px;
}

/* 打印优化 */
@media print {
    .sidebar,
    .header,
    .detail-header button {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .content {
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* 响应式 */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .content > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 72px;
    }

    .sidebar .logo {
        padding: 0;
        text-align: center;
        font-size: 0;
    }

    .sidebar .logo::before {
        margin-right: 0;
    }

    .sidebar .menu {
        padding: 14px 8px;
    }

    .sidebar .menu-item {
        justify-content: center;
        padding: 0;
    }

    .sidebar .menu-item span:last-child {
        display: none;
    }

    .main-content {
        margin-left: 72px;
    }

    .header {
        padding: 0 16px;
    }

    .content {
        padding: 18px;
    }

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

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

    .login-card {
        width: 100%;
        padding: 34px 26px;
    }
}
