:root {
  --primary: #1f4fd8;
  --primary-dark: #163aa3;
  --secondary: #f7b731;
  --ink: #111827;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --danger: #dc2626;
  --danger-dark: #991b1b;
  --success: #16a34a;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

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

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

code {
  background: #eaf0ff;
  color: var(--primary-dark);
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
  background: rgba(248, 250, 252, 0.86);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.navbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

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

.brand-logo {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), #5b8cff);
  color: #fff;
  font-weight: 900;
  letter-spacing: -0.06em;
  box-shadow: 0 12px 28px rgba(31, 79, 216, 0.28);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

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

.nav-links a {
  padding: 10px 14px;
  border-radius: 999px;
  color: #334155;
  font-weight: 700;
}

.nav-links a:hover {
  color: var(--primary);
  background: #eaf0ff;
}

.nav-links .nav-danger {
  color: var(--danger);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  margin: 4px auto;
  border-radius: 99px;
}

.hero,
.admin-hero {
  padding: 86px 0 70px;
  background:
    radial-gradient(circle at 12% 18%, rgba(31, 79, 216, 0.17), transparent 28%),
    radial-gradient(circle at 82% 22%, rgba(247, 183, 49, 0.26), transparent 26%),
    linear-gradient(180deg, #f8fbff, #f8fafc);
}

.hero-grid,
.admin-hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  align-items: center;
  gap: 46px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 900;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.4rem, 5.4vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.075em;
  margin-bottom: 22px;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.055em;
  margin-bottom: 16px;
}

h3 {
  font-size: 1.12rem;
  line-height: 1.25;
  margin-bottom: 8px;
}

.hero-text,
.section-desc {
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

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

.btn-primary {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 16px 30px rgba(31, 79, 216, 0.24);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.btn-secondary:hover,
.btn-light:hover {
  background: #f1f5f9;
}

.btn-light {
  color: #334155;
  background: #ffffff;
  border: 1px solid var(--line);
}

.btn-danger {
  color: #fff;
  background: var(--danger);
}

.btn-danger:hover {
  background: var(--danger-dark);
}

.btn-small {
  padding: 8px 12px;
  font-size: 0.86rem;
}

.btn-full {
  width: 100%;
}

.hero-card,
.admin-panel-card {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: var(--radius-xl);
  padding: 30px;
  box-shadow: var(--shadow);
}

.card-topline {
  width: 120px;
  height: 10px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  margin-bottom: 22px;
}

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

.admin-stats {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 34px;
}

.stat-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #f8fafc;
}

.stat-card span {
  display: block;
  font-size: 2.2rem;
  font-weight: 950;
  letter-spacing: -0.06em;
}

.stat-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 700;
}

.section {
  padding: 78px 0;
}

.section-muted {
  background: #eef4ff;
}

.two-column,
.guide-grid,
.detail-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 42px;
  align-items: start;
}

.notice {
  margin-top: 24px;
  padding: 18px;
  border-left: 5px solid var(--secondary);
  background: #fff8e7;
  border-radius: 14px;
  color: #5f4200;
}

.portfolio-form,
.detail-card,
.detail-cover-card,
.table-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

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

.form-row {
  margin-bottom: 16px;
}

label {
  display: block;
  margin-bottom: 7px;
  font-weight: 900;
  color: #263246;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  padding: 12px 14px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(31, 79, 216, 0.11);
}

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

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filters {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr auto auto;
  gap: 14px;
  margin-bottom: 24px;
}

.filters .btn {
  min-height: 48px;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.portfolio-card {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.08);
}

.portfolio-cover {
  height: 190px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #dbeafe, #fff7d6);
  color: var(--primary);
  font-size: 2.8rem;
  font-weight: 950;
  letter-spacing: -0.08em;
}

.portfolio-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portfolio-body {
  padding: 18px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eaf0ff;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
}

.badge.yellow {
  color: #7a4b00;
  background: #fff3c7;
}

.badge.soft {
  color: #334155;
  background: #f1f5f9;
}

.portfolio-meta {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 12px;
}

.portfolio-desc {
  color: #475569;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 70px;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.card-actions form {
  margin: 0;
}

.link-karya {
  color: var(--primary);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.delete-card {
  background: transparent;
  color: var(--danger);
  border: 0;
  font-weight: 900;
  cursor: pointer;
}

.empty-state {
  display: none;
  padding: 48px 24px;
  text-align: center;
  border: 2px dashed #b9c7dc;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.58);
}

.empty-state.visible {
  display: block;
}

.guide-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.guide-list article {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
}

.guide-list span {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: #eaf0ff;
  color: var(--primary);
  font-weight: 950;
}

.guide-list p {
  color: var(--muted);
  margin-bottom: 0;
}

.site-footer {
  padding: 28px 0;
  background: #0f172a;
  color: #cbd5e1;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-content p {
  margin-bottom: 0;
}

.footer-content a {
  color: #fff;
  font-weight: 900;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 360px;
  padding: 14px 18px;
  border-radius: 16px;
  background: #0f172a;
  color: #fff;
  box-shadow: var(--shadow);
  transform: translateY(130%);
  transition: transform 0.25s ease;
  z-index: 60;
  font-weight: 800;
}

.toast.show {
  transform: translateY(0);
}

.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 20%, rgba(31, 79, 216, 0.17), transparent 28%),
    radial-gradient(circle at 84% 78%, rgba(247, 183, 49, 0.28), transparent 28%),
    #f8fafc;
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.auth-card {
  width: min(640px, 100%);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 34px;
  box-shadow: var(--shadow);
}

.auth-brand {
  margin-bottom: 28px;
}

.auth-card h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.auth-form {
  margin-top: 24px;
  box-shadow: none;
}

.auth-note {
  margin-bottom: 18px;
}

.admin-label {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--success);
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
}

.admin-heading {
  align-items: center;
}

.table-card {
  padding: 0;
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 940px;
}

.admin-table th,
.admin-table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.admin-table th {
  background: #f8fafc;
  color: #334155;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-table tbody tr:hover {
  background: #fbfdff;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-actions form {
  margin: 0;
}

.empty-table {
  text-align: center;
  color: var(--muted);
  padding: 34px !important;
}

.detail-grid {
  grid-template-columns: 0.78fr 1.22fr;
}

.detail-cover-card {
  position: sticky;
  top: 104px;
}

.detail-cover {
  height: 340px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 18px;
}

.detail-actions {
  display: grid;
  gap: 10px;
}

.detail-actions form {
  margin: 0;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.detail-list div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #f8fafc;
}

.detail-list .full-row {
  grid-column: 1 / -1;
}

.detail-list dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 0;
  font-weight: 800;
}

@media (max-width: 1000px) {
  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 900px) {
  .hero-grid,
  .admin-hero-grid,
  .two-column,
  .guide-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-cover-card {
    position: static;
  }
}

@media (max-width: 680px) {
  .nav-toggle {
    display: block;
  }

  .nav-links:not(.static-links) {
    position: absolute;
    top: 76px;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow);
  }

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

  .nav-links a {
    border-radius: 12px;
  }

  .static-links {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .hero,
  .admin-hero {
    padding-top: 54px;
  }

  .stats-grid,
  .admin-stats,
  .form-grid,
  .portfolio-grid,
  .guide-list,
  .detail-list,
  .filters {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .footer-content {
    align-items: flex-start;
    flex-direction: column;
  }

  .filters .btn,
  .toolbar-actions .btn {
    width: 100%;
  }

  .auth-card {
    padding: 24px;
  }
}

.edit-layout {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 42px;
  align-items: start;
}

.preview-card {
  margin-top: 24px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

.preview-card h2 {
  margin-top: 16px;
  font-size: 1.35rem;
}

.preview-card p {
  color: var(--muted);
  font-weight: 700;
}

.edit-preview-cover {
  height: 260px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.admin-edit-form {
  position: relative;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
  font-weight: 800;
}

.checkbox-row input {
  width: auto;
  min-width: 18px;
  height: 18px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 900px) {
  .edit-layout {
    grid-template-columns: 1fr;
  }
}

.backup-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.inner-form {
  margin-top: 18px;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.backup-result {
  margin-top: 18px;
}

.backup-result ul {
  margin: 10px 0;
  padding-left: 20px;
}

@media (max-width: 900px) {
  .backup-layout {
    grid-template-columns: 1fr;
  }
}
