/* Kusuwata スタッフポータル SPA - styles */
:root {
  --bg: #f8f9fa;
  --card-bg: #fff;
  --text: #222;
  --text-muted: #666;
  --text-light: #999;
  --primary: #2d6cdf;
  --primary-dark: #1e5bb8;
  --secondary: #666;
  --border: #eee;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --status-in: #2d6cdf;
  --status-break: #f59f00;
  --status-out: #868e96;
  --status-none: #868e96;
  --success-bg: #d3f9d8;
  --success-border: #8ce99a;
  --error-bg: #ffe3e3;
  --error-border: #ffa8a8;
  --error-text: #c92a2a;
  --warn-bg: #fff4cc;
  --warn-border: #ffe082;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 920px;
  margin: 0 auto;
  padding: 12px;
  padding-bottom: 80px;  /* room for nav */
}

.boot {
  text-align: center;
  padding: 80px 16px;
  color: var(--text-muted);
}

h1 { font-size: 18px; margin: 0 0 4px; }
h2 { font-size: 14px; margin: 0 0 8px; color: #333; }
h3 { font-size: 12px; margin: 12px 0 4px; color: #666; }

.sub {
  color: var(--text-muted);
  font-size: 12px;
  margin: 0 0 12px;
}

.status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
}

.status.in    { background: var(--status-in); }
.status.break { background: var(--status-break); }
.status.out   { background: var(--status-out); }
.status.none  { background: var(--status-none); }

/* Card */
.card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

/* Key-value list */
.kv {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px dotted var(--border);
  font-size: 13px;
}
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-muted); }
.kv .v { color: #111; font-weight: 500; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 8px 14px;
  margin: 4px 4px 4px 0;
  background: var(--primary);
  color: #fff !important;
  text-decoration: none;
  border-radius: 6px;
  font-size: 13px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.btn:active { background: var(--primary-dark); }
.btn.secondary { background: var(--secondary); }
.btn.big {
  font-size: 18px;
  padding: 18px 24px;
  min-width: 140px;
  text-align: center;
}
.btn.disabled,
.btn:disabled {
  background: #ccc !important;
  color: #888 !important;
  cursor: not-allowed;
  pointer-events: none;
}
.btn.block {
  display: block;
  width: 100%;
}

/* Navigation */
nav.tabs {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #e9ecef;
  display: flex;
  z-index: 100;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
nav.tabs a {
  flex: 1;
  text-align: center;
  padding: 10px 4px;
  text-decoration: none;
  color: #555;
  font-size: 11px;
  border-top: 3px solid transparent;
}
nav.tabs a.active {
  color: var(--primary);
  border-top-color: var(--primary);
  font-weight: 600;
}
nav.tabs a .ico {
  display: block;
  font-size: 20px;
  margin-bottom: 2px;
}

/* Clock buttons */
.clock-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}

/* Summary grid */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.summary-grid .cell {
  background: #f1f3f5;
  padding: 10px;
  border-radius: 6px;
  text-align: center;
}
.summary-grid .cell .label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.summary-grid .cell .value {
  font-size: 18px;
  font-weight: 600;
  color: #222;
}

/* Flash */
.flash {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 10px;
  font-size: 13px;
  text-align: center;
}
.flash.error {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error-text);
}
.flash.warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: #6b4c00;
}

/* Placeholder */
.placeholder {
  color: var(--text-light);
  font-size: 12px;
  text-align: center;
  padding: 20px;
  border: 1px dashed #ccc;
  border-radius: 6px;
}
.placeholder.small { padding: 8px; }

/* History table */
table.history {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
table.history th,
table.history td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
table.history th {
  background: #f8f9fa;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11px;
}
table.history tr.weekend { background: #fffaf0; }

/* Forms */
form.req {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
form.req label {
  font-size: 12px;
  color: #555;
}
form.req input,
form.req select,
form.req textarea {
  font-size: 14px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 100%;
  font-family: inherit;
}
form.req textarea { min-height: 80px; resize: vertical; }

/* Request list (申請メニュー) */
.req-list .req-item {
  padding: 12px;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  margin-bottom: 8px;
}
.req-list .req-item h3 { margin: 0 0 4px; font-size: 14px; color: #222; }
.req-list .req-item p { margin: 0 0 8px; color: var(--text-muted); font-size: 12px; }

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #ccc;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
}

/* Footer */
.footer {
  text-align: center;
  color: var(--text-light);
  font-size: 11px;
  margin: 20px 0 8px;
}

/* Larger screens */
@media (min-width: 768px) {
  #app { padding: 28px; padding-bottom: 80px; }
  h1 { font-size: 22px; }
  .btn.big { font-size: 20px; padding: 20px 32px; }
  .clock-row {
    grid-template-columns: repeat(4, 1fr);
  }
}
