/* Reset / Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
  background-color: #f5f7fa;
  color: #1f2933;
}

/* Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
} 

/* Sidebar (legacy — hidden in SPA) */
.sidebar {
  display: none; /* hide old sidebar when using header-based SPA */
  width: 240px;
  background-color: #0f172a;
  color: #e5e7eb;
  padding: 1.5rem 1rem;
}

.sidebar-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.menu-list {
  list-style: none;
}

.menu-list li {
  margin-bottom: 0.75rem;
}

.menu-list a {
  color: #cbd5f5;
  text-decoration: none;
  font-size: 0.95rem;
}

.menu-list a:hover {
  color: #ffffff;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}

/* Header */
.page-header {
  margin-bottom: 2rem;
}

.page-title {
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
}

.page-subtitle {
  margin-top: 0.5rem;
  font-size: 1rem;
  color: #475569;
}

/* Main Flow */
.content-flow {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Table */
.table-container {
  background: #ffffff;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background-color: #e2e8f0;
}

th, td {
  text-align: left;
  padding: 0.75rem;
}

th {
  font-weight: 600;
  font-size: 0.9rem;
}

tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #0f172a;
  color: #e5e7eb;
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 8px rgba(2,6,23,0.08);
}

.site-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
}

.header-title {
  font-weight: 700;
  color: #e5e7eb;
  font-size: 1.1rem;
}

.header-nav .menu-list {
  display: flex;
  gap: 0.75rem;
  list-style: none;
}

.header-nav .menu-list li {
  margin: 0;
}

.header-nav .menu-list a {
  color: #cbd5f5;
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
}

.header-nav .menu-list a.active,
.header-nav .menu-list a:hover {
  background: rgba(255,255,255,0.06);
  color: #ffffff;
}

@media (max-width: 768px) {
  .main-content {
    padding: 1rem;
  }
}

/* Admin form styles */
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-row {
  display: flex;
  flex-direction: column;
}

.form-row-inline {
  display: flex;
  gap: 1rem;
}

.form-field label,
.form-row label {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  color: #334155;
}

input[type="text"],
input[type="number"],
input[type="datetime-local"] {
  padding: 0.5rem 0.65rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  font-size: 0.95rem;
  color: #0f172a;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.btn {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: 1px solid transparent;
  background: #eef2ff;
  color: #0f172a;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(0.96);
}

.btn.primary {
  background: #0f172a;
  color: #ffffff;
}

.btn.danger {
  background: #fecaca; /* light red */
  color: #7f1d1d; /* dark red text */
  border: 1px solid rgba(127,29,29,0.08);
}

.btn.danger:hover {
  filter: brightness(0.97);
}

.result-area {
  margin-top: 1rem;
  color: #0f172a;
  background: #f8fafc;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

@media (max-width: 520px) {
  .form-row-inline {
    flex-direction: column;
  }
}

/* Segmented control for operation */
.segmented {
  display: inline-flex;
  gap: 4px;
  background: #eef2ff;
  padding: 4px;
  border-radius: 8px;
}

.seg-btn {
  border: none;
  background: transparent;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  color: #0f172a;
}

.seg-btn.active {
  background: #0f172a;
  color: #ffffff;
}

.seg-btn:focus {
  outline: 2px solid #c7d2fe;
  outline-offset: 2px;
}
