/* ============================================================
   CORE LAYOUT – Struktur global WP Admin + WPSG
   ============================================================ */
:root {
    --border-color: rgba(0,0,0,0.25);
    --table-border: rgba(0,0,0,0.25);
    /* dashicons */
    --dashicons-plus : "\f542";
    --dashicons-minus: "\f460";
    --dashicons-trash: "\f182";
    --dashicons-image: "\f128";
    --fa-plus   : "\2b";
    --fa-trash  : "\f2ed";
}

/* Gunakan font system WordPress */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
             Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans",
             "Helvetica Neue", sans-serif;
    background: #f0f0f1;
}

th div::before, td div::before {
    white-space: pre;
}

table { padding: 0px; border-spacing: 0 !important; border-collapse: collapse !important;}
table th, table td { 
    cursor: default; 
    border-spacing: 0 !important; 
    border-collapse: collapse !important;
}

table th { padding: 0.5em 0.8em 0.4em; font-size: 1.05em; height: 2.50em; text-align: center; font-weight: 600; background-color: rgba(222,228,232,1); }
table td { padding: 0.5em 0.6em;       font-size: 1.00em; height: 1.25em; text-align: left;   vertical-align: top; }

table.wpsg-full-width { width: 100%; }

select.regular-text,
input.regular-text {
    line-height: 1.6em;
    height: 3.0em;
}

table.v-align-top tr td { vertical-align: top; }
table.base-line tr td { vertical-align: baseline; }

table.outer-border {
    border-width: 1px; border-style: solid; border-color: var(--table-border);
}

table.bordered td, table.bordered th {
    border-width: 1px; border-style: solid; border-color: var(--table-border);
}

table.hover tr:hover td { background-color: rgba(248,248,168,0.35); }

table.striped tr:nth-child(odd) td { background-color: rgba(255,255,255,0.25); }
table.striped tr:nth-child(even) td { background-color: rgba(0,0,0,0.025); }

.row-actions {
    font-size: 12px;
    line-height: 1;
    color: #666;
    display: inline-block;
    margin-top: 2px;
}
.row-actions {
    display: block;
}
.row-actions span + span:before {
    content: " | ";
}

.text-center {
    text-align: center;
}

.btn {
    padding: 4px 8px 5px;
    cursor: pointer;
    border-radius: 3px;
}

.btn-action {
    border-width: 1px;
    border-style: solid;
    border-color: rgba(127,127,127,0.25);
    padding: 4px 8px 5px;
}
.btn-danger {
    color: rgba(63,17,17,1);
    border-color: rgba(127,63,31,0.25);
    background: rgb(232,192,192);
}
.btn-danger:hover {
    color: rgba(31,7,7,1);
    border-color: rgba(127,63,31,0.25);
    background: rgb(232,212,212);
}

a.btn {
    text-decoration: none;
}

.nav-tab {
    background-color: #e7e7e7 !important;
    border: 1px solid #d1d1d1 !important;
    border-bottom: none !important;
    color: #555 !important;
}
.nav-tab:hover {
    background-color: #f3f3f3 !important;
    color: #0073aa !important;
}

.nav-tab-active {
    background-color: #fff !important;
    border-color: #d1d1d1 #d1d1d1 #fff !important;
    z-index: 2 !important;
    color: #0073aa !important;
    box-shadow: none !important;
}

/* Untuk menonaktifkan sidebar WP */
#adminmenu,
#adminmenuback,
#adminmenuwrap {
    display: none !important;
}

.wpsg-row {
    display: flex;
    flex: content;
    width: 100%;
    gap: 10px;
}

.wpsg-row .col-2 {
    display: flex;
    flex-direction: column;
}

.ncol-1  { width: 100%; }
.ncol-2  { width: calc( 100% * ( 1/2  ) ); }
.ncol-3  { width: calc( 100% * ( 1/3  ) ); }
.ncol-4  { width: calc( 100% * ( 1/4  ) ); }
.ncol-5  { width: calc( 100% * ( 1/5  ) ); }
.ncol-6  { width: calc( 100% * ( 1/6  ) ); }
.ncol-7  { width: calc( 100% * ( 1/7  ) ); }
.ncol-8  { width: calc( 100% * ( 1/8  ) ); }
.ncol-9  { width: calc( 100% * ( 1/9  ) ); }
.ncol-10 { width: calc( 100% * ( 1/10 ) ); }
.ncol-11 { width: calc( 100% * ( 1/11 ) ); }
.ncol-12 { width: calc( 100% * ( 1/12 ) ); }
.ncol-13 { width: calc( 100% * ( 1/13 ) ); }
.ncol-14 { width: calc( 100% * ( 1/14 ) ); }
.ncol-15 { width: calc( 100% * ( 1/15 ) ); }
.ncol-16 { width: calc( 100% * ( 1/16 ) ); }

.col-1  { width: calc( 100% * ( 1/12) ); }
.col-2  { width: calc( 100% * ( 2/12) ); }
.col-3  { width: calc( 100% * ( 3/12) ); }
.col-4  { width: calc( 100% * ( 4/12) ); }
.col-5  { width: calc( 100% * ( 5/12) ); }
.col-6  { width: calc( 100% * ( 6/12) ); }
.col-7  { width: calc( 100% * ( 7/12) ); }
.col-8  { width: calc( 100% * ( 8/12) ); }
.col-9  { width: calc( 100% * ( 9/12) ); }
.col-10 { width: calc( 100% * (10/12) ); }
.col-11 { width: calc( 100% * (11/12) ); }
.col-12 { width: calc( 100% * (12/12) ); }

/* ==== WP Admin Layout Alignment ==== */
.wpsg-admin-wrapper {
    padding: 20px 30px;
    box-sizing: border-box;
}

.wpsg > .wpsg-admin-wrapper { 
    padding: 20px 0px; 
}

/* Wrapper admin WPSG (menggantikan adminmenu) */
#wpsg-admin-wrapper {
    width: 100vw;
    flex-direction: row;
    height: 100vh;

}

/* Konten utama di kanan */
#wpsg-admin-content {
    flex-grow: 1;
    margin-left: 160px; /* Mengikuti lebar sidebar */
    padding: 32px;
    box-sizing: border-box;
}

/* Judul halaman */
#wpsg-admin-content h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #1d2327;
}

/* Flex container untuk cards */
.wpsg-flex {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: flex-start;
    align-items: flex-start;
}

/* wpsg-cards */
/* ===========================================
   CARD STYLE
   =========================================== */
.wpsg-card {
    background: #fff;
    border: 1px solid #d1d1d1;
    padding: 20px;
    flex: 1 1 220px; /* flex-grow:1; flex-shrink:1; flex-basis:220px */
    min-width: 220px; /* jangan mengecil dari 220px */
    box-sizing: border-box;
    border-radius: 8px;
    box-shadow: 0 0 5px 2px rgba(0,0,0,0.07);
    transition: transform 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 120px;
}

/*
.wpsg-card:hover {
    box-shadow: 0 0 12px 3px rgba(0,0,0,0.125);
}
*/

/* Title di dalam card */
.wpsg-card h1, .wpsg-card h2, .wpsg-card h3, .wpsg-card h4 {
    margin: 0 0 10px;
    font-weight: 600;
    text-align: center;
    background-color: #d3e4f0;
    color: #1d2327;
}
.wpsg-card:hover h1, .wpsg-card:hover h2, .wpsg-card:hover h3, .wpsg-card:hover h4 {
    background-color: #b0d4ea;
    transition: 0.2s ease-in-out;
}

.wpsg-card h1 { font-size: 2.500rem; }
.wpsg-card h2 { font-size: 1.250rem; }
.wpsg-card h3 { font-size: 1.125rem; }
.wpsg-card h4 { font-size: 1rem;     }

/* Description di dalam card */
.wpsg-card p {
    text-align: left;
    margin: 0;
    font-size: 0.85rem;
    color: #5a5f63;
}

a .wpsg-card { margin: 0; padding: 0; }
a .wpsg-card * { margin: 0px; padding: 10px 30px; }

a.wpsg-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* ===========================================
   RESPONSIVE FIX
   =========================================== */
@media (max-width: 1400px) {
    .wpsg-card {
        width: calc(50% - 20px);
    }
}

@media (max-width: 900px) {
    .wpsg-card {
        flex: 1 1 100%;
        min-width: 100%;
    }
}

.wpsg-form .input-wrapper {
    position: relative;
    display: block;
    width: 100%; /* bebas */
}

.wpsg-form .input-wrapper input {
    width: 100%;
    padding-right: 32px; /* ruang untuk tombol */
}

.wpsg-form .input-wrapper .clear-btn {
    position: absolute;
    right: 6px;
    top: 0px;
    height: 100%;
    transform: translateY(-50%);
    border: none;
    background: #ddd;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 12px;
    border-radius: 4px;
    display: none; /* muncul saat input ada isinya */
}

.wpsg-boxed {
    background: #fff;
    border: 1px solid #d1d1d1;
    padding: 20px;
    box-sizing: border-box;
}

.wpsg-form-field {
    margin-top   : 0.5rem;
    margin-bottom: 0.5rem;
}

.wpsg-form-field input, 
.wpsg-form-field select,
.wpsg-form-field textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
.wpsg-form-field label {
    display: block;
    width: 100%;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.wpsg-gallery-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, 120px);
    gap: 12px;
    margin: 0;
    padding: 0;
}

.wpsg-gallery-item {
    background: #fff;
    border: 1px solid #ccd0d4;
    padding: 6px;
    list-style: none;
    position: relative;
}

.wpsg-gallery-thumb img {
    max-width: 100%;
    height: auto;
    display: block;
}

.wpsg-actions {
    position: absolute;
    top: 4px;
    right: 4px;
}

.wpsg-border {
    border-color: var(--border-color);
    border-style: solid;
    border-width: 1px;
}

.wpsg-gap-h-1 * { margin-left: 0.325em; padding-left: 0.325em; padding-right: 0.325em; }
.wpsg-gap-h-2 * { margin-left: 0.750em; padding-left: 0.325em; padding-right: 0.325em; }
.wpsg-gap-h-3 * { margin-left: 1.125em; padding-left: 0.325em; padding-right: 0.325em; }
    .wpsg-gap-h-1 *:first-child, 
    .wpsg-gap-h-2 *:first-child,
    .wpsg-gap-h-3 *:first-child { margin-left: 0; }