"use client";

import { useEffect, useState } from "react";
import Link from "next/link";

type Skill = {
  id: number;
  name: string;
  category: string | null;
  level: number | null;
  icon: string | null;
};

export default function SkillsAdminPage() {
  const [skills, setSkills] = useState<Skill[]>([]);
  const [loading, setLoading] = useState(true);
  const [sidebarOpen, setSidebarOpen] = useState(false);

  const getSkills = async () => {
    try {
      setLoading(true);

      const response = await fetch("/api/skills", {
        method: "GET",
        cache: "no-store",
      });

      const result = await response.json();

      if (result.success) {
        setSkills(result.data);
      } else {
        console.error(result.message || "Gagal mengambil data Skills");
      }
    } catch (error) {
      console.error("GET SKILLS:", error);
    } finally {
      setLoading(false);
    }
  };

  useEffect(() => {
    getSkills();
  }, []);

  const deleteSkill = async (id: number) => {
    const confirmed = window.confirm(
      "Apakah Anda yakin ingin menghapus Skill ini?"
    );

    if (!confirmed) {
      return;
    }

    try {
      const response = await fetch(`/api/skills?id=${id}`, {
        method: "DELETE",
      });

      const result = await response.json();

      if (!response.ok || !result.success) {
        alert(result.message || "Gagal menghapus Skill");
        return;
      }

      alert("Skill berhasil dihapus");

      await getSkills();
    } catch (error) {
      console.error("DELETE SKILL:", error);
      alert("Terjadi kesalahan saat menghapus Skill");
    }
  };

  const closeSidebar = () => {
    setSidebarOpen(false);
  };

  const activeSkills = skills.filter(
    (skill) => skill.level !== null && skill.level > 0
  ).length;

  const categorizedSkills = skills.filter(
    (skill) => skill.category !== null && skill.category.trim() !== ""
  ).length;

  return (
    <>
      <style>{`
        * {
          box-sizing: border-box;
        }

        html,
        body {
          margin: 0;
          padding: 0;
          max-width: 100%;
          overflow-x: hidden;
        }

        body {
          background: #f5f7fb;
        }

        button,
        a {
          -webkit-tap-highlight-color: transparent;
        }

        .skills-admin-page {
          min-height: 100vh;
          width: 100%;
          background: #f5f7fb;
          color: #1f2937;
        }

        .admin-layout {
          min-height: 100vh;
          width: 100%;
          display: flex;
          position: relative;
        }

        /* =========================================================
           SIDEBAR
        ========================================================= */

        .admin-sidebar {
          width: 270px;
          min-width: 270px;
          height: 100vh;
          position: fixed;
          top: 0;
          left: 0;
          z-index: 1050;
          background: #ffffff;
          border-right: 1px solid #e8ecf1;
          transition: transform 0.3s ease;
        }

        .sidebar-inner {
          height: 100%;
          display: flex;
          flex-direction: column;
          padding: 24px 16px;
          overflow-y: auto;
          overflow-x: hidden;
        }

        .sidebar-brand {
          display: flex;
          align-items: center;
          gap: 12px;
          padding: 4px 10px 28px;
          border-bottom: 1px solid #edf0f4;
          margin-bottom: 22px;
        }

        .brand-icon {
          width: 42px;
          height: 42px;
          min-width: 42px;
          border-radius: 12px;
          display: flex;
          align-items: center;
          justify-content: center;
          background: linear-gradient(
            135deg,
            #198754,
            #20c997
          );
          color: #ffffff;
          font-size: 18px;
          box-shadow: 0 8px 20px rgba(25, 135, 84, 0.2);
        }

        .brand-text {
          min-width: 0;
        }

        .brand-text strong {
          display: block;
          font-size: 16px;
          line-height: 1.2;
          color: #17202a;
        }

        .brand-text span {
          display: block;
          margin-top: 3px;
          font-size: 11px;
          color: #8b95a5;
          font-weight: 600;
          letter-spacing: 0.08em;
          text-transform: uppercase;
        }

        .sidebar-close {
          margin-left: auto;
          border: 0;
          background: transparent;
          color: #7b8492;
          font-size: 17px;
          cursor: pointer;
          padding: 5px;
        }

        .sidebar-section-label {
          padding: 0 12px;
          margin-bottom: 8px;
          color: #9aa3af;
          font-size: 10px;
          font-weight: 700;
          letter-spacing: 0.1em;
        }

        .sidebar-nav {
          display: flex;
          flex-direction: column;
          gap: 4px;
        }

        .sidebar-link {
          display: flex;
          align-items: center;
          gap: 12px;
          min-height: 44px;
          padding: 10px 12px;
          border-radius: 11px;
          color: #697386;
          text-decoration: none;
          font-size: 14px;
          font-weight: 500;
          transition:
            background 0.2s ease,
            color 0.2s ease,
            transform 0.2s ease;
        }

        .sidebar-link:hover {
          background: #f0f8f4;
          color: #198754;
          transform: translateX(2px);
        }

        .sidebar-link.active {
          background: linear-gradient(
            90deg,
            rgba(25, 135, 84, 0.12),
            rgba(25, 135, 84, 0.06)
          );
          color: #198754;
          font-weight: 700;
        }

        .sidebar-link-icon {
          width: 23px;
          min-width: 23px;
          text-align: center;
          font-size: 16px;
          flex-shrink: 0;
        }

        .sidebar-bottom {
          margin-top: auto;
          padding-top: 18px;
          border-top: 1px solid #edf0f4;
        }

        .sidebar-bottom a {
          display: flex;
          align-items: center;
          gap: 10px;
          padding: 11px 12px;
          border-radius: 10px;
          color: #6b7280;
          text-decoration: none;
          font-size: 13px;
          transition: 0.2s ease;
        }

        .sidebar-bottom a:hover {
          background: #f5f7fa;
          color: #198754;
        }

        /* =========================================================
           MAIN
        ========================================================= */

        .admin-main {
          width: calc(100% - 270px);
          margin-left: 270px;
          min-width: 0;
        }

        /* =========================================================
           TOPBAR
        ========================================================= */

        .admin-topbar {
          width: 100%;
          height: 76px;
          background: rgba(255, 255, 255, 0.96);
          border-bottom: 1px solid #e9edf2;
          display: flex;
          align-items: center;
          justify-content: space-between;
          gap: 15px;
          padding: 0 34px;
          position: sticky;
          top: 0;
          z-index: 900;
          backdrop-filter: blur(12px);
        }

        .topbar-left {
          display: flex;
          align-items: center;
          gap: 14px;
          min-width: 0;
        }

        .mobile-menu-button {
          width: 40px;
          height: 40px;
          border: 1px solid #e2e7ed;
          background: #ffffff;
          border-radius: 10px;
          color: #344054;
          font-size: 18px;
          cursor: pointer;
          transition: 0.2s ease;
          flex-shrink: 0;
        }

        .mobile-menu-button:hover {
          background: #f5f8f6;
          color: #198754;
          border-color: #cde5d7;
        }

        .topbar-left > div:last-child {
          min-width: 0;
        }

        .topbar-label {
          color: #9aa3af;
          font-size: 10px;
          font-weight: 700;
          letter-spacing: 0.1em;
          margin-bottom: 3px;
        }

        .topbar-title {
          color: #17202a;
          font-size: 15px;
          font-weight: 700;
          white-space: nowrap;
        }

        .topbar-right {
          display: flex;
          align-items: center;
          gap: 10px;
          flex-shrink: 0;
        }

        .topbar-website,
        .topbar-logout {
          min-height: 40px;
          display: inline-flex;
          align-items: center;
          justify-content: center;
          gap: 8px;
          border-radius: 10px;
          padding: 8px 13px;
          text-decoration: none;
          font-size: 13px;
          font-weight: 600;
          transition: 0.2s ease;
          white-space: nowrap;
        }

        .topbar-website {
          color: #667085;
          border: 1px solid #e4e8ed;
          background: #ffffff;
        }

        .topbar-website:hover {
          color: #198754;
          border-color: #b7ddca;
          background: #f4fbf7;
        }

        .topbar-logout {
          color: #dc3545;
          border: 1px solid #f1c4c9;
          background: #ffffff;
        }

        .topbar-logout:hover {
          background: #fff5f6;
          border-color: #e8aeb5;
        }

        /* =========================================================
           CONTENT
        ========================================================= */

        .admin-content {
          width: 100%;
          max-width: 1550px;
          margin: 0 auto;
          padding: 34px;
          animation: contentEnter 0.45s ease both;
        }

        @keyframes contentEnter {
          from {
            opacity: 0;
            transform: translateY(10px);
          }

          to {
            opacity: 1;
            transform: translateY(0);
          }
        }

        /* =========================================================
           PAGE HEADER
        ========================================================= */

        .page-header {
          display: flex;
          align-items: flex-end;
          justify-content: space-between;
          gap: 25px;
          margin-bottom: 28px;
        }

        .page-header-left {
          min-width: 0;
          flex: 1;
        }

        .page-eyebrow {
          display: flex;
          align-items: center;
          gap: 7px;
          color: #198754;
          font-size: 10px;
          font-weight: 800;
          letter-spacing: 0.11em;
          margin-bottom: 8px;
        }

        .page-eyebrow-dot {
          width: 6px;
          height: 6px;
          border-radius: 50%;
          background: #20c997;
          flex-shrink: 0;
        }

        .page-title-row {
          display: flex;
          align-items: flex-start;
          gap: 15px;
        }

        .page-title-icon {
          width: 56px;
          height: 56px;
          min-width: 56px;
          border-radius: 15px;
          background: linear-gradient(
            135deg,
            rgba(25, 135, 84, 0.13),
            rgba(32, 201, 151, 0.08)
          );
          color: #198754;
          display: flex;
          align-items: center;
          justify-content: center;
          font-size: 23px;
          flex-shrink: 0;
        }

        .page-title {
          margin: 0;
          font-size: clamp(26px, 3vw, 35px);
          font-weight: 800;
          letter-spacing: -0.025em;
          color: #182230;
          line-height: 1.15;
        }

        .page-description {
          margin: 8px 0 0;
          color: #7a8493;
          font-size: 13px;
          line-height: 1.7;
          max-width: 720px;
          text-align: justify;
          text-justify: inter-word;
          overflow-wrap: anywhere;
        }

        .add-button {
          min-height: 46px;
          display: inline-flex;
          align-items: center;
          justify-content: center;
          gap: 8px;
          padding: 10px 17px;
          border-radius: 11px;
          color: #ffffff;
          background: linear-gradient(
            135deg,
            #198754,
            #20a46c
          );
          border: 1px solid #198754;
          text-decoration: none;
          font-size: 13px;
          font-weight: 700;
          white-space: nowrap;
          box-shadow: 0 8px 18px rgba(25, 135, 84, 0.17);
          transition: 0.2s ease;
          flex-shrink: 0;
        }

        .add-button:hover {
          color: #ffffff;
          transform: translateY(-1px);
          box-shadow: 0 11px 23px rgba(25, 135, 84, 0.25);
        }

        /* =========================================================
           SUMMARY
        ========================================================= */

        .summary-grid {
          display: grid;
          grid-template-columns: repeat(3, minmax(0, 1fr));
          gap: 15px;
          margin-bottom: 22px;
        }

        .summary-card {
          min-width: 0;
          background: #ffffff;
          border: 1px solid #e7ebef;
          border-radius: 15px;
          padding: 17px 18px;
          display: flex;
          align-items: center;
          gap: 13px;
          box-shadow:
            0 5px 20px rgba(20, 30, 45, 0.035),
            0 1px 4px rgba(20, 30, 45, 0.025);
          transition:
            transform 0.2s ease,
            box-shadow 0.2s ease;
        }

        .summary-card:hover {
          transform: translateY(-2px);
          box-shadow:
            0 10px 25px rgba(20, 30, 45, 0.06),
            0 2px 7px rgba(20, 30, 45, 0.035);
        }

        .summary-icon {
          width: 42px;
          height: 42px;
          min-width: 42px;
          border-radius: 11px;
          display: flex;
          align-items: center;
          justify-content: center;
          background: #eaf7f0;
          color: #198754;
          font-size: 17px;
          flex-shrink: 0;
        }

        .summary-label {
          color: #929baa;
          font-size: 10px;
          font-weight: 700;
          letter-spacing: 0.04em;
          text-transform: uppercase;
          margin-bottom: 2px;
        }

        .summary-value {
          color: #202b38;
          font-size: 19px;
          font-weight: 800;
        }

        /* =========================================================
           TABLE CARD
        ========================================================= */

        .table-card {
          width: 100%;
          min-width: 0;
          background: #ffffff;
          border: 1px solid #e5e9ee;
          border-radius: 18px;
          overflow: hidden;
          box-shadow:
            0 8px 30px rgba(20, 30, 45, 0.045),
            0 2px 8px rgba(20, 30, 45, 0.025);
        }

        .table-card-header {
          min-height: 72px;
          padding: 16px 22px;
          display: flex;
          align-items: center;
          justify-content: space-between;
          gap: 15px;
          border-bottom: 1px solid #edf0f3;
          background: linear-gradient(
            180deg,
            #ffffff 0%,
            #fcfdfd 100%
          );
        }

        .table-heading-left {
          display: flex;
          align-items: center;
          gap: 12px;
          min-width: 0;
        }

        .table-heading-icon {
          width: 40px;
          height: 40px;
          min-width: 40px;
          border-radius: 10px;
          display: flex;
          align-items: center;
          justify-content: center;
          background: #f0f8f4;
          color: #198754;
          font-size: 17px;
          flex-shrink: 0;
        }

        .table-heading-left > div:last-child {
          min-width: 0;
        }

        .table-heading-title {
          margin: 0;
          color: #202b38;
          font-size: 14px;
          font-weight: 800;
        }

        .table-heading-description {
          margin: 3px 0 0;
          color: #9aa3af;
          font-size: 11px;
          line-height: 1.6;
          text-align: justify;
          text-justify: inter-word;
          overflow-wrap: anywhere;
        }

        .record-count {
          display: inline-flex;
          align-items: center;
          gap: 6px;
          padding: 7px 10px;
          border-radius: 8px;
          background: #f4f7f9;
          color: #697386;
          font-size: 10px;
          font-weight: 700;
          white-space: nowrap;
          flex-shrink: 0;
        }

        /* =========================================================
           DESKTOP TABLE
        ========================================================= */

        .table-scroll {
          width: 100%;
          max-width: 100%;
          overflow-x: auto;
          overflow-y: hidden;
          -webkit-overflow-scrolling: touch;
          scrollbar-width: thin;
        }

        .skills-table {
          width: 100%;
          min-width: 850px;
          margin: 0;
          border-collapse: separate;
          border-spacing: 0;
          table-layout: auto;
        }

        .skills-table thead th {
          padding: 14px 18px;
          background: #f8fafb;
          border-bottom: 1px solid #e8edf1;
          color: #7b8492;
          font-size: 10px;
          font-weight: 800;
          letter-spacing: 0.055em;
          text-transform: uppercase;
          white-space: nowrap;
        }

        .skills-table tbody td {
          padding: 17px 18px;
          border-bottom: 1px solid #edf0f3;
          color: #475467;
          font-size: 12px;
          vertical-align: middle;
        }

        .skills-table tbody tr:last-child td {
          border-bottom: 0;
        }

        .skills-table tbody tr {
          transition: background 0.18s ease;
        }

        .skills-table tbody tr:hover {
          background: #fbfdfc;
        }

        .id-badge {
          display: inline-flex;
          align-items: center;
          justify-content: center;
          min-width: 34px;
          height: 28px;
          padding: 0 8px;
          border-radius: 8px;
          background: #f3f5f7;
          color: #667085;
          font-size: 11px;
          font-weight: 700;
        }

        .skill-name-cell {
          min-width: 200px;
        }

        .skill-name {
          color: #202b38;
          font-size: 13px;
          font-weight: 800;
          line-height: 1.45;
          overflow-wrap: anywhere;
          text-align: justify;
          text-justify: inter-word;
        }

        .skill-icon-text {
          margin-top: 4px;
          color: #9aa3af;
          font-size: 10px;
          line-height: 1.5;
          overflow-wrap: anywhere;
          text-align: justify;
          text-justify: inter-word;
        }

        .category-badge {
          display: inline-flex;
          align-items: center;
          max-width: 190px;
          padding: 7px 10px;
          border-radius: 8px;
          background: #eaf7f0;
          color: #198754;
          font-size: 10px;
          font-weight: 700;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
        }

        .level-wrapper {
          width: 150px;
        }

        .level-top {
          display: flex;
          align-items: center;
          justify-content: space-between;
          gap: 8px;
          margin-bottom: 6px;
        }

        .level-label {
          color: #7b8492;
          font-size: 10px;
          font-weight: 600;
        }

        .level-value {
          color: #198754;
          font-size: 11px;
          font-weight: 800;
        }

        .level-bar {
          width: 100%;
          height: 6px;
          overflow: hidden;
          border-radius: 99px;
          background: #edf1f3;
        }

        .level-progress {
          height: 100%;
          border-radius: inherit;
          background: linear-gradient(
            90deg,
            #198754,
            #20c997
          );
          transition: width 0.5s ease;
        }

        .no-level {
          color: #9aa3af;
          font-size: 11px;
        }

        .action-cell {
          text-align: right;
          white-space: nowrap;
        }

        .action-buttons {
          display: inline-flex;
          align-items: center;
          justify-content: flex-end;
          gap: 7px;
        }

        .action-button {
          min-height: 34px;
          display: inline-flex;
          align-items: center;
          justify-content: center;
          gap: 6px;
          padding: 7px 10px;
          border-radius: 8px;
          background: #ffffff;
          font-size: 10px;
          font-weight: 700;
          cursor: pointer;
          transition: 0.2s ease;
          text-decoration: none;
          white-space: nowrap;
        }

        .edit-button {
          color: #0d6efd;
          border: 1px solid #c9dcfa;
        }

        .edit-button:hover {
          color: #0b5ed7;
          background: #f3f7ff;
          border-color: #9fc2f5;
        }

        .delete-button {
          color: #dc3545;
          border: 1px solid #f1c4c9;
        }

        .delete-button:hover {
          color: #bb2d3b;
          background: #fff5f6;
          border-color: #e8aeb5;
        }

        /* =========================================================
           MOBILE CARD VIEW
        ========================================================= */

        .mobile-skills-list {
          display: none;
        }

        .mobile-skill-card {
          background: #ffffff;
          border: 1px solid #e7ebef;
          border-radius: 14px;
          padding: 15px;
          box-shadow:
            0 4px 16px rgba(20, 30, 45, 0.035),
            0 1px 3px rgba(20, 30, 45, 0.025);
        }

        .mobile-skill-card + .mobile-skill-card {
          margin-top: 10px;
        }

        .mobile-card-top {
          display: flex;
          align-items: center;
          justify-content: space-between;
          gap: 10px;
          padding-bottom: 13px;
          border-bottom: 1px solid #edf0f3;
        }

        .mobile-card-id {
          display: flex;
          align-items: center;
          gap: 8px;
          min-width: 0;
        }

        .mobile-card-id-label {
          color: #9aa3af;
          font-size: 9px;
          font-weight: 700;
          text-transform: uppercase;
          letter-spacing: 0.05em;
        }

        .mobile-card-id-value {
          color: #475467;
          font-size: 11px;
          font-weight: 800;
        }

        .mobile-card-section {
          padding-top: 14px;
        }

        .mobile-card-label {
          display: block;
          color: #9aa3af;
          font-size: 9px;
          font-weight: 800;
          letter-spacing: 0.07em;
          text-transform: uppercase;
          margin-bottom: 6px;
        }

        .mobile-card-name {
          color: #202b38;
          font-size: 14px;
          font-weight: 800;
          line-height: 1.5;
          overflow-wrap: anywhere;
          text-align: justify;
          text-justify: inter-word;
        }

        .mobile-card-icon {
          margin-top: 5px;
          color: #8b95a5;
          font-size: 10px;
          line-height: 1.6;
          overflow-wrap: anywhere;
          text-align: justify;
          text-justify: inter-word;
        }

        .mobile-card-category {
          display: inline-flex;
          max-width: 100%;
          padding: 6px 9px;
          border-radius: 8px;
          background: #eaf7f0;
          color: #198754;
          font-size: 10px;
          line-height: 1.4;
          font-weight: 700;
          overflow-wrap: anywhere;
        }

        .mobile-card-level {
          margin-top: 8px;
        }

        .mobile-level-top {
          display: flex;
          align-items: center;
          justify-content: space-between;
          gap: 10px;
          margin-bottom: 6px;
        }

        .mobile-level-value {
          color: #198754;
          font-size: 11px;
          font-weight: 800;
        }

        .mobile-level-bar {
          width: 100%;
          height: 7px;
          border-radius: 99px;
          overflow: hidden;
          background: #edf1f3;
        }

        .mobile-level-progress {
          height: 100%;
          border-radius: inherit;
          background: linear-gradient(
            90deg,
            #198754,
            #20c997
          );
        }

        .mobile-no-data {
          color: #a0a7b1;
          font-size: 10px;
        }

        .mobile-card-actions {
          display: grid;
          grid-template-columns: 1fr 1fr;
          gap: 8px;
          padding-top: 15px;
          margin-top: 15px;
          border-top: 1px solid #edf0f3;
        }

        .mobile-action-button {
          min-height: 40px;
          display: inline-flex;
          align-items: center;
          justify-content: center;
          gap: 7px;
          padding: 9px 10px;
          border-radius: 9px;
          background: #ffffff;
          text-decoration: none;
          font-size: 11px;
          font-weight: 700;
          cursor: pointer;
          transition: 0.2s ease;
        }

        .mobile-edit-button {
          color: #0d6efd;
          border: 1px solid #c9dcfa;
        }

        .mobile-edit-button:hover {
          color: #0b5ed7;
          background: #f3f7ff;
        }

        .mobile-delete-button {
          color: #dc3545;
          border: 1px solid #f1c4c9;
        }

        .mobile-delete-button:hover {
          color: #bb2d3b;
          background: #fff5f6;
        }

        /* =========================================================
           TABLE FOOTER
        ========================================================= */

        .table-card-footer {
          padding: 13px 20px;
          border-top: 1px solid #edf0f3;
          background: #fcfdfd;
          display: flex;
          align-items: center;
          justify-content: space-between;
          gap: 15px;
          color: #9aa3af;
          font-size: 10px;
        }

        .table-footer-info {
          display: flex;
          align-items: center;
          gap: 7px;
        }

        .table-footer-info i {
          color: #198754;
        }

        .scroll-hint {
          display: none;
          align-items: center;
          gap: 5px;
        }

        /* =========================================================
           LOADING
        ========================================================= */

        .loading-state {
          min-height: 360px;
          display: flex;
          flex-direction: column;
          align-items: center;
          justify-content: center;
          padding: 40px 20px;
        }

        .loading-icon {
          width: 54px;
          height: 54px;
          border-radius: 15px;
          display: flex;
          align-items: center;
          justify-content: center;
          background: #eaf7f0;
          color: #198754;
          margin-bottom: 15px;
        }

        .loading-state p {
          color: #7a8493;
          font-size: 12px;
          margin: 0;
          text-align: justify;
          text-justify: inter-word;
        }

        /* =========================================================
           EMPTY STATE
        ========================================================= */

        .empty-state {
          min-height: 360px;
          display: flex;
          flex-direction: column;
          align-items: center;
          justify-content: center;
          padding: 40px 20px;
          text-align: center;
        }

        .empty-icon {
          width: 65px;
          height: 65px;
          border-radius: 18px;
          display: flex;
          align-items: center;
          justify-content: center;
          background: #fff7e6;
          color: #d99a00;
          font-size: 25px;
          margin-bottom: 17px;
        }

        .empty-title {
          margin: 0 0 6px;
          color: #263241;
          font-size: 16px;
          font-weight: 800;
        }

        .empty-description {
          max-width: 430px;
          margin: 0 0 18px;
          color: #929baa;
          font-size: 11px;
          line-height: 1.65;
          text-align: justify;
          text-justify: inter-word;
          overflow-wrap: anywhere;
        }

        .empty-button {
          min-height: 40px;
          display: inline-flex;
          align-items: center;
          gap: 7px;
          padding: 8px 13px;
          border-radius: 9px;
          background: #198754;
          border: 1px solid #198754;
          color: #ffffff;
          text-decoration: none;
          font-size: 11px;
          font-weight: 700;
        }

        .empty-button:hover {
          color: #ffffff;
          background: #157347;
        }

        /* =========================================================
           PAGE FOOTER
        ========================================================= */

        .admin-page-footer {
          padding: 20px 2px 5px;
          display: flex;
          align-items: center;
          justify-content: space-between;
          gap: 15px;
          color: #9aa3af;
          font-size: 10px;
        }

        .admin-page-footer div {
          display: flex;
          align-items: center;
          gap: 7px;
        }

        .admin-page-footer i {
          color: #198754;
        }

        .admin-page-footer a {
          display: inline-flex;
          align-items: center;
          color: #7b8492;
          text-decoration: none;
          font-weight: 600;
        }

        .admin-page-footer a:hover {
          color: #198754;
        }

        /* =========================================================
           SIDEBAR OVERLAY
        ========================================================= */

        .sidebar-overlay {
          display: none;
        }

        /* =========================================================
           LARGE DESKTOP
        ========================================================= */

        @media (max-width: 1399.98px) {
          .admin-content {
            padding: 30px;
          }

          .skills-table {
            min-width: 820px;
          }
        }

        /* =========================================================
           TABLET / LAPTOP
        ========================================================= */

        @media (max-width: 1199.98px) {
          .admin-content {
            padding: 28px;
          }

          .page-header {
            align-items: flex-start;
          }

          .summary-grid {
            grid-template-columns: repeat(3, minmax(0, 1fr));
          }

          .skills-table {
            min-width: 800px;
          }
        }

        /* =========================================================
           MOBILE SIDEBAR
        ========================================================= */

        @media (max-width: 991.98px) {
          .admin-sidebar {
            transform: translateX(-100%);
            box-shadow: 15px 0 40px rgba(20, 30, 45, 0.1);
          }

          .admin-sidebar.open {
            transform: translateX(0);
          }

          .admin-main {
            width: 100%;
            margin-left: 0;
          }

          .sidebar-overlay {
            position: fixed;
            inset: 0;
            z-index: 1040;
            display: block;
            background: rgba(15, 23, 42, 0.35);
            backdrop-filter: blur(2px);
          }

          .admin-topbar {
            padding: 0 24px;
          }

          .page-header {
            flex-direction: column;
            align-items: stretch;
          }

          .add-button {
            align-self: flex-start;
          }
        }

        /* =========================================================
           TABLET
        ========================================================= */

        @media (max-width: 767.98px) {
          .admin-topbar {
            height: 68px;
            padding: 0 16px;
          }

          .topbar-title {
            font-size: 13px;
          }

          .admin-content {
            width: 100%;
            max-width: 100%;
            padding: 22px 16px;
          }

          .page-header {
            margin-bottom: 22px;
          }

          .page-title-row {
            gap: 12px;
          }

          .page-title-icon {
            width: 48px;
            height: 48px;
            min-width: 48px;
            border-radius: 13px;
            font-size: 20px;
          }

          .page-title {
            font-size: 26px;
          }

          .page-description {
            font-size: 11px;
            line-height: 1.7;
            text-align: justify;
            text-justify: inter-word;
          }

          .add-button {
            width: 100%;
            min-height: 44px;
          }

          .summary-grid {
            grid-template-columns: 1fr;
            gap: 10px;
            margin-bottom: 17px;
          }

          .summary-card {
            padding: 14px;
          }

          .table-card {
            border-radius: 15px;
          }

          .table-card-header {
            padding: 15px 16px;
            min-height: 65px;
          }

          .table-heading-icon {
            width: 37px;
            height: 37px;
            min-width: 37px;
          }

          .table-heading-title {
            font-size: 13px;
          }

          .table-heading-description {
            font-size: 10px;
            text-align: justify;
            text-justify: inter-word;
          }

          .record-count {
            padding: 6px 8px;
            font-size: 9px;
          }

          .skills-table {
            min-width: 790px;
          }

          .skills-table thead th {
            padding: 12px 14px;
          }

          .skills-table tbody td {
            padding: 14px;
          }

          .scroll-hint {
            display: inline-flex;
          }

          .table-card-footer {
            padding: 11px 14px;
            align-items: flex-start;
            flex-direction: column;
            gap: 6px;
          }

          .admin-page-footer {
            flex-direction: column;
            align-items: flex-start;
            padding-top: 17px;
          }
        }

        /* =========================================================
           MOBILE
        ========================================================= */

        @media (max-width: 575.98px) {
          .admin-content {
            padding: 19px 12px;
          }

          .admin-topbar {
            padding-left: 12px;
            padding-right: 12px;
          }

          .topbar-left {
            gap: 9px;
          }

          .topbar-right {
            gap: 6px;
          }

          .topbar-website,
          .topbar-logout {
            width: 38px;
            height: 38px;
            min-height: 38px;
            padding: 0;
            border-radius: 9px;
          }

          .mobile-menu-button {
            width: 38px;
            height: 38px;
          }

          .page-title-row {
            align-items: flex-start;
            gap: 10px;
          }

          .page-title-icon {
            width: 43px;
            height: 43px;
            min-width: 43px;
            border-radius: 11px;
            font-size: 17px;
          }

          .page-title {
            font-size: 23px;
          }

          .page-description {
            font-size: 10px;
            line-height: 1.7;
            text-align: justify;
            text-justify: inter-word;
          }

          .summary-card {
            border-radius: 12px;
          }

          .summary-icon {
            width: 38px;
            height: 38px;
            min-width: 38px;
          }

          .summary-value {
            font-size: 17px;
          }

          .table-card {
            overflow: hidden;
          }

          .table-card-header {
            padding: 14px;
          }

          .table-heading-description {
            display: none;
          }

          .record-count {
            display: none;
          }

          .table-scroll {
            display: none;
          }

          .mobile-skills-list {
            display: block;
            padding: 12px;
            background: #f9fafb;
          }

          .mobile-skill-card {
            padding: 14px;
            border-radius: 13px;
          }

          .mobile-card-name {
            font-size: 13px;
            text-align: justify;
            text-justify: inter-word;
          }

          .mobile-card-icon {
            font-size: 10px;
            line-height: 1.7;
            text-align: justify;
            text-justify: inter-word;
          }

          .mobile-card-label {
            font-size: 8px;
          }

          .mobile-card-category {
            font-size: 9px;
          }

          .mobile-card-actions {
            grid-template-columns: 1fr 1fr;
          }

          .mobile-action-button {
            min-height: 40px;
            font-size: 10px;
          }

          .table-card-footer {
            padding: 11px 14px;
          }

          .scroll-hint {
            display: none;
          }
        }

        /* =========================================================
           EXTRA SMALL
        ========================================================= */

        @media (max-width: 399.98px) {
          .topbar-title {
            max-width: 130px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
          }

          .page-title {
            font-size: 21px;
          }

          .page-title-icon {
            width: 40px;
            height: 40px;
            min-width: 40px;
          }

          .admin-content {
            padding-left: 10px;
            padding-right: 10px;
          }

          .mobile-skills-list {
            padding: 9px;
          }

          .mobile-skill-card {
            padding: 12px;
          }

          .mobile-card-top {
            gap: 6px;
          }

          .mobile-card-actions {
            gap: 6px;
          }

          .mobile-action-button {
            min-height: 38px;
            padding-left: 7px;
            padding-right: 7px;
          }
        }

        /* =========================================================
           VERY SMALL SCREEN
        ========================================================= */

        @media (max-width: 340px) {
          .admin-content {
            padding-left: 8px;
            padding-right: 8px;
          }

          .topbar-title {
            max-width: 105px;
          }

          .page-title {
            font-size: 19px;
          }

          .page-description {
            font-size: 9px;
            text-align: justify;
            text-justify: inter-word;
          }

          .mobile-skills-list {
            padding: 7px;
          }

          .mobile-skill-card {
            padding: 11px;
          }

          .mobile-card-name {
            font-size: 12px;
            text-align: justify;
            text-justify: inter-word;
          }

          .mobile-card-actions {
            grid-template-columns: 1fr;
          }
        }

        /* =========================================================
           REDUCED MOTION
        ========================================================= */

        @media (prefers-reduced-motion: reduce) {
          .skills-admin-page *,
          .skills-admin-page *::before,
          .skills-admin-page *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
          }
        }
      `}</style>

      <div className="skills-admin-page">
        <div className="admin-layout">

          {/* =====================================================
              MOBILE OVERLAY
          ===================================================== */}

          {sidebarOpen && (
            <div
              className="sidebar-overlay"
              onClick={closeSidebar}
              aria-hidden="true"
            />
          )}

          {/* =====================================================
              SIDEBAR
          ===================================================== */}

          <aside
            className={`admin-sidebar ${
              sidebarOpen ? "open" : ""
            }`}
          >
            <div className="sidebar-inner">

              <div className="sidebar-brand">

                <div className="brand-icon">
                  <i className="bi bi-grid-1x2-fill"></i>
                </div>

                <div className="brand-text">
                  <strong>GloVaTech</strong>
                  <span>Admin Panel</span>
                </div>

                <button
                  type="button"
                  className="sidebar-close d-lg-none"
                  onClick={closeSidebar}
                  aria-label="Close sidebar"
                >
                  <i className="bi bi-x-lg"></i>
                </button>

              </div>

              {/* MAIN MENU */}

              <div className="sidebar-section-label">
                MAIN MENU
              </div>

              <nav className="sidebar-nav">

                <Link
                  href="/secure-panel"
                  className="sidebar-link"
                  onClick={closeSidebar}
                >
                  <span className="sidebar-link-icon">
                    <i className="bi bi-speedometer2"></i>
                  </span>

                  <span>Dashboard</span>
                </Link>

              </nav>

              {/* CONTENT */}

              <div className="sidebar-section-label mt-4">
                CONTENT
              </div>

              <nav className="sidebar-nav">

                {/* HERO */}

                <Link
                  href="/secure-panel/hero"
                  className="sidebar-link"
                  onClick={closeSidebar}
                >
                  <span className="sidebar-link-icon">
                    <i className="bi bi-stars"></i>
                  </span>

                  <span>Hero</span>
                </Link>

                {/* ABOUT */}

                <Link
                  href="/secure-panel/about"
                  className="sidebar-link"
                  onClick={closeSidebar}
                >
                  <span className="sidebar-link-icon">
                    <i className="bi bi-person-vcard"></i>
                  </span>

                  <span>About</span>
                </Link>

                {/* STATS */}

                <Link
                  href="/secure-panel/about/stats"
                  className="sidebar-link"
                  onClick={closeSidebar}
                >
                  <span className="sidebar-link-icon">
                    <i className="bi bi-bar-chart-line"></i>
                  </span>

                  <span>Stats</span>
                </Link>

                {/* EDUCATION */}

                <Link
                  href="/secure-panel/education"
                  className="sidebar-link"
                  onClick={closeSidebar}
                >
                  <span className="sidebar-link-icon">
                    <i className="bi bi-mortarboard"></i>
                  </span>

                  <span>Education</span>
                </Link>

                {/* SKILLS */}

                <Link
                  href="/secure-panel/skills"
                  className="sidebar-link active"
                  onClick={closeSidebar}
                >
                  <span className="sidebar-link-icon">
                    <i className="bi bi-tools"></i>
                  </span>

                  <span>Skills</span>
                </Link>

                {/* EXPERIENCE */}

                <Link
                  href="/secure-panel/experience"
                  className="sidebar-link"
                  onClick={closeSidebar}
                >
                  <span className="sidebar-link-icon">
                    <i className="bi bi-briefcase"></i>
                  </span>

                  <span>Experience</span>
                </Link>

                {/* PROJECTS */}

                <Link
                  href="/secure-panel/projects"
                  className="sidebar-link"
                  onClick={closeSidebar}
                >
                  <span className="sidebar-link-icon">
                    <i className="bi bi-code-square"></i>
                  </span>

                  <span>Projects</span>
                </Link>

                {/* CERTIFICATION */}

                <Link
                  href="/secure-panel/certifications"
                  className="sidebar-link"
                  onClick={closeSidebar}
                >
                  <span className="sidebar-link-icon">
                    <i className="bi bi-patch-check"></i>
                  </span>

                  <span>Certification</span>
                </Link>

                {/* ACHIEVEMENT */}

                <Link
                  href="/secure-panel/achievements"
                  className="sidebar-link"
                  onClick={closeSidebar}
                >
                  <span className="sidebar-link-icon">
                    <i className="bi bi-trophy"></i>
                  </span>

                  <span>Achievement</span>
                </Link>

                {/* SERVICES */}

                <Link
                  href="/secure-panel/services"
                  className="sidebar-link"
                  onClick={closeSidebar}
                >
                  <span className="sidebar-link-icon">
                    <i className="bi bi-gear-wide-connected"></i>
                  </span>

                  <span>Services</span>
                </Link>

                {/* GALLERY */}

                <Link
                  href="/secure-panel/gallery"
                  className="sidebar-link"
                  onClick={closeSidebar}
                >
                  <span className="sidebar-link-icon">
                    <i className="bi bi-images"></i>
                  </span>

                  <span>Gallery</span>
                </Link>

                {/* CONTACT */}

                <Link
                  href="/secure-panel/contact-info"
                  className="sidebar-link"
                  onClick={closeSidebar}
                >
                  <span className="sidebar-link-icon">
                    <i className="bi bi-person-lines-fill"></i>
                  </span>

                  <span>Contact</span>
                </Link>

                <Link
                  href="/secure-panel/contact-info/list"
                  className="sidebar-link"
                  onClick={closeSidebar}
                >
                  <span className="sidebar-link-icon">
                    <i className="bi bi-share-fill"></i>
                  </span>

                  <span>Contact Social Media</span>
                </Link>

                {/* ARTICLES */}

                <Link
                  href="/secure-panel/articles"
                  className="sidebar-link"
                  onClick={closeSidebar}
                >
                  <span className="sidebar-link-icon">
                    <i className="bi bi-journal-text"></i>
                  </span>

                  <span>Articles</span>
                </Link>

                {/* CONTACT MESSAGES */}

<Link
  href="/secure-panel/contact-messages"
  className="sidebar-link"
  onClick={closeSidebar}
>
  <span className="sidebar-link-icon">
    <i className="bi bi-chat-left-text"></i>
  </span>

  <span>Contact Messages</span>
</Link>

{/* CONTACT USER */}

<Link
  href="/secure-panel/contact-users"
  className="sidebar-link"
  onClick={closeSidebar}
>
  <span className="sidebar-link-icon">
    <i className="bi bi-people-fill"></i>
  </span>

  <span>Contact User</span>
</Link>

              </nav>

              {/* SIDEBAR BOTTOM */}

              <div className="sidebar-bottom">

                <Link
                  href="/"
                  onClick={closeSidebar}
                >
                  <i className="bi bi-globe2"></i>

                  <span>View Website</span>

                  <i className="bi bi-arrow-up-right ms-auto"></i>
                </Link>

              </div>

            </div>
          </aside>

          {/* =====================================================
              MAIN AREA
          ===================================================== */}

          <div className="admin-main">

            {/* TOPBAR */}

            <header className="admin-topbar">

              <div className="topbar-left">

                <button
                  type="button"
                  className="mobile-menu-button d-lg-none"
                  onClick={() => setSidebarOpen(true)}
                  aria-label="Open menu"
                >
                  <i className="bi bi-list"></i>
                </button>

                <div>

                  <div className="topbar-label">
                    ADMIN PANEL
                  </div>

                  <div className="topbar-title">
                    Skills Management
                  </div>

                </div>

              </div>

              <div className="topbar-right">

                <Link
                  href="/"
                  className="topbar-website"
                  title="View Website"
                  aria-label="View Website"
                >
                  <i className="bi bi-globe2"></i>

                  <span className="d-none d-sm-inline">
                    Website
                  </span>
                </Link>

                <Link
                  href="/secure-panel/login"
                  className="topbar-logout"
                  title="Logout"
                  aria-label="Logout"
                >
                  <i className="bi bi-box-arrow-right"></i>

                  <span className="d-none d-sm-inline">
                    Logout
                  </span>
                </Link>

              </div>

            </header>

            {/* ===================================================
                CONTENT
            =================================================== */}

            <main className="admin-content">

              {/* PAGE HEADER */}

              <section className="page-header">

                <div className="page-header-left">

                  <div className="page-eyebrow">
                    <span className="page-eyebrow-dot"></span>
                    CONTENT MANAGEMENT
                  </div>

                  <div className="page-title-row">

                    <div className="page-title-icon">
                      <i className="bi bi-tools"></i>
                    </div>

                    <div>

                      <h1 className="page-title">
                        Skills
                      </h1>

                      <p className="page-description">
                        Kelola kemampuan dan keahlian yang
                        ditampilkan pada website GloVaTech.
                        Atur nama skill, kategori, tingkat
                        kemampuan, serta informasi icon secara
                        terstruktur agar profil keahlian terlihat
                        profesional dan mudah dikelola.
                      </p>

                    </div>

                  </div>

                </div>

                <Link
                  href="/secure-panel/skills/create"
                  className="add-button"
                >
                  <i className="bi bi-plus-lg"></i>

                  <span>
                    Tambah Skill
                  </span>
                </Link>

              </section>

              {/* =================================================
                  SUMMARY
              ================================================= */}

              {!loading && (
                <section className="summary-grid">

                  <div className="summary-card">

                    <div className="summary-icon">
                      <i className="bi bi-tools"></i>
                    </div>

                    <div>

                      <div className="summary-label">
                        Total Skills
                      </div>

                      <div className="summary-value">
                        {skills.length}
                      </div>

                    </div>

                  </div>

                  <div className="summary-card">

                    <div className="summary-icon">
                      <i className="bi bi-bar-chart-line"></i>
                    </div>

                    <div>

                      <div className="summary-label">
                        With Level
                      </div>

                      <div className="summary-value">
                        {activeSkills}
                      </div>

                    </div>

                  </div>

                  <div className="summary-card">

                    <div className="summary-icon">
                      <i className="bi bi-tags"></i>
                    </div>

                    <div>

                      <div className="summary-label">
                        Categorized
                      </div>

                      <div className="summary-value">
                        {categorizedSkills}
                      </div>

                    </div>

                  </div>

                </section>
              )}

              {/* =================================================
                  TABLE CARD
              ================================================= */}

              <section className="table-card">

                {/* TABLE HEADER */}

                <div className="table-card-header">

                  <div className="table-heading-left">

                    <div className="table-heading-icon">
                      <i className="bi bi-list-ul"></i>
                    </div>

                    <div>

                      <h2 className="table-heading-title">
                        Skill Records
                      </h2>

                      <p className="table-heading-description">
                        Daftar kemampuan dan keahlian yang
                        tersimpan pada sistem.
                      </p>

                    </div>

                  </div>

                  {!loading && skills.length > 0 && (
                    <div className="record-count">

                      <i className="bi bi-database"></i>

                      {skills.length} Record

                    </div>
                  )}

                </div>

                {/* =================================================
                    LOADING
                ================================================= */}

                {loading ? (

                  <div className="loading-state">

                    <div className="loading-icon">

                      <span
                        className="spinner-border spinner-border-sm text-success"
                        role="status"
                        aria-hidden="true"
                      ></span>

                    </div>

                    <p>
                      Memuat data Skills...
                    </p>

                  </div>

                ) : skills.length === 0 ? (

                  /* =================================================
                     EMPTY
                  ================================================= */

                  <div className="empty-state">

                    <div className="empty-icon">
                      <i className="bi bi-tools"></i>
                    </div>

                    <h3 className="empty-title">
                      Belum Ada Data Skills
                    </h3>

                    <p className="empty-description">
                      Belum ada kemampuan atau keahlian yang
                      tersimpan. Tambahkan skill pertama untuk
                      mulai mengelola daftar keahlian yang akan
                      ditampilkan pada website.
                    </p>

                    <Link
                      href="/secure-panel/skills/create"
                      className="empty-button"
                    >
                      <i className="bi bi-plus-lg"></i>

                      Tambah Skill
                    </Link>

                  </div>

                ) : (

                  <>

                    {/* =================================================
                        DESKTOP / TABLET TABLE
                    ================================================= */}

                    <div className="table-scroll">

                      <table className="skills-table">

                        <thead>

                          <tr>

                            <th style={{ width: "70px" }}>
                              ID
                            </th>

                            <th>
                              Skill
                            </th>

                            <th style={{ width: "180px" }}>
                              Category
                            </th>

                            <th style={{ width: "200px" }}>
                              Level
                            </th>

                            <th style={{ width: "180px" }}>
                              Aksi
                            </th>

                          </tr>

                        </thead>

                        <tbody>

                          {skills.map((skill) => (

                            <tr key={skill.id}>

                              {/* ID */}

                              <td>

                                <span className="id-badge">
                                  #{skill.id}
                                </span>

                              </td>

                              {/* SKILL */}

                              <td className="skill-name-cell">

                                <div className="skill-name">
                                  {skill.name}
                                </div>

                                {skill.icon && (
                                  <div className="skill-icon-text">
                                    <i className="bi bi-code-square me-1"></i>
                                    {skill.icon}
                                  </div>
                                )}

                              </td>

                              {/* CATEGORY */}

                              <td>

                                {skill.category ? (

                                  <span className="category-badge">
                                    {skill.category}
                                  </span>

                                ) : (

                                  <span className="text-secondary">
                                    —
                                  </span>

                                )}

                              </td>

                              {/* LEVEL */}

                              <td>

                                {skill.level !== null ? (

                                  <div className="level-wrapper">

                                    <div className="level-top">

                                      <span className="level-label">
                                        Proficiency
                                      </span>

                                      <span className="level-value">
                                        {skill.level}%
                                      </span>

                                    </div>

                                    <div className="level-bar">

                                      <div
                                        className="level-progress"
                                        style={{
                                          width: `${Math.min(
                                            Math.max(
                                              skill.level,
                                              0
                                            ),
                                            100
                                          )}%`,
                                        }}
                                      ></div>

                                    </div>

                                  </div>

                                ) : (

                                  <span className="no-level">
                                    —
                                  </span>

                                )}

                              </td>

                              {/* ACTION */}

                              <td className="action-cell">

                                <div className="action-buttons">

                                  <Link
                                    href={`/secure-panel/skills/${skill.id}/edit`}
                                    className="action-button edit-button"
                                    title="Edit Skill"
                                  >

                                    <i className="bi bi-pencil"></i>

                                    <span>
                                      Edit
                                    </span>

                                  </Link>

                                  <button
                                    type="button"
                                    className="action-button delete-button"
                                    title="Hapus Skill"
                                    onClick={() =>
                                      deleteSkill(skill.id)
                                    }
                                  >

                                    <i className="bi bi-trash"></i>

                                    <span>
                                      Hapus
                                    </span>

                                  </button>

                                </div>

                              </td>

                            </tr>

                          ))}

                        </tbody>

                      </table>

                    </div>

                    {/* =================================================
                        MOBILE CARD VIEW
                    ================================================= */}

                    <div className="mobile-skills-list">

                      {skills.map((skill) => (

                        <article
                          key={`mobile-${skill.id}`}
                          className="mobile-skill-card"
                        >

                          {/* TOP */}

                          <div className="mobile-card-top">

                            <div className="mobile-card-id">

                              <span className="mobile-card-id-label">
                                ID
                              </span>

                              <span className="mobile-card-id-value">
                                #{skill.id}
                              </span>

                            </div>

                            {skill.category && (

                              <span className="mobile-card-category">
                                {skill.category}
                              </span>

                            )}

                          </div>

                          {/* SKILL */}

                          <div className="mobile-card-section">

                            <span className="mobile-card-label">
                              Skill
                            </span>

                            <div className="mobile-card-name">
                              {skill.name}
                            </div>

                            {skill.icon && (

                              <div className="mobile-card-icon">

                                <i className="bi bi-code-square"></i>

                                <span className="ms-1">
                                  {skill.icon}
                                </span>

                              </div>

                            )}

                          </div>

                          {/* CATEGORY */}

                          <div className="mobile-card-section">

                            <span className="mobile-card-label">
                              Category
                            </span>

                            {skill.category ? (

                              <span className="mobile-card-category">
                                {skill.category}
                              </span>

                            ) : (

                              <span className="mobile-no-data">
                                —
                              </span>

                            )}

                          </div>

                          {/* LEVEL */}

                          <div className="mobile-card-section">

                            <span className="mobile-card-label">
                              Level
                            </span>

                            {skill.level !== null ? (

                              <div className="mobile-card-level">

                                <div className="mobile-level-top">

                                  <span className="mobile-no-data">
                                    Proficiency
                                  </span>

                                  <span className="mobile-level-value">
                                    {skill.level}%
                                  </span>

                                </div>

                                <div className="mobile-level-bar">

                                  <div
                                    className="mobile-level-progress"
                                    style={{
                                      width: `${Math.min(
                                        Math.max(
                                          skill.level,
                                          0
                                        ),
                                        100
                                      )}%`,
                                    }}
                                  ></div>

                                </div>

                              </div>

                            ) : (

                              <span className="mobile-no-data">
                                Belum ditentukan
                              </span>

                            )}

                          </div>

                          {/* ACTION */}

                          <div className="mobile-card-actions">

                            <Link
                              href={`/secure-panel/skills/${skill.id}/edit`}
                              className="mobile-action-button mobile-edit-button"
                              title="Edit Skill"
                            >

                              <i className="bi bi-pencil"></i>

                              <span>
                                Edit Skill
                              </span>

                            </Link>

                            <button
                              type="button"
                              className="mobile-action-button mobile-delete-button"
                              title="Hapus Skill"
                              onClick={() =>
                                deleteSkill(skill.id)
                              }
                            >

                              <i className="bi bi-trash"></i>

                              <span>
                                Hapus Skill
                              </span>

                            </button>

                          </div>

                        </article>

                      ))}

                    </div>

                  </>

                )}

                {/* =================================================
                    TABLE FOOTER
                ================================================= */}

                {!loading && skills.length > 0 && (

                  <div className="table-card-footer">

                    <div className="table-footer-info">

                      <i className="bi bi-shield-check"></i>

                      <span>
                        Skills Management System
                      </span>

                    </div>

                    <div className="scroll-hint">

                      <i className="bi bi-arrow-left-right"></i>

                      <span>
                        Geser tabel untuk melihat semua kolom
                      </span>

                    </div>

                    <span>
                      {skills.length} data tersimpan
                    </span>

                  </div>

                )}

              </section>

              {/* =================================================
                  PAGE FOOTER
              ================================================= */}

              <footer className="admin-page-footer">

                <div>

                  <i className="bi bi-shield-check"></i>

                  <span>
                    Admin Content Management System
                  </span>

                </div>

                <Link href="/secure-panel">

                  <i className="bi bi-arrow-left me-1"></i>

                  Dashboard

                </Link>

              </footer>

            </main>

          </div>

        </div>
      </div>
    </>
  );
}