/* ── Base ── */
body { background: #c4cdd8; }

/* ── Alerts ── */
.app-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 20px;
}
.app-alert i { flex-shrink: 0; margin-top: 2px; }
.app-alert-danger  { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.app-alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #16a34a; }

/* ── Card ── */
.app-card {
  background: #fff;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  margin-bottom: 24px;
  overflow: hidden;
}
.app-card-header {
  padding: 14px 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.app-card-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  margin: 0;
  line-height: 1.3;
}
.app-card-body { padding: 20px; }

/* ── Welcome banner ── */
.welcome-banner {
  background: linear-gradient(135deg, #00a8c9 0%, #0090ad 100%);
  border-radius: 4px;
  padding: 14px 20px;
  color: #fff;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.welcome-banner .wb-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 15px; color: #fff;
  overflow: hidden;
}
.welcome-banner .wb-icon img {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
}
.welcome-banner h2 {
  font-size: 14px; font-weight: 600;
  color: #fff; margin: 0 0 1px; line-height: 1.3;
}
.welcome-banner p { font-size: 12px; color: rgba(255,255,255,0.75); margin: 0; }

/* ── Search bar ── */
.search-wrap {
  position: relative;
  margin-bottom: 16px;
}
.search-wrap i {
  position: absolute; left: 13px; top: 50%;
  transform: translateY(-50%);
  color: #9ca3af; font-size: 14px; pointer-events: none;
}
.search-wrap input[type="text"] {
  width: 100%; height: 40px;
  padding: 0 14px 0 38px;
  border: 1.5px solid #e5e7eb; border-radius: 4px;
  font-size: 14px; color: #374151; background: #fff;
  outline: none; box-shadow: none; line-height: 40px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-wrap input[type="text"]:focus {
  border-color: #00a8c9;
  box-shadow: 0 0 0 3px rgba(0,168,201,0.10);
}
.search-wrap input::placeholder { color: #c4c9d4; }

/* ── Tables ── */
.app-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.app-table thead th {
  background: #eaeff4;
  color: #6b7280; font-size: 11px; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase;
  padding: 10px 14px; border-bottom: 1px solid #d5dce5;
  white-space: nowrap;
}
.app-table tbody tr {
  border-bottom: 1px solid #eaeff4;
  transition: background 0.1s;
}
.app-table tbody tr:hover { background: #f0f4f7; }
.app-table tbody tr:last-child { border-bottom: none; }
.app-table td { padding: 11px 14px; color: #374151; vertical-align: middle; }
.app-table td.td-icon { width: 58px; }
.app-table td img { display: block; }
.app-table td.td-center { text-align: center; }
.app-table th.th-center { text-align: center; }

/* Type separator row */
.type-sep td {
  background: #dde4ed; padding: 7px 14px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: #4b5a6e;
  border-top: 1px solid #c4cdd8;
}

/* Resource name */
.res-name { font-weight: 600; color: #111827; font-size: 13.5px; }
.res-name a { color: #111827; text-decoration: none; }
.res-name a:hover { color: #00a8c9; }
.res-desc { font-size: 12px; color: #9ca3af; margin-top: 2px; }

/* Version tag */
.tag-version {
  display: inline-block;
  background: #e8ecf0; color: #374151;
  border-radius: 4px; padding: 5px 12px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  border: 1px solid #d0d7e0;
}

/* ── Action buttons ── */
.btn-act {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 4px;
  border: 1px solid #d0d7e0; background: #fff;
  color: #6b7280; font-size: 13px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-decoration: none; vertical-align: middle;
  padding: 0;
}
.btn-act:hover { color: #fff !important; border-color: transparent; }
.btn-act-edit:hover  { background: #00a8c9; }
.btn-act-del:hover   { background: #ef4444; }
.btn-act-view:hover  { background: #8b5cf6; }
.btn-act-mail:hover  { background: #f59e0b; }
.btn-act + .btn-act  { margin-left: 4px; }

/* Download icon button */
.btn-dl {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 4px;
  background: #e8ecf0; border: 1px solid #d0d7e0;
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none; cursor: pointer;
}
.btn-dl:hover { background: #00a8c9; border-color: #00a8c9; }
.btn-dl img { width: 30px; height: 30px; display: block; }
.btn-dl:hover img { filter: brightness(0) invert(1); }

/* ── Badges ── */
.badge-yes {
  display: inline-flex; align-items: center; gap: 4px;
  background: #f0fdf4; color: #16a34a;
  border-radius: 4px; padding: 2px 8px;
  font-size: 11.5px; font-weight: 600;
}
.badge-no {
  background: #f9fafb; color: #9ca3af;
  border-radius: 4px; padding: 2px 8px;
  font-size: 11.5px; display: inline-block;
}

/* ── Filter form ── */
.filter-form {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
  padding: 16px 20px; background: #fff;
  border-bottom: 1px solid #e5e7eb;
}
.filter-field { flex: 1; min-width: 150px; }
.filter-field label {
  display: block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: #6b7280; margin-bottom: 5px;
}
.filter-field select,
.filter-field input[type="text"] {
  width: 100%; height: 36px; padding: 0 10px;
  border: 1.5px solid #e5e7eb; border-radius: 4px;
  font-size: 13.5px; color: #374151; background: #fff;
  outline: none; box-shadow: none;
  transition: border-color 0.2s;
}
.filter-field select:focus,
.filter-field input[type="text"]:focus {
  border-color: #00a8c9;
  box-shadow: 0 0 0 3px rgba(0,168,201,0.10);
}
.filter-actions { display: flex; gap: 8px; }

/* ── Buttons ── */
.btn-app {
  height: 36px; padding: 0 16px;
  border: none; border-radius: 4px;
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; white-space: nowrap; transition: opacity 0.2s;
}
.btn-app-primary { background: #00a8c9; color: #fff; }
.btn-app-primary:hover { opacity: 0.85; color: #fff; }
.btn-app-ghost {
  background: transparent; color: #6b7280;
  border: 1.5px solid #e5e7eb;
}
.btn-app-ghost:hover { border-color: #00a8c9; color: #00a8c9; }
.btn-app-danger { background: #ef4444; color: #fff; }
.btn-app-danger:hover { opacity: 0.85; color: #fff; }

/* ── Avatar ── */
.user-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  object-fit: cover; border: 2px solid #e5e7eb;
}
.user-avatar-placeholder {
  width: 38px; height: 38px; border-radius: 50%;
  background: #e5e7eb; display: inline-flex;
  align-items: center; justify-content: center;
  color: #9ca3af; font-size: 16px;
}

/* ── No results row ── */
.no-results-row td {
  text-align: center; padding: 32px; color: #9ca3af;
  font-size: 14px;
}

/* ── Modal polish ── */
.modal-content { border-radius: 4px; border: none; box-shadow: 0 20px 50px rgba(0,0,0,0.18); }
.modal-header { border-bottom: 1px solid #e5e7eb; padding: 16px 20px; }
.modal-header h1, .modal-header h4 { font-size: 16px; font-weight: 600; color: #111827; margin: 0; }
.modal-body { padding: 20px; }
.modal-footer { border-top: 1px solid #e5e7eb; padding: 12px 20px; }

/* ── Form controls inside modals ── */
.modal .form-control {
  height: 38px; border-radius: 4px;
  border: 1.5px solid #e5e7eb; color: #374151;
  background: #f9fafb !important; font-size: 13.5px;
  box-shadow: none !important;
}
.modal .form-control:focus {
  border-color: #00a8c9 !important;
  box-shadow: 0 0 0 3px rgba(0,168,201,0.10) !important;
}
.modal textarea.form-control { height: auto; padding-top: 10px; }
.modal select.form-control { color: #374151 !important; font-weight: normal !important; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .filter-form { flex-direction: column; }
  .welcome-banner { flex-direction: column; text-align: center; }
  .filter-field { min-width: 100%; }
}
