:root {
  --bg: #f6f3ea;
  --bg-deep: #ece6d9;
  --ink: #172722;
  --muted: #4c5b56;
  --accent: #63b233;
  --accent-2: #1f5f49;
  --card: #ffffff;
  --line: rgba(23, 39, 34, 0.12);
  --shadow: 0 18px 40px rgba(22, 33, 28, 0.12);
  --shadow-soft: 0 10px 24px rgba(22, 33, 28, 0.08);
  --font-base: "Segoe UI", "Tahoma", "Arial", sans-serif;
  --font-title: "Segoe UI", "Tahoma", "Arial", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-base);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 12%, #e7f4d6 0%, transparent 55%),
    radial-gradient(circle at 85% 18%, #dff1f8 0%, transparent 45%),
    linear-gradient(180deg, var(--bg) 0%, #f4f0e7 40%, var(--bg-deep) 100%);
}

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

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(246, 243, 234, 0.88);
  border-bottom: 1px solid var(--line);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  gap: 24px;
}

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

.brand img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(99, 178, 51, 0.3);
  background: #e7f4d6;
}

.brand-title {
  font-family: var(--font-title);
  font-size: 16px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.2px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  transition: all 0.2s ease;
}

.nav-link:hover {
  border-color: var(--line);
  color: var(--ink);
}

.nav-link.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 20px rgba(99, 178, 51, 0.25);
}

.user-area {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notif-wrap {
  position: relative;
}

.icon-button {
  position: relative;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.icon-button .icon {
  font-size: 16px;
}

.notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.notif-badge.hidden {
  display: none;
}

.notif-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 320px;
  max-width: 90vw;
  max-height: 360px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  z-index: 50;
}

.notif-panel.hidden {
  display: none;
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 13px;
}

.notif-list {
  display: grid;
}

.notif-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.notif-item:hover {
  background: #f7f8f2;
}

.notif-title {
  font-size: 13px;
  font-weight: 600;
}

.notif-message {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.notif-time {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

.notif-empty {
  padding: 14px;
  font-size: 12px;
  color: var(--muted);
}

.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 60;
}

.toast {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow-soft);
  min-width: 240px;
  max-width: 320px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.hide {
  opacity: 0;
  transform: translateY(6px);
}

.toast-title {
  font-weight: 600;
  font-size: 13px;
}

.toast-message {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.dtp-wrapper {
  display: flex;
  align-items: center;
  position: relative;
  gap: 8px;
  width: 100%;
}

.js-dtp-full-input {
  flex: 1;
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: #2c2a27;
  box-sizing: border-box;
  font-family: var(--font-base);
}

.dtp-calendar-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f7f2e8;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.dtp-calendar-btn:hover {
  background: #efe6d8;
}

.dtp-error-input {
  border-color: #cc5542;
  box-shadow: 0 0 0 2px rgba(204, 85, 66, 0.15);
}

.dtp-popup {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(23, 27, 21, 0.18);
  padding: 10px;
  z-index: 1000;
  min-width: 240px;
  display: none;
}

.dtp-wrapper.dtp-open .dtp-popup {
  display: block;
}

.dtp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}

.dtp-title {
  font-weight: 600;
}

.dtp-nav-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  padding: 0 6px;
}

.dtp-calendar {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  margin-bottom: 8px;
}

.dtp-calendar th {
  text-align: center;
  padding: 2px;
  font-weight: 500;
  color: var(--muted);
}

.dtp-calendar td {
  width: 14.28%;
  text-align: center;
  padding: 4px 0;
  cursor: pointer;
  border-radius: 6px;
}

.dtp-calendar td.dtp-empty {
  cursor: default;
}

.dtp-calendar td.dtp-day:hover {
  background: #f3ede3;
}

.dtp-calendar td.dtp-day-selected {
  background: #2f6b37;
  color: #fff;
}

.dtp-calendar td.dtp-day-today {
  border: 1px solid #2f6b37;
}

.dtp-time-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 12px;
}

.dtp-time-label {
  color: var(--muted);
}

.dtp-time-hour,
.dtp-time-minute {
  font-size: 12px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.dtp-time-sep {
  font-size: 12px;
  color: var(--muted);
}

.dtp-btn-box {
  text-align: center;
  margin-top: 4px;
}

.dtp-btn {
  font-size: 12px;
  padding: 6px 10px;
  margin: 0 4px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f7f2e8;
  cursor: pointer;
}

.dtp-btn-primary {
  border-color: #2f6b37;
  background: #2f6b37;
  color: #fff;
}

.dtp-btn-primary:hover {
  background: #255b2e;
}

.comment.highlight {
  outline: 2px solid var(--accent);
  box-shadow: 0 0 0 2px rgba(99, 178, 51, 0.25);
}

.user-chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
}

.user-link {
  cursor: pointer;
}

.user-chip span {
  color: var(--muted);
  font-weight: 500;
}

.ghost-button {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.ghost-button:hover {
  border-color: var(--accent);
}

main {
  flex: 1;
  padding: 32px 28px 60px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 24px;
  align-items: center;
}

.card {
  background: var(--card);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.card h1 {
  font-family: var(--font-title);
  font-size: 26px;
  margin: 0 0 12px;
}

.card p {
  margin: 0 0 16px;
  color: var(--muted);
}

.feature-list {
  display: grid;
  gap: 12px;
}

.feature {
  padding: 12px 14px;
  border-radius: 16px;
  background: #f7f8f2;
  border: 1px solid var(--line);
  font-size: 13px;
}

.form {
  display: grid;
  gap: 14px;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  gap: 20px;
}

.card-sub {
  background: #f7f8f2;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}

.tg-link a {
  display: inline-block;
  max-width: 100%;
  word-break: break-all;
}

.tg-command {
  margin-top: 6px;
  font-size: 12px;
}

.tg-command code {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  word-break: break-all;
}

.qr-wrap {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.qr-wrap img {
  width: 220px;
  height: 220px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  object-fit: contain;
}

.value {
  font-size: 13px;
  font-weight: 600;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.field input,
.field select,
.field textarea {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  font-size: 14px;
  font-family: var(--font-base);
  background: #fff;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.row {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.primary-button {
  padding: 12px 18px;
  border-radius: 14px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}

.primary-button:hover {
  background: #56a42b;
}

.secondary-button {
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 600;
  cursor: pointer;
}

.section-title {
  font-family: var(--font-title);
  font-size: 20px;
  margin: 0 0 16px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: #f0f6ec;
  color: #2f5b2a;
  font-weight: 600;
}

.muted {
  color: var(--muted);
}

.card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.panel {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
}

.panel h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.list {
  display: grid;
  gap: 10px;
}

.tech-list {
  word-break: break-word;
}

.list-item {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.comment {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #faf9f5;
  display: grid;
  gap: 6px;
}

.comment.internal {
  border-color: rgba(205, 84, 84, 0.35);
  background: #fff2f2;
}

.comment-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.comment-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
}

.footer {
  padding: 20px 28px 28px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.flash {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #fff;
  padding: 12px 16px;
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
  font-size: 13px;
  z-index: 30;
}

.flash.success {
  border-color: rgba(99, 178, 51, 0.45);
}

.flash.error {
  border-color: rgba(210, 60, 60, 0.45);
}

.attachments-list {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.attachments-preview {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f7f8f2;
}

.attachment-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.attachment-icon {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--muted);
  background: #fff;
}

.attachment-info {
  flex: 1;
  display: grid;
  gap: 2px;
}

.attachment-name {
  font-size: 13px;
  font-weight: 600;
}

.attachment-meta {
  font-size: 12px;
  color: var(--muted);
}

.attachment-block {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.attachment-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.attachment-inline {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent-2);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}

.link-button:hover {
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .topbar {
    flex-wrap: wrap;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  main {
    padding: 24px 18px 48px;
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 14px 16px;
    gap: 12px;
  }

  .brand {
    width: 100%;
  }

  .brand img {
    width: 40px;
    height: 40px;
  }

  .brand-title {
    font-size: 14px;
  }

  .user-area {
    width: 100%;
    margin-left: 0;
  }

  .user-actions {
    flex-wrap: wrap;
    width: 100%;
    justify-content: space-between;
  }

  .nav {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-link {
    white-space: nowrap;
    font-size: 12px;
  }

  main {
    padding: 20px 14px 40px;
  }

  .card,
  .panel {
    padding: 18px;
    border-radius: 18px;
  }

  .section-title {
    font-size: 18px;
  }

  .row {
    grid-template-columns: 1fr;
  }

  .comment-meta {
    flex-wrap: wrap;
  }

  .toast-stack {
    right: 12px;
    left: 12px;
    bottom: 12px;
  }

  .toast {
    max-width: none;
  }
}

@media (max-width: 560px) {
  .icon-button,
  .ghost-button,
  .secondary-button,
  .primary-button {
    width: 100%;
  }

  .user-chip {
    width: 100%;
    text-align: center;
  }

  .notif-panel {
    right: 0;
    left: auto;
  }

  .attachment-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer {
    padding: 16px 16px 22px;
  }
}
