:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 24px;
  background: #111827;
  color: #fff;
}
.topbar h1 { margin: 0; font-size: 22px; }
.topbar h1 a:hover { color: #bfdbfe; }
.subtitle { color: #cbd5e1; font-size: 13px; margin-top: 4px; }
.account { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.wrap { max-width: 1220px; margin: 22px auto; padding: 0 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}
.btn:hover { background: #f9fafb; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn.small { min-height: 30px; padding: 5px 9px; font-size: 13px; }

.navline { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.crumbs { margin: 8px 0 16px; color: var(--muted); font-size: 14px; }
.crumbs a { color: var(--primary); }
.crumbs .sep { margin: 0 8px; color: #9ca3af; }

.searchbox { padding: 14px; margin-bottom: 14px; }
.searchbox form { display: flex; gap: 8px; flex-wrap: nowrap; }
.searchbox input[type=text] { flex: 1; min-width: 280px; }
.hint { margin-top: 9px; color: var(--muted); font-size: 14px; }

.admin { padding: 14px; margin-bottom: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.admin form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

input[type=text], input[type=file] {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  min-height: 34px;
}

.listcard { overflow: hidden; }
.filetable {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.filetable th, .filetable td {
  border-bottom: 1px solid var(--line);
  padding: 11px 14px;
  vertical-align: middle;
}
.filetable th {
  background: #f9fafb;
  font-size: 14px;
  text-align: left;
}
.filetable tr:last-child td { border-bottom: 0; }
.filetable tbody tr:hover { background: #fcfcfd; }
.selectcol { width: 42px; text-align: center !important; }
.namecol { text-align: left; }
.datecol { width: 140px; text-align: right !important; white-space: nowrap; }
.sizecol { width: 130px; text-align: right !important; white-space: nowrap; }
.actioncol { width: 150px; text-align: right !important; white-space: nowrap; }
.namecell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.icon { font-size: 19px; width: 24px; text-align: center; flex: 0 0 24px; }
.filename { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #111827; font-weight: 600; }
.filename:hover { color: var(--primary); }
.muted { color: var(--muted); font-size: 14px; }
.badge { font-size: 11px; background: #fee2e2; color: #991b1b; padding: 2px 6px; border-radius: 999px; flex: 0 0 auto; }
.empty { padding: 24px !important; color: var(--muted); text-align: center !important; }
.message { margin: 12px 0; padding: 10px 12px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; }

@media (max-width: 900px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .searchbox form { flex-wrap: wrap; }
  .filetable, .filetable thead, .filetable tbody, .filetable tr, .filetable th, .filetable td { display: block; width: 100%; }
  .filetable thead { display: none; }
  .filetable tr { border-bottom: 1px solid var(--line); padding: 10px 12px; }
  .filetable td { border-bottom: 0; padding: 5px 0; }
  .selectcol, .datecol, .sizecol, .actioncol { text-align: left !important; width: 100%; }
}
