/*
=========================================================
 MK2030 ACTIVITY LOG
 File: assets/css/mk-activity-log.css
 Version: 1.0.0
=========================================================
*/

:root {
  --bg: #07111f;
  --panel: rgba(15, 33, 61, 0.95);
  --panel2: rgba(24, 46, 79, 0.9);
  --line: rgba(255, 255, 255, 0.1);

  --text: #f7f9ff;
  --muted: #9eafc9;

  --mint: #64ffda;
  --purple: #7f5af0;
  --pink: #f0aaff;
  --blue: #6ab7ff;
  --gold: #ffd166;
  --danger: #ff7b93;
  --success: #4ce0a1;

  --radius: 24px;

  --shadow:
    0 24px 70px rgba(0, 0, 0, 0.35);

  --ease:
    transform 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;

  color: var(--text);

  font-family:
    Inter,
    "Segoe UI",
    system-ui,
    sans-serif;

  background:
    radial-gradient(
      circle at 10% 3%,
      rgba(127, 90, 240, 0.24),
      transparent 31%
    ),
    radial-gradient(
      circle at 90% 8%,
      rgba(100, 255, 218, 0.12),
      transparent 28%
    ),
    linear-gradient(
      135deg,
      #07111f,
      #10183a 50%,
      #071729
    );
}

body.al-modal-open {
  overflow: hidden;
}

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

button,
select {
  cursor: pointer;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(100, 255, 218, 0.36);
  outline-offset: 3px;
}

.al-header {
  position: sticky;
  top: 0;
  z-index: 100;

  min-height: 78px;
  padding: 13px 28px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;

  border-bottom: 1px solid var(--line);

  background: rgba(3, 9, 20, 0.9);
  backdrop-filter: blur(20px);
}

.al-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.al-brand > span:last-child strong,
.al-brand > span:last-child small {
  display: block;
}

.al-brand small {
  margin-top: 3px;

  color: var(--muted);

  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.al-mark {
  width: 50px;
  height: 50px;

  display: grid;
  place-items: center;

  border-radius: 16px;

  color: #06111e;
  font-weight: 1000;

  background:
    linear-gradient(
      135deg,
      var(--purple),
      var(--pink),
      var(--mint)
    );

  box-shadow:
    0 14px 34px rgba(100, 255, 218, 0.17);
}

.al-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.al-nav a {
  min-height: 39px;
  padding: 0 14px;

  display: inline-flex;
  align-items: center;

  border: 1px solid var(--line);
  border-radius: 999px;

  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);

  font-size: 0.85rem;
  font-weight: 800;

  transition: var(--ease);
}

.al-nav a:hover {
  transform: translateY(-2px);

  color: var(--mint);
  border-color: rgba(100, 255, 218, 0.38);
  background: rgba(100, 255, 218, 0.07);
}

.al-menu {
  display: none;

  min-height: 42px;
  padding: 0 15px;

  border: 1px solid var(--line);
  border-radius: 13px;

  color: var(--text);
  background: rgba(255, 255, 255, 0.055);

  font-weight: 900;
}

.al-shell {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0 88px;

  display: grid;
  gap: 24px;
}

.al-hero {
  position: relative;

  padding: clamp(32px, 5.5vw, 68px);

  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: end;
  gap: 30px;

  overflow: hidden;

  border: 1px solid var(--line);
  border-radius: 34px;

  background:
    radial-gradient(
      circle at 86% 12%,
      rgba(106, 183, 255, 0.14),
      transparent 30%
    ),
    radial-gradient(
      circle at 14% 90%,
      rgba(100, 255, 218, 0.08),
      transparent 35%
    ),
    linear-gradient(
      140deg,
      rgba(21, 30, 71, 0.98),
      rgba(7, 22, 44, 0.96)
    );

  box-shadow: var(--shadow);
}

.al-hero h1 {
  max-width: 960px;
  margin: 0 0 20px;

  font-size: clamp(3rem, 6vw, 5.8rem);
  line-height: 0.94;
  letter-spacing: -0.07em;
}

.al-hero h1 span {
  display: block;

  color: transparent;

  background:
    linear-gradient(
      90deg,
      var(--text),
      var(--pink),
      var(--mint)
    );

  background-clip: text;
  -webkit-background-clip: text;
}

.al-lead {
  max-width: 850px;
  margin: 0;

  color: var(--muted);

  font-size: 1.04rem;
  line-height: 1.8;
}

.al-kicker {
  margin: 0 0 11px;

  color: var(--mint);

  font-size: 0.75rem;
  font-weight: 1000;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.al-actions,
.al-modal-actions,
.al-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.al-actions {
  margin-top: 26px;
}

.al-btn {
  min-height: 46px;
  padding: 0 18px;

  border-radius: 14px;

  font-weight: 1000;

  transition: var(--ease);
}

.al-btn:hover {
  transform: translateY(-2px);
}

.al-btn.primary {
  color: #06111e;

  background:
    linear-gradient(
      90deg,
      var(--purple),
      var(--pink),
      var(--mint)
    );

  box-shadow:
    0 14px 34px rgba(127, 90, 240, 0.22);
}

.al-btn.secondary {
  border: 1px solid var(--line);

  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

.al-btn.secondary:hover {
  color: var(--mint);
  border-color: rgba(100, 255, 218, 0.25);
}

.al-status-card {
  padding: 23px;

  border: 1px solid var(--line);
  border-radius: 26px;

  background: rgba(255, 255, 255, 0.055);
}

.al-live {
  display: flex;
  align-items: center;
  gap: 12px;
}

.al-live > span {
  width: 13px;
  height: 13px;

  border-radius: 50%;

  background: var(--success);

  box-shadow:
    0 0 0 7px rgba(76, 224, 161, 0.09),
    0 0 22px rgba(76, 224, 161, 0.5);

  animation: pulse 2.4s ease-in-out infinite;
}

.al-live strong,
.al-live small {
  display: block;
}

.al-live strong {
  color: var(--mint);
  font-size: 1.3rem;
}

.al-live small {
  margin-top: 3px;
  color: var(--muted);
}

.al-status-card dl {
  margin: 24px 0 0;

  display: grid;
  gap: 12px;
}

.al-status-card dl div {
  padding-top: 12px;

  display: flex;
  justify-content: space-between;
  gap: 14px;

  border-top: 1px solid var(--line);
}

.al-status-card dt {
  color: var(--muted);
  font-weight: 800;
}

.al-status-card dd {
  margin: 0;

  font-weight: 900;
  text-align: right;
}

@keyframes pulse {
  50% {
    opacity: 0.7;
    transform: scale(0.88);
  }
}

.al-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 15px;
}

.al-stats article {
  padding: 21px;

  border: 1px solid var(--line);
  border-radius: 26px;

  background: var(--panel);

  box-shadow: var(--shadow);

  transition: var(--ease);
}

.al-stats article:hover {
  transform: translateY(-3px);
  border-color: rgba(100, 255, 218, 0.22);
}

.al-stats span,
.al-stats strong,
.al-stats small {
  display: block;
}

.al-stats span {
  color: var(--muted);

  font-size: 0.84rem;
  font-weight: 900;
}

.al-stats strong {
  margin-top: 8px;

  color: var(--mint);

  font-size: 2rem;
}

.al-stats small {
  margin-top: 4px;

  color: var(--muted);

  font-size: 0.78rem;
}

.al-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
}

.al-sidebar {
  position: sticky;
  top: 100px;

  display: grid;
  gap: 18px;
}

.al-main {
  min-width: 0;

  display: grid;
  gap: 22px;
}

.al-panel {
  min-width: 0;
  padding: 24px;

  border: 1px solid var(--line);
  border-radius: 26px;

  background:
    linear-gradient(
      145deg,
      rgba(17, 37, 68, 0.97),
      rgba(8, 23, 47, 0.95)
    );

  box-shadow: var(--shadow);
}

.al-panel h2 {
  margin: 0;
}

.al-panel-head {
  margin-bottom: 20px;

  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.al-head-actions {
  align-items: center;
  justify-content: flex-end;
}

.al-head-actions > span {
  color: var(--muted);

  font-size: 0.84rem;
  font-weight: 800;
}

.al-view-list,
.al-range-list,
.al-admin-list {
  display: grid;
  gap: 8px;
  margin-top: 17px;
}

.al-view-list button,
.al-range-list button,
.al-admin-list button {
  min-height: 44px;
  padding: 0 13px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  border: 1px solid transparent;
  border-radius: 13px;

  color: var(--muted);
  background: transparent;

  font-weight: 900;
  text-align: left;

  transition: var(--ease);
}

.al-view-list button:hover,
.al-view-list button.active,
.al-range-list button:hover,
.al-range-list button.active,
.al-admin-list button:hover {
  color: var(--mint);

  border-color: rgba(100, 255, 218, 0.2);
  background: rgba(100, 255, 218, 0.075);
}

.al-view-list b {
  min-width: 29px;
  padding: 4px 7px;

  border-radius: 999px;

  color: var(--text);
  background: rgba(255, 255, 255, 0.075);

  font-size: 0.72rem;
  text-align: center;
}

.al-field {
  margin-top: 17px;

  display: grid;
  gap: 8px;

  color: var(--muted);
  font-weight: 900;
}

.al-field select,
.al-toolbar input,
.al-toolbar select,
.al-date-row input,
.al-note-form input,
.al-note-form select,
.al-note-form textarea {
  width: 100%;

  border: 1px solid var(--line);
  border-radius: 14px;

  color: var(--text);
  background: rgba(255, 255, 255, 0.065);
}

.al-field select {
  min-height: 46px;
  padding: 0 12px;
}

.al-danger {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;

  border-radius: 13px;

  color: #ffffff;

  background:
    linear-gradient(
      90deg,
      #a9294c,
      var(--danger)
    );

  font-weight: 900;
}

.al-toolbar {
  margin-bottom: 17px;

  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 11px;
}

.al-toolbar label {
  flex: 0 1 175px;

  display: grid;
  gap: 7px;
}

.al-toolbar label.wide {
  flex: 1 1 300px;
}

.al-toolbar label > span,
.al-date-row label > span,
.al-note-form label > span {
  color: var(--muted);

  font-size: 0.76rem;
  font-weight: 900;
}

.al-toolbar input,
.al-toolbar select,
.al-date-row input {
  min-height: 44px;
  padding: 0 12px;
}

.al-date-row {
  margin-bottom: 17px;
  padding: 14px;

  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 11px;

  border: 1px solid var(--line);
  border-radius: 15px;

  background: rgba(255, 255, 255, 0.035);
}

.al-date-row label {
  flex: 0 1 200px;

  display: grid;
  gap: 7px;
}

.al-table-wrap {
  width: 100%;
  overflow-x: auto;

  border: 1px solid var(--line);
  border-radius: 18px;
}

.al-table {
  width: 100%;
  min-width: 1260px;

  border-collapse: collapse;
}

.al-table th,
.al-table td {
  padding: 14px;

  border-bottom: 1px solid var(--line);

  text-align: left;
  vertical-align: top;
}

.al-table th {
  position: sticky;
  top: 0;
  z-index: 1;

  color: var(--mint);
  background: #10243f;

  font-size: 0.74rem;
  font-weight: 1000;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.al-table td {
  color: var(--muted);

  font-size: 0.86rem;
  line-height: 1.45;
}

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

.al-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.al-table strong {
  color: var(--text);
}

.al-table button {
  min-height: 35px;
  padding: 0 11px;

  border: 1px solid var(--line);
  border-radius: 10px;

  color: var(--text);
  background: rgba(255, 255, 255, 0.055);

  font-size: 0.76rem;
  font-weight: 900;
}

.al-empty {
  padding: 42px 20px;
  text-align: center;
}

.al-empty h3 {
  margin: 0;
}

.al-empty p {
  color: var(--muted);
}

.al-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 6px 9px;

  border-radius: 999px;

  font-size: 0.7rem;
  font-weight: 1000;
  text-transform: capitalize;
  white-space: nowrap;
}

.severity-info,
.status-recorded {
  color: var(--blue);
  background: rgba(106, 183, 255, 0.12);
}

.severity-success,
.status-completed,
.status-resolved,
.integrity-ok {
  color: var(--success);
  background: rgba(76, 224, 161, 0.12);
}

.severity-warning,
.status-pending {
  color: var(--gold);
  background: rgba(255, 209, 102, 0.12);
}

.severity-critical,
.status-failed,
.integrity-bad {
  color: var(--danger);
  background: rgba(255, 123, 147, 0.12);
}

.category-badge {
  color: var(--pink);
  background: rgba(240, 170, 255, 0.1);
}

.al-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.al-timeline {
  display: grid;
  gap: 11px;
}

.al-timeline article {
  position: relative;

  padding: 15px 15px 15px 52px;

  border: 1px solid var(--line);
  border-radius: 15px;

  background: rgba(255, 255, 255, 0.045);
}

.al-timeline article::before {
  content: "";

  position: absolute;
  top: 18px;
  left: 20px;

  width: 12px;
  height: 12px;

  border-radius: 50%;

  background: var(--mint);

  box-shadow:
    0 0 0 6px rgba(100, 255, 218, 0.08);
}

.al-timeline strong {
  display: block;
}

.al-timeline p {
  margin: 5px 0;

  color: var(--muted);
  line-height: 1.5;
}

.al-timeline footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;

  color: var(--muted);

  font-size: 0.74rem;
}

.al-insights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.al-insights article {
  padding: 16px;

  border: 1px solid var(--line);
  border-radius: 15px;

  background: rgba(255, 255, 255, 0.045);
}

.al-insights span,
.al-insights strong {
  display: block;
}

.al-insights span {
  color: var(--muted);

  font-size: 0.76rem;
  font-weight: 900;
}

.al-insights strong {
  margin-top: 8px;

  color: var(--mint);

  font-size: 1.28rem;
}

.al-closing {
  padding: clamp(34px, 5vw, 66px);

  border: 1px solid var(--line);
  border-radius: 34px;

  background:
    radial-gradient(
      circle at top center,
      rgba(100, 255, 218, 0.1),
      transparent 40%
    ),
    var(--panel);

  text-align: center;

  box-shadow: var(--shadow);
}

.al-closing h2 {
  margin: 0 0 13px;

  font-size: clamp(2rem, 4vw, 3.2rem);
}

.al-closing > p:not(.al-kicker) {
  max-width: 790px;
  margin: 0 auto 23px;

  color: var(--muted);
  line-height: 1.78;
}

.al-modal[hidden] {
  display: none;
}

.al-modal {
  position: fixed;
  inset: 0;
  z-index: 300;

  padding: 22px;

  display: grid;
  place-items: center;
}

.al-backdrop {
  position: absolute;
  inset: 0;

  background: rgba(1, 6, 17, 0.84);
  backdrop-filter: blur(10px);
}

.al-modal-card {
  position: relative;
  z-index: 1;

  width: min(800px, 100%);
  max-height: 90vh;
  overflow-y: auto;

  padding: 30px;

  border: 1px solid var(--line);
  border-radius: 26px;

  background: #10243f;

  box-shadow: var(--shadow);
}

.al-modal-card.wide {
  width: min(1080px, 100%);
}

.al-close {
  position: absolute;
  top: 13px;
  right: 13px;

  width: 42px;
  height: 42px;

  border: 1px solid var(--line);
  border-radius: 50%;

  color: var(--text);
  background: rgba(255, 255, 255, 0.07);

  font-size: 1.45rem;
}

.al-modal-actions {
  margin-top: 20px;
}

.al-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.al-detail-grid article,
.al-detail-box {
  padding: 14px;

  border: 1px solid var(--line);
  border-radius: 14px;

  background: rgba(255, 255, 255, 0.045);
}

.al-detail-grid span,
.al-detail-grid strong {
  display: block;
}

.al-detail-grid span {
  color: var(--muted);

  font-size: 0.74rem;
  font-weight: 900;
}

.al-detail-grid strong {
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.al-detail-box {
  margin-top: 18px;
}

.al-detail-box h3 {
  margin-top: 0;
}

.al-detail-box p {
  color: var(--muted);
  line-height: 1.75;
}

.al-meta-table {
  width: 100%;
  border-collapse: collapse;
}

.al-meta-table th,
.al-meta-table td {
  padding: 10px;

  border-bottom: 1px solid var(--line);

  text-align: left;
  vertical-align: top;
}

.al-meta-table th {
  width: 32%;
  color: var(--mint);
}

.al-meta-table td {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.al-note-form {
  display: grid;
  gap: 16px;
}

.al-note-form label {
  display: grid;
  gap: 8px;

  color: var(--muted);
  font-weight: 900;
}

.al-note-form input,
.al-note-form select {
  min-height: 50px;
  padding: 0 13px;
}

.al-note-form textarea {
  min-height: 140px;
  padding: 13px;

  resize: vertical;
}

.al-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.al-consent {
  padding: 14px;

  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: start;

  border: 1px solid var(--line);
  border-radius: 14px;

  background: rgba(255, 255, 255, 0.045);
}

.al-consent input {
  width: auto;
  min-height: auto;
  margin-top: 4px;

  accent-color: var(--mint);
}

.al-toast {
  position: fixed;
  right: 23px;
  bottom: 23px;
  z-index: 400;

  max-width: min(420px, calc(100% - 46px));

  padding: 16px 19px;

  border: 1px solid var(--line);
  border-radius: 15px;

  color: var(--text);
  background: #132c4c;

  box-shadow: var(--shadow);

  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;

  transition:
    opacity 0.24s ease,
    transform 0.24s ease;
}

.al-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.al-toast[data-type="success"] {
  border-color: rgba(76, 224, 161, 0.4);
}

.al-toast[data-type="warning"] {
  border-color: rgba(255, 209, 102, 0.42);
}

.al-toast[data-type="error"],
.al-toast[data-type="critical"] {
  border-color: rgba(255, 123, 147, 0.42);
}

@media (max-width: 1320px) {
  .al-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .al-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .al-hero,
  .al-layout {
    grid-template-columns: 1fr;
  }

  .al-sidebar {
    position: static;

    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .al-status-card {
    max-width: 680px;
  }
}

@media (max-width: 980px) {
  .al-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .al-menu {
    display: inline-flex;
    align-items: center;
  }

  .al-nav {
    width: 100%;
    display: none;
    justify-content: flex-start;
  }

  .al-nav.open {
    display: flex;
  }

  .al-sidebar {
    grid-template-columns: 1fr;
  }

  .al-two-col {
    grid-template-columns: 1fr;
  }

  .al-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .al-head-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .al-stats,
  .al-form-grid,
  .al-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .al-insights {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .al-shell {
    width: min(100% - 20px, 1500px);
  }

  .al-header {
    padding: 12px;
  }

  .al-nav a {
    flex: 1 1 calc(50% - 9px);
    justify-content: center;
  }

  .al-hero,
  .al-panel,
  .al-modal-card {
    padding: 21px;
  }

  .al-hero h1 {
    font-size: clamp(2.55rem, 14vw, 4rem);
  }

  .al-actions,
  .al-modal-actions,
  .al-head-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .al-actions .al-btn,
  .al-modal-actions .al-btn,
  .al-head-actions .al-btn {
    width: 100%;
  }

  .al-toolbar label,
  .al-toolbar label.wide,
  .al-date-row label {
    flex: 1 1 100%;
  }

  .al-date-row .al-btn {
    width: 100%;
  }
}

@media (max-width: 460px) {
  .al-stats,
  .al-form-grid,
  .al-detail-grid {
    grid-template-columns: 1fr;
  }

  .al-nav a {
    flex-basis: 100%;
  }

  .al-status-card dl div {
    align-items: flex-start;
    flex-direction: column;
  }

  .al-status-card dd {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
