/* ====== 古琴租赁云 - 管理后台样式 ====== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif; background: #f5f2ed; color: #1c1917; min-height: 100vh; }
.hidden { display: none !important; }

#login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #451a03 0%, #292524 50%, #1c1917 100%); }
.login-box { background: #fff; padding: 48px 40px; border-radius: 20px; width: 400px; box-shadow: 0 25px 80px rgba(0,0,0,0.4); text-align: center; }
.login-box .logo { font-size: 48px; margin-bottom: 12px; }
.login-box h1 { font-size: 24px; color: #451a03; font-weight: 700; letter-spacing: 2px; }
.login-box .subtitle { font-size: 13px; color: #a8a29e; margin: 4px 0 28px; }
.login-box input { width: 100%; height: 46px; border: 2px solid #e6d9be; border-radius: 12px; padding: 0 16px; font-size: 15px; outline: none; margin-bottom: 16px; }
.login-box input:focus { border-color: #b81d22; }
.login-box .login-btn { width: 100%; height: 46px; background: #b81d22; color: #fff; border: none; border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer; }
.login-box .login-btn:hover { background: #971418; }
.login-error { color: #b81d22; font-size: 13px; margin-bottom: 12px; display: none; }
.login-error.show { display: block; }
.login-box .footer-hint { font-size: 12px; color: #a8a29e; margin-top: 20px; }
.login-box .footer-hint code { background: #f5f2ed; padding: 2px 8px; border-radius: 4px; font-family: "SF Mono", "Fira Code", monospace; color: #b81d22; font-weight: 600; }

#main-layout { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: #292524; color: #d4d4d4; display: flex; flex-direction: column; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-header { padding: 24px 20px 20px; border-bottom: 1px solid #3e3e3e; text-align: center; }
.sidebar-header .brand-icon { font-size: 32px; margin-bottom: 6px; }
.sidebar-header h2 { font-size: 17px; color: #fef3c7; font-weight: 700; letter-spacing: 1px; }
.sidebar-header p { font-size: 11px; color: #78746e; margin-top: 4px; }
.sidebar-nav { padding: 12px 10px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px; cursor: pointer; font-size: 13px; margin-bottom: 2px; }
.nav-item:hover { background: #3e3e3e; }
.nav-item.active { background: #b81d22; color: #fff; font-weight: 600; }
.nav-item .icon { font-size: 16px; width: 24px; text-align: center; }
.nav-item .badge { margin-left: auto; background: #b81d22; color: #fff; font-size: 10px; padding: 1px 8px; border-radius: 10px; font-weight: 600; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid #3e3e3e; font-size: 10px; color: #78746e; text-align: center; }

.content { flex: 1; padding: 28px 32px; overflow-y: auto; min-height: 100vh; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 22px; font-weight: 700; color: #1c1917; }
.page-header .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; white-space: nowrap; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-primary { background: #b81d22; color: #fff; } .btn-primary:hover { background: #971418; }
.btn-secondary { background: #e6d9be; color: #451a03; } .btn-secondary:hover { background: #d4c4a3; }
.btn-outline { background: transparent; border: 1.5px solid #d4c4a3; color: #57534e; } .btn-outline:hover { background: #f5f2ed; }
.btn-success { background: #15803d; color: #fff; } .btn-success:hover { background: #166534; }
.btn-danger { background: #b81d22; color: #fff; } .btn-danger:hover { background: #971418; }
.btn-ghost { background: transparent; color: #57534e; border: none; } .btn-ghost:hover { background: #f5f2ed; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: #fff; border: 1px solid #e6d9be; border-radius: 14px; padding: 22px 24px; }
.stat-card .stat-label { font-size: 12px; color: #a8a29e; font-weight: 500; }
.stat-card .stat-value { font-size: 30px; font-weight: 700; color: #1c1917; margin-top: 4px; }
.stat-card .stat-sub { font-size: 11px; color: #a8a29e; margin-top: 4px; }

.card { background: #fff; border: 1px solid #e6d9be; border-radius: 14px; overflow: hidden; margin-bottom: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid #e6d9be; display: flex; justify-content: space-between; align-items: center; }
.card-header h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 12px 16px; background: #faf8f5; color: #78746e; font-size: 12px; font-weight: 600; border-bottom: 1px solid #e6d9be; white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid #f5f3f0; vertical-align: middle; }
tr:hover td { background: #faf8f5; }
.text-mono { font-family: "SF Mono", "Fira Code", monospace; font-size: 12px; }

.status-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.status-renting { background: #dcfce7; color: #15803d; }
.status-completed { background: #f5f5f4; color: #78746e; }
.status-cancelled { background: #fef2f2; color: #b91c1c; }

.guqin-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: #f5f2ed; border: 1px solid #e6d9be; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 560px; max-height: 85vh; overflow-y: auto; box-shadow: 0 25px 80px rgba(0,0,0,0.3); }
.modal-header { padding: 20px 24px 16px; border-bottom: 1px solid #e6d9be; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: #fff; }
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-close { width: 32px; height: 32px; border-radius: 8px; border: none; background: #f5f2ed; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; color: #78746e; }
.modal-body { padding: 24px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #57534e; margin-bottom: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group .hint { font-size: 11px; color: #a8a29e; margin-top: 4px; }
.featured-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.featured-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #faf8f5; border: 1px solid #e6d9be; border-radius: 8px; cursor: pointer; font-size: 13px; }
.featured-item:hover { border-color: #b81d22; }
.featured-item.active { border-color: #b81d22; background: #fef2f2; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 14px; border: 1.5px solid #e6d9be; border-radius: 10px; font-size: 14px; outline: none; font-family: inherit; background: #fff; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #b81d22; }
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group .img-preview { width: 120px; height: 120px; border-radius: 10px; object-fit: cover; border: 1px solid #e6d9be; margin-top: 8px; background: #f5f2ed; }

.search-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search-bar input { padding: 9px 14px; border: 1.5px solid #e6d9be; border-radius: 10px; font-size: 13px; outline: none; min-width: 220px; flex: 1; }
.search-bar input:focus { border-color: #b81d22; }

.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; border-radius: 12px; font-size: 13px; font-weight: 500; box-shadow: 0 8px 32px rgba(0,0,0,0.15); max-width: 360px; }
.toast-success { background: #15803d; color: #fff; }
.toast-error { background: #b91c1c; color: #fff; }
.toast-info { background: #1e40af; color: #fff; }

.banner-list { display: flex; flex-direction: column; gap: 10px; }
.banner-item { display: flex; gap: 8px; align-items: center; padding: 12px; background: #faf8f5; border: 1px solid #e6d9be; border-radius: 10px; flex-wrap: wrap; }
.banner-item input { padding: 7px 10px; border: 1px solid #d4c4a3; border-radius: 6px; font-size: 12px; flex: 1; min-width: 120px; }
.banner-item input:focus { border-color: #b81d22; outline: none; }

.tab-bar { display: flex; gap: 4px; margin-bottom: 16px; background: #f5f2ed; padding: 4px; border-radius: 10px; }
.tab-btn { padding: 8px 18px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; border: none; background: transparent; color: #57534e; }
.tab-btn.active { background: #fff; color: #1c1917; font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,0.1); }

.empty-state { text-align: center; padding: 48px 20px; color: #a8a29e; }

@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-header h2, .sidebar-header p, .sidebar-footer { display: none; }
  .nav-item span { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .content { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
}
