@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap");

:root {
  --erp-bg: #f4f7fb;
  --erp-bg-deep: #eaf1f8;
  --erp-surface: rgba(255, 255, 255, 0.88);
  --erp-surface-strong: rgba(255, 255, 255, 0.96);
  --erp-border: rgba(148, 163, 184, 0.18);
  --erp-border-strong: rgba(71, 85, 105, 0.18);
  --erp-text: #102038;
  --erp-text-soft: #62748b;
  --erp-title: #071224;
  --erp-accent: #31c5d7;
  --erp-accent-2: #7c72ff;
  --erp-accent-3: #59d9a5;
  --erp-danger: #ef6b73;
  --erp-warning: #f7b84b;
  --erp-shadow-lg: 0 28px 80px rgba(15, 23, 42, 0.12);
  --erp-shadow-md: 0 18px 44px rgba(15, 23, 42, 0.08);
  --erp-shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.06);
  --page-radius: 28px;
  --card-radius: 22px;
  --field-radius: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--erp-text);
  background:
    radial-gradient(circle at top left, rgba(49, 197, 215, 0.14), transparent 24%),
    radial-gradient(circle at top right, rgba(124, 114, 255, 0.12), transparent 22%),
    radial-gradient(circle at bottom left, rgba(89, 217, 165, 0.12), transparent 24%),
    linear-gradient(180deg, #f9fbfd 0%, var(--erp-bg) 46%, var(--erp-bg-deep) 100%);
  background-attachment: fixed;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.36), transparent 28%),
    repeating-linear-gradient(
      90deg,
      rgba(15, 23, 42, 0.018) 0,
      rgba(15, 23, 42, 0.018) 1px,
      transparent 1px,
      transparent 96px
    );
  opacity: 0.45;
}

button {
  cursor: pointer;
  font: inherit;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

input,
textarea,
select {
  outline: none;
}

a {
  color: inherit;
}

.content {
  margin-left: 320px;
  margin-top: 104px;
  padding: 28px;
  position: relative;
  z-index: 1;
  transition: margin-left 0.28s ease, padding 0.28s ease;
}

body.sidebar-mini-layout .content {
  margin-left: 136px;
}

.dashboard-cards,
.issue-options {
  display: grid;
  gap: 18px;
}

.dashboard-cards {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 20px;
}

.card,
.form-box,
.issue-card,
.modal-box {
  position: relative;
  overflow: hidden;
  border-radius: var(--card-radius);
  border: 1px solid var(--erp-border);
  background:
    linear-gradient(180deg, var(--erp-surface-strong), rgba(248, 250, 252, 0.92));
  box-shadow: var(--erp-shadow-sm);
}

.card,
.form-box,
.issue-card {
  padding: 20px;
}

.card::before,
.form-box::before,
.issue-card::before,
.modal-box::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgba(49, 197, 215, 0.12), transparent 30%),
    radial-gradient(circle at bottom right, rgba(89, 217, 165, 0.1), transparent 24%);
  opacity: 0.7;
}

.card > *,
.form-box > *,
.issue-card > *,
.modal-box > * {
  position: relative;
  z-index: 1;
}

.card h3 {
  margin: 0;
  color: var(--erp-text-soft);
  font-size: 14px;
  font-weight: 700;
}

.card p {
  margin: 10px 0 0;
  color: var(--erp-title);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.form-box {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

.form-box input,
.form-box select,
.form-box textarea,
.modal-box input,
.modal-box select,
.modal-box textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--field-radius);
  background: rgba(255, 255, 255, 0.9);
  color: var(--erp-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.form-box input:focus,
.form-box select:focus,
.form-box textarea:focus,
.modal-box input:focus,
.modal-box select:focus,
.modal-box textarea:focus {
  border-color: rgba(49, 197, 215, 0.42);
  box-shadow: 0 0 0 4px rgba(49, 197, 215, 0.12);
}

textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  resize: vertical;
}

.table,
.data-table {
  width: 100%;
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--erp-surface-strong);
  border: 1px solid var(--erp-border);
  border-radius: var(--card-radius);
  box-shadow: var(--erp-shadow-sm);
}

.table th,
.table td,
.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
}

.table th,
.data-table th {
  position: sticky;
  top: 0;
  background:
    linear-gradient(135deg, #0f172a 0%, #18324a 100%);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table td,
.data-table td {
  color: var(--erp-text);
  border-bottom: 1px solid rgba(226, 232, 240, 0.92);
}

.table tr:last-child td,
.data-table tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover,
.data-table tbody tr:hover {
  background: rgba(241, 245, 249, 0.8);
}

.btn-primary,
.btn-secondary {
  border: none;
  border-radius: 14px;
  padding: 10px 16px;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.btn-primary {
  color: #052c3b;
  background: linear-gradient(135deg, #6ae7f8 0%, #a8f5d1 100%);
  box-shadow: 0 14px 28px rgba(49, 197, 215, 0.22);
}

.btn-secondary {
  color: var(--erp-text);
  background: rgba(226, 232, 240, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.btn-primary:hover,
.btn-secondary:hover,
.issue-card:hover {
  transform: translateY(-2px);
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  padding: 24px;
  background: rgba(7, 18, 36, 0.42);
  backdrop-filter: blur(10px);
  justify-content: center;
  align-items: center;
  z-index: 1500;
}

.modal.show {
  display: flex;
}

.modal-box {
  width: min(100%, 520px);
  max-height: min(88vh, 860px);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.issue-card {
  margin: 15px 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.issue-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 15px;
}

.chat-container {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  height: min(80vh, 860px);
  border-radius: 24px;
  border: 1px solid var(--erp-border);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--erp-shadow-md);
}

.chat-users {
  border-right: 1px solid rgba(226, 232, 240, 0.95);
  overflow: auto;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.92));
}

.chat-users div {
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.chat-users div:hover {
  background: rgba(255, 255, 255, 0.82);
}

.chat-box {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  overflow: auto;
  padding: 18px;
  background:
    radial-gradient(circle at top right, rgba(49, 197, 215, 0.08), transparent 24%),
    linear-gradient(180deg, #fcfdff 0%, #f7fafc 100%);
}

.chat-input {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid rgba(226, 232, 240, 0.92);
  background: rgba(255, 255, 255, 0.85);
}

.chat-input input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(248, 250, 252, 0.9);
}

.chat-input button {
  padding: 12px 18px;
  border: none;
  border-radius: 16px;
  color: #082f49;
  background: linear-gradient(135deg, #6ae7f8 0%, #a8f5d1 100%);
}

.me,
.other {
  max-width: min(72%, 520px);
  margin: 6px 0;
  padding: 10px 12px;
  border-radius: 16px;
  display: inline-block;
  line-height: 1.5;
}

.me {
  margin-left: auto;
  text-align: left;
  color: #083344;
  background: linear-gradient(135deg, rgba(106, 231, 248, 0.96), rgba(168, 245, 209, 0.96));
}

.other {
  color: var(--erp-text);
  background: rgba(226, 232, 240, 0.86);
}

.notif-badge {
  background: linear-gradient(135deg, #ef4444, #fb7185);
  color: white;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
}

@media (max-width: 1280px) {
  .content {
    margin-left: 300px;
    padding: 22px;
  }
}

@media (max-width: 1024px) {
  .content,
  body.sidebar-mini-layout .content {
    margin-left: 0;
    padding: 18px;
  }

  .chat-container {
    grid-template-columns: 1fr;
    height: auto;
  }

  .chat-users {
    max-height: 240px;
    border-right: 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
  }
}

@media (max-width: 700px) {
  .content {
    margin-top: 92px;
    padding: 14px;
  }

  .card,
  .form-box,
  .issue-card,
  .modal-box {
    border-radius: 18px;
  }

  .issue-options,
  .dashboard-cards {
    grid-template-columns: 1fr;
  }

  .table,
  .data-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .modal {
    padding: 12px;
  }

  .modal-box {
    width: 100%;
    padding: 18px;
  }

  .page-actions,
  .modal-actions,
  .chat-input {
    flex-direction: column;
  }

  .chat-input button {
    width: 100%;
  }

  .me,
  .other {
    max-width: 92%;
  }
}
