*, *:before, *:after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: rgba(255,255,255,0.92);

  background-image: url('/vipcrm/assets/tiled-squares-dark-background.jpeg');
  background-repeat: repeat;
  background-position: top left;
  background-size: auto;
}

.logo {
  width: 44px; height: 44px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(99,102,241,0.9), rgba(16,185,129,0.85));
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.login-card {
  width: 100%;
  max-width: 500px;
  border-radius: 18px;
  padding: 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}

.login-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.login-brand h1 { margin: 0; font-size: 18px; }
.login-brand p { margin: 3px 0 0; font-size: 13px; color: rgba(255,255,255,0.65); }

.login-form { display: grid; gap: 10px; }
.auth-status { font-size: 12px; color: rgba(255,255,255,0.70); min-height: 16px; }
.login-footnote { margin-top: 12px; font-size: 12px; color: rgba(255,255,255,0.55); }

.app { max-width: 1200px; margin: 0 auto; padding: 28px 18px 48px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { margin: 0; font-size: 18px; letter-spacing: 0.2px; }
.brand p { margin: 2px 0 0; font-size: 13px; color: rgba(255,255,255,0.65); }

.top-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.content { display: grid; gap: 14px; }

.card {
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 4px 4px 10px;
}

.card-header h2 { margin: 0; font-size: 14px; letter-spacing: 0.4px; text-transform: uppercase; color: rgba(255,255,255,0.82); }
.hint { font-size: 12px; color: rgba(255,255,255,0.55); }
.status { font-size: 12px; color: rgba(255,255,255,0.70); }

.filters {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
}

.field { display: grid; gap: 6px; }
.field.actions { align-self: end; }
label { font-size: 12px; color: rgba(255,255,255,0.65); }
input, select, textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
  color: rgba(255,255,255,0.92);
  padding: 10px 10px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: rgba(99,102,241,0.7); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
textarea { resize: vertical; }

.btn {
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.92);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
}
.btn:hover { background: rgba(255,255,255,0.12); }
.btn-primary {
  border-color: rgba(99,102,241,0.55);
  background: linear-gradient(135deg, rgba(99,102,241,0.85), rgba(16,185,129,0.65));
}
.btn-primary:hover { filter: brightness(1.05); }

.table-wrap { overflow: auto; border-radius: 14px; border: 1px solid rgba(255,255,255,0.10); }
.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
  background: rgba(0,0,0,0.18);
}
.table th, .table td { padding: 10px 10px; border-bottom: 1px solid rgba(255,255,255,0.08); vertical-align: top; }
.table th { text-align: left; font-size: 12px; color: rgba(255,255,255,0.70); text-transform: uppercase; letter-spacing: 0.4px; }
.table td { font-size: 13px; color: rgba(255,255,255,0.86); }
.th-actions { width: 160px; }

.row-actions { display: flex; gap: 8px; }
.small-btn {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.92);
  cursor: pointer;
}
.small-btn:hover { background: rgba(255,255,255,0.12); }
.small-btn.danger { border-color: rgba(239,68,68,0.55); }

.modal.hidden { display: none; }
.modal { position: fixed; inset: 0; z-index: 50; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.modal-panel {
  position: relative;
  margin: 40px auto;
  width: min(860px, calc(100% - 24px));
  border-radius: 18px;
  background: rgba(15, 18, 31, 0.92);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 30px 90px rgba(0,0,0,0.6);
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
.modal-header h3 { margin: 0; font-size: 15px; }
.icon-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.92);
  cursor: pointer;
  font-size: 18px;
}
.modal-body { padding: 14px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.span-2 { grid-column: span 2; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 10px; }

@media (max-width: 1050px) { .filters { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 720px) {
  .topbar { flex-direction: column; align-items: stretch; }
  .top-actions { justify-content: flex-end; }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
}
