/* =============================================================
   Admin 公共样式
   ============================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif; }
body { background: #0f0f1a; color: #fff; }

/* =============================================================
   登录页
   ============================================================= */
body.login-body { background: #1a1a2e; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { background: #16213e; border-radius: 16px; padding: 40px 32px; width: 100%; max-width: 380px; border: 1px solid rgba(255,255,255,0.06); box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.login-box .logo { font-size: 24px; font-weight: 700; color: #fff; text-align: center; margin-bottom: 6px; }
.login-box .sub { text-align: center; color: rgba(255,255,255,0.4); font-size: 14px; margin-bottom: 28px; }
.login-box .field { margin-bottom: 16px; }
.login-box .field label { display: block; font-size: 13px; color: rgba(255,255,255,0.5); margin-bottom: 4px; }
.login-box .field input { width: 100%; padding: 12px 14px; border: 1.5px solid rgba(255,255,255,0.08); border-radius: 10px; font-size: 15px; outline: none; transition: border 0.2s; background: rgba(255,255,255,0.05); color: #fff; }
.login-box .field input:focus { border-color: #1a73e8; }
.login-box .btn-login { width: 100%; padding: 14px; border: none; border-radius: 10px; font-size: 16px; font-weight: 600; color: #fff; background: #1a73e8; cursor: pointer; transition: background 0.2s; }
.login-box .btn-login:active { background: #1557b0; }
.login-box .btn-login:disabled { opacity: 0.6; cursor: not-allowed; }
.login-box .error { color: #ea4335; font-size: 14px; text-align: center; margin-top: 12px; min-height: 20px; }

/* =============================================================
   布局
   ============================================================= */
.app { display: flex; min-height: 100vh; }

/* =============================================================
   Sidebar
   ============================================================= */
.sidebar { width: 220px; background: #16213e; padding: 20px 0; flex-shrink: 0; border-right: 1px solid rgba(255,255,255,0.06); display: flex; flex-direction: column; height: 100vh; position: sticky; top: 0; }
.sidebar .brand { padding: 0 20px 24px; font-size: 18px; font-weight: 700; color: #fff; }
.sidebar .brand span { color: #1a73e8; }
.sidebar .nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: rgba(255,255,255,0.5); cursor: pointer; transition: all 0.2s; border-left: 3px solid transparent; text-decoration: none; font-size: 14px; }
.sidebar .nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar .nav-item.active { color: #fff; border-left-color: #1a73e8; background: rgba(26,115,232,0.1); }
.sidebar .nav-item .icon { font-size: 18px; }
.sidebar .nav-bottom { margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.06); }
.sidebar .nav-item.logout { color: #ea4335; }
.sidebar .nav-item.logout:hover { background: rgba(234,67,53,0.1); }

/* =============================================================
   Main
   ============================================================= */
.main { flex: 1; padding: 24px 32px; overflow-y: auto; max-height: 100vh; }
.main .header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.main .header h1 { font-size: 24px; font-weight: 600; }
.main .header .admin-info { color: rgba(255,255,255,0.5); font-size: 14px; }

/* =============================================================
   Stats
   ============================================================= */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stats .stat { background: #16213e; border-radius: 12px; padding: 16px 20px; border: 1px solid rgba(255,255,255,0.06); }
.stats .stat .num { font-size: 28px; font-weight: 700; }
.stats .stat .label { font-size: 13px; color: rgba(255,255,255,0.4); margin-top: 4px; }
.stats .stat .num.green { color: #34a853; }
.stats .stat .num.orange { color: #fbbc04; }
.stats .stat .num.blue { color: #1a73e8; }
.stats .stat .num.red { color: #ea4335; }

/* =============================================================
   Panel
   ============================================================= */
.panel { background: #16213e; border-radius: 12px; border: 1px solid rgba(255,255,255,0.06); overflow: hidden; }
.panel .panel-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.panel .panel-header h3 { font-size: 16px; font-weight: 600; }
.panel .panel-header .actions { display: flex; gap: 10px; align-items: center; }
.panel .panel-header select { padding: 6px 12px; border-radius: 6px; background: rgba(255,255,255,0.06); color: #fff; border: 1px solid rgba(255,255,255,0.08); font-size: 13px; outline: none; }
.panel .panel-header select option { background: #16213e; }
.panel table { width: 100%; border-collapse: collapse; font-size: 14px; }
.panel table th { text-align: left; padding: 12px 16px; color: rgba(255,255,255,0.4); font-weight: 500; font-size: 12px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.panel table td { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.panel table tr:hover td { background: rgba(255,255,255,0.02); }
.panel table .badge { padding: 2px 10px; border-radius: 12px; font-size: 12px; }
.panel table .badge.pending { background: rgba(251,188,4,0.2); color: #fbbc04; }
.panel table .badge.approved { background: rgba(52,168,83,0.2); color: #34a853; }
.panel table .badge.rejected { background: rgba(234,67,53,0.2); color: #ea4335; }
.panel table .badge.online { background: rgba(52,168,83,0.2); color: #34a853; }
.panel table .badge.offline { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.3); }
.panel table .badge.info { background: rgba(26,115,232,0.2); color: #4a8ff5; }
.panel table .btn-sm { padding: 4px 12px; border: none; border-radius: 4px; font-size: 12px; cursor: pointer; margin-right: 4px; }
.panel table .btn-sm.approve { background: #34a853; color: #fff; }
.panel table .btn-sm.reject { background: #ea4335; color: #fff; }
.panel table .btn-sm.delete { background: transparent; color: #ea4335; border: 1px solid rgba(234,67,53,0.3); }
.panel table .btn-sm.delete:hover { background: rgba(234,67,53,0.1); }
.panel table .btn-sm.primary { background: #1a73e8; color: #fff; }
.panel table .btn-sm.detail { background: transparent; color: #4a8ff5; border: 1px solid rgba(74,143,245,0.3); }
.panel table .btn-sm:disabled { opacity: 0.4; cursor: not-allowed; }

.empty { padding: 40px; text-align: center; color: rgba(255,255,255,0.3); font-size: 14px; }
.sub-panel { margin-bottom: 20px; }

/* =============================================================
   Modal
   ============================================================= */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 999; padding: 20px; }
.modal-mask.hidden { display: none; }
.modal { background: #16213e; border-radius: 12px; border: 1px solid rgba(255,255,255,0.08); max-width: 640px; width: 100%; max-height: 80vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.modal-header h3 { font-size: 16px; }
.modal-header .close { background: transparent; border: none; color: rgba(255,255,255,0.5); font-size: 20px; cursor: pointer; }
.modal-body { padding: 20px; }
.modal-body .row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.modal-body .row .label { color: rgba(255,255,255,0.5); }
.modal-body .row .value { color: #fff; text-align: right; max-width: 60%; word-break: break-all; }
.modal-body .section { margin-top: 16px; margin-bottom: 8px; font-weight: 600; color: #4a8ff5; font-size: 13px; }
.modal-body input, .modal-body textarea { width: 100%; padding: 10px 12px; background: rgba(255,255,255,0.05); border: 1.5px solid rgba(255,255,255,0.08); border-radius: 8px; color: #fff; font-size: 14px; outline: none; margin-top: 4px; }
.modal-body input:focus, .modal-body textarea:focus { border-color: #1a73e8; }
.modal-body label { font-size: 12px; color: rgba(255,255,255,0.5); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.06); }

/* =============================================================
   Responsive
   ============================================================= */
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar .brand { font-size: 14px; padding: 0 12px 20px; }
    .sidebar .brand span { display: none; }
    .sidebar .nav-item span { display: none; }
    .sidebar .nav-item { padding: 12px 16px; justify-content: center; }
    .main { padding: 16px; }
    .stats { grid-template-columns: 1fr 1fr; }
}