* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  background: #f2f3f5;
  color: #333;
}
a { color: #1a73c7; text-decoration: none; }
a:hover { text-decoration: underline; }

.navbar {
  background: #1c1c1c;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 14px 28px;
}
.navbar .brand { color: #fff; font-weight: 700; letter-spacing: 1px; white-space: nowrap; }
.navbar .brand:hover { text-decoration: none; opacity: 0.85; }
.navbar-top { display: flex; align-items: center; justify-content: space-between; }
#main-nav { display: flex; gap: 24px; align-items: center; }
.navbar nav a { color: #fff; font-size: 14px; }
.navbar .user { font-size: 13px; color: #ccc; margin-left: 20px; white-space: nowrap; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span { display: block; width: 100%; height: 2px; background: #fff; border-radius: 1px; }

.container { max-width: 960px; margin: 32px auto; padding: 0 20px; }
.container.narrow { max-width: 440px; }

.card {
  background: #fff;
  border-radius: 6px;
  padding: 32px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

h1.page-title { font-size: 20px; margin: 0 0 20px; }

.field { margin-bottom: 20px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #555; }
.field input[type=text],
.field input[type=email],
.field input[type=password],
.field input[type=number],
.field input[type=date],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 16px;
  background: #fafafa;
  color: #333;
}
.field textarea { resize: vertical; min-height: 80px; }
.field .hint { font-size: 12px; color: #888; margin-top: 4px; }
.field label .required-mark { color: #c0392b; font-weight: 600; margin-left: 4px; }
.field label .optional-mark { color: #000; font-weight: 600; margin-left: 4px; }

.radio-group { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 18px; }
.radio-group label { font-size: 14px; display: flex; align-items: center; gap: 6px; }

.row2 { display: flex; gap: 24px; }
.row2 .field { flex: 1; min-width: 0; }

.btn {
  display: inline-block;
  background: #1a73c7;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: #145a9e; text-decoration: none; }
.btn.secondary { background: #fff; color: #1a73c7; border: 1px solid #1a73c7; }
.btn.danger { background: #c0392b; }
.btn.small { padding: 6px 14px; font-size: 13px; }

.flash { padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; font-size: 14px; }
.flash.success { background: #e6f4ea; color: #1e7e34; }
.flash.error { background: #fdecea; color: #c0392b; }

.date-group { margin: 24px 0 8px; font-weight: 600; font-size: 13px; color: #555; }
.expense-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border-radius: 4px;
  margin-bottom: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.expense-row .status {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 3px;
  background: #eee;
  color: #666;
  white-space: nowrap;
}
.expense-row .status.承認済 { background: #e6f4ea; color: #1e7e34; }
.expense-row .status.却下 { background: #fdecea; color: #c0392b; }
.expense-row .status.申請中 { background: #fff4e0; color: #b8720a; }
.expense-row .title { flex: 1; min-width: 160px; }
.expense-row .title .cat { font-weight: 600; }
.expense-row .title .sub { color: #888; font-size: 13px; margin-left: 8px; }
.expense-row .amount { font-weight: 700; color: #1a73c7; }

.upload-box {
  border: 2px dashed #bcd; background: #f5f9fd; border-radius: 6px;
  padding: 32px; text-align: center; color: #666; font-size: 13px; cursor: pointer;
}
.upload-box.dragover { background: #e6f0fa; }

table.data-table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  font-size: 14px;
}
table.data-table th, table.data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #eee; white-space: nowrap; }
table.data-table th { color: #666; font-weight: 600; font-size: 13px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.badge { font-size: 12px; background: #eee; padding: 2px 8px; border-radius: 10px; color: #666; }
.section { margin-bottom: 40px; }

.admin-tabs {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  border-bottom: 1px solid #ddd;
  margin-bottom: 20px;
  padding-bottom: 8px;
}
.admin-tabs a { color: #333; flex-shrink: 0; }
.admin-tabs a.active { font-weight: 600; color: #1a73c7; }

@media (max-width: 720px) {
  .navbar { flex-direction: column; align-items: stretch; padding: 12px 16px; }
  .navbar-top { width: 100%; }

  .nav-toggle { display: flex; }

  #main-nav {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
    margin-top: 14px;
  }
  #main-nav.open { display: flex; }
  #main-nav a { width: 100%; padding: 4px 0; }
  .navbar .user { margin-left: 0; width: 100%; }

  .container { margin: 16px auto; padding: 0 12px; }
  .card { padding: 20px; }
  h1.page-title { font-size: 18px; }

  .row2 { flex-direction: column; gap: 0; }

  table.data-table th, table.data-table td { padding: 8px 10px; font-size: 13px; }
}

@media (max-width: 480px) {
  .btn:not(.small) { width: 100%; }
  .expense-row { padding: 12px; }
}
