/* Base styles for the Time‑Sheet & Invoice Platform */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  background: #f7f8fb;
  color: #333;
  min-height: 100vh;
}

/* Login page specific styling */
body.login-page {
  /* Background image for the login page */
  background: url('login-bg.png') no-repeat center center fixed;
  background-size: cover;
  /* Provide a subtle overlay to improve text legibility */
  position: relative;
}

/* Overlay for login page to dim the background slightly */
body.login-page::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.6);
  /* This overlay sits below other content */
  z-index: -1;
}

/* Header styling specific to the login page */
.login-header {
  background: transparent;
  padding: 1.5rem 0;
}

/* Flex container for logo and text in header */
.header-flex {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
}

/* Logo image size */
.logo-img {
  /* Increase logo height so it stands out more */
  height: 80px;
  width: auto;
}

/* Adjust logo text styling when placed next to the logo */
.logo-text {
  /* Make the site title more prominent */
  font-size: 2.2rem;
  font-weight: 600;
  margin: 0;
  color: #222;
}

/* Utility classes */
.hidden {
  display: none !important;
}

/* Layout containers */
.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
/* Lightened header style across the site */
.app-header {
  /* Use a lighter gradient so the colorful logo stands out */
  background: linear-gradient(135deg, #b9c5ff, #d8c8ff);
  color: #333;
  padding: 1rem 0;
  text-align: center;
}
.logo {
  margin: 0;
  font-weight: 600;
  font-size: 1.8rem;
  color: #333;
}

/* Footer */
.app-footer {
  background: #eee;
  padding: 1rem 0;
  text-align: center;
  font-size: 0.875rem;
  color: #666;
  margin-top: 2rem;
}

/* Card component for forms */
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.card h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
  color: #333;
}
.card p {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #555;
}

/* Role selection buttons */
.role-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}
.role-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 6px;
  background: #5d5fe5;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
}
.role-btn:hover, .role-btn:focus {
  background: #4a4cca;
  outline: none;
}

/* Form styling */
form {
  display: flex;
  flex-direction: column;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.form-row .form-group {
  flex: 1;
}

label {
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: #444;
}
.required {
  color: #c0392b;
  margin-left: 0.15rem;
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
  padding: 0.55rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  background-color: #fff;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #5d5fe5;
  box-shadow: 0 0 0 3px rgba(93, 95, 229, 0.15);
}

textarea {
  resize: vertical;
}

/* File upload drop area */
.file-drop {
  position: relative;
  border: 2px dashed #bbb;
  border-radius: 6px;
  padding: 1.5rem;
  text-align: center;
  background-color: #fafafa;
  cursor: pointer;
  transition: border-color 0.3s ease;
}
.file-drop:hover {
  border-color: #5d5fe5;
}
.file-drop p {
  margin: 0;
  color: #888;
  font-size: 0.9rem;
}
.file-drop input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* File list styling */
.file-list {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #555;
}
.file-list span {
  display: inline-block;
  margin-right: 0.5rem;
  background-color: #f2f2f2;
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
}

/* Submit button */
.submit-btn {
  align-self: flex-start;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  background: #5d5fe5;
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s ease;
  margin-top: 1rem;
}
.submit-btn:hover, .submit-btn:focus {
  background: #4a4cca;
  outline: none;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .form-row {
    flex-direction: column;
  }
  .role-buttons {
    flex-direction: column;
  }
  .role-btn {
    width: 100%;
  }
}

/* ===================== Dashboard styles ===================== */
/* Metrics grid containing summary cards */
.metrics-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}
.metric-card {
  flex: 1 1 calc(20% - 1rem);
  min-width: 160px;
  background: #ffffff;
  border-radius: 8px;
  padding: 0.8rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  text-align: center;
  color: #333;
}
.metric-card span:first-child {
  display: block;
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.metric-card h3 {
  margin: 0.2rem 0;
  font-size: 1.2rem;
  font-weight: 700;
}
.metric-card .count {
  font-size: 0.9rem;
  color: #555;
}
/* Coloured variants */
.metric-total { background: #f5f5f5; }
.metric-accepted { background: #d0e5ff; color: #0a4d8c; }
.metric-inprocess { background: #cddfff; color: #204378; }
.metric-paid { background: #d1f5e5; color: #166a3f; }
.metric-rejected { background: #fddada; color: #9f1f27; }
.metric-submitted { background: #feefc3; color: #8e5b00; }

/* Invoice sections grid */
.invoices-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.invoice-card {
  flex: 1 1 calc(50% - 1rem);
  min-width: 240px;
  background: #ffffff;
  border-radius: 8px;
  padding: 0.8rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  position: relative;
}
.invoice-card h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #333;
}
.invoice-card .summary {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}
.invoice-card .invoice-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 150px;
  overflow-y: auto;
}
.invoice-card .invoice-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid #f0f0f0;
}
.invoice-card .invoice-list li:last-child {
  border-bottom: none;
}
.invoice-card .invoice-number {
  color: #0057b8;
  cursor: pointer;
  text-decoration: underline;
}
.invoice-card .invoice-vendor {
  flex: 1;
  margin-left: 0.5rem;
  color: #555;
}
.invoice-card .invoice-amount {
  font-weight: 600;
  white-space: nowrap;
}
.invoice-card .invoice-date {
  font-size: 0.8rem;
  color: #777;
  white-space: nowrap;
}
.invoice-card .show-more {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #0057b8;
  cursor: pointer;
  text-decoration: underline;
}

@media (max-width: 800px) {
  .metric-card {
    flex: 1 1 calc(50% - 1rem);
  }
  .invoice-card {
    flex: 1 1 100%;
  }
}
