/*
Theme Name: Personal Organiser
Theme URI: https://example.org/personal-organiser
Author: Personal Organiser
Author URI: https://example.org
Description: A professional personal-organiser theme built around modular workspaces. Ships with two modules: Overview (landing) and Collection (a comprehensive database for Australian and world Coins, Banknotes & Stamps, with popup-driven item management). Designed to be extended with further modules.
Version: 1.0.5
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: personal-organiser
Tags: one-column, custom-colors, custom-menu, featured-images, threaded-comments
*/

/* ==========================================================================
   1. Design tokens
   ========================================================================== */

:root {
  /* Palette — deep navy & antique gold */
  --navy-950: #0a1526;
  --navy-900: #0d1a2c;
  --navy-800: #132238;
  --navy-700: #1b2f4d;
  --navy-600: #27405f;

  --gold-600: #a3841f;
  --gold-500: #c9a227;
  --gold-400: #d9b53f;
  --gold-300: #e8cd6d;

  --ink-900: #13203a;
  --ink-700: #33465e;
  --ink-600: #45566b;
  --ink-400: #8494a8;
  --ink-300: #a8b4c4;

  --bg: #f2f5f9;
  --bg-deep: #e9eef5;
  --card: #ffffff;
  --line: #e2e8f2;
  --line-strong: #cfd9e6;

  --teal-600: #0f766e;
  --teal-50: #e4f5f2;
  --rose-600: #be2e5f;
  --rose-50: #fbe9f0;
  --purple-600: #6d28d9;
  --purple-50: #f1e9fd;
  --red-600: #c0392b;
  --red-50: #fdecea;
  --green-600: #2f855a;
  --green-50: #e7f6ee;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(13, 26, 44, .06), 0 1px 6px rgba(13, 26, 44, .05);
  --shadow-md: 0 4px 12px rgba(13, 26, 44, .10), 0 2px 4px rgba(13, 26, 44, .06);
  --shadow-lg: 0 18px 50px rgba(10, 21, 38, .28);

  --sidebar-w: 272px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ==========================================================================
   2. Base
   ========================================================================== */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-600);
  background: var(--bg);
}

img { max-width: 100%; height: auto; }

a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--gold-600); }

h1, h2, h3, h4, h5, h6 {
  color: var(--ink-900);
  font-weight: 750;
  line-height: 1.25;
  margin: 0 0 .5em;
}

h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }

p { margin: 0 0 1em; }

::selection { background: var(--gold-400); color: var(--navy-950); }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
}

/* ==========================================================================
   3. Layout shell
   ========================================================================== */

.org-layout {
  display: flex;
  min-height: 100vh;
}

.org-main {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}

.org-content {
  flex: 1 1 auto;
  padding: 42px 48px 60px;
  max-width: 1280px;
  width: 100%;
}

/* ==========================================================================
   4. Sidebar (module navigation)
   ========================================================================== */

.org-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-950) 100%);
  color: #93a5bd;
  display: flex;
  flex-direction: column;
  z-index: 50;
  border-right: 1px solid rgba(201, 162, 39, .18);
}

.org-sidebar::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-500), var(--gold-300), var(--gold-500));
}

.org-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 26px 22px 22px;
}

.org-brand-mark {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(201, 162, 39, .35);
  color: var(--navy-950);
}

.org-brand-name {
  color: #fff;
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.2;
}

.org-brand-sub {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold-400);
  margin-top: 2px;
  font-weight: 600;
}

.org-sidebar-nav {
  flex: 1 1 auto;
  padding: 14px 14px;
  overflow-y: auto;
}

.org-nav-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #5f7290;
  padding: 10px 12px 8px;
}

.org-nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }

.org-nav-item { margin: 0; }

.org-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  color: #9db0c8;
  font-weight: 600;
  font-size: 14.5px;
  transition: background .15s ease, color .15s ease;
  border: 1px solid transparent;
}

.org-nav-link svg { flex: 0 0 auto; opacity: .85; }

.org-nav-link:hover { background: rgba(255, 255, 255, .07); color: #e8edf4; }

.org-nav-link.is-active {
  background: linear-gradient(135deg, rgba(201, 162, 39, .22), rgba(201, 162, 39, .10));
  border-color: rgba(201, 162, 39, .35);
  color: #fff;
}

.org-nav-link.is-active svg { color: var(--gold-300); }

.org-nav-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, .10);
  color: #c6d2e2;
  border-radius: 999px;
  padding: 1px 9px;
  font-variant-numeric: tabular-nums;
}

.org-nav-link.is-active .org-nav-count { background: var(--gold-500); color: var(--navy-950); }

.org-nav-coming {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  color: #46597a;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px dashed #223455;
  border-radius: 10px;
  margin-top: 4px;
  cursor: default;
}

.org-nav-coming span { margin-left: auto; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #3e5272; }

.org-sidebar-foot {
  padding: 16px 22px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: 11.5px;
  color: #5d7090;
  line-height: 1.7;
}

.org-sidebar-foot strong { color: #8fa2bf; font-weight: 700; }

/* Mobile nav toggle */
.org-nav-toggle {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 60;
  width: 44px; height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  box-shadow: var(--shadow-md);
  color: var(--navy-800);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   5. Module header (inside content)
   ========================================================================== */

.org-module-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.org-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-600);
  margin-bottom: 8px;
}

.org-kicker::before {
  content: "";
  width: 26px; height: 2px;
  background: var(--gold-500);
  border-radius: 2px;
}

.org-module-head h1 { margin: 0 0 6px; font-size: 30px; letter-spacing: -.01em; }

.org-module-desc { color: var(--ink-400); font-size: 15px; max-width: 640px; margin: 0; }

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

/* ==========================================================================
   6. Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none;
  line-height: 1.3;
  white-space: nowrap;
}

.btn:focus-visible { outline: 3px solid rgba(201, 162, 39, .45); outline-offset: 2px; }

.btn-gold {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: var(--navy-950);
  box-shadow: 0 3px 10px rgba(201, 162, 39, .30);
}

.btn-gold:hover { background: linear-gradient(135deg, var(--gold-300), var(--gold-400)); color: var(--navy-950); transform: translateY(-1px); box-shadow: 0 5px 14px rgba(201, 162, 39, .38); }

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

.btn-navy:hover { background: var(--navy-700); color: #fff; }

.btn-outline {
  background: var(--card);
  border-color: var(--line-strong);
  color: var(--ink-700);
}

.btn-outline:hover { border-color: var(--navy-600); color: var(--navy-800); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-400);
}

.btn-ghost:hover { background: rgba(19, 32, 58, .05); color: var(--ink-700); }

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

.btn-danger:hover { background: #a93226; color: #fff; }

.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 8px; }

.btn-block { width: 100%; }

.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none !important; }

/* ==========================================================================
   7. Overview module (landing)
   ========================================================================== */

.org-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 55%, var(--navy-700) 100%);
  border-radius: 18px;
  padding: 46px 48px;
  color: #c9d6e6;
  margin-bottom: 30px;
  box-shadow: var(--shadow-md);
}

.org-hero::before {
  content: "";
  position: absolute;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 162, 39, .28), transparent 65%);
  top: -180px; right: -120px;
}

.org-hero::after {
  content: "";
  position: absolute;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .06), transparent 65%);
  bottom: -140px; left: 22%;
}

.org-hero h1 { color: #fff; font-size: 34px; margin: 0 0 10px; position: relative; z-index: 1; }

.org-hero p { font-size: 16px; max-width: 560px; position: relative; z-index: 1; margin-bottom: 24px; }

.org-hero-stats {
  display: flex;
  gap: 34px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}

.org-hero-stat .num {
  font-size: 26px;
  font-weight: 800;
  color: var(--gold-300);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.org-hero-stat .lbl { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #7f93b0; font-weight: 700; }

.org-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 34px 0 18px;
}

.org-section-title h2 { margin: 0; font-size: 20px; }

.org-section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.org-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.org-module-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}

.org-module-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.org-module-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.org-module-card--overview::before { background: linear-gradient(90deg, var(--gold-500), var(--gold-300)); }
.org-module-card--collection::before { background: linear-gradient(90deg, var(--teal-600), #14b8a6); }

.org-module-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}

.org-module-icon--gold { background: #fdf3dd; color: var(--gold-600); }
.org-module-icon--teal { background: var(--teal-50); color: var(--teal-600); }

.org-module-card h3 { margin: 0 0 4px; font-size: 18px; }

.org-module-card .badge { margin-bottom: 12px; }

.org-module-card p { font-size: 14px; color: var(--ink-400); margin-bottom: 16px; }

.org-feature-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.org-feature-list li {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 13.5px;
  color: var(--ink-600);
}

.org-feature-list svg { flex: 0 0 auto; margin-top: 3px; color: var(--teal-600); }

.org-module-card-foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.org-coming-note {
  background: var(--card);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 22px 26px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--ink-400);
  font-size: 14px;
}

.org-coming-note strong { color: var(--ink-700); }

/* ==========================================================================
   8. Badges & pills
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .05em;
  padding: 3px 10px;
  border-radius: 999px;
  line-height: 1.5;
}

.badge-coin { background: #fdf3dd; color: #92610a; border: 1px solid #f0ddb4; }
.badge-banknote { background: var(--teal-50); color: var(--teal-600); border: 1px solid #c3e7e2; }
.badge-stamp { background: var(--purple-50); color: var(--purple-600); border: 1px solid #dcc9f5; }

.badge-soft { background: var(--bg-deep); color: var(--ink-600); border: 1px solid var(--line); }

.pill-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--bg-deep);
  color: var(--ink-600);
  border: 1px solid var(--line);
}

.pill-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-400); }

.pill-status--in { background: var(--green-50); color: var(--green-600); border-color: #c6e6d2; }
.pill-status--in::before { background: var(--green-600); }
.pill-status--sold { background: var(--red-50); color: var(--red-600); border-color: #f3d3cf; }
.pill-status--sold::before { background: var(--red-600); }
.pill-status--sale { background: var(--gold-500); color: #fff; border-color: var(--gold-600); }
.pill-status--sale::before { background: #fff; }
.pill-status--dup { background: #eef1f6; color: var(--ink-400); border-color: var(--line); }
.pill-status--dup::before { background: var(--ink-400); }
.pill-status--traded { background: var(--purple-50); color: var(--purple-600); border-color: #dcc9f5; }
.pill-status--traded::before { background: var(--purple-600); }

/* ==========================================================================
   9. Collection toolbar & filters
   ========================================================================== */

.org-toolbar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.org-field {
  position: relative;
  min-width: 0;
}

.org-field-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-400);
  margin-bottom: 5px;
}

.org-input, .org-select, .org-textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink-900);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 9px 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.org-input:focus, .org-select:focus, .org-textarea:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, .18);
}

.org-input::placeholder, .org-textarea::placeholder { color: var(--ink-300); }

.org-textarea { resize: vertical; min-height: 84px; line-height: 1.55; }

.org-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238494a8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 34px;
  cursor: pointer;
}

.org-toolbar .org-search { flex: 1 1 220px; max-width: 360px; }

.org-search-wrap { position: relative; }

.org-search-wrap .org-input { padding-left: 36px; }

.org-search-wrap svg {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-300);
  pointer-events: none;
}

.org-toolbar-spacer { flex: 1 1 auto; }

/* Stats strip */
.org-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.org-stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 13px;
  box-shadow: var(--shadow-sm);
}

.org-stat-card .ico {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}

.org-stat-card .num { font-size: 21px; font-weight: 800; color: var(--ink-900); line-height: 1.1; font-variant-numeric: tabular-nums; }
.org-stat-card .lbl { font-size: 12px; color: var(--ink-400); font-weight: 600; }

/* ==========================================================================
   10. Collection item cards
   ========================================================================== */

.org-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 18px;
}

.org-item-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.org-item-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold-400);
}

.org-item-thumb {
  aspect-ratio: 4 / 3;
  background: linear-gradient(145deg, var(--navy-900), var(--navy-700));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.org-item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.org-item-thumb .placeholder { color: rgba(255, 255, 255, .35); }

.org-item-type {
  position: absolute;
  top: 10px; left: 10px;
}

.org-item-status {
  position: absolute;
  top: 10px; right: 10px;
}

.org-item-body { padding: 14px 16px 15px; display: flex; flex-direction: column; gap: 7px; flex: 1; }

.org-item-title {
  font-size: 14.5px;
  font-weight: 750;
  color: var(--ink-900);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.org-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  font-size: 12px;
  color: var(--ink-400);
  font-weight: 600;
}

.org-item-meta span { display: inline-flex; align-items: center; gap: 5px; }
.org-item-meta svg { color: var(--ink-300); }

.org-item-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.org-item-catno { font-family: var(--font-mono); font-size: 11px; color: var(--ink-400); background: var(--bg); border: 1px solid var(--line); padding: 2px 8px; border-radius: 6px; }

.org-item-year { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink-600); }

/* Empty state */
.org-empty {
  background: var(--card);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 60px 30px;
  text-align: center;
  color: var(--ink-400);
}

.org-empty svg { color: var(--ink-300); margin-bottom: 12px; }

.org-empty h3 { margin-bottom: 4px; }

.org-empty p { margin-bottom: 18px; }

/* Pagination */
.org-pagination {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.org-pagination .page-numbers {
  min-width: 38px; height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-600);
  font-weight: 700;
  font-size: 13.5px;
  transition: all .15s ease;
}

.org-pagination .page-numbers:hover { border-color: var(--gold-500); color: var(--navy-800); }

.org-pagination .page-numbers.current {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
}

/* ==========================================================================
   11. Modal (popup) system
   ========================================================================== */

.org-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 16, 30, .62);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, visibility .18s ease;
}

.org-overlay[hidden] { display: none !important; }

.org-overlay.is-open { display: flex; opacity: 1; visibility: visible; }

.org-modal {
  background: var(--card);
  border-radius: 16px;
  width: 100%;
  max-width: 760px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(.985);
  transition: transform .18s ease;
  border-top: 4px solid var(--gold-500);
}

.org-overlay.is-open .org-modal { transform: none; }

.org-modal--wide { max-width: 900px; }
.org-modal--narrow { max-width: 460px; }

.org-modal-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
  color: #fff;
  flex: 0 0 auto;
}

.org-modal-head .title { margin: 0; color: #fff; font-size: 17px; font-weight: 750; }

.org-modal-head .sub { font-size: 12px; color: #8fa2bf; margin-top: 2px; }

.org-modal-head .ico {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(201, 162, 39, .16);
  border: 1px solid rgba(201, 162, 39, .35);
  color: var(--gold-300);
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}

.org-modal-close {
  margin-left: auto;
  width: 36px; height: 36px;
  border-radius: 9px;
  border: none;
  background: rgba(255, 255, 255, .08);
  color: #b9c6d8;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease, color .15s ease;
}

.org-modal-close:hover { background: rgba(255, 255, 255, .18); color: #fff; }

.org-modal-body {
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.org-modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px 24px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
  flex: 0 0 auto;
}

.org-modal-foot .org-modal-hint {
  margin-right: auto;
  font-size: 12px;
  color: var(--ink-400);
}

/* Form sections inside modal */
.org-form-section { margin-bottom: 26px; }

.org-form-section > legend {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--navy-700);
  padding: 0;
  margin-bottom: 14px;
  width: 100%;
}

.org-form-section > legend::after { content: ""; flex: 1; height: 1px; background: var(--line); margin-left: 4px; }

.org-form-section > legend .sec-ico {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--bg-deep);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--gold-600);
}

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

.org-form-grid .org-field--full { grid-column: 1 / -1; }

.org-field .req { color: var(--red-600); margin-left: 2px; }

.org-field-help { font-size: 11.5px; color: var(--ink-300); margin-top: 4px; }

.org-field[hidden] { display: none !important; }

.org-field.is-type-hidden { display: none !important; }

/* View modal — definition rows */
.org-detail-hero {
  display: flex;
  gap: 18px;
  margin-bottom: 20px;
}

.org-detail-hero .thumb {
  width: 132px; height: 132px;
  flex: 0 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(145deg, var(--navy-900), var(--navy-700));
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
}

.org-detail-hero .thumb img { width: 100%; height: 100%; object-fit: cover; }

.org-detail-hero .info h3 { margin: 0 0 6px; font-size: 19px; }

.org-detail-hero .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

.org-detail-hero .desc { font-size: 13px; color: var(--ink-400); }

.org-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px 18px;
}

.org-detail-row { padding: 10px 0; border-bottom: 1px dashed var(--line); }

.org-detail-row dt {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-400);
  margin-bottom: 3px;
}

.org-detail-row dd { margin: 0; font-size: 13.5px; color: var(--ink-900); font-weight: 600; white-space: pre-wrap; }

/* Confirm modal */
.org-confirm-body { text-align: center; padding: 26px 22px 18px; }

.org-confirm-body .ico {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--red-50);
  color: var(--red-600);
  display: flex; align-items: center; justify-content: center;
}

.org-confirm-body h3 { margin-bottom: 6px; }

.org-confirm-body p { color: var(--ink-400); font-size: 14px; margin-bottom: 0; }

/* Toasts */
.org-toast-wrap {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 200;
  display: grid;
  gap: 10px;
}

.org-toast {
  background: var(--navy-900);
  color: #e8edf4;
  border-left: 4px solid var(--gold-500);
  padding: 13px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: org-toast-in .22s ease;
  max-width: 340px;
}

.org-toast--success { border-left-color: #34d399; }
.org-toast--error { border-left-color: #f87171; }

@keyframes org-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.org-toast.out { opacity: 0; transform: translateY(6px); transition: all .25s ease; }

/* ==========================================================================
   12. Single item page (permalink view)
   ========================================================================== */

.org-single-head { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 26px; }

.org-single-head .thumb {
  width: 200px; height: 200px;
  flex: 0 0 auto;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(145deg, var(--navy-900), var(--navy-700));
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
}

.org-single-head .thumb img { width: 100%; height: 100%; object-fit: cover; }

.org-single-head h1 { font-size: 26px; }

.org-single-head .chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0 12px; }

.org-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.org-panel + .org-panel { margin-top: 20px; }

.org-panel-head {
  padding: 15px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}

.org-panel-head h2 { margin: 0; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: var(--navy-700); }

.org-panel-body { padding: 8px 22px 18px; }

.org-detail-table { width: 100%; border-collapse: collapse; }

.org-detail-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-400);
  padding: 12px 16px 4px 0;
  width: 240px;
  vertical-align: top;
}

.org-detail-table td {
  padding: 12px 0 4px;
  font-size: 14px;
  color: var(--ink-900);
  font-weight: 600;
  vertical-align: top;
  white-space: pre-wrap;
}

.org-breadcrumb { font-size: 12.5px; color: var(--ink-400); margin-bottom: 14px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.org-breadcrumb a { color: var(--ink-400); font-weight: 600; }
.org-breadcrumb a:hover { color: var(--gold-600); }
.org-breadcrumb .sep { color: var(--ink-300); }

/* ==========================================================================
   13. Footer & misc
   ========================================================================== */

.org-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--ink-300);
  font-size: 12.5px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.org-footer strong { color: var(--ink-400); }

.org-screen {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 48px 40px;
  text-align: center;
}

.org-screen h2 { margin-bottom: 6px; }
.org-screen p { color: var(--ink-400); max-width: 420px; margin: 0 auto 20px; }

/* Loading spinner */
.org-spinner {
  width: 22px; height: 22px;
  border: 3px solid rgba(201, 162, 39, .25);
  border-top-color: var(--gold-500);
  border-radius: 50%;
  animation: org-spin .7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes org-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   14. WP admin — collection meta box
   ========================================================================== */

#org_item_fields .org-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
#org_item_fields .org-form-section { margin-bottom: 20px; }
#org_item_fields .org-field--full { grid-column: 1 / -1; }
#org_item_fields .org-field.is-type-hidden { display: none !important; }
#org_item_fields .org-field-label { font-size: 11px; margin-bottom: 4px; }
#org_item_fields .org-input, #org_item_fields .org-select, #org_item_fields .org-textarea { font-size: 13px; }

/* ==========================================================================
   15. Responsive
   ========================================================================== */

@media (max-width: 1080px) {
  .org-content { padding: 34px 26px 48px; }
}

@media (max-width: 860px) {
  .org-sidebar {
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  body.org-nav-open .org-sidebar { transform: none; }
  .org-main { margin-left: 0; }
  .org-nav-toggle { display: flex; }
  .org-content { padding: 84px 18px 40px; }
  .org-hero { padding: 32px 26px; }
  .org-hero h1 { font-size: 26px; }
  .org-form-grid { grid-template-columns: 1fr; }
  .org-modal { max-height: calc(100vh - 20px); }
  .org-overlay { padding: 10px; }
  .org-detail-hero { flex-direction: column; }
  .org-detail-hero .thumb { width: 100%; height: 180px; }
}

@media (max-width: 480px) {
  .org-module-head h1 { font-size: 24px; }
  .org-hero-stats { gap: 18px; }
}
