/* ======= Typography ======= */
body, html {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f8fafc;
  color: #222;
}

h1, h2, h3 {
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: #18181b;
  letter-spacing: -0.5px;
}

h1 {
  font-size: 2.4rem;
}

h2 {
  font-size: 1.3rem;
}

h3, .card-title {
  font-size: 1.14rem;
  font-weight: 700;
  margin-bottom: 1.1rem;
}

.greeting, .score-caption, .audit-doc-desc {
  color: #6b7280;
  font-size: 1.09rem;
  font-weight: 400;
  margin-bottom: 0.4rem;
}

/* ======= Layout ======= */
.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 235px;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem 1rem 1.2rem 1.3rem;
}
.sidebar-logo {
  font-weight: 800;
  font-size: 2.1rem;
  color: #222;
  text-align: center;
  margin-bottom: 2.3rem;
}
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  font-size: 1.08rem;
  color: #444;
  border-radius: 0.7rem;
  padding: 0.59rem 1.15rem;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.nav-item.active, .nav-item:hover {
  background: #f1f5f9;
  color: #222;
  font-weight: 700;
}
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-top: 2.1rem;
  border-top: 1px solid #f3f4f6;
}
.profile-pic {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
}
.profile-name { font-weight: 700; color: #18181b; }
.profile-role { font-size: 1rem; color: #78716c; }

/* ======= Main Content ======= */
.main-content {
  flex: 1;
  padding: 2.7rem 2.7rem 2rem 2.7rem;
  background: #f8fafc;
  min-height: 100vh;
}

/* Header */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2.5rem;
}
.main-header h1 {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -2px;
  margin-bottom: 0.11rem;
  color: #111;
}
.header-actions {
  display: flex;
  gap: 0.75rem;
}

.header-actions .btn {
  font-size: 0.85rem;
  padding: 0.6rem 1.6rem !important;
  font-weight: 500;
  min-width: fit-content;
  white-space: nowrap;
  line-height: 1;
}

.header-actions .btn-black {
  font-size: 0.85rem;
  padding: 0.6rem 1.6rem !important;
  font-weight: 500;
  min-width: fit-content;
  white-space: nowrap;
  line-height: 1;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.7rem;
  margin-bottom: 2.1rem;
}
.tab {
  border: none;
  background: #f3f4f6;
  color: #222;
  padding: 0.72rem 2.0rem;
  border-radius: 999px;
  font-size: 1.07rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  outline: none;
}
.tab.active, .tab:focus {
  background: #fff;
  box-shadow: 0 2px 6px 0 rgba(44,62,80,0.09);
  color: #111;
}

/* Dashboard Cards Grid */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.1rem;
  margin-bottom: 2.6rem;
}

/* Cards */
.card {
  background: #fff;
  border-radius: 1.3rem;
  box-shadow: 0 4px 24px 0 rgba(44,62,80,0.07);
  padding: 2.1rem 1.7rem 2rem 1.7rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

/* ======= INCIDENT FORM CARD ENHANCEMENTS ======= */
.card.incident-form {
  max-width: 620px;
  margin: 2.5rem auto 2rem auto;
  padding: 2.3rem 2rem 2rem 2rem;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 32px 0 rgba(0,0,0,0.10);
}

/* ======= Modern Form Styles ======= */
.form-group {
  margin-bottom: 1.6rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.form-group label {
  font-size: 1.11rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.form-control, .form-control-file, select, input[type="text"], textarea {
  width: 100%;
  border-radius: 10px;
  border: 1.5px solid #e5e7eb;
  padding: 0.65rem 1rem;
  font-size: 1.08rem;
  font-family: inherit;
  margin-top: 0.18rem;
  background: #f8fafc;
  color: #222;
  transition: border 0.14s;
}
.form-control:focus, .form-control-file:focus, select:focus, input[type="text"]:focus, textarea:focus {
  border: 1.5px solid #18181b;
  outline: none;
}
textarea.form-control {
  min-height: 100px;
  max-height: 220px;
  resize: vertical;
}
input[type="file"].form-control-file {
  padding: 0.38rem 0.2rem;
}

/* ======= Buttons (Streamlined & Balanced) ======= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 1rem;             /* Slightly smaller */
  font-weight: 500;            /* Lighter weight */
  padding: 0.6rem 1.4rem;      /* Reduced vertical padding */
  border-radius: 10px;         /* Balanced corner rounding */
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
  line-height: 1;              /* Reduced line-height for better centering */
}

.btn:hover {
  background: #f1f5f9;
}

/* Primary (Black) Button */
.btn-black {
  background: #18181b;
  color: #fff;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.7rem 2.0rem !important;
  line-height: 1;
  letter-spacing: 0.005em;
  min-width: fit-content;
  white-space: nowrap;
}

.btn-black:hover {
  background: #222;
  color: #fff;
}

/* Outline Button */
.btn-outline {
  background: #fff;
  color: #111;
  border: 1.5px solid #d1d5db;
  padding: 0.6rem 1.4rem !important;
  min-width: fit-content;
  white-space: nowrap;
  line-height: 1;
}

.btn-outline:hover {
  background: #f3f4f6;
}

/* Danger Button */
.btn-danger {
  background: #fee2e2;
  color: #b91c1c;
  border: 1.5px solid #fecaca;
}

.btn-danger:hover {
  background: #fecaca;
  color: #7f1d1d;
}

/* Size Variants */
.btn-sm {
  font-size: 0.92rem;
  padding: 0.55rem 1.0rem;
  border-radius: 8px;
}

.btn-lg {
  font-size: 1.05rem;
  padding: 0.9rem 1.8rem;
  border-radius: 12px;
}

.btn-block {
  width: 100%;
}



/* ======= Card/Content Specific ======= */
.compliance-score-card {
  align-items: center;
  justify-content: center;
  text-align: center;
}
.score-label {
  font-weight: 700;
  color: #111;
  font-size: 1.11rem;
  margin-bottom: 0.68rem;
}
.score-value {
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 0.23rem;
}
.score-subtext {
  font-size: 1.07rem;
  font-weight: 500;
  color: #a3a3a3;
  margin-bottom: 0.47rem;
}
.score-caption {
  font-size: 1.02rem;
  color: #6b7280;
}

/* Metric Card */
.metric-card {
  min-width: 0;
}
.metric-label {
  font-size: 1.07rem;
  font-weight: 600;
  color: #111;
  margin-bottom: 0.7rem;
}
.metric-value {
  font-size: 1.67rem;
  font-weight: 800;
  color: #18181b;
  letter-spacing: -1.2px;
  margin-bottom: 0.3rem;
}
.metric-value span {
  color: #6b7280;
  font-size: 1.05rem;
  font-weight: 500;
  margin-left: 0.4rem;
}
.progress-bar-bg {
  width: 100%;
  height: 0.65rem;
  background: #f3f4f6;
  border-radius: 999px;
  margin-top: 0.18rem;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: #222;
  border-radius: 999px;
  transition: width 0.4s;
}

/* Lower Section */
.dashboard-lower {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 2.1rem;
  margin-bottom: 2rem;
}

/* Action Items */
.action-items-card {
  padding-bottom: 1.3rem;
}
.action-item-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.09rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.action-item-row:last-child { border-bottom: none; }
.status-dot {
  width: 17px; height: 17px; border-radius: 50%; display: inline-block; margin-right: 2px;
}
.status-dot.high { background: #ef4444; }
.status-dot.medium { background: #f59e42; }
.status-dot.low { background: #22c55e; }
.action-item-title {
  font-weight: 700;
  margin-right: 0.25rem;
  color: #111;
}
.badge {
  display: inline-block;
  padding: 0.12em 0.9em;
  border-radius: 999px;
  font-size: 0.93rem;
  font-weight: 600;
  margin-right: 0.18rem;
  margin-left: 0.08rem;
  vertical-align: middle;
}
.badge-high { background: #fee2e2; color: #b91c1c;}
.badge-medium { background: #fff7e1; color: #b45309;}
.badge-low { background: #d1fae5; color: #065f46;}
.badge-gray { background: #e5e7eb; color: #6b7280; }
.action-item-date {
  color: #6b7280; font-size: 0.99em; margin-left: 0.2rem;
}
.action-item-status {
  color: #22c55e; font-size: 0.98em; font-weight: 600;
}

/* Audit Doc Card */
.audit-doc-card {
  align-items: flex-start;
  justify-content: flex-start;
}
.audit-doc-desc {
  font-size: 1rem;
  margin-bottom: 1.3rem;
  color: #6b7280;
}

/* ======= Modern Table Styles ======= */
.styled-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  background: transparent;
  margin-top: 0.2rem;
}

.styled-table th, .styled-table td {
  text-align: left;
  padding: 0.85rem 0.7rem;
}

.styled-table th {
  background-color: #f3f4f6;
  color: #374151;
  font-weight: 600;
  font-size: 1.04rem;
  border-bottom: 2px solid #e5e7eb;
}

.styled-table td {
  border-bottom: 1px solid #f1f5f9;
  color: #222;
  vertical-align: middle;
}

.styled-table tr:last-child td {
  border-bottom: none;
}

.empty-state {
  text-align: center;
  color: #a3a3a3;
  font-size: 1.11rem;
  padding: 2.3rem 0;
}

/* Icon emoji fallback */
.icon-calendar:before { content: "📅"; margin-right: 0.3em; }
.icon-download:before { content: "⬇️"; margin-right: 0.3em; }

/* Muted text */
.text-muted {
  color: #a3a3a3;
}

/* Responsive Tweaks */
@media (max-width: 1200px) {
  .dashboard-cards { grid-template-columns: 1fr 1fr; gap: 1.5rem;}
  .dashboard-lower { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { display:none; }
  .main-content { padding: 1.5rem 0.6rem; }
  .dashboard-cards { grid-template-columns: 1fr; gap: 1rem;}
}
@media (max-width: 700px) {
  .main-header { flex-direction: column; gap: 1.1rem; align-items: flex-start; }
  .tabs { gap: 0.4rem; }
  .dashboard-lower { grid-template-columns: 1fr; gap: 1.3rem;}
  .card.incident-form {
    padding: 1.3rem 0.6rem 1rem 0.6rem;
    max-width: 98vw;
  }
}

/* Utility */
.bg-dashboard { background: #f8fafc; }
.text-foreground { color: #222; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1.5rem; }
.gap-6 { gap: 2.5rem; }

/* File input styling */
.file-input {
  font-size: 1rem;
  border-radius: 1rem;
  border: 1.5px solid #e5e7eb;
  padding: 0.58rem 1.2rem;
  background: #f8fafc;
  margin-right: 1rem;
}
.file-input::-webkit-file-upload-button {
  font-family: inherit;
  color: #fff;
  background: #18181b;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
}
.file-input::file-selector-button {
  font-family: inherit;
  color: #fff;
  background: #18181b;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
}

.sidebar-nav .icon,
.sidebar-nav svg {
  display: inline-block;
  vertical-align: middle;
  width: 22px;
  height: 22px;
  stroke: #18181b;
  fill: none;
  stroke-width: 1.8;
  margin-right: 0.85em;
}

/* ---- Auth Container Modern Login ---- */
.auth-container {
  max-width: 430px;
  margin: 40px auto;
  padding: 2.5rem 2rem;
  background: #fff;
  border-radius: 2rem;
  box-shadow: 0 8px 32px rgba(60,80,120,0.07);
  text-align: center;
}

.auth-container form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  width: 100%;
}
.auth-container form {
  padding-left: 2px;
  padding-right: 2px;
}

.auth-container input[type="email"],
.auth-container input[type="password"] {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 0.6rem;
  border: 1.5px solid #d1d5db;
  background: #f8fafc;
  font-size: 1.1rem;
  box-sizing: border-box;
  outline: none;
}

.btn-black, .btn.btn-black, .auth-container button.btn-black {
  width: 100%;
  background: #18181b;
  color: #fff;
  border-radius: 2rem;
  padding: 1rem 0;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  box-shadow: 0 2px 6px 0 rgba(44,62,80,0.07);
  transition: background 0.15s, color 0.15s;
  margin-top: 1.1rem;
  letter-spacing: 0.005em;
  display: block;
  line-height: 1.2;
}
.btn-black:hover, .btn.btn-black:hover, .auth-container button.btn-black:hover {
  background: #222;
  color: #fff;
}


.auth-container label {
  font-weight: 600;
  text-align: left;
  margin-bottom: 0.2rem;
  margin-left: 2px;
  display: block;
}

.auth-container .remember-me {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-size: 1rem;
  margin: 0.3rem 0 0.7rem 0;
}

.auth-container .auth-links {
  margin-top: 1.2rem;
  font-size: 1.08rem;
  color: #1984e4;
}

.auth-container .flash {
  color: #c22;
  list-style: none;
  padding: 0;
  margin: 0.5em 0 0 0;
  font-weight: 500;
}
.remember-row {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 1.1rem;
  width: 100%;
}

.remember-row label {
  margin-bottom: 0;
  font-weight: 400;
  font-size: 1.04rem;
  cursor: pointer;
  display: inline-block; /* ensures it's not a block element */
}

.remember-checkbox {
  width: 1.1em;
  height: 1.1em;
  accent-color: #228be6; /* optional: blue accent for modern look */
}
