/*
 * Layoff ICU - Simple CSS
 * No frameworks, just clean styles
 */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  margin: 0;
  padding: 0;
  background: #f9fafb;
}

/* Form controls don't inherit the body font by default — make them consistent */
button, input, select, textarea {
  font-family: inherit;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Typography */
h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: #111;
}

.text-red {
  color: #dc2626;
}

.text-blue {
  color: #2563eb;
}

.subtitle {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 1rem;
}

.description {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.7;
  margin-bottom: 1rem;
  max-width: 800px;
}

.note {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 1.5rem;
}

/* Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 1rem;
}

.toolbar .pagy-nav {
  margin: 0;
}

/* Forms */
select, input[type="text"] {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  color: #374151;
  height: 36px;
}

select {
  appearance: none;
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  cursor: pointer;
}

select:focus, input[type="text"]:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

input[type="text"] {
  width: 250px;
}

.year-form {
  margin-left: auto;
}

.search-form {
  display: flex;
  gap: 0.5rem;
}

button[type="submit"] {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  background: #3b82f6;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

button[type="submit"]:hover {
  background: #2563eb;
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

thead {
  background: #f3f4f6;
}

th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #374151;
  border-bottom: 1px solid #e5e7eb;
}

th a {
  color: inherit;
  text-decoration: none;
}

th a:hover {
  color: #3b82f6;
}

.sort-icon {
  display: inline-block;
  margin-left: 0.25rem;
  font-size: 0.7rem;
  color: #9ca3af;
}

td {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
}

tbody tr:hover {
  background: #f9fafb;
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Pagination (Pagy) */
.pagy-nav {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.pagy-nav .page {
  font-size: 0.85rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  color: #374151;
  background: #fff;
}

.pagy-nav .page a {
  display: block;
  padding: 0.4rem 0.6rem;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.pagy-nav .page:hover {
  background: #f3f4f6;
}

.pagy-nav .page.active,
.pagy-nav .page.disabled {
  padding: 0.4rem 0.6rem;
}

.pagy-nav .page.active {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}

.pagy-nav .page.disabled {
  color: #9ca3af;
  border-color: #e5e7eb;
}

.pagy-nav .page.disabled:hover {
  background: #fff;
}

.pagy-nav .page.gap {
  border: none;
  background: transparent;
  padding: 0.4rem 0.25rem !important;
}

.pagy-nav .page.gap:hover {
  background: transparent;
}

/* Bottom pagination */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

/* Navigation */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.nav-brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: #111;
  text-decoration: none;
}

.nav-brand:hover {
  color: #3b82f6;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links a {
  color: #374151;
  text-decoration: none;
  font-size: 0.9rem;
}

.nav-links a:hover {
  color: #3b82f6;
}

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

.nav-logout-btn {
  background: none;
  border: none;
  color: #374151;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
}

.nav-logout-btn:hover {
  color: #ef4444;
}

.nav-login-btn {
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.nav-login-btn:hover {
  background: #2563eb;
}

/* User dropdown */
.nav-dropdown {
  position: relative;
}

.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  background: #3b82f6;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.nav-user-btn:hover {
  background: #2563eb;
}

.nav-caret {
  color: rgba(255, 255, 255, 0.85);
}

.nav-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  min-width: 190px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  padding: 0.35rem;
  z-index: 20;
}

.nav-menu[hidden] {
  display: none;
}

.nav-menu form {
  margin: 0;
}

.nav-menu .nav-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.6rem;
  border: none;
  border-radius: 6px;
  background: none;
  color: #374151;
  font-size: 0.9rem;
  font-weight: 400;
  cursor: pointer;
  text-decoration: none;
}

.nav-menu .nav-menu-item:hover {
  background: #f3f4f6;
  color: #111;
}

/* Flash messages */
.flash-notice {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.flash-alert {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.flash-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  opacity: 0.6;
  flex-shrink: 0;
}

.flash-close:hover {
  opacity: 1;
}

/* Auth pages */
/* Interior content pages (Profile, Company Tracking) — left-aligned, matches the site */
.page-narrow {
  max-width: 460px;
  margin: 2rem auto 0;
  text-align: center;
}

/* Keep form fields left-aligned within the centered block */
.page-narrow .auth-form {
  text-align: left;
}

.page-narrow .description {
  margin-bottom: 1.5rem;
}

.auth-page {
  display: flex;
  justify-content: center;
  padding-top: 2rem;
}

.auth-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 2rem;
  width: 100%;
  max-width: 420px;
}

.auth-card h1 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.auth-form .form-group {
  margin-bottom: 1rem;
}

.auth-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.25rem;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  height: auto;
}

.auth-form input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.btn {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.btn-primary {
  background: #3b82f6;
  color: #fff;
}

.btn-primary:hover {
  background: #2563eb;
}

/* Disabled Save: gray until there's an actual change */
.btn-primary:disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
}

.btn-secondary {
  background: #fff;
  color: #374151;
  border: 1px solid #d1d5db;
}

.btn-secondary:hover {
  background: #f9fafb;
}

/* Side-by-side Cancel / Save */
.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

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

/* Standalone non-full-width button (e.g. Back) */
.btn-inline {
  display: inline-block;
  width: auto;
}

.btn-google {
  background: #fff;
  color: #374151;
  border: 1px solid #d1d5db;
  margin-top: 0;
}

.btn-google:hover {
  background: #f9fafb;
}

.auth-divider {
  text-align: center;
  margin: 1.25rem 0;
  position: relative;
}

.auth-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px solid #e5e7eb;
}

.auth-divider span {
  background: #fff;
  padding: 0 0.75rem;
  position: relative;
  color: #9ca3af;
  font-size: 0.85rem;
}

.auth-link {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: #6b7280;
}

.auth-link a {
  color: #3b82f6;
  text-decoration: none;
}

.auth-link a:hover {
  text-decoration: underline;
}

.auth-badge {
  text-align: center;
  font-size: 0.85rem;
  color: #065f46;
  background: #ecfdf5;
  border-radius: 4px;
  padding: 0.4rem 0.75rem;
  margin-bottom: 1rem;
}

.form-errors {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.form-errors p {
  color: #991b1b;
  font-size: 0.85rem;
  margin: 0.25rem 0;
}

.input-disabled {
  background: #f3f4f6;
  color: #6b7280;
  cursor: not-allowed;
}

.form-hint {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
  h1 {
    font-size: 1.75rem;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .pagy-nav {
    justify-content: center;
  }

  .search-form {
    flex-direction: column;
  }

  input[type="text"] {
    width: 100%;
  }

  table {
    font-size: 0.8rem;
  }

  th, td {
    padding: 0.5rem;
  }
}
