﻿:root {
  --bg: #fff8fb;
  --surface: #ffffff;
  --surface-strong: #fdf1f8;
  --border: #f6d8e8;
  --text: #3f233f;
  --muted: #7a4a74;
  --accent: #d12c7a;
  --accent-soft: #f7cce5;
  --positive: #138456;
  --warning: #f08845;
  --danger: #be1b4d;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(145, 48, 109, 0.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; width: 100%; height: 100%; color: var(--text); background: linear-gradient(130deg, #ffe7f5, #fff2fd); font-family: "Inter", "Segoe UI", sans-serif; }
body { min-height: 100vh; }

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

.topnav {
  position: sticky;
  top: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 64px;
  padding: 0 1.25rem;
  background: linear-gradient(90deg, #dc3f8d, #ef8ab5);
  box-shadow: 0 6px 20px rgba(164, 73, 126, 0.38);
}
.topnav .logo { color: #fff; font-size: 1.35rem; font-weight: 900; letter-spacing: 0.06em; }
.topnav .nav-links { display: flex; gap: 0.5rem; }
.topnav .nav-links a { display: inline-flex; align-items: center; gap: 0.3rem; color: #fff; font-weight: 700; border-radius: 999px; padding: 0.5rem 0.9rem; transition: background 0.2s ease; }
.topnav .nav-links a.active, .topnav .nav-links a:hover { background: rgba(255, 255, 255, 0.2); }
.topnav .right-group { display: flex; align-items: center; gap: 0.6rem; color: #fff; font-weight: 700; }
.topnav .logout { background: rgba(255, 255, 255, 0.22); border-radius: 8px; padding: 0.35rem 0.7rem; }

.header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.4rem; }

.main-content { display: flex; flex-direction: column; min-height: calc(100vh - 64px); padding: 1.25rem; gap: 1rem; overflow-y: auto; }
.section-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.15rem; }
.card-title { margin: 0 0 0.6rem; font-size: 1.05rem; color: var(--accent); font-weight: 800; }
.card-value { font-size: 2.15rem; font-weight: 900; color: #6b205f; }

.section-title { margin: 0 0 0.65rem; display: inline-flex; align-items: center; gap: 0.55rem; color: #7f2d63; font-size: 1.06rem; font-weight: 800; }

.action-btn { border: none; background: linear-gradient(90deg, #f47bae, #daa1c4); color: #fff; border-radius: 10px; padding: 0.45rem 0.75rem; font-weight: 700; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.action-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(175, 69, 125, 0.35); }

.action-btn i, .button i { margin-right: 0.45rem; }

.table-wrap { overflow-x: auto; }
.table2 { width: 100%; border-collapse: collapse; min-width: 780px; margin-top: 0.8rem; }
.table2.compact th, .table2.compact td { padding: 0.45rem 0.6rem; }
.table2 th, .table2 td { padding: 0.72rem 0.9rem; border: 1px solid #f4d5e8; }
.table2 th { text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.08em; background: #ffe9f6; color: #8f3d7c; }
.table2 tr.high-risk { border-left: 4px solid #cc2452; box-shadow: inset 2px 0 0 rgba(204, 36, 82, 0.25); }
.table2 tr.status-active { background: rgba(33, 134, 121, 0.05); }
.table2 tr.status-completed { background: rgba(52, 150, 81, 0.08); }
.table2 tr.status-cancelled { background: rgba(198, 30, 70, 0.08); }
.status-icon { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; transition: transform 0.18s ease, color 0.18s ease; }
.status-icon:hover { transform: scale(1.08) translateY(-1px); }
.status-complete { color: #12a459; }
.status-alert { color: #c61d48; }
.status-stable { color: #1f7d58; }
.status-icon { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; }
.status-icon svg { width: 15px; height: 15px; }
.status-complete { color: #12a459; }
.status-alert { color: #c61d48; }
.status-stable { color: #1f7d58; }

.table2 tbody tr { background: #fff; transition: background 0.2s ease; }
.table2 tbody tr:nth-child(odd) { background: #fff7fd; }
.table2 tbody tr:hover { background: #ffe8f6; }
.table2 tbody tr.active { background: #ffdce8; }

.badge, .badge-normal, .badge-high-risk { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 0.2rem 0.6rem; font-size: 0.74rem; font-weight: 700; }
.badge.normal, .badge-normal { background: #daf9eb; color: #0d6f4c; }
.badge.high-risk, .badge-high-risk { background: #ffdbde; color: #c92e53; }

.card .muted { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.875rem; }

.button { border: none; border-radius: 10px; padding: 0.55rem 0.8rem; font-weight: 700; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.button-primary { background: linear-gradient(90deg, #df2f8c, #f286bd); color: #fff; }
.button-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 12px rgba(208, 53, 118, 0.3); }
.button-secondary { background: #ffe6f5; color: #9f4275; }
.button-secondary:hover { background: #ffd3ec; }

.section-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.section-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(209, 44, 122, 0.2);
}

.section-btn i {
  font-size: 1.5rem;
  color: var(--accent);
}

.section-btn span {
  font-size: 0.9rem;
  text-align: center;
}

.form-grid { display: grid; gap: 0.9rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8rem; font-weight: 700; color: #72375c; }
.input, select, textarea { border: 1px solid #f3c9df; border-radius: 8px; padding: 0.55rem 0.7rem; font: inherit; }
.input:focus, select:focus, textarea:focus { outline: 2px solid rgba(225, 67, 127, 0.5); box-shadow: 0 0 0 2px rgba(247, 173, 217, 0.4); }

.modal-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(26, 10, 25, 0.35); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 0.8rem; }
.modal { width: min(740px, 95vw); max-height: 95vh; overflow-y: auto; background: var(--surface); border: 1px solid #f1c9dc; border-radius: var(--radius); box-shadow: 0 24px 40px rgba(91, 52, 94, 0.3); padding: 1.1rem; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.8rem; }
.modal .form-grid { grid-template-columns: 1fr !important; }
.modal-title { margin: 0; font-size: 1.2rem; font-weight: 800; color: #7d1e5f; }
.modal-close { border: none; background: transparent; color: #7a4f72; font-size: 1.3rem; cursor: pointer; }

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(140deg, #ffefff 0%, #fef8ff 100%); }
.login-page .card { width: min(420px, 92vw); padding: 2rem; box-shadow: 0 18px 35px rgba(124, 36, 92, 0.25); border: 1px solid rgba(246, 160, 190, 0.35); background: #fff; border-radius: 16px; }
.login-page h1 { margin: 0 0 0.35rem; font-size: 2rem; color: #c42f74; }
.login-page .subtitle { margin: 0 0 1rem; color: #7a3f71; font-weight: 600; }
.login-page form { display: grid; gap: 0.8rem; }
.login-page label { font-weight: 700; color: #7c4b73; font-size: 0.9rem; }
.login-page input { border: 1px solid #f2c7df; border-radius: 8px; padding: 0.7rem 0.9rem; }
.login-page input:focus { outline: 2px solid rgba(224, 84, 129, 0.4); box-shadow: 0 0 0 3px rgba(253, 204, 229, 0.4); }
.login-page button { background: linear-gradient(90deg, #de2b88, #ec8fbe); color: #fff; border: none; font-weight: 700; border-radius: 8px; padding: 0.75rem 0.9rem; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.login-page button:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(219, 89, 144, 0.3); }
.login-page .hint { margin: 0.9rem 0 0; color: #906677; font-size: 0.85rem; }

@media (max-width: 1000px) {
  .section-row { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .topnav { flex-wrap: wrap; row-gap: 0.6rem; height: auto; padding: 0.75rem; }
}

@media (max-width: 720px) {
  .topnav .nav-links { width: 100%; justify-content: space-evenly; }
  .table2 { min-width: 600px; }
}
