/**
 * Biscotti CMP - Admin Styles
 *
 * Local admin UI styles for all plugin pages.
 * All styles are enqueued via wp_enqueue_style() — no inline <style> tags.
 *
 * @package Biscotti_CMP
 * @since 3.1.0
 */

/* ============================================================================
   ADMIN LAYOUT
   ============================================================================ */

.biscotti-admin-wrap {
    max-width: 1200px;
    margin: 20px auto;
    padding-bottom: 60px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#biscotti-dynamic-view {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* ============================================================================
   PAGE HEADER — Global gradient header for ALL plugin views
   ============================================================================ */

#biscotti-dynamic-view h2 {
    margin-top: 0;
    padding-bottom: 12px;
    font-size: 1.4em;
}
#biscotti-dynamic-view h2:not(.bsc-page-header h2) {
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
}

.bsc-page-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    padding: 28px 24px;
    border-radius: 16px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}
.bsc-page-header::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(212,165,116,0.15) 0%, transparent 70%);
    pointer-events: none;
}
/* Ensure the dark-gradient header h2 stays white */
.bsc-page-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff !important;
    border-bottom: none;
    padding-bottom: 0;
}
.bsc-page-header p {
    margin: 6px 0 0;
    color: #94a3b8;
    font-size: 14px;
}
.bsc-page-header .bsc-plan-badge {
    background: linear-gradient(135deg, #9B6B3C, #8B5A2B);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================================
   CONNECTION WIZARD
   ============================================================================ */

.biscotti-connection-wizard {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.biscotti-connection-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 40px;
    max-width: 480px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.biscotti-connection-card .biscotti-logo {
    margin-bottom: 16px;
}

.biscotti-connection-card h2 {
    margin: 0 0 8px;
    color: #1e293b;
}

.biscotti-connection-card p {
    color: #64748b;
    margin: 0 0 24px;
}

.biscotti-form-group {
    text-align: left;
    margin-bottom: 16px;
}

.biscotti-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    color: #374151;
}

.biscotti-form-group input {
    width: 100% !important;
    padding: 8px 12px;
    border-radius: 6px;
}

.biscotti-help-text {
    margin-top: 16px;
    color: #94a3b8;
    font-size: 0.9em;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.biscotti-admin-wrap .button-primary {
    background: linear-gradient(135deg, #9B6B3C 0%, #8B5A2B 100%);
    border: none;
    color: #fff;
    border-radius: 6px;
    padding: 8px 20px;
    font-weight: 600;
    transition: all 0.2s;
}

.biscotti-admin-wrap .button-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.4);
}

.biscotti-admin-wrap .button-hero {
    font-size: 16px;
    padding: 12px 32px;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 782px) {
    .biscotti-admin-wrap {
        margin: 10px;
    }

    .biscotti-connection-card {
        padding: 24px;
    }
}


/* ============================================================================
   SUPPRESS FOREIGN NOTICES ON BISCOTTI PAGES
   Moved from inline wp_add_inline_style() to proper stylesheet rule.
   ============================================================================ */

.biscotti-admin-wrap ~ .notice:not(.biscotti-notice),
.biscotti-admin-wrap ~ .update-nag,
.biscotti-admin-wrap ~ .updated:not(.biscotti-notice),
.biscotti-admin-wrap ~ .error:not(.biscotti-notice),
body.toplevel_page_biscotti-cmp .notice:not(.biscotti-notice),
body.toplevel_page_biscotti-cmp .update-nag,
body.toplevel_page_biscotti-cmp .updated:not(.biscotti-notice),
body.toplevel_page_biscotti-cmp .error:not(.biscotti-notice),
body[class*="biscotti"] .notice:not(.biscotti-notice),
body[class*="biscotti"] .update-nag,
body[class*="biscotti"] .updated:not(.biscotti-notice),
body[class*="biscotti"] .error:not(.biscotti-notice) {
    display: none !important;
}

/* ============================================================================
   STAT CARD GRID
   ============================================================================ */

.biscotti-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.biscotti-stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: box-shadow 0.2s ease;
}

.biscotti-stat-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.biscotti-stat-card .biscotti-stat-icon {
    font-size: 24px;
    color: #9B6B3C;
    margin-bottom: 4px;
}

.biscotti-stat-card .biscotti-stat-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.biscotti-stat-card .biscotti-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.biscotti-stat-card .biscotti-stat-change {
    font-size: 12px;
    color: #22c55e;
    font-weight: 500;
}

.biscotti-stat-card .biscotti-stat-change.negative {
    color: #ef4444;
}

/* ============================================================================
   FORM STYLES (WordPress form-table pattern)
   ============================================================================ */

.biscotti-admin-wrap .form-table {
    margin-top: 16px;
}

.biscotti-admin-wrap .form-table th {
    padding: 16px 10px 16px 0;
    width: 220px;
    vertical-align: top;
    font-weight: 600;
    color: #1e293b;
}

.biscotti-admin-wrap .form-table td {
    padding: 12px 10px;
    vertical-align: top;
}

.biscotti-admin-wrap .form-table td p.description {
    margin-top: 6px;
    color: #64748b;
    font-size: 13px;
    font-style: normal;
}

.biscotti-admin-wrap .form-table input[type="text"],
.biscotti-admin-wrap .form-table input[type="number"],
.biscotti-admin-wrap .form-table input[type="url"],
.biscotti-admin-wrap .form-table input[type="email"],
.biscotti-admin-wrap .form-table textarea,
.biscotti-admin-wrap .form-table select {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.biscotti-admin-wrap .form-table input:focus,
.biscotti-admin-wrap .form-table textarea:focus,
.biscotti-admin-wrap .form-table select:focus {
    border-color: #9B6B3C;
    box-shadow: 0 0 0 1px #9B6B3C;
    outline: none;
}

.biscotti-admin-wrap .form-table textarea {
    min-height: 80px;
    resize: vertical;
}

/* Toggle switch */
.biscotti-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.biscotti-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.biscotti-toggle .biscotti-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    border-radius: 24px;
    transition: background-color 0.2s;
}

.biscotti-toggle .biscotti-toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.biscotti-toggle input:checked + .biscotti-toggle-slider {
    background-color: #9B6B3C;
}

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

.biscotti-toggle input:focus + .biscotti-toggle-slider {
    box-shadow: 0 0 0 2px rgba(155, 107, 60, 0.3);
}

/* Form actions row */
.biscotti-form-actions {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

/* ============================================================================
   DATA TABLE STYLES
   ============================================================================ */

.biscotti-data-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.biscotti-data-table thead th {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.biscotti-data-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #334155;
    vertical-align: middle;
}

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

.biscotti-data-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.biscotti-data-table tbody tr:hover {
    background: #f1f5f9;
}

.biscotti-data-table .biscotti-table-actions {
    white-space: nowrap;
}

.biscotti-data-table .biscotti-table-actions .button {
    margin-right: 4px;
}

.biscotti-data-table .biscotti-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
}

.biscotti-badge-success {
    background: #dcfce7;
    color: #166534;
}

.biscotti-badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.biscotti-badge-error {
    background: #fee2e2;
    color: #991b1b;
}

.biscotti-badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Empty state for tables */
.biscotti-data-table .biscotti-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.biscotti-data-table .biscotti-empty-state .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #cbd5e1;
    margin-bottom: 12px;
}

/* ============================================================================
   PREMIUM INFO CARD
   ============================================================================ */

.biscotti-premium-info {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 40vh;
    padding: 40px 20px;
}

.biscotti-info-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.biscotti-info-card .biscotti-info-icon {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #9B6B3C;
    margin-bottom: 16px;
}

.biscotti-info-card h2 {
    margin: 0 0 12px;
    font-size: 22px;
    color: #1e293b;
}

.biscotti-info-card p {
    color: #64748b;
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 24px;
}

.biscotti-info-card .button-primary {
    font-size: 15px;
    padding: 10px 28px;
}

/* ============================================================================
   LOADING SPINNER
   ============================================================================ */

.biscotti-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #64748b;
    font-size: 14px;
}

.biscotti-loading .biscotti-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #9B6B3C;
    border-radius: 50%;
    animation: biscotti-spin 0.8s linear infinite;
    margin-bottom: 12px;
}

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

.biscotti-loading-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.biscotti-loading-inline .biscotti-spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
    margin-bottom: 0;
}

/* ============================================================================
   MODAL / OVERLAY (Document Preview)
   ============================================================================ */

.biscotti-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.biscotti-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.biscotti-modal {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.2s;
}

.biscotti-modal-overlay.active .biscotti-modal {
    transform: translateY(0);
}

.biscotti-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.biscotti-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #1e293b;
}

.biscotti-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.2s;
}

.biscotti-modal-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.biscotti-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    font-size: 14px;
    line-height: 1.7;
    color: #334155;
}

.biscotti-modal-footer {
    padding: 12px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

/* ============================================================================
   COLOR PICKER INTEGRATION
   ============================================================================ */

.biscotti-color-field {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.biscotti-color-field label {
    min-width: 140px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.biscotti-color-field .wp-picker-container {
    display: inline-flex;
    align-items: center;
}

.biscotti-color-field .wp-picker-container .wp-color-result {
    border-radius: 4px;
    height: 30px;
    min-width: 30px;
}

.biscotti-color-field .wp-picker-container .wp-picker-input-wrap {
    margin-left: 8px;
}

.biscotti-color-field .wp-picker-container .wp-picker-input-wrap input.wp-color-picker {
    width: 80px;
    font-size: 13px;
}

.biscotti-color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

/* ============================================================================
   TOAST NOTIFICATION (positioned, auto-dismiss)
   ============================================================================ */

.biscotti-toast {
    position: fixed;
    top: 40px;
    right: 20px;
    z-index: 100001;
    padding: 12px 20px;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 360px;
}

.biscotti-toast.active {
    transform: translateX(0);
}

.biscotti-toast-success {
    background: #166534;
    color: #fff;
}

.biscotti-toast-error {
    background: #991b1b;
    color: #fff;
}

.biscotti-toast-warning {
    background: #92400e;
    color: #fff;
}

.biscotti-toast-info {
    background: #1e40af;
    color: #fff;
}

/* ============================================================================
   ADMIN NOTICES (WordPress pattern)
   ============================================================================ */

.biscotti-notice {
    border-left-width: 4px;
    border-left-style: solid;
    padding: 12px 16px;
    margin: 16px 0;
    background: #fff;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.biscotti-notice-success {
    border-left-color: #22c55e;
}

.biscotti-notice-error {
    border-left-color: #ef4444;
}

.biscotti-notice-warning {
    border-left-color: #f59e0b;
}

.biscotti-notice-info {
    border-left-color: #3b82f6;
}

.biscotti-notice p {
    margin: 0;
    font-size: 14px;
    color: #334155;
}

/* ============================================================================
   PAGE SECTIONS
   ============================================================================ */

.biscotti-page {
    margin-top: 16px;
}

.biscotti-page h1 {
    font-size: 23px;
    font-weight: 400;
    margin: 0 0 16px;
    color: #1e293b;
}

.biscotti-section {
    margin-bottom: 24px;
}

.biscotti-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

/* ============================================================================
   DASHBOARD (native)
   ============================================================================ */

.biscotti-dash-hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    padding: 28px 24px;
    border-radius: 12px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.biscotti-dash-hero::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(212, 165, 116, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.biscotti-dash-hero h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.biscotti-dash-hero p {
    margin: 8px 0 0;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.5;
    max-width: 640px;
}

.biscotti-dash-period {
    margin: 0 0 16px;
}

.biscotti-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.biscotti-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}

.biscotti-card h3 {
    margin: 0 0 16px;
    font-size: 16px;
    color: #1e293b;
}

.biscotti-device-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.biscotti-device-name {
    min-width: 110px;
    font-size: 14px;
    color: #334155;
}

.biscotti-device-pct {
    min-width: 44px;
    text-align: right;
    font-weight: 600;
    color: #1e293b;
}

.biscotti-bar-wrap {
    flex: 1;
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}

.biscotti-bar {
    display: block;
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.biscotti-quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.biscotti-action-btn {
    display: block;
    padding: 14px 12px;
    text-align: center;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: #1e293b;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.biscotti-action-btn:hover,
.biscotti-action-btn:focus {
    border-color: #9B6B3C;
    background: #FFF9F5;
    color: #1e293b;
}

/* ============================================================================
   TOOLS / SCANNER (native)
   ============================================================================ */

.biscotti-tools-intro {
    margin: 0 0 16px;
    line-height: 1.6;
}

.biscotti-plan-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    background: #FFF9F5;
    border: 1px solid #E7C9A9;
    color: #8B5A2B;
    font-size: 12px;
    font-weight: 600;
    vertical-align: middle;
}

.biscotti-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.biscotti-pill-green { background: #dcfce7; color: #166534; }
.biscotti-pill-blue  { background: #dbeafe; color: #1e40af; }
.biscotti-pill-red   { background: #fee2e2; color: #991b1b; }
.biscotti-pill-gray  { background: #f1f5f9; color: #475569; }

.biscotti-page-tools .biscotti-empty-state {
    text-align: center;
    padding: 24px 16px;
    color: #64748b;
}

.biscotti-empty-icon {
    font-size: 36px;
    width: 36px;
    height: 36px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.biscotti-page-tools .biscotti-empty-state h3 {
    margin: 4px 0;
    color: #334155;
}

.biscotti-issues-list .notice {
    margin: 8px 0;
}

#biscotti-scan-status {
    margin-left: 12px;
    font-size: 13px;
}

/* ============================================================================
   SUBSCRIPTION (native)
   ============================================================================ */

.biscotti-sub-header {
    margin-bottom: 16px;
}

.biscotti-sub-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 4px;
}

.biscotti-sub-email {
    color: #64748b;
    margin-right: 10px;
}

.biscotti-features-table td {
    padding: 8px 12px;
}

.biscotti-features-table .biscotti-feature-val {
    font-weight: 600;
    color: #1e293b;
    text-align: right;
}

.biscotti-usage-bar {
    background: #e5e7eb;
    border-radius: 6px;
    height: 14px;
    overflow: hidden;
    max-width: 480px;
}

.biscotti-usage-fill {
    height: 100%;
    background: #22c55e;
    transition: width 0.3s ease;
}

.biscotti-usage-fill.is-high {
    background: #ef4444;
}

.biscotti-ltd-card {
    border: 2px solid #4ade80;
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
}

/* ============================================================================
   DOCUMENTS (native)
   ============================================================================ */

.biscotti-doc-gen-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.biscotti-doc-select {
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    min-width: 240px;
}

.biscotti-doc-select:focus {
    border-color: #9B6B3C;
    outline: none;
    box-shadow: 0 0 0 2px rgba(212, 165, 116, 0.2);
}

.biscotti-doc-sc {
    font-size: 11px;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    color: #475569;
}

.biscotti-doc-copy {
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    margin-left: 4px;
    opacity: 0.7;
}

.biscotti-doc-copy:hover {
    opacity: 1;
}

.biscotti-pill-amber {
    background: #fef3c7;
    color: #92400e;
}

.biscotti-documents-table .biscotti-table-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.biscotti-doc-is-published {
    color: #b91c1c;
    border-color: #fecaca;
}

/* Modals (editor + assigner) — hidden by default, .is-open shows */
.biscotti-doc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
}

.biscotti-doc-overlay.is-open {
    display: flex;
}

.biscotti-doc-modal {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 880px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.biscotti-doc-modal-sm {
    max-width: 480px;
}

.biscotti-doc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.biscotti-doc-modal-header h3 {
    margin: 0;
    font-size: 16px;
}

.biscotti-doc-modal-close {
    border: none;
    background: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #94a3b8;
}

.biscotti-doc-modal-close:hover {
    color: #ef4444;
}

.biscotti-doc-modal-body {
    padding: 20px;
}

.biscotti-doc-editor-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    font-size: 14px;
    line-height: 1.7;
    min-height: 300px;
    outline: none;
}

.biscotti-doc-editor-content:focus {
    box-shadow: inset 0 0 0 2px rgba(212, 165, 116, 0.3);
}

.biscotti-doc-modal-footer {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid #e2e8f0;
}

/* ============================================================================
   SERVICES / PROVIDER EDITOR (native)
   ============================================================================ */

.biscotti-svc-hint {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #92400e;
}

.biscotti-form-row {
    margin: 0 0 12px;
}

.biscotti-form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 13px;
    color: #334155;
}

.biscotti-svc-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.biscotti-svc-input:focus {
    border-color: #9B6B3C;
    outline: none;
    box-shadow: 0 0 0 2px rgba(212, 165, 116, 0.2);
}

.biscotti-btn-danger {
    color: #b91c1c !important;
    border-color: #fecaca !important;
}

.biscotti-services-table td {
    vertical-align: middle;
}

/* ============================================================================
   LEGAL WIZARD (native)
   ============================================================================ */

.biscotti-lw-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 16px 0 20px;
}

.biscotti-lw-step {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 5px 12px 5px 6px;
    cursor: pointer;
    font-size: 12px;
    color: #64748b;
    transition: all 0.15s;
}

.biscotti-lw-step:hover { border-color: #c49a6c; }

.biscotti-lw-step.active {
    border-color: #9B6B3C;
    background: #FFF9F5;
    color: #1e293b;
    font-weight: 600;
}

.biscotti-lw-step.done { color: #166534; }

.biscotti-lw-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f1f5f9;
    font-size: 11px;
    font-weight: 700;
}

.biscotti-lw-step.active .biscotti-lw-step-num { background: #9B6B3C; color: #fff; }
.biscotti-lw-step.done .biscotti-lw-step-num { background: #16a34a; color: #fff; }

.biscotti-lw-panel { display: none; }
.biscotti-lw-panel.active { display: block; }

.biscotti-lw-panel h4 {
    margin: 18px 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.biscotti-lw-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.biscotti-lw-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.biscotti-lw-radio-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }

.lw-radio, .lw-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    background: #fff;
}

.lw-cb { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }

.biscotti-lw-toggle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.biscotti-lw-comp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.biscotti-lw-comp-grid .lw-comp-label { display: block; font-size: 12px; color: #64748b; margin-bottom: 4px; }

.biscotti-lw-disclaimer {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    font-size: 13px;
    line-height: 1.6;
    color: #475569;
}

.biscotti-lw-agb-link { margin-top: 16px; padding-top: 12px; border-top: 1px solid #e2e8f0; }

.biscotti-lw-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding: 14px 0;
}

.biscotti-page-legal-wizard .biscotti-empty-state {
    text-align: center;
    color: #64748b;
    padding: 24px;
}

@media (max-width: 782px) {
    .biscotti-lw-grid-2, .biscotti-lw-grid-3, .biscotti-lw-comp-grid { grid-template-columns: 1fr; }
}

.biscotti-jt-hint {
    margin: 16px 0;
    font-size: 13px;
    color: #475569;
}

.biscotti-agb-cat { margin-bottom: 16px; }
.biscotti-agb-q { padding: 10px 0; border-top: 1px solid #f1f5f9; }
.biscotti-agb-q:first-of-type { border-top: none; }
.biscotti-agb-label { display: block; font-weight: 600; font-size: 13px; color: #334155; margin-bottom: 4px; }

/* ============================================================================
   RESPONSIVE ADJUSTMENTS FOR NEW COMPONENTS
   ============================================================================ */

@media (max-width: 782px) {
    .biscotti-stats-grid {
        grid-template-columns: 1fr;
    }

    .biscotti-two-col {
        grid-template-columns: 1fr;
    }

    .biscotti-quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    .biscotti-stat-card .biscotti-stat-value {
        font-size: 22px;
    }

    .biscotti-admin-wrap .form-table th {
        width: auto;
        display: block;
        padding-bottom: 4px;
    }

    .biscotti-admin-wrap .form-table td {
        display: block;
        padding-left: 0;
    }

    .biscotti-admin-wrap .form-table input[type="text"],
    .biscotti-admin-wrap .form-table input[type="number"],
    .biscotti-admin-wrap .form-table textarea,
    .biscotti-admin-wrap .form-table select {
        max-width: 100%;
    }

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

    .biscotti-info-card {
        padding: 24px;
    }

    .biscotti-modal {
        max-height: 90vh;
        margin: 10px;
    }

    .biscotti-color-grid {
        grid-template-columns: 1fr;
    }

    .biscotti-color-field {
        flex-direction: column;
        align-items: flex-start;
    }

    .biscotti-toast {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}
