/* ============================================================
   order protect — Admin Styles
   Clean, lightweight, professional dashboard UI
   ============================================================ */

/* ── Reset & Base ───────────────────────────────────────── */
.og-wrap * { box-sizing: border-box; }

.og-wrap {
    --og-bg:        #f7f8fa;
    --og-surface:   #ffffff;
    --og-border:    #e5e7eb;
    --og-text:      #111827;
    --og-muted:     #6b7280;
    --og-primary:   #2563eb;
    --og-danger:    #dc2626;
    --og-success:   #16a34a;
    --og-warn:      #d97706;
    --og-radius:    10px;
    --og-shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --og-font:      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    font-family: var(--og-font);
    color: var(--og-text);
    background: var(--og-bg);
    min-height: 100vh;
    padding: 0;
    margin: 0 -20px;    /* override WP padding */
}

/* ── Header bar ─────────────────────────────────────────── */
.og-header {
    display: flex;
    align-items: center;
    gap: 24px;
    background: var(--og-surface);
    border-bottom: 1px solid var(--og-border);
    padding: 0 28px;
    height: 56px;
    position: sticky;
    top: 32px;
    z-index: 50;
}

.og-header__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    color: var(--og-text);
    letter-spacing: -.3px;
}

.og-header__brand svg {
    color: var(--og-primary);
}

.og-nav {
    display: flex;
    gap: 2px;
    margin-left: auto;
}

.og-nav__link {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--og-muted);
    border-radius: 6px;
    text-decoration: none;
    transition: color .15s, background .15s;
}

.og-nav__link:hover {
    color: var(--og-text);
    background: var(--og-bg);
}

.og-nav__link--active {
    color: var(--og-primary);
    background: #eff6ff;
}

/* ── Page body ──────────────────────────────────────────── */
.og-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 28px 0;
    flex-wrap: wrap;
}

.og-toolbar__left { flex: 1; }

.og-toolbar__search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.og-page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--og-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Layout (sidebar + table) ───────────────────────────── */
.og-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    padding: 20px 28px 32px;
    align-items: start;
}

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

/* ── Card ───────────────────────────────────────────────── */
.og-card {
    background: var(--og-surface);
    border: 1px solid var(--og-border);
    border-radius: var(--og-radius);
    box-shadow: var(--og-shadow);
    overflow: hidden;
}

.og-card__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--og-text);
    background: #f9fafb;
    border-bottom: 1px solid var(--og-border);
}

/* ── Table wrap (full-width pages) ─────────────────────── */
.og-table-wrap {
    background: var(--og-surface);
    border: 1px solid var(--og-border);
    border-radius: var(--og-radius);
    box-shadow: var(--og-shadow);
    overflow-x: auto;
    margin: 0 28px;
}

.og-card--table .og-table-wrap {
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
}

/* ── Table ──────────────────────────────────────────────── */
.og-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.og-table thead tr {
    background: #f9fafb;
}

.og-table th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--og-muted);
    border-bottom: 1px solid var(--og-border);
    white-space: nowrap;
}

.og-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--og-border);
    vertical-align: middle;
}

.og-table tbody tr:last-child td { border-bottom: none; }

.og-table tbody tr:hover { background: #fafafa; }

.og-table__check { width: 36px; padding-left: 16px !important; }

.og-row--expired { opacity: .5; }

/* ── Bulk bar ───────────────────────────────────────────── */
.og-bulk-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #fefce8;
    border-bottom: 1px solid #fde68a;
    font-size: 13px;
}

.og-bulk-bar__count {
    font-weight: 600;
    color: #92400e;
}

/* ── Search ─────────────────────────────────────────────── */
.og-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--og-surface);
    border: 1px solid var(--og-border);
    border-radius: 7px;
    padding: 0 10px;
    height: 34px;
    color: var(--og-muted);
}

.og-search input {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    font-size: 13px;
    width: 220px;
    color: var(--og-text);
}

/* ── Inputs / selects ───────────────────────────────────── */
.og-form { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }

.og-form__row { display: flex; gap: 12px; }
.og-form__row--2 > * { flex: 1; }

.og-form__group { display: flex; flex-direction: column; gap: 5px; }

.og-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--og-text);
}

.og-form__optional {
    font-weight: 400;
    color: var(--og-muted);
}

.og-input,
.og-select {
    height: 36px;
    border: 1px solid var(--og-border);
    border-radius: 7px;
    padding: 0 10px;
    font-size: 13px;
    font-family: var(--og-font);
    color: var(--og-text);
    background: var(--og-surface);
    width: 100%;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
}

.og-input:focus,
.og-select:focus {
    border-color: var(--og-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* ── Buttons ────────────────────────────────────────────── */
.og-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    height: 34px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--og-font);
    border: none;
    cursor: pointer;
    transition: filter .15s, transform .1s;
    text-decoration: none;
    white-space: nowrap;
}

.og-btn:hover { filter: brightness(.93); }
.og-btn:active { transform: scale(.97); }

.og-btn--primary { background: var(--og-primary); color: #fff; }
.og-btn--danger  { background: var(--og-danger);  color: #fff; }
.og-btn--sm { height: 30px; font-size: 12px; padding: 0 10px; }
.og-btn--full { width: 100%; justify-content: center; height: 38px; }

/* ── Actions column ─────────────────────────────────────── */
.og-actions { display: flex; gap: 4px; }

.og-actions__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--og-border);
    color: var(--og-muted);
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
}

.og-actions__btn:hover { background: #fff7ed; color: var(--og-warn); border-color: #fdba74; }
.og-actions__btn--warn { color: var(--og-warn); }

/* ── Pills ──────────────────────────────────────────────── */
.og-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .2px;
}

.og-pill--blue   { background: #dbeafe; color: #1d4ed8; }
.og-pill--purple { background: #ede9fe; color: #6d28d9; }
.og-pill--orange { background: #ffedd5; color: #c2410c; }
.og-pill--grey   { background: #f3f4f6; color: #374151; }
.og-pill--green  { background: #dcfce7; color: #15803d; }
.og-pill--red    { background: #fee2e2; color: #b91c1c; }

/* ── Misc ───────────────────────────────────────────────── */
.og-badge {
    display: inline-block;
    background: #e5e7eb;
    color: #374151;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
}

.og-code {
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 11px;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    color: #374151;
}

.og-link { color: var(--og-primary); text-decoration: none; font-weight: 500; }
.og-link:hover { text-decoration: underline; }

.og-muted { color: var(--og-muted); }
.og-text--sm { font-size: 12px; }

.og-empty {
    text-align: center;
    padding: 40px 20px !important;
    color: var(--og-muted);
    font-size: 13px;
}

/* ── Notices ────────────────────────────────────────────── */
.og-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 28px 0;
    padding: 11px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

.og-notice--success { background: #f0fdf4; border: 1px solid #bbf7d0; color: var(--og-success); }
.og-notice--error   { background: #fef2f2; border: 1px solid #fecaca; color: var(--og-danger); }

/* ── Pagination ─────────────────────────────────────────── */
.og-pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 14px 16px;
    justify-content: flex-end;
    border-top: 1px solid var(--og-border);
}

.og-pagination__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--og-muted);
    text-decoration: none;
    border: 1px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
}

.og-pagination__item:hover {
    background: var(--og-bg);
    color: var(--og-text);
    border-color: var(--og-border);
}

.og-pagination__item--active {
    background: var(--og-primary);
    color: #fff;
    border-color: var(--og-primary);
}

/* ── Global hint box ────────────────────────────────────── */
.og-global-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 18px 0;
    padding: 10px 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 7px;
    font-size: 12px;
    color: #1e40af;
    line-height: 1.5;
}

.og-global-hint svg {
    flex-shrink: 0;
    margin-top: 1px;
    color: #3b82f6;
}

/* ── Type selector (radio card group) ───────────────────── */
.og-type-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.og-type-option { cursor: pointer; }

.og-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.og-type-option__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border: 2px solid var(--og-border);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--og-muted);
    text-align: center;
    transition: border-color .15s, background .15s, color .15s;
    background: var(--og-surface);
}

.og-type-option__card svg {
    transition: color .15s;
}

.og-type-option:hover .og-type-option__card {
    border-color: #93c5fd;
    background: #f0f9ff;
    color: var(--og-text);
}

.og-type-option input[type="radio"]:checked + .og-type-option__card {
    border-color: var(--og-primary);
    background: #eff6ff;
    color: var(--og-primary);
}

/* ── Scope cell in limits table ─────────────────────────── */
.og-scope {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.og-scope__label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--og-muted);
}

/* ── Cap display ─────────────────────────────────────────── */
.og-cap {
    font-size: 18px;
    font-weight: 700;
    color: var(--og-text);
    line-height: 1;
    display: block;
}
.og-wrap > form > .og-table-wrap { margin: 12px 28px 0; }
.og-wrap > form > .og-pagination { margin: 0 28px; }

/* Card-table variant: remove extra margin/border */
.og-card--table { overflow: hidden; }
.og-card--table .og-pagination { background: #f9fafb; }

/* ── Popup checkout error notice (frontend) ─────────────── */
.og-popup-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
    border-radius: 6px;
    color: #7f1d1d;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 16px;
    margin: 12px 0;
    line-height: 1.5;
}

/* ── Device ID copy cell ────────────────────────────── */
.og-copy {
    cursor: pointer;
    display: inline-block;
    word-break: break-all;
    vertical-align: middle;
    transition: background 0.15s, color 0.15s;
    position: relative;
}
.og-copy:hover {
    background: #2271b1;
    color: #fff;
    border-radius: 3px;
}
.og-copy.og-copied {
    background: #00a32a;
    color: #fff;
    border-radius: 3px;
}
