:root {
  --app-bg: #f5f7fb;
  --app-surface: #ffffff;
  --app-surface-soft: #f2f5f9;
  --app-text: #1d2738;
  --app-muted: #5b667a;
  --app-primary: #0f7f79;
  --app-primary-strong: #0a625d;
  --app-border: #d7deea;
  --app-accent: #ef7c47;
  --app-shadow: 0 12px 30px rgba(20, 34, 57, 0.08);
}

html,
body {
  min-height: 100%;
}

body.app-shell {
  background: radial-gradient(1200px 600px at 20% -10%, rgba(15, 127, 121, 0.2), transparent 60%),
    radial-gradient(900px 500px at 100% 0, rgba(239, 124, 71, 0.18), transparent 60%),
    var(--app-bg);
  color: var(--app-text);
  font-family: "Manrope", "Segoe UI", sans-serif;
  position: relative;
}

.app-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(transparent 98%, rgba(15, 127, 121, 0.06) 100%),
    linear-gradient(90deg, transparent 98%, rgba(15, 127, 121, 0.04) 100%);
  background-size: 22px 22px;
  opacity: 0.25;
  z-index: -1;
}

.app-topbar {
  backdrop-filter: blur(8px);
  background-color: rgba(245, 247, 251, 0.78);
  border-bottom: 1px solid rgba(15, 127, 121, 0.14);
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--app-primary), #3fb8b3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(15, 127, 121, 0.25);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-logo-fallback {
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-name {
  color: var(--app-text);
  font-weight: 800;
  font-size: 1.03rem;
}

.app-nav-links .nav-link {
  color: var(--app-muted);
  font-weight: 600;
  margin-right: 0.15rem;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  transition: all 0.15s ease;
}

.app-nav-links .nav-link:hover {
  color: var(--app-primary-strong);
  background: rgba(15, 127, 121, 0.09);
}

.app-user-button {
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  color: var(--app-text);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.7rem 0.35rem 0.35rem;
  font-weight: 600;
}

.app-user-button:hover,
.app-user-button:focus {
  border-color: rgba(15, 127, 121, 0.45);
  color: var(--app-text);
}

.app-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ffd7c5, #ef7c47);
  color: #6d2a0f;
  border: 1px solid rgba(239, 124, 71, 0.35);
  flex-shrink: 0;
}

.app-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-initials {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
}

.app-user-name {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-content .card,
.app-content .table-responsive,
.app-content form {
  animation: rise-in 0.35s ease both;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-content .card,
.table-responsive,
.app-panel {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 14px;
  box-shadow: var(--app-shadow);
}

.table-responsive {
  padding: 0.2rem;
}

.table {
  --bs-table-bg: transparent;
  margin-bottom: 0;
}

.table > :not(caption) > * > * {
  padding-top: 0.76rem;
  padding-bottom: 0.76rem;
}

.table thead th {
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--app-muted);
  border-bottom: 1px solid var(--app-border);
}

.table tbody tr:hover {
  background: rgba(15, 127, 121, 0.06);
}

.form-control,
.form-select {
  border-color: var(--app-border);
  background-color: #fff;
  min-height: 42px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="file"],
textarea,
select {
  border: 1px solid var(--app-border);
  border-radius: 0.375rem;
  background-color: #fff;
  min-height: 42px;
  padding: 0.5rem 0.75rem;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(15, 127, 121, 0.6);
  box-shadow: 0 0 0 0.2rem rgba(15, 127, 121, 0.16);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
input[type="file"]:focus,
textarea:focus,
select:focus {
  outline: 0;
  border-color: rgba(15, 127, 121, 0.6);
  box-shadow: 0 0 0 0.2rem rgba(15, 127, 121, 0.16);
}

.btn-primary {
  --bs-btn-bg: var(--app-primary);
  --bs-btn-border-color: var(--app-primary);
  --bs-btn-hover-bg: var(--app-primary-strong);
  --bs-btn-hover-border-color: var(--app-primary-strong);
}

.btn-outline-secondary {
  --bs-btn-color: #44506a;
  --bs-btn-border-color: #9aa7bf;
  --bs-btn-hover-bg: #e7ecf5;
  --bs-btn-hover-color: #2f3b55;
}

.btn-outline-dark {
  --bs-btn-color: #233046;
  --bs-btn-border-color: #7d8ca8;
  --bs-btn-hover-bg: #d8deeb;
  --bs-btn-hover-color: #1a2537;
}

.breadcrumb {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--app-border);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  box-shadow: 0 6px 18px rgba(20, 34, 57, 0.06);
  display: inline-flex;
}

.breadcrumb-item,
.breadcrumb-item a {
  color: #51607b;
  text-decoration: none;
}

.pagination .page-link {
  border-color: var(--app-border);
  color: #42516d;
}

.pagination .page-item.active .page-link {
  background: var(--app-primary);
  border-color: var(--app-primary);
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--app-border);
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(17, 33, 56, 0.18);
}

.auth-caption {
  color: var(--app-muted);
  font-size: 0.85rem;
}

@media (max-width: 992px) {
  .app-nav-links {
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
  }

  .app-user-name {
    max-width: 100%;
  }
}

.app-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.app-page-head h1 {
  margin-bottom: 0.25rem;
}

.app-page-subtitle {
  color: var(--app-muted);
  margin-bottom: 0;
}

.app-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.app-stat-pill {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--app-border);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
}

.app-stat-pill .label {
  color: var(--app-muted);
  font-weight: 600;
}

.app-stat-pill .value {
  color: var(--app-text);
  font-weight: 800;
}

.app-filter-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--app-border);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--app-shadow);
  margin-bottom: 1rem;
}

.app-filter-panel .form-label {
  margin-bottom: 0.25rem;
  color: #52607b;
  font-size: 0.82rem;
  font-weight: 700;
}

.app-table-title {
  padding: 0.9rem 1rem 0.3rem 1rem;
  color: var(--app-muted);
  font-size: 0.85rem;
}

.app-mono {
  font-family: "IBM Plex Mono", monospace;
}

.app-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  border: 1px solid transparent;
  font-size: 0.77rem;
  font-weight: 700;
}

.app-badge-neutral {
  background: #eef2f8;
  border-color: #d9e1ef;
  color: #3b4a62;
}

.app-badge-success {
  background: #e7f9ef;
  border-color: #b7e9cb;
  color: #1a6b39;
}

.app-badge-warning {
  background: #fff5df;
  border-color: #f5ddb0;
  color: #7e5710;
}

.app-badge-danger {
  background: #fde9e9;
  border-color: #f6c7c7;
  color: #842929;
}

.app-empty {
  text-align: center;
  padding: 2rem 1rem !important;
  color: var(--app-muted);
}

.app-form-shell {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--app-border);
  border-radius: 16px;
  box-shadow: var(--app-shadow);
  padding: 1rem;
}

.app-form-section {
  border: 1px solid var(--app-border);
  background: #fff;
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.app-form-section:last-child {
  margin-bottom: 0;
}

.app-form-section h2 {
  margin-bottom: 0.2rem;
}

.app-form-section .section-note {
  color: var(--app-muted);
  font-size: 0.86rem;
  margin-bottom: 0.9rem;
}

.app-inline-check {
  min-height: 42px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: #fff;
}

.app-inline-check .form-check-input {
  margin-top: 0;
}

.app-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}
