:root {
  --main-color: #4fa8dc;
  --accent-color: #f5f5f5;
  --font-color: #333;
  --button-color: #4fa8dc;
  --button-hover: #3b90c5;
}

body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--accent-color);
  color: var(--font-color);
}

header {
  background-color: var(--main-color);
  color: white;
  padding: 1rem;
  text-align: center;
  font-size: 1.5em;
  font-weight: bold;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1em;
  background-color: white;
  border-bottom: 1px solid #ddd;
}

.top-bar a {
  margin-left: 1em;
  text-decoration: none;
  color: var(--main-color);
  font-weight: bold;
}

.container {
  max-width: 800px;
  margin: auto;
  padding: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  border-radius: 10px;
  overflow: hidden;
}

th, td {
  padding: 1rem;
  text-align: center;
  border-bottom: 1px solid #eee;
}

th {
  background-color: #e6f3fb;
}

tr:hover {
  background-color: #f9f9f9;
}

input[type="text"],
input[type="number"],
select {
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 90%;
}

button {
  background-color: var(--button-color);
  color: white;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

button:hover {
  background-color: var(--button-hover);
}

.status-icon {
  font-size: 1.2em;
}

.status-icon.attend { color: green; }
.status-icon.absent { color: red; }
.status-icon.late { color: orange; }
.status-icon.none { color: #999; }

.details {
  display: none;
  margin: 0.5em 0 1em 0;
  padding: 0.5em;
  background: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.details p {
  margin: 0.2em 0;
}

.toggle-button {
  cursor: pointer;
  color: var(--main-color);
  text-decoration: underline;
  font-size: 0.9em;
}

@media (max-width: 600px) {
  th, td {
    padding: 0.6rem;
    font-size: 0.9rem;
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  input, select {
    font-size: 0.9rem;
  }

  button {
    width: 100%;
    margin-top: 0.5rem;
  }

  /* タイムバー全体の背景 */
  .time-bar {
    position: relative;
    width: 100%;
    height: 20px;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
    margin: 4px 0;
  }

  .time-bar .bar {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 10px;
    color: white;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    white-space: nowrap;
  }

  /* ステータス別カラー */
  .time-bar .bar.attend      { background: #0077b6; } /* 全幅出席 */
  .time-bar .bar.late        { background: #f39c12; } /* 遅刻 */
  .time-bar .bar.leave       { background: #e74c3c; } /* 早退 */
  .time-bar .bar.late-leave  { background: #8e44ad; } /* 遅刻・早退 */

  .details-row {
    display: none;
  }
  .details-row.visible {
    display: table-row;
  }


}
