/* Reset / base */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f3f4f6;
  color: #111827;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}

p { margin: 0 0 1rem; }

.muted { color: #6b7280; font-size: 0.9rem; }

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem;
  min-height: 100vh;
}

.screen { display: block; }
.screen[hidden] { display: none; }

.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.screen-header h1 { margin: 0; }

.card {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
}

/* Forms */
form label {
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: #374151;
}

form input[type="text"],
form input[type="password"],
form input[type="date"],
form textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  background: #ffffff;
  color: #111827;
  font-family: inherit;
}

form textarea { resize: vertical; min-height: 120px; }

form input:focus,
form textarea:focus,
button:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  border-color: #2563eb;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.7rem 1.1rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: background-color 0.15s, opacity 0.15s;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: #2563eb;
  color: #ffffff;
}
.btn-primary:hover:not(:disabled) { background: #1d4ed8; }

.btn-secondary {
  background: #e5e7eb;
  color: #111827;
}
.btn-secondary:hover:not(:disabled) { background: #d1d5db; }

.btn-danger {
  background: #dc2626;
  color: #ffffff;
}
.btn-danger:hover:not(:disabled) { background: #b91c1c; }

.btn-link {
  background: transparent;
  color: #2563eb;
  padding: 0.4rem 0.6rem;
  font-weight: 500;
}
.btn-link:hover:not(:disabled) { text-decoration: underline; }

.btn-block {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.form-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.form-actions .btn { flex: 1; }

/* News list */
.news-items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.news-item {
  background: #ffffff;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

.news-item-title {
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: #111827;
  word-break: break-word;
}

.news-item-body {
  color: #374151;
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.news-item-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #dbeafe;
}

.news-item-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.news-item-actions .btn {
  padding: 0.45rem 0.8rem;
  font-size: 0.9rem;
}

.empty-state {
  text-align: center;
  padding: 2rem 1rem;
}

/* Error */
.error {
  color: #b91c1c;
  font-size: 0.9rem;
  min-height: 1.2rem;
  margin: 0.5rem 0 0;
}

.error:empty { min-height: 0; margin: 0; }

/* Success */
.success-msg {
  color: #059669;
  font-size: 0.9rem;
  min-height: 1.2rem;
  margin: 0.5rem 0 0;
}
.success-msg:empty { min-height: 0; margin: 0; }

/* Tab bar */
.tab-bar {
  display: flex;
  border-bottom: 2px solid #e5e7eb;
  gap: 0;
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: #6b7280;
  border-radius: 0;
  font-family: inherit;
  transition: color 0.15s;
}

.tab-btn:hover { color: #111827; }
.tab-btn--active { color: #2563eb; border-bottom-color: #2563eb; cursor: default; }
.tab-btn:focus { outline: 2px solid #2563eb; outline-offset: 2px; }

.screen-header {
  margin-bottom: 1rem;
}

/* Small button variant */
.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

/* Hours grid */
.hours-grid {
  margin-top: 0.5rem;
}

.hours-day-row {
  padding: 0.6rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.hours-day-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: #374151;
  margin-bottom: 0.4rem;
}

.hours-slots-container {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
}

.hours-slot-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.hours-slot-row input[type="time"] {
  width: 100px;
  padding: 0.35rem 0.45rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.875rem;
  background: #fff;
  color: #111827;
  font-family: inherit;
}

.hours-slot-row input[type="text"] {
  flex: 1;
  min-width: 130px;
  padding: 0.35rem 0.45rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.875rem;
  background: #fff;
  color: #111827;
  font-family: inherit;
}

.hours-slot-row input:focus { outline: 2px solid #2563eb; outline-offset: 1px; border-color: #2563eb; }

.slot-sep {
  color: #6b7280;
  font-size: 0.9rem;
}

/* Icon button (×) */
.btn-icon {
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  line-height: 1;
  font-family: inherit;
}
.btn-icon:hover { color: #dc2626; background: #fee2e2; }
.btn-icon:focus { outline: 2px solid #2563eb; outline-offset: 1px; }

.add-slot-btn { margin-top: 0.15rem; }

/* Exceptions */
.hours-exceptions-section { margin-top: 1.5rem; }
.hours-exceptions-section h2 { font-size: 1.1rem; margin: 0 0 0.25rem; }
.hours-exceptions-hint { font-size: 0.82rem; margin-bottom: 0.75rem; }

.hours-exceptions-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.exception-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.exception-row input[type="date"],
.exception-row input[type="text"] {
  padding: 0.35rem 0.45rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.875rem;
  background: #fff;
  color: #111827;
  font-family: inherit;
}

.exception-row input[type="text"] { flex: 1; min-width: 130px; }
.exception-row input:focus { outline: 2px solid #2563eb; outline-offset: 1px; border-color: #2563eb; }
