/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: #333;
    background: #f0f2f5;
}

a {
    text-decoration: none;
    color: #1890ff;
}

a:hover {
    color: #40a9ff;
}

ul, ol {
    list-style: none;
}

/* ===== Login Page ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    width: 400px;
    padding: 40px;
}

.login-box .logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-box .logo h1 {
    font-size: 24px;
    color: #2c3e50;
    font-weight: 600;
}

.login-box .logo p {
    font-size: 13px;
    color: #999;
    margin-top: 5px;
}

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

.login-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #666;
}

.login-form .form-control {
    width: 100%;
    height: 40px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    padding: 0 12px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.login-form .form-control:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.login-form .btn-login {
    width: 100%;
    height: 40px;
    background: #1890ff;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.3s;
}

.login-form .btn-login:hover {
    background: #40a9ff;
}

.login-form .alert {
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 13px;
}

.login-form .alert-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
}

/* ===== Admin Layout ===== */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 220px;
    background: #001529;
    color: rgba(255, 255, 255, 0.85);
    flex-shrink: 0;
    transition: width 0.3s;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar.collapsed {
    width: 64px;
}

.sidebar .logo {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    background: #002140;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar .logo h1 {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-left: 10px;
}

.sidebar .logo .logo-icon {
    font-size: 22px;
    color: #1890ff;
    flex-shrink: 0;
}

.sidebar .logo .logo-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #1890ff;
    padding: 4px;
}

.sidebar .nav-menu {
    padding: 8px 0;
}

.sidebar .nav-item {
    position: relative;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 44px;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar .nav-link:hover {
    background: #1890ff;
    color: #fff;
}

.sidebar .nav-link.active {
    background: #1890ff;
    color: #fff;
}

.sidebar .nav-link .nav-icon {
    width: 20px;
    text-align: center;
    margin-right: 10px;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar .nav-link .nav-text {
    font-size: 14px;
    flex: 1;
}

.sidebar .nav-link .nav-arrow {
    font-size: 10px;
    transition: transform 0.3s;
}

.sidebar .nav-link .nav-arrow.expanded {
    transform: rotate(90deg);
}

.sidebar .nav-submenu {
    display: none;
    background: #000c17;
    overflow: hidden;
}

.sidebar .nav-submenu.expanded {
    display: block;
}

.sidebar .nav-submenu .nav-link {
    height: 40px;
    padding-left: 52px;
    font-size: 13px;
}

.sidebar .nav-group-title {
    padding: 12px 20px 4px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Top Header */
.top-header {
    height: 64px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 10;
}

.top-header .header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-header .toggle-btn {
    font-size: 18px;
    cursor: pointer;
    color: #333;
    background: none;
    border: none;
    padding: 4px 8px;
}

.top-header .breadcrumb {
    font-size: 14px;
    color: #666;
}

.top-header .header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-header .user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
}

.top-header .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1890ff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.top-header .user-name {
    font-size: 14px;
    color: #333;
}

.top-header .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 160px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 4px 0;
    display: none;
    z-index: 100;
}

.top-header .dropdown-menu.show {
    display: block;
}

.top-header .dropdown-menu a {
    display: block;
    padding: 8px 16px;
    color: #333;
    font-size: 13px;
}

.top-header .dropdown-menu a:hover {
    background: #f5f5f5;
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

/* Card */
.card {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

.card-body {
    padding: 24px;
}

/* Search Bar */
.search-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 16px 24px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.search-bar .form-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-bar .form-item label {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

.search-bar .form-item .form-control {
    width: 180px;
}

.search-bar .search-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

/* Form Controls */
.form-control {
    height: 32px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    padding: 0 11px;
    font-size: 13px;
    color: #333;
    transition: border-color 0.3s;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

textarea.form-control {
    height: auto;
    padding: 6px 11px;
    min-height: 80px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
    padding-right: 28px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #666;
}

.form-group label .required {
    color: #ff4d4f;
    margin-left: 2px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 32px;
    padding: 0 15px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    border-color: #1890ff;
    color: #1890ff;
}

.btn-primary {
    background: #1890ff;
    border-color: #1890ff;
    color: #fff;
}

.btn-primary:hover {
    background: #40a9ff;
    border-color: #40a9ff;
    color: #fff;
}

.btn-danger {
    background: #ff4d4f;
    border-color: #ff4d4f;
    color: #fff;
}

.btn-danger:hover {
    background: #ff7875;
    border-color: #ff7875;
    color: #fff;
}

.btn-success {
    background: #52c41a;
    border-color: #52c41a;
    color: #fff;
}

.btn-success:hover {
    background: #73d13d;
    border-color: #73d13d;
    color: #fff;
}

.btn-link {
    border: none;
    background: none;
    color: #1890ff;
    padding: 0;
    height: auto;
}

.btn-link:hover {
    color: #40a9ff;
}

.btn-link.danger {
    color: #ff4d4f;
}

.btn-link.danger:hover {
    color: #ff7875;
}

.btn-sm {
    height: 24px;
    padding: 0 8px;
    font-size: 12px;
}

.btn-lg {
    height: 40px;
    padding: 0 24px;
    font-size: 15px;
}

/* Table */
.table-wrapper {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    background: #fafafa;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e8e8e8;
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.data-table tr:hover td {
    background: #fafafa;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table .table-image {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    background: #f0f0f0;
}

.data-table .actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    line-height: 20px;
}

.status-normal {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

.status-disabled {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
}

.status-pending {
    background: #fffbe6;
    border: 1px solid #ffe58f;
    color: #faad14;
}

.status-approved {
    background: #e6f7ff;
    border: 1px solid #91d5ff;
    color: #1890ff;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    padding: 16px 24px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
}

.pagination .page-info {
    font-size: 13px;
    color: #666;
    margin-right: 16px;
}

.pagination .page-size-selector {
    font-size: 13px;
    color: #666;
    margin-right: 16px;
    display: flex;
    align-items: center;
}

.pagination .page-size-selector label {
    margin: 0;
    font-weight: normal;
}

.pagination .page-size-selector select {
    padding: 3px 6px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    margin: 0 4px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    outline: none;
}

.pagination .page-size-selector select:focus {
    border-color: #1890ff;
}

.pagination .page-btn {
    min-width: 32px;
    height: 32px;
    border: 1px solid #d9d9d9;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    transition: all 0.3s;
    text-decoration: none;
}

.pagination .page-btn:hover {
    border-color: #1890ff;
    color: #1890ff;
}

.pagination .page-btn.active {
    background: #1890ff;
    border-color: #1890ff;
    color: #fff;
}

.pagination .page-btn.active:hover {
    background: #40a9ff;
    border-color: #40a9ff;
    color: #fff;
}

/* Form Page */
.form-page {
    max-width: 800px;
}

.form-page .form-actions {
    margin-top: 24px;
    display: flex;
    gap: 8px;
}

.form-page .form-actions .btn {
    min-width: 80px;
}

/* Alert Messages */
.alert {
    padding: 8px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 13px;
}

.alert-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

.alert-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #999;
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state .empty-text {
    font-size: 14px;
}

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
