/* =========================================================
   PHPMaker 2024 — GitHub-like Theme (Light / Dark)
   Global custom.css
   ========================================================= */

/* ================================
   DESIGN TOKENS
   ================================ */
:root {
  --gh-font: -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans", Helvetica, Arial, sans-serif;

  --gh-radius: 0px;
  --gh-radius-lg: 12px;
}

/* ---------- LIGHT ---------- */
[data-bs-theme="light"] {
  --gh-bg: #ffffff;
  --gh-canvas: #f6f8fa;
  --gh-surface: #ffffff;
  --gh-surface-2: #f6f8fa;

  --gh-border: #d0d7de;
  --gh-border-muted: rgba(208, 215, 222, .7);

  --gh-text: #1f2328;
  --gh-muted: #656d76;

  --gh-link: #0969da;
  --gh-focus: rgba(9, 105, 218, .30);

  --gh-primary: #1f883d;
  --gh-primary-hover: #1a7f37;
  --gh-danger: #cf222e;
  --gh-warning: #9a6700;
}

/* ---------- DARK ---------- */
[data-bs-theme="dark"] {
  --gh-bg: #0d1117;
  --gh-canvas: #0d1117;
  --gh-surface: #161b22;
  --gh-surface-2: #0d1117;

  --gh-border: #30363d;
  --gh-border-muted: rgba(48, 54, 61, .85);

  --gh-text: #c9d1d9;
  --gh-muted: #8b949e;

  --gh-link: #2f81f7;
  --gh-focus: rgba(47, 129, 247, .35);

  --gh-primary: #238636;
  --gh-primary-hover: #2ea043;
  --gh-danger: #f85149;
  --gh-warning: #d29922;
}

/* ================================
   BASE
   ================================ */
body {
  font-family: var(--gh-font) !important;
  background: var(--gh-bg) !important;
  color: var(--gh-text) !important;
}

a {
  color: var(--gh-link) !important;
}

a:hover {
  text-decoration: underline;
}

/* ================================
   NAVBAR (TOP)
   ================================ */
.main-header.navbar {
  background: var(--gh-surface) !important;
  border-bottom: 1px solid var(--gh-border) !important;
  padding: .35rem .75rem !important;
}

.main-header .nav-link {
  color: var(--gh-text) !important;
  border-radius: var(--gh-radius) !important;
  padding: .45rem .6rem !important;
}

.main-header .nav-link:hover {
  background: rgba(9, 105, 218, .08) !important;
}

/* ================================
   SIDEBAR
   ================================ */
.main-sidebar {
  background: var(--gh-surface-2) !important;
  border-right: 1px solid var(--gh-border) !important;
}

.nav-sidebar {
  padding: .5rem !important;
}

.nav-sidebar .nav-link {
  padding: .42rem .6rem !important;
  font-size: .95rem !important;
  line-height: 1.2 !important;
  color: var(--gh-text) !important;
  border-radius: var(--gh-radius) !important;
}

.nav-sidebar .nav-link:hover {
  background: rgba(9, 105, 218, .08) !important;
}

.nav-sidebar .nav-link.active {
  background: rgba(9, 105, 218, .14) !important;
  border: 1px solid rgba(9, 105, 218, .25) !important;
  position: relative !important;
}

.nav-sidebar .nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: .35rem;
  bottom: .35rem;
  width: 3px;
  background: var(--gh-link);
  border-radius: 999px;
}

/* ================================
   BRAND / LOGO (LIGHT / DARK)
   ================================ */
.brand-link {
  display: flex;
  align-items: center;
  gap: .55rem;
background: #161b22 !important;
  /* background: var(--gh-surface-2) !important; */
  border-bottom: 1px solid var(--gh-border) !important;

  padding: .0rem .75rem;
  min-height: 52px;
}

.brand-link .brand-text {
  font-size: .95rem;
  font-weight: 600;
  color: var(--gh-text);
}

.brand-link .brand-image {
  width: 175px;
  height: 43px;
  object-fit: contain;
  border-radius: 6px;
}

/* Logo switch */
.brand-logo-dark {
  display: none;
}

[data-bs-theme="dark"] .brand-logo-light {
  display: none;
}

[data-bs-theme="dark"] .brand-logo-dark {
  display: inline-block;
}

/* Sidebar collapsed */
.sidebar-collapse .brand-text {
  display: none;
}

.sidebar-collapse .brand-link {
  justify-content: center;
}


/* ================================
   CARDS / GRIDS / MODALS
   ================================ */
.card,
.ew-grid,
.modal-content {
  background: var(--gh-surface) !important;
  border: 1px solid var(--gh-border) !important;
  border-radius: var(--gh-radius-lg) !important;
}

/* ================================
   TABLES
   ================================ */
.table thead th {
  background: var(--gh-surface-2) !important;
  border-bottom: 1px solid var(--gh-border) !important;
  font-weight: 600;
}

.table-hover tbody tr:hover {
  background: rgba(9, 105, 218, .06) !important;
}

/* ================================
   FORMS
   ================================ */
.form-control,
.form-select {
  background: var(--gh-surface) !important;
  border: 1px solid var(--gh-border) !important;
  border-radius: var(--gh-radius) !important;
  color: var(--gh-text) !important;
}

.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 .2rem var(--gh-focus) !important;
  border-color: var(--gh-link) !important;
}

/* ================================
   BUTTONS
   ================================ */
.btn-primary {
  background: var(--gh-primary) !important;
  border-color: var(--gh-primary) !important;
}

.btn-primary:hover {
  background: var(--gh-primary-hover) !important;
}

/* ================================
   BADGES (GitHub-like)
   ================================ */
.badge {
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid var(--gh-border);
}

.badge.bg-primary {
  background: rgba(9, 105, 218, .12) !important;
  color: var(--gh-link) !important;
}

/* ================================
   TABS (Repo-like)
   ================================ */
.nav-tabs {
  border-bottom: 1px solid var(--gh-border);
}

.nav-tabs .nav-link {
  border: 0;
  background: transparent;
  font-weight: 600;
  color: var(--gh-muted);
}

.nav-tabs .nav-link.active::after {
  content: "";
  position: absolute;
  left: .6rem;
  right: .6rem;
  bottom: -1px;
  height: 2px;
  background: var(--gh-link);
  border-radius: 999px;
}

/* ================================
   AVATARS / DROPDOWNS
   ================================ */
img.avatar,
img.rounded-circle {
  border-radius: 999px;
  border: 1px solid var(--gh-border);
}

.dropdown-menu {
  border-radius: var(--gh-radius-lg);
  border: 1px solid var(--gh-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}