* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --brand-earth-deep: #1f1f1f;
  --brand-earth: #4a4a4a;
  --brand-earth-dark: #2f2f2f;
  --text-primary: #1f1f1f;
  --text-muted: #707070;
  --surface: #ffffff;
  --surface-muted: #f2f2f2;
  --border: #d0d0d0;
  --shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 10px 20px rgba(0, 0, 0, 0.06);
}

body.app-body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--surface-muted);
  color: var(--text-primary);
  margin: 0;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--surface-muted);
}

.app-sidebar {
  width: 250px;
  background: #1f1f1f;
  color: #f2f2f2;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 6px 0 16px rgba(0, 0, 0, 0.18);
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-logo {
  color: #f7f7f7;
  font-weight: 700;
  font-size: 20px;
  text-decoration: none;
}

.sidebar-pill {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #e6e6e6;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-section {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(242, 242, 242, 0.7);
  margin-top: 10px;
}

.app-sidebar .nav-link {
  color: #f2f2f2;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 500;
}

.app-sidebar .nav-link:hover,
.app-sidebar .nav-link:focus {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.app-sidebar .nav-link.active {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-weight: 600;
}

.app-sidebar .nav-link.active::before {
  content: "";
  width: 6px;
  height: 6px;
  background: #ffffff;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.header-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--brand-earth-deep);
}

.header-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-search {
  width: 280px;
}

.app-search .form-control {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f4f4f4;
  padding-left: 14px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #ededed;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-primary);
}

.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #2f2f2f;
  color: #ffffff;
  font-weight: 600;
}

.app-content {
  flex: 1;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.app-footer {
  padding: 14px 28px 22px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--brand-earth-deep);
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.page-actions {
  display: flex;
  gap: 10px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.card-header {
  background: #f6f6f6;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.table {
  margin-bottom: 0;
}

.table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.table tbody tr:hover {
  background: #f3f3f3;
}

.badge-soft {
  background: #e5e5e5;
  color: #3f3f3f;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}

.status-pill {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #e5e5e5;
  color: #3f3f3f;
}

.status-open {
  background: #e7e7e7;
  color: #2a2a2a;
}

.status-active,
.status-in-progress {
  background: #e3e3e3;
  color: #3a3a3a;
}

.status-pending {
  background: #ededed;
  color: #4a4a4a;
}

.status-closed {
  background: #e4e4e4;
  color: #5a5a5a;
}

.status-cancelled,
.status-canceled {
  background: #e2e2e2;
  color: #5a5a5a;
}

.status-on-hold,
.status-on-hold-,
.status-on-hold-1 {
  background: #e6e6e6;
  color: #4a4a4a;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  position: relative;
  background-image:
    linear-gradient(135deg, rgba(18, 18, 18, 0.78) 0%, rgba(18, 18, 18, 0.5) 35%, rgba(242, 242, 242, 0.7) 36%),
    url("/static/img/core-lexes-signin.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.auth-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 28px;
  width: min(360px, 100%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.auth-brand {
  font-weight: 700;
  font-size: 20px;
  color: var(--brand-earth-deep);
  margin-bottom: 16px;
}

.auth-form {
  max-width: 320px;
  margin: 0 auto;
}

.auth-watermark {
  position: absolute;
  right: 24px;
  bottom: 16px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

.text-muted {
  color: var(--text-muted) !important;
}

.list-group-item {
  border-color: var(--border);
}

.list-group-item:hover {
  background: #f3f3f3;
}

.link-muted {
  color: var(--text-muted);
  text-decoration: none;
}

.link-muted:hover {
  color: #5a5a54;
}

.btn-primary {
  background: var(--brand-earth);
  border-color: var(--brand-earth);
}

.btn-primary:hover {
  background: var(--brand-earth-dark);
  border-color: var(--brand-earth-dark);
}

.btn-outline-primary {
  border-color: var(--brand-earth);
  color: var(--brand-earth);
}

.btn-outline-primary:hover {
  background: var(--brand-earth);
  border-color: var(--brand-earth);
  color: #ffffff;
}

.nav-pills .nav-link {
  border-radius: 999px;
  padding: 6px 14px;
  color: var(--brand-earth);
}

.nav-pills .nav-link.active {
  background: var(--brand-earth);
  color: #ffffff;
}

.stat-card {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--brand-earth-deep);
}

.calendar-day {
  min-width: 160px;
  background: #ffffff;
}

.calendar-grid {
  border-color: var(--border);
}

.calendar-grid th,
.calendar-grid td {
  border: 1px solid var(--border);
}

.calendar-grid td {
  min-height: 140px;
  height: 140px;
  vertical-align: top;
  padding: 8px;
}

.calendar-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.calendar-day-events {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.calendar-entry {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 8px;
  background: #f7f7f7;
}

.calendar-entry-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.calendar-entry-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.calendar-entry-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
