* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; background: #f0f2f5; color: #333; min-height: 100vh; }

/* Login */
.login-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-box { background: #fff; padding: 40px; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.15); width: 400px; }
.login-box h2 { text-align: center; margin-bottom: 30px; color: #333; font-size: 24px; }
.login-box .form-group { margin-bottom: 20px; }
.login-box label { display: block; margin-bottom: 6px; font-weight: 500; color: #555; }
.login-box input { width: 100%; padding: 10px 14px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 14px; transition: border-color .3s; }
.login-box input:focus { outline: none; border-color: #667eea; box-shadow: 0 0 0 2px rgba(102,126,234,.2); }
.login-box .btn { width: 100%; padding: 12px; background: #667eea; color: #fff; border: none; border-radius: 6px; font-size: 16px; cursor: pointer; transition: background .3s; }
.login-box .btn:hover { background: #5a6fd6; }
.login-error { color: #ff4d4f; text-align: center; margin-top: 10px; display: none; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #001529; color: #fff; flex-shrink: 0; }
.sidebar .logo { padding: 20px; font-size: 18px; font-weight: bold; text-align: center; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar .nav a { display: block; padding: 14px 24px; color: rgba(255,255,255,.65); text-decoration: none; transition: all .3s; border-left: 3px solid transparent; }
.sidebar .nav a:hover, .sidebar .nav a.active { color: #fff; background: rgba(255,255,255,.08); border-left-color: #1890ff; }
.sidebar .nav a .icon { margin-right: 8px; }
.sidebar .user-info { padding: 16px 24px; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; color: rgba(255,255,255,.45); position: absolute; bottom: 0; width: 220px; }
.sidebar .user-info button { background: none; border: none; color: rgba(255,255,255,.45); cursor: pointer; font-size: 12px; text-decoration: underline; }
.main { flex: 1; display: flex; flex-direction: column; }
.topbar { background: #fff; padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.topbar h3 { font-size: 16px; color: #333; }
.content { flex: 1; padding: 24px; overflow-y: auto; }

/* Card / Panel */
.panel { background: #fff; border-radius: 8px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.panel-header h4 { font-size: 16px; }

/* Buttons */
.btn { display: inline-block; padding: 8px 20px; border: 1px solid #d9d9d9; border-radius: 4px; cursor: pointer; font-size: 14px; text-decoration: none; transition: all .3s; background: #fff; color: #333; }
.btn-primary { background: #1890ff; border-color: #1890ff; color: #fff; }
.btn-primary:hover { background: #40a9ff; border-color: #40a9ff; }
.btn-danger { color: #ff4d4f; border-color: #ff4d4f; }
.btn-danger:hover { color: #fff; background: #ff4d4f; }
.btn-sm { padding: 4px 12px; font-size: 12px; margin-right: 4px; }
.btn-success { background: #52c41a; border-color: #52c41a; color: #fff; }

/* Table */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #f0f0f0; }
th { background: #fafafa; font-weight: 600; color: #555; font-size: 13px; }
tr:hover td { background: #fafafa; }

/* Tags */
.tag { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 12px; }
.tag-blue { background: #e6f7ff; color: #1890ff; }
.tag-green { background: #f6ffed; color: #52c41a; }
.tag-red { background: #fff2f0; color: #ff4d4f; }
.tag-orange { background: #fff7e6; color: #fa8c16; }

/* Modal */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.45); z-index: 1000; justify-content: center; align-items: center; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 8px; padding: 24px; width: 520px; max-height: 80vh; overflow-y: auto; box-shadow: 0 12px 48px rgba(0,0,0,.15); }
.modal h4 { margin-bottom: 20px; font-size: 16px; }
.modal .form-group { margin-bottom: 16px; }
.modal label { display: block; margin-bottom: 4px; font-weight: 500; font-size: 13px; color: #555; }
.modal input, .modal select, .modal textarea { width: 100%; padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; }
.modal input:focus, .modal select:focus { outline: none; border-color: #1890ff; box-shadow: 0 0 0 2px rgba(24,144,255,.2); }
.modal .btn-row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal textarea { resize: vertical; min-height: 60px; }

/* Checkbox group */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 12px; padding: 8px 0; }
.checkbox-group label { display: flex; align-items: center; gap: 4px; font-weight: 400; cursor: pointer; }
.checkbox-group input[type=checkbox] { width: auto; }

/* Empty */
.empty { text-align: center; padding: 40px; color: #999; }

/* Search bar */
.search-bar { display: flex; gap: 10px; align-items: center; }
.search-bar select { padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 13px; }

/* Toast */
.toast { position: fixed; top: 20px; right: 20px; padding: 12px 24px; border-radius: 4px; color: #fff; z-index: 2000; display: none; font-size: 14px; }
.toast.success { background: #52c41a; }
.toast.error { background: #ff4d4f; }

/* Responsive */
@media (max-width: 768px) { .sidebar { width: 60px; } .sidebar .logo { font-size: 14px; padding: 10px; } .sidebar .nav a span { display: none; } .content { padding: 12px; } }
