/* ========================================
   Admin System - Custom Styles
   ======================================== */

/* ----------------------------------------
   Base Styles
   ---------------------------------------- */
body {
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ----------------------------------------
   Sidebar Styles
   ---------------------------------------- */
.sidebar {
    min-height: 100vh;
    background-color: #ffffff;
    border-right: 1px solid #e9ecef;
    padding: 1.5rem 0;
}

.sidebar .brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
    padding: 0 1.5rem;
    margin-bottom: 2rem;
}

.sidebar .nav-link {
    color: #6c757d;
    padding: 0.75rem 1.5rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar .nav-link:hover {
    color: #0d6efd;
    background-color: #f8f9fa;
}

.sidebar .nav-link.active {
    color: #0d6efd;
    background-color: #e7f1ff;
    border-left-color: #0d6efd;
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
    width: 1.25rem;
}

/* ----------------------------------------
   User Info (Sidebar Footer)
   ---------------------------------------- */
.user-info {
    padding: 1.5rem;
    border-top: 1px solid #e9ecef;
    margin-top: auto;
}

.user-info .user-name {
    font-weight: 500;
    color: #212529;
    margin-bottom: 0.5rem;
}

.user-info .user-role {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

/* ----------------------------------------
   Main Content Area
   ---------------------------------------- */
main {
    padding: 2rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}


/* ----------------------------------------
   Card Styles
   ---------------------------------------- */
.card {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* ----------------------------------------
   Stat Card Styles (Dashboard)
   ---------------------------------------- */
.stat-card {
    border: none;
    border-radius: 0.75rem;
    padding: 1.5rem;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: #212529;
    margin: 0.5rem 0;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card.primary .stat-icon {
    background-color: #e7f1ff;
    color: #0d6efd;
}

/* ----------------------------------------
   Button Styles
   ---------------------------------------- */
.btn {
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

/* ----------------------------------------
   Table Styles
   ---------------------------------------- */
.table {
    background: white;
}

.table thead th {
    border-bottom: 2px solid #e9ecef;
    color: #6c757d;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ----------------------------------------
   Alert Styles
   ---------------------------------------- */
.alert {
    border-radius: 0.5rem;
    border: none;
}

/* ----------------------------------------
   Toast Container
   ---------------------------------------- */
.toast-container {
    z-index: 1080;
}

.toast {
    min-width: 300px;
}

/* ----------------------------------------
   Utility Classes
   ---------------------------------------- */
.text-truncate-custom {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 0;
}

/* 表格单元格内的文本截断 */
td.text-truncate-custom {
    max-width: 1px;
}

/* 非表格元素的文本截断 */
span.text-truncate-custom,
div.text-truncate-custom,
strong.text-truncate-custom {
    display: block;
    max-width: 100%;
}

.avatar-sm {
    width: 32px;
    height: 32px;
}

.icon-box {
    width: 48px;
    height: 48px;
}

.icon-box-lg {
    width: 56px;
    height: 56px;
}
