.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: rgba(255,255,255,0.6);
  border: 1px solid #dcd3b2;
  padding: 1.25rem;
  border-radius: 2px;
  transition: all 0.2s;
}

.stat-card:hover {
  background: rgba(255,255,255,0.9);
  border-color: #bfa57d;
}

.stat-label {
  font-family: var(--font-hand);
  font-size: 0.8rem;
  color: #999;
  margin-bottom: 6px;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: bold;
  color: #2c2c2c;
  line-height: 1;
}

.stat-sub {
  font-size: 0.75rem;
  color: #bfa57d;
  margin-top: 6px;
  font-family: var(--font-hand);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.85rem;
  color: #2c2c2c;
  margin-bottom: 5px;
}

.form-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #dcd3b2;
  border-radius: 3px;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  background: #fff;
  color: #2c2c2c;
  transition: border-color 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: #8b3a3a;
  box-shadow: 0 0 0 2px rgba(139, 58, 58, 0.06);
}

textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%235d5d5d'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  border-radius: 3px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: #8b3a3a;
  color: #fff;
}
.btn-primary:hover { background: #a54444; }

.btn-outline {
  background: transparent;
  border: 1px solid #dcd3b2;
  color: #5d5d5d;
}
.btn-outline:hover { border-color: #8b3a3a; color: #8b3a3a; }

.btn-danger {
  background: transparent;
  border: 1px solid #e0c0c0;
  color: #a93226;
}
.btn-danger:hover { background: #a93226; color: #fff; border-color: #a93226; }

.btn-sm { padding: 4px 10px; font-size: 0.78rem; }

.btn-icon {
  padding: 6px 10px;
  min-width: 32px;
  justify-content: center;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #dcd3b2;
  font-size: 0.9rem;
}

.admin-table th {
  background: #f7f1e3;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.8rem;
  color: #5d5d5d;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #dcd3b2;
}

.admin-table td {
  padding: 10px 14px;
  font-family: var(--font-hand);
  font-size: 0.85rem;
  color: #444;
  border-bottom: 1px solid #f0ebe0;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(139, 58, 58, 0.015); }

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-family: var(--font-hand);
  white-space: nowrap;
}

.tag-red { background: rgba(139, 58, 58, 0.08); color: #8b3a3a; }
.tag-green { background: rgba(74, 107, 101, 0.08); color: #4a6b65; }
.tag-gray { background: rgba(0,0,0,0.04); color: #888; }
.tag-yellow { background: rgba(212, 172, 13, 0.08); color: #b7950b; }
.tag-blue { background: rgba(80, 120, 160, 0.08); color: #5078a0; }

.perm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-family: var(--font-hand);
  white-space: nowrap;
}

.perm-public { background: rgba(74, 107, 101, 0.08); color: #4a6b65; }
.perm-encrypted { background: rgba(212, 172, 13, 0.08); color: #b7950b; }
.perm-private { background: rgba(0,0,0,0.04); color: #888; }

.perm-badge i { font-size: 0.65rem; }

.editor-toolbar {
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  background: #f7f1e3;
  border: 1px solid #dcd3b2;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  flex-wrap: wrap;
}

.editor-toolbar button {
  background: #fff;
  border: 1px solid #dcd3b2;
  padding: 5px 9px;
  border-radius: 3px;
  cursor: pointer;
  font-family: var(--font-serif);
  font-size: 0.78rem;
  color: #5d5d5d;
  transition: all 0.15s;
}
.editor-toolbar button:hover { border-color: #8b3a3a; color: #8b3a3a; }

.editor-body { border: 1px solid #dcd3b2; border-top: none; border-radius: 0 0 3px 3px; }

.editor-body textarea {
  width: 100%;
  border: none;
  padding: 1rem;
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.8;
  resize: vertical;
  min-height: 400px;
  outline: none;
  background: #fff;
  color: #2c2c2c;
}

.upload-zone {
  border: 2px dashed #dcd3b2;
  border-radius: 3px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(255,255,255,0.4);
}
.upload-zone:hover { border-color: #8b3a3a; background: rgba(139, 58, 58, 0.02); }

.upload-zone .upload-icon { font-size: 2.2rem; color: #bfa57d; margin-bottom: 6px; }
.upload-zone .upload-text { font-family: var(--font-hand); color: #999; font-size: 0.85rem; }

.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0.75rem;
}

.upload-preview-item {
  width: 72px;
  height: 72px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid #dcd3b2;
  position: relative;
}

.upload-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview-item .remove-preview {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.admin-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: #2c2c2c;
  color: #e0d8c8;
  padding: 10px 22px;
  border-radius: 4px;
  font-family: var(--font-hand);
  font-size: 0.85rem;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.admin-toast.show { opacity: 1; }

.folder-tree {
  font-family: var(--font-hand);
  font-size: 0.9rem;
  line-height: 2;
}

.folder-tree .tree-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}

.folder-tree .tree-item:hover { background: rgba(139, 58, 58, 0.05); color: #8b3a3a; }
.folder-tree .tree-item.selected { background: rgba(139, 58, 58, 0.08); color: #8b3a3a; font-weight: 600; }
.folder-tree .tree-item i { color: #bfa57d; }

.folder-tree .tree-indent { padding-left: 1.2rem; }
.folder-tree .tree-indent-2 { padding-left: 2.4rem; }

.file-preview-area {
  background: rgba(0,0,0,0.02);
  border: 1px dashed #dcd3b2;
  border-radius: 3px;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.file-preview-area img { max-width: 100%; max-height: 400px; object-fit: contain; }
.file-preview-area video { max-width: 100%; max-height: 400px; }

.empty-hint {
  text-align: center;
  color: #c0b8a8;
  padding: 2rem;
}

.empty-hint i { font-size: 2rem; display: block; margin-bottom: 8px; opacity: 0.5; }
.empty-hint p { font-family: var(--font-hand); font-size: 0.9rem; }

.admin-section-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: bold;
  color: #2c2c2c;
  border-left: 3px solid #8b3a3a;
  padding-left: 10px;
  margin: 1.5rem 0 1rem 0;
}

.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #dcd3b2;
  margin-bottom: 1.5rem;
}

.admin-tab-btn {
  padding: 10px 20px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.9rem;
  color: #999;
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  position: relative;
  bottom: -1px;
}

.admin-tab-btn:hover { color: #5d5d5d; }

.admin-tab-btn.active {
  color: #8b3a3a;
  border-bottom-color: #8b3a3a;
}

.admin-tab-panel { display: none; }
.admin-tab-panel.active { display: block; }

.admin-tab-btn .tab-count {
  font-family: var(--font-hand);
  font-size: 0.7rem;
  color: #ccc;
  margin-left: 4px;
  font-weight: normal;
}

.admin-tab-btn.active .tab-count { color: #8b3a3a; }

.file-browser {
  background: rgba(255,255,255,0.5);
  border: 1px solid #dcd3b2;
  border-radius: 3px;
  max-height: 320px;
  overflow-y: auto;
  font-family: var(--font-hand);
  font-size: 0.85rem;
}

.file-browser .fb-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  cursor: pointer;
  transition: all 0.15s;
  border-bottom: 1px solid #f0ebe0;
}

.file-browser .fb-item:last-child { border-bottom: none; }

.file-browser .fb-item:hover { background: rgba(139, 58, 58, 0.04); }

.file-browser .fb-item.selected {
  background: rgba(139, 58, 58, 0.08);
  color: #8b3a3a;
  font-weight: 600;
}

.file-browser .fb-item .fb-icon { color: #bfa57d; font-size: 1.1rem; flex-shrink: 0; }

.file-browser .fb-indent { padding-left: 2rem; }

.file-browser .fb-breadcrumb {
  padding: 8px 12px;
  border-bottom: 1px solid #dcd3b2;
  font-size: 0.78rem;
  color: #999;
  background: #fdfbf6;
}

.file-browser .fb-breadcrumb span {
  color: #8b3a3a;
  cursor: pointer;
  transition: color 0.15s;
}

.file-browser .fb-breadcrumb span:hover { text-decoration: underline; }

.batch-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(139, 58, 58, 0.05);
  border: 1px dashed #dcd3b2;
  border-radius: 3px;
  margin-bottom: 0.75rem;
  font-family: var(--font-hand);
  font-size: 0.8rem;
  color: #999;
}

.batch-bar .batch-count { color: #8b3a3a; font-weight: bold; }

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.status-dot.online { background: #4a6b65; box-shadow: 0 0 6px rgba(74,107,101,0.4); }
.status-dot.offline { background: #a93226; box-shadow: 0 0 6px rgba(169,50,38,0.3); }
.status-dot.checking { background: #d4ac0d; animation: pulse 1s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.connectivity-panel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.connectivity-card {
  background: rgba(255,255,255,0.5);
  border: 1px solid #dcd3b2;
  border-radius: 3px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.connectivity-card .conn-icon {
  font-size: 1.5rem;
  color: #bfa57d;
  flex-shrink: 0;
}

.connectivity-card .conn-info { flex: 1; min-width: 0; }
.connectivity-card .conn-name { font-family: var(--font-serif); font-weight: 600; font-size: 0.85rem; color: #2c2c2c; }
.connectivity-card .conn-detail { font-family: var(--font-hand); font-size: 0.72rem; color: #999; margin-top: 2px; }

.inline-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.inline-form .form-group { margin-bottom: 0; flex: 1; min-width: 150px; }

.path-preview {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(74, 107, 101, 0.08);
  color: #4a6b65;
  border-radius: 12px;
  font-family: var(--font-hand);
  font-size: 0.8rem;
  margin-top: 6px;
}

@media (max-width: 768px) {
  .admin-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-table { font-size: 0.78rem; }
  .admin-table th, .admin-table td { padding: 8px 10px; }
  .editor-toolbar { gap: 2px; }
  .editor-toolbar button { padding: 4px 7px; font-size: 0.7rem; }
  .admin-tab-btn { padding: 8px 12px; font-size: 0.8rem; }
  .connectivity-panel { grid-template-columns: 1fr 1fr; }
  .inline-form { flex-direction: column; }
  .inline-form .form-group { min-width: auto; width: 100%; }
}
