/**
 * Shared Admin V3 Styles - Premium style inspired "Pro" UI
 *
 * Modern, premium design with glassmorphism and iOS aesthetics.
 * Shared across Settings, Wishlist, and Analytics pages.
 *
 * @package King_Addons
 */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../../fonts/Inter.woff2') format('woff2');
}

/* ===== RESET & BASE ===== */
body.ka-admin-v3 #wpcontent,
body.ka-admin-v3 #wpbody,
body.ka-admin-v3 #wpbody-content {
    background: #f5f5f7 !important;
    padding: 0 !important;
}

body.ka-admin-v3.ka-v3-dark #wpcontent,
body.ka-admin-v3.ka-v3-dark #wpbody,
body.ka-admin-v3.ka-v3-dark #wpbody-content {
    background: #000000 !important;
}

html.ka-v3-dark,
html.ka-v3-dark body {
    background: #000000 !important;
}

.ka-admin-wrap {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 40px;
    color: #1d1d1f;
    transition: color 0.3s ease;
}

.ka-admin-wrap * {
    box-sizing: border-box;
}

/* ===== TYPOGRAPHY ===== */
.ka-admin-title {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin: 0 0 8px;
    line-height: 1.1;
    background: linear-gradient(135deg, #1d1d1f 0%, #515154 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ka-admin-subtitle {
    font-size: 19px;
    font-weight: 400;
    color: #86868b;
    margin: 0;
    line-height: 1.5;
}

/* ===== HEADER ===== */
.ka-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 48px;
    gap: 24px;
}

.ka-admin-header-left {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.ka-admin-header-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #0071e3 0%, #0077ed 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ka-admin-header-icon .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #fff;
}

.ka-admin-header-icon.pink {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
}

.ka-admin-header-icon.purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.ka-admin-header-icon.red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.ka-admin-header-icon.green {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.ka-admin-header-icon.orange {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.ka-admin-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ===== FOOTER ===== */
#wpfooter {
    visibility: visible;
}

/* ===== BUTTONS ===== */
.ka-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 980px;
    font-size: 15px;
    font-weight: 400;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.ka-btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.ka-btn-secondary {
    background: rgba(0, 0, 0, 0.06);
    color: #1d1d1f;
}

.ka-btn-secondary:hover {
    background: rgba(0, 0, 0, 0.12);
    color: #1d1d1f;
}

.ka-btn-primary {
    background: #0071e3;
    color: #fff;
}

.ka-btn-primary:hover {
    background: #0077ed;
    color: #fff;
    transform: scale(1.02);
}

.ka-btn-pink {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    color: #fff;
}

.ka-btn-pink:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.4);
    color: #fff;
}

.ka-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ===== THEME TOGGLE ===== */
.ka-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 980px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ka-theme-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
}

.ka-theme-toggle .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #86868b;
    transition: color 0.3s ease;
}

/* ===== THEME SEGMENTED (Dashboard-style) ===== */
.ka-v3-segmented {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    padding: 2px;
    border-radius: 980px;
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    min-width: 240px;
    height: 40px;
    overflow: hidden;
}

.ka-v3-segmented-indicator {
    position: absolute;
    top: 2px;
    bottom: 2px;
    left: 2px;
    width: calc(33.333% - 2px);
    border-radius: 980px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    transform: translateX(0);
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 0;
}

.ka-v3-segmented[data-active="dark"] .ka-v3-segmented-indicator {
    transform: translateX(100%);
}

.ka-v3-segmented[data-active="auto"] .ka-v3-segmented-indicator {
    transform: translateX(200%);
}

.ka-v3-segmented-btn {
    position: relative;
    z-index: 1;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 980px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #1d1d1f;
    cursor: pointer;
    transition: color 0.25s ease, transform 0.25s ease;
    user-select: none;
    white-space: nowrap;
}

.ka-v3-segmented-btn:active {
    transform: scale(0.98);
}

.ka-v3-segmented-icon {
    font-size: 14px;
    line-height: 1;
    opacity: 0.9;
}

.ka-v3-segmented-btn[aria-pressed="false"] {
    color: rgba(29, 29, 31, 0.7);
}

body.ka-admin-v3.ka-v3-dark .ka-v3-segmented,
body.ka-v3-dark .ka-v3-segmented {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

body.ka-admin-v3.ka-v3-dark .ka-v3-segmented-indicator,
body.ka-v3-dark .ka-v3-segmented-indicator {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

body.ka-admin-v3.ka-v3-dark .ka-v3-segmented-btn,
body.ka-v3-dark .ka-v3-segmented-btn {
    color: #f5f5f7;
}

body.ka-admin-v3.ka-v3-dark .ka-v3-segmented-btn[aria-pressed="false"],
body.ka-v3-dark .ka-v3-segmented-btn[aria-pressed="false"] {
    color: rgba(245, 245, 247, 0.72);
}


body.toplevel_page_king-addons.ka-v3-dark {
    background: #000000 !important;
}

/* ===== ADMIN NOTICES (V3) ===== */
body.ka-admin-v3 .notice,
body.ka-admin-v3 .updated,
body.ka-admin-v3 .error,
.ka-admin-wrap .notice,
.ka-admin-wrap .updated,
.ka-admin-wrap .error {
    margin: 0 0 16px;
    padding: 18px 20px;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

body.ka-admin-v3.ka-dark-theme .notice,
body.ka-admin-v3.ka-dark-theme .updated,
body.ka-admin-v3.ka-dark-theme .error,
body.ka-admin-v3.ka-v3-dark .ka-admin-wrap .notice,
body.ka-admin-v3.ka-v3-dark .ka-admin-wrap .updated,
body.ka-admin-v3.ka-v3-dark .ka-admin-wrap .error {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(28, 28, 30, 0.72);
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.3);
    color: #f5f5f7;
}

body.ka-admin-v3.ka-v3-dark .notice,
body.ka-admin-v3.ka-v3-dark .updated,
body.ka-admin-v3.ka-v3-dark .error {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(28, 28, 30, 0.72);
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.3);
    color: #f5f5f7;
}

/* Dashboard (admin.php?page=king-addons) can render notices outside .ka-admin-wrap and without ka-admin-v3 */
body.toplevel_page_king-addons.ka-v3-dark .notice,
body.toplevel_page_king-addons.ka-v3-dark .notice.notice-success,
body.toplevel_page_king-addons.ka-v3-dark .notice.notice-info,
body.toplevel_page_king-addons.ka-v3-dark .notice.notice-warning,
body.toplevel_page_king-addons.ka-v3-dark .notice.notice-error,
body.toplevel_page_king-addons.ka-v3-dark .updated,
body.toplevel_page_king-addons.ka-v3-dark .error {
    border-color: rgba(255, 255, 255, 0.08) !important;
    background: rgba(28, 28, 30, 0.72) !important;
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.3) !important;
    color: #f5f5f7 !important;
}

body.ka-admin-v3 .notice p,
body.ka-admin-v3 .updated p,
body.ka-admin-v3 .error p,
.ka-admin-wrap .notice p,
.ka-admin-wrap .updated p,
.ka-admin-wrap .error p {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
}

body.ka-admin-v3 .notice a,
body.ka-admin-v3 .updated a,
body.ka-admin-v3 .error a,
.ka-admin-wrap .notice a,
.ka-admin-wrap .updated a,
.ka-admin-wrap .error a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

body.ka-admin-v3.ka-v3-dark .notice .notice-dismiss:before,
body.ka-admin-v3.ka-dark-theme .notice .notice-dismiss:before {
    color: rgba(245, 245, 247, 0.72);
}

body.ka-admin-v3.ka-v3-dark .notice .notice-dismiss:hover:before,
body.ka-admin-v3.ka-v3-dark .notice .notice-dismiss:focus:before,
body.ka-admin-v3.ka-dark-theme .notice .notice-dismiss:hover:before,
body.ka-admin-v3.ka-dark-theme .notice .notice-dismiss:focus:before {
    color: rgba(245, 245, 247, 0.92);
}

/* Subtle left accent like callouts */
body.ka-admin-v3 .notice,
body.ka-admin-v3 .updated,
body.ka-admin-v3 .error,
.ka-admin-wrap .notice,
.ka-admin-wrap .updated,
.ka-admin-wrap .error {
    border-left-width: 4px;
}

body.ka-admin-v3 .notice.notice-error,
body.ka-admin-v3 .error,
.ka-admin-wrap .notice.notice-error,
.ka-admin-wrap .error {
    border-left-color: rgba(255, 59, 48, 0.9);
}

body.ka-admin-v3 .notice.notice-info,
.ka-admin-wrap .notice.notice-info {
    border-left-color: rgba(0, 113, 227, 0.9);
}

body.ka-admin-v3 .notice.notice-warning,
.ka-admin-wrap .notice.notice-warning {
    border-left-color: rgba(245, 158, 11, 0.9);
}

body.ka-admin-v3 .updated,
body.ka-admin-v3 .notice.notice-success,
.ka-admin-wrap .updated,
.ka-admin-wrap .notice.notice-success {
    border-left-color: rgba(52, 199, 89, 0.9);
}

/* ===== STATUS BADGE ===== */
.ka-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 980px;
    font-size: 13px;
    font-weight: 500;
}

.ka-status-enabled {
    background: rgba(52, 199, 89, 0.15);
    color: #34c759;
}

.ka-status-disabled {
    background: rgba(255, 59, 48, 0.15);
    color: #ff3b30;
}

.ka-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* ===== TABS ===== */
.ka-tabs {
    display: flex;
    justify-content: center;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    padding: 6px;
    border-radius: 980px;
    width: fit-content;
    margin: 0 auto 40px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.ka-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #86868b;
    background: transparent;
    border: none;
    border-radius: 980px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ka-tab:hover {
    color: #1d1d1f;
}

.ka-tab.active {
    background: #fff;
    color: #1d1d1f;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ka-tab-content {
    display: none;
}

.ka-tab-content.active {
    display: block;
}

/* ===== CARDS ===== */
.ka-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
    margin-bottom: 24px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.ka-card:hover {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}

.ka-card-header {
    padding: 20px 28px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 12px;
}

.ka-card-header h2,
.ka-card-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #1d1d1f;
}

.ka-card-header .dashicons {
    color: #0071e3;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.ka-card-header .dashicons.pink {
    color: #ec4899;
}

.ka-card-body {
    padding: 24px 28px;
}

/* ===== FORM ROWS ===== */
.ka-row {
    display: flex;
    align-items: flex-start;
    padding: 18px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.ka-row:last-child {
    border-bottom: none;
}

.ka-row-label {
    width: 200px;
    flex-shrink: 0;
    font-size: 15px;
    font-weight: 500;
    color: #1d1d1f;
    padding-top: 10px;
}

.ka-row-field {
    flex: 1;
}

.ka-row-field input[type="text"],
.ka-row-field input[type="number"],
.ka-row-field input[type="password"],
.ka-row-field input[type="email"],
.ka-row-field input[type="url"],
.ka-row-field input[type="date"],
.ka-row-field textarea,
.ka-row-field select {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Select dropdown arrow (single selects only) */
.ka-row-field select:not([multiple]) {
    padding-right: 48px;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%231d1d1f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 18px 18px;
}

.ka-row-field input:focus,
.ka-row-field textarea:focus,
.ka-row-field select:focus {
    outline: none;
    border-color: #0071e3;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.ka-row-desc {
    font-size: 13px;
    color: #86868b;
    margin-top: 8px;
    line-height: 1.5;
}

.ka-row-desc a {
    color: #0071e3;
    text-decoration: none;
}

.ka-row-desc a:hover {
    text-decoration: underline;
}

/* ===== TOGGLE SWITCH (iOS Style) ===== */
.ka-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.ka-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ka-toggle-slider {
    width: 51px;
    height: 31px;
    background: #e9e9eb;
    border-radius: 16px;
    position: relative;
    transition: background 0.3s ease;
}

.ka-toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 27px;
    height: 27px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.1);
}

.ka-toggle input:checked + .ka-toggle-slider {
    background: #34c759;
}

.ka-toggle input:checked + .ka-toggle-slider::after {
    transform: translateX(20px);
}

.ka-toggle-label {
    font-size: 15px;
    color: #86868b;
}

/* ===== RADIO GROUP ===== */
.ka-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ka-radio-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: #1d1d1f;
    cursor: pointer;
}

.ka-radio-item input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: #0071e3;
}

/* WP Admin renders radio dots via ::before in some contexts; align it with our accent color */
body.ka-admin-v3 .ka-admin-wrap input[type="radio"]:checked::before,
body.ka-admin-v3 .ka-admin-wrap .ka-radio-item input[type="radio"]:checked::before {
    content: "";
    border-radius: 50%;
    width: 10px;
    height: 10px;
    margin: 4px;
    background-color: #0071e3;
    line-height: 1.14285714;
}

body.ka-admin-v3.ka-v3-dark .ka-admin-wrap input[type="radio"]:checked::before,
body.ka-admin-v3.ka-v3-dark .ka-admin-wrap .ka-radio-item input[type="radio"]:checked::before {
    background-color: #0a84ff;
}

/* ===== COLOR PICKER ===== */
.ka-color-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ka-color-wrap input[type="text"] {
    max-width: 140px !important;
}

/* ===== PRO BADGE ===== */
.ka-pro-badge {
    display: inline-block;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 10px;
}

/* ===== SUBMIT FOOTER ===== */
.ka-submit {
    padding: 24px 28px;
    background: rgba(0, 0, 0, 0.02);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ===== STATS GRID ===== */
.ka-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.ka-stat-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ka-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.ka-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0071e3, #0077ed);
}

.ka-stat-card:nth-child(2)::before {
    background: linear-gradient(90deg, #8b5cf6, #7c3aed);
}

.ka-stat-card:nth-child(3)::before {
    background: linear-gradient(90deg, #34c759, #30d158);
}

.ka-stat-card:nth-child(4)::before {
    background: linear-gradient(90deg, #ff9f0a, #ff9500);
}

.ka-stat-card:nth-child(5)::before {
    background: linear-gradient(90deg, #ec4899, #db2777);
}

.ka-stat-label {
    font-size: 13px;
    font-weight: 500;
    color: #86868b;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ka-stat-value {
    font-size: 36px;
    font-weight: 700;
    color: #1d1d1f;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
    line-height: 1;
}

.ka-stat-value.good {
    color: #34c759;
}

/* ===== FILTER BAR ===== */
.ka-filter-bar {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.ka-filter-bar label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #86868b;
}

.ka-filter-bar input[type="date"] {
    padding: 10px 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    font-size: 14px;
}

.ka-filter-bar input[type="date"]:focus {
    outline: none;
    border-color: #0071e3;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.ka-filter-bar .button {
    padding: 10px 20px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.06);
    border: none;
    color: #1d1d1f;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ka-filter-bar .button:hover {
    background: rgba(0, 0, 0, 0.1);
}

.ka-export-btn {
    margin-left: auto;
}

/* ===== TABLE ===== */
.ka-table {
    width: 100%;
    border-collapse: collapse;
}

.ka-table th {
    background: rgba(0, 0, 0, 0.02);
    padding: 16px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #86868b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.ka-table td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    font-size: 15px;
    color: #1d1d1f;
}

.ka-table tbody tr {
    transition: background 0.2s ease;
}

.ka-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

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

.ka-table .font-bold {
    font-weight: 600;
}

/* Product cell */
.ka-product-cell {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ka-product-cell img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.ka-product-cell a {
    color: #1d1d1f;
    font-weight: 500;
    text-decoration: none;
}

.ka-product-cell a:hover {
    color: #0071e3;
}

/* ===== BADGE ===== */
.ka-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 980px;
    font-size: 13px;
    font-weight: 500;
}

.ka-badge-success {
    background: rgba(52, 199, 89, 0.15);
    color: #34c759;
}

.ka-badge-warning {
    background: rgba(255, 159, 10, 0.15);
    color: #ff9f0a;
}

.ka-badge-neutral {
    background: rgba(0, 0, 0, 0.06);
    color: #86868b;
}

/* ===== STOCK STATUS ===== */
.ka-stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
}

.ka-stock-in {
    color: #34c759;
}

.ka-stock-out {
    color: #ff3b30;
}

.ka-stock .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ===== SORTABLE LIST ===== */
.ka-sortable-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 360px;
}

.ka-sortable-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    cursor: move;
    transition: all 0.2s ease;
}

.ka-sortable-item:hover {
    border-color: #0071e3;
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.1);
}

.ka-sortable-item.ui-sortable-helper {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-color: #0071e3;
}

.ka-sortable-item.ui-sortable-placeholder {
    visibility: visible !important;
    background: rgba(0, 113, 227, 0.08);
    border: 2px dashed #0071e3;
}

.ka-sortable-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin: 0;
    font-size: 15px;
}

.ka-sortable-handle {
    color: #86868b;
    margin-right: 10px;
}

/* ===== PRO NOTICE / UPGRADE CARD ===== */
.ka-pro-notice,
.ka-upgrade-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(124, 58, 237, 0.08) 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    margin-bottom: 24px;
}

.ka-pro-notice h2,
.ka-upgrade-card h3 {
    margin: 0 0 12px;
    font-size: 24px;
    font-weight: 700;
    color: #7c3aed;
}

.ka-pro-notice p,
.ka-upgrade-card p {
    margin: 0 0 24px;
    font-size: 16px;
    color: #86868b;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.ka-upgrade-card ul {
    text-align: left;
    max-width: 400px;
    margin: 0 auto 24px;
    padding-left: 0;
    list-style: none;
}

.ka-upgrade-card li {
    margin-bottom: 10px;
    padding-left: 28px;
    position: relative;
    font-size: 15px;
    color: #1d1d1f;
}

.ka-upgrade-card li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #7c3aed;
    font-weight: 600;
}

/* ===== EMPTY STATE ===== */
.ka-empty {
    text-align: center;
    padding: 60px 20px;
    color: #86868b;
}

.ka-empty .dashicons {
    font-size: 56px;
    width: 56px;
    height: 56px;
    opacity: 0.3;
    margin-bottom: 20px;
}

.ka-empty p {
    font-size: 17px;
}

/* ===== TWO COLUMN GRID ===== */
.ka-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 40px;
}

/* ===== DARK THEME ===== */
body.ka-v3-dark .ka-admin-wrap {
    color: #f5f5f7;
}

body.ka-v3-dark .ka-admin-title {
    background: linear-gradient(135deg, #f5f5f7 0%, #a1a1a6 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

body.ka-v3-dark .ka-admin-subtitle {
    color: #86868b;
}

body.ka-v3-dark .ka-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #f5f5f7;
}

body.ka-v3-dark .ka-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

body.ka-v3-dark .ka-theme-toggle {
    background: rgba(255, 255, 255, 0.1);
}

body.ka-v3-dark .ka-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

body.ka-v3-dark .ka-tabs {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.06);
}

body.ka-v3-dark .ka-tab {
    color: #86868b;
}

body.ka-v3-dark .ka-tab:hover {
    color: #f5f5f7;
}

body.ka-v3-dark .ka-tab.active {
    background: rgba(255, 255, 255, 0.12);
    color: #f5f5f7;
}

body.ka-v3-dark .ka-card {
    background: #1c1c1e;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

body.ka-v3-dark .ka-card-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.ka-v3-dark .ka-card-header h2,
body.ka-v3-dark .ka-card-header h3 {
    color: #f5f5f7;
}

body.ka-v3-dark .ka-card-body {
    background: #1c1c1e;
}

body.ka-v3-dark .ka-row {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

body.ka-v3-dark .ka-row-label {
    color: #f5f5f7;
}

body.ka-v3-dark .ka-row-field input,
body.ka-v3-dark .ka-row-field textarea,
body.ka-v3-dark .ka-row-field select {
    background-color: #2c2c2e;
    border-color: rgba(255, 255, 255, 0.1);
    color: #f5f5f7;
}

/* Tables (e.g., Categories) also contain inputs/selects outside .ka-row-field */
body.ka-v3-dark .ka-table input[type="text"],
body.ka-v3-dark .ka-table input[type="number"],
body.ka-v3-dark .ka-table input[type="password"],
body.ka-v3-dark .ka-table input[type="email"],
body.ka-v3-dark .ka-table input[type="date"],
body.ka-v3-dark .ka-table textarea,
body.ka-v3-dark .ka-table select {
    background-color: #2c2c2e;
    border-color: rgba(255, 255, 255, 0.1);
    color: #f5f5f7;
}

body.ka-v3-dark .ka-row-field select:not([multiple]) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f7' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

body.ka-v3-dark .ka-row-field input:focus,
body.ka-v3-dark .ka-row-field textarea:focus,
body.ka-v3-dark .ka-row-field select:focus {
    border-color: #0a84ff;
    box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.2);
}

body.ka-v3-dark .ka-toggle-slider {
    background: #3a3a3c;
}

body.ka-v3-dark .ka-toggle input:checked + .ka-toggle-slider {
    background: #30d158;
}

body.ka-v3-dark .ka-radio-item {
    color: #f5f5f7;
}

body.ka-v3-dark .ka-submit {
    background: rgba(255, 255, 255, 0.04);
    border-top-color: rgba(255, 255, 255, 0.08);
}

body.ka-v3-dark .ka-stat-card {
    background: #1c1c1e;
}

body.ka-v3-dark .ka-stat-value {
    color: #f5f5f7;
}

body.ka-v3-dark .ka-filter-bar {
    background: #1c1c1e;
}

body.ka-v3-dark .ka-filter-bar label {
    color: #86868b;
}

body.ka-v3-dark .ka-filter-bar input[type="date"] {
    background: #2c2c2e;
    border-color: rgba(255, 255, 255, 0.1);
    color: #f5f5f7;
}

body.ka-v3-dark .ka-filter-bar .button {
    background: rgba(255, 255, 255, 0.1);
    color: #f5f5f7;
}

body.ka-v3-dark .ka-table th {
    background: rgba(255, 255, 255, 0.04);
    color: #86868b;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.ka-v3-dark .ka-table td {
    color: #f5f5f7;
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

body.ka-v3-dark .ka-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

body.ka-v3-dark .ka-product-cell a {
    color: #f5f5f7;
}

body.ka-v3-dark .ka-product-cell a:hover {
    color: #0a84ff;
}

body.ka-v3-dark .ka-sortable-item {
    background: #2c2c2e;
    border-color: rgba(255, 255, 255, 0.1);
    color: #f5f5f7;
}

body.ka-v3-dark .ka-sortable-item:hover {
    border-color: #0a84ff;
}

body.ka-v3-dark .ka-pro-notice,
body.ka-v3-dark .ka-upgrade-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(124, 58, 237, 0.15) 100%);
    border-color: rgba(139, 92, 246, 0.3);
}

body.ka-v3-dark .ka-upgrade-card li {
    color: #f5f5f7;
}

body.ka-v3-dark .ka-empty {
    color: #86868b;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .ka-admin-wrap {
        padding: 40px 24px;
    }

    .ka-admin-title {
        font-size: 36px;
    }

    .ka-grid-2 {
        grid-template-columns: 1fr;
    }

    .ka-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 782px) {
    .ka-admin-header {
        flex-direction: column;
        text-align: center;
    }

    .ka-admin-header-left {
        flex-direction: column;
        align-items: center;
    }

    .ka-admin-header-actions {
        justify-content: center;
    }

    .ka-row {
        flex-direction: column;
        gap: 10px;
    }

    .ka-row-label {
        width: 100%;
        padding-top: 0;
    }

    .ka-tabs {
        flex-wrap: wrap;
        width: 100%;
        justify-content: center;
    }

    .ka-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .ka-export-btn {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }

    .ka-stats-grid {
        grid-template-columns: 1fr;
    }

    .ka-table {
        display: block;
        overflow-x: auto;
    }
}

/* ===== WP COLOR PICKER ===== */
.wp-picker-container {
    display: inline-block;
}

/* Iris (WP Color Picker) relies on content-box sizing for correct geometry; our global
   `.ka-admin-wrap * { box-sizing: border-box; }` can break slider placement. */
body.ka-admin-v3 .wp-picker-container .iris-picker,
body.ka-admin-v3 .wp-picker-container .iris-picker * {
    box-sizing: content-box;
}

body.ka-admin-v3 .wp-picker-container .iris-picker {
    direction: ltr;
}

/* Iris container border (dark theme) */
body.ka-v3-dark .wp-picker-container .iris-border {
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 200px;
    background-color: #2c2c2e;
}

.wp-picker-container .wp-color-result {
    height: 38px;
    border-radius: 8px;
}

body.ka-v3-dark .wp-picker-container .wp-color-result {
    border-color: rgba(255, 255, 255, 0.2);
}

/* WP Color Picker text label (dark theme) */
body.ka-v3-dark .wp-picker-container .wp-color-result-text {
    background: #2c2c2e;
    border-left: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(245, 245, 247, 0.85);
}

.wp-picker-container input.wp-color-picker {
    max-width: 100px !important;
}
