/* ===== FORM WRAPPER ===== */
.ai-form {
    max-width: 600px;
    margin: 50px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid #eee;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ===== FIELD WRAPPER ===== */
.ai-field {
    margin-bottom: 22px;
}

/* ===== LABEL ===== */
.ai-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #222;
}

/* ===== INPUTS ===== */
.ai-input,
.ai-textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #fafafa;
    transition: all 0.2s ease;
}

.ai-input:focus,
.ai-textarea:focus {
    background: #fff;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
    outline: none;
}

.ai-textarea {
    min-height: 120px;
    resize: vertical;
}

/* ===== BUTTON ===== */
.ai-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #0073aa, #005f8d);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.ai-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 115, 170, 0.25);
}

.ai-button:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ===== MESSAGE ===== */
.ai-message {
    max-width: 600px;
    margin: 30px auto;
    padding: 12px 16px;
    background: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 8px;
    color: #856404;
    font-size: 14px;
}

.ai-success {
    max-width: 600px;
    margin: 20px auto;
    padding: 12px 16px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    color: #155724;
    font-size: 14px;
}

/* =====================================================
   OWNER DASHBOARD (RESTORED ORIGINAL GRID CARD SYSTEM)
===================================================== */

.ai-dashboard-wrapper {
    max-width: 1000px;
    margin: 50px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ai-dashboard-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 25px;
    color: #1a1a1a;
}

/* IMPORTANT: ORIGINAL GRID BEHAVIOUR RESTORED */
.ai-properties-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

@media (min-width: 768px) {
    .ai-properties-list {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1100px) {
    .ai-properties-list {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* PROPERTY CARD (UNCHANGED LOOK) */
.ai-property-card {
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    transition: all 0.25s ease;
}

.ai-property-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
}

.ai-property-name {
    font-size: 18px;
    font-weight: 600;
    color: #111;
    margin-bottom: 4px;
}

.ai-property-address {
    font-size: 13px;
    color: #777;
    margin-bottom: 14px;
}

.ai-assigned-agent {
    font-size: 13px;
    color: #333;
    margin: 10px 0;
    padding: 8px 10px;
    background: #f7f7f7;
    border-radius: 8px;
}

/* BUTTONS */
.ai-btn {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.ai-btn-primary {
    background: linear-gradient(135deg, #0073aa, #005f8d);
    color: #fff;
    margin-bottom: 14px;
}

.ai-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0, 115, 170, 0.25);
}

.ai-btn-secondary {
    background: #2c2c2c;
    color: #fff;
}

.ai-btn-secondary:hover {
    background: #000;
}

.ai-assign-form {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.ai-assign-form .ai-input {
    margin: 6px 0 10px 0;
}

/* =====================================================
   PROPERTY DASHBOARD (UNCHANGED)
===================================================== */

.ai-property-dashboard {
    max-width: 1400px;
    margin: 50px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ai-property-dashboard-header {
    margin-bottom: 25px;
}

.ai-property-dashboard-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #111;
}

.ai-property-dashboard-address {
    font-size: 14px;
    color: #777;
}

.ai-no-inspections {
    margin-top: 20px;
    padding: 12px;
    background: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 8px;
    color: #856404;
}

.ai-inspection-table-wrapper {
    margin-top: 20px;
    overflow-x: auto;
}

.ai-inspection-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
}

.ai-inspection-table thead {
    background: #0073aa;
    color: #fff;
}

.ai-inspection-table th,
.ai-inspection-table td {
    padding: 14px 16px;
    text-align: left;
    font-size: 14px;
}

.ai-inspection-table tbody tr {
    border-bottom: 1px solid #eee;
}

.ai-inspection-table tbody tr:hover {
    background: #f9f9f9;
}


/* =====================================================
   SAAS MODAL SYSTEM v2 (DARK GLASS UI)
===================================================== */

.ai-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;

    background: rgba(2, 6, 23, 0.75);
    backdrop-filter: blur(8px);
}

/* MAIN MODAL CARD */
.ai-modal-content {
    background: #0f172a; /* SaaS dark base */
    margin: 4% auto;
    width: 92%;
    max-width: 960px;

    border-radius: 18px;
    position: relative;
    overflow: hidden;

    border: 1px solid #1e293b;
    box-shadow: 0 25px 70px rgba(0,0,0,0.6);

    animation: modalIn 0.18s ease-out;
}

/* ENTRY ANIMATION */
@keyframes modalIn {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* CLOSE BUTTON */
.ai-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 26px;
    cursor: pointer;
    color: #94a3b8;
    transition: 0.2s ease;
}

.ai-modal-close:hover {
    color: #ffffff;
}

/* BODY AREA */
#ai-modal-body {
    padding: 22px;
    max-height: 75vh;
    overflow-y: auto;

    background: linear-gradient(
        180deg,
        #0f172a 0%,
        #0b1222 100%
    );
}

/* =====================================================
   SUMMARY BLOCK (HEADER INFO)
===================================================== */

.ai-modal-summary {
    background: #111c33;
    border: 1px solid #1e293b;
    padding: 14px 16px;
    border-radius: 14px;

    font-size: 13px;
    color: #cbd5e1;

    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* =====================================================
   INSPECTION ITEMS
===================================================== */

.ai-inspection-details {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ai-modal-item {
    background: #111c33;
    border: 1px solid #1e293b;
    border-radius: 14px;

    padding: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    transition: all 0.2s ease;
}

.ai-modal-item:hover {
    border-color: #334155;
    transform: translateY(-2px);
}

.ai-item-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #f1f5f9;
}

/* =====================================================
   INSTANCES
===================================================== */

.ai-modal-instances {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-modal-instance {
    background: #0b1222;
    border: 1px solid #1e293b;
    border-radius: 10px;
    padding: 10px 12px;

    color: #cbd5e1;
}

/* =====================================================
   BADGES (OPTIONAL BUT RECOMMENDED)
===================================================== */

.ai-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.ai-badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.ai-badge-ok {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* =====================================================
   GENERAL NOTES BLOCK
===================================================== */

.ai-modal-general-notes {
    margin-top: 10px;
    background: #111c33;
    border: 1px solid #1e293b;
    border-radius: 14px;
    padding: 14px 16px;
    color: #cbd5e1;
}

.ai-modal-general-notes h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* =====================================================
   SCROLLBAR (NICE TOUCH)
===================================================== */

#ai-modal-body::-webkit-scrollbar {
    width: 8px;
}

#ai-modal-body::-webkit-scrollbar-track {
    background: #0b1222;
}

#ai-modal-body::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 10px;
}

#ai-modal-body::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 768px) {
    .ai-modal-content {
        margin: 6% auto;
        width: 95%;
    }

    .ai-modal-summary {
        grid-template-columns: 1fr;
    }
}
/* =====================================================
   PAGINATION (NEW — ISOLATED)
===================================================== */

.ai-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    gap: 10px;
}

.ai-page-info {
    font-size: 14px;
    color: #555;
}

/* =====================================================
   AGENT DASHBOARD (FULLY ISOLATED — NO BLEED)
===================================================== */

.ai-agent-dashboard-wrapper {
    max-width: 1000px;
    margin: 50px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ai-agent-dashboard-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 25px;
    color: #1a1a1a;
}

/* GRID (same behavior, different class) */
.ai-agent-properties-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

@media (min-width: 768px) {
    .ai-agent-properties-list {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1100px) {
    .ai-agent-properties-list {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* CARD */
.ai-agent-card {
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    transition: all 0.25s ease;
}

.ai-agent-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
}

.ai-agent-card-name {
    font-size: 18px;
    font-weight: 600;
    color: #111;
    margin-bottom: 4px;
}

.ai-agent-card-address {
    font-size: 13px;
    color: #777;
    margin-bottom: 14px;
}

/* BUTTON (DO NOT reuse .ai-btn) */
.ai-agent-btn {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ai-agent-btn-primary {
    background: linear-gradient(135deg, #0073aa, #005f8d);
    color: #fff;
}

.ai-agent-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0, 115, 170, 0.25);
}

/* AGENT OWNER GROUP */
.ai-agent-owner-group {
    margin-bottom: 30px;
}

.ai-agent-owner-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #333;
}

/* 2 COLUMN GRID */
.ai-agent-properties-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

@media (min-width: 768px) {
    .ai-agent-properties-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* =====================================================
   START SCREEN BUTTON STYLES (ISOLATED + HARDENED)
   ===================================================== */

.inspection-start-screen {
    margin-top: 20px;
}

.inspection-start-screen .inspection-start-form {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    align-items: center;
}

/* Base style for BOTH button + anchor */
.inspection-start-screen button,
.inspection-start-screen a.btn-issues {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 12px 22px !important;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;

    border-radius: 10px !important;
    border: none !important;

    text-decoration: none !important;
    cursor: pointer;

    line-height: 1;
    white-space: nowrap;

    transition: all 0.2s ease;

    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
}

/* GREEN BUTTON */
.inspection-start-screen .btn-ok {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #fff;
}

/* RED BUTTON */
.inspection-start-screen a.btn-issues {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
}

/* Hover */
.inspection-start-screen .btn-ok:hover {
    background: linear-gradient(135deg, #27ae60, #1e8449);
    transform: translateY(-1px);
}

.inspection-start-screen a.btn-issues:hover {
    background: linear-gradient(135deg, #c0392b, #922b21);
    transform: translateY(-1px);
}

/* Active */
.inspection-start-screen button:active,
.inspection-start-screen a.btn-issues:active {
    transform: scale(0.97);
}

/* =====================================================
   INSPECTION BACK BUTTON (FULLY ISOLATED — NEW)
===================================================== */

.ai-inspection-back-wrapper {
    margin-bottom: 20px;
}

.ai-inspection-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;

    background: #2c2c2c;
    color: #ffffff !important;

    border-radius: 8px;
    text-decoration: none !important;

    transition: all 0.2s ease;

    /* isolation */
    border: none;
    line-height: 1;
}

.ai-inspection-back-btn:hover {
    background: #000000;
    transform: translateY(-1px);
}

.ai-inspection-back-btn:active {
    transform: scale(0.97);
}

/* =====================================================
   ISSUE FORM (MATCHES CURRENT PHP EXACTLY)
===================================================== */

.ai-inspection-issue-wrapper {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* HEADER */
.ai-inspection-issue-header {
    margin-bottom: 25px;
}

.ai-inspection-title {
    font-size: 26px;
    font-weight: 700;
    color: #111;
    margin-bottom: 6px;
}

.ai-inspection-address {
    font-size: 14px;
    color: #777;
}

/* FORM */
.ai-inspection-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ITEM CARD */
.ai-inspection-item-card {
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 8px 22px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.ai-inspection-item-card:hover {
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

/* ITEM TITLE */
.ai-inspection-item-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #111;
}

/* INSTANCES WRAPPER */
.ai-inspection-instances {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* SIMPLE ITEM WRAPPER */
.ai-inspection-simple {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* LABEL */
.ai-inspection-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* CHECKBOX */
.ai-inspection-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #0073aa;
    cursor: pointer;
}

/* LOCATION TEXT */
.ai-inspection-location {
    font-size: 14px;
}

/* TEXTAREA */
.ai-inspection-textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #fafafa;
    resize: vertical;
    min-height: 60px;
    transition: all 0.2s ease;
}

.ai-inspection-textarea:focus {
    outline: none;
    background: #fff;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.15);
}

/* SUBMIT WRAPPER */
.ai-inspection-submit-wrapper {
    margin-top: 10px;
}

/* SUBMIT BUTTON */
.ai-inspection-submit-btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;

    background: linear-gradient(135deg, #0073aa, #005f8d);
    color: #fff;

    transition: all 0.25s ease;
}

.ai-inspection-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,115,170,0.25);
}

.ai-inspection-submit-btn:active {
    transform: scale(0.98);
}

/* =====================================================
   OWNER DASHBOARD - MANAGE PROPERTY BUTTON (NEW)
===================================================== */

.ai-btn-manage {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;

    background: linear-gradient(135deg, #005f8d, #004c73);
    color: #fff;

    margin-bottom: 14px;

    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.ai-btn-manage:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(108, 92, 231, 0.25);
    background: linear-gradient(135deg, #005f8d, #004c73);
}

.ai-btn-manage:active {
    transform: translateY(0);
    box-shadow: none;
}

/* =====================================================
   PROPERTY FEATURES (FULLY ISOLATED MODULE)
   PREFIX: ai-features-
===================================================== */

.ai-features-wrapper {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* HEADER */
.ai-features-title {
    font-size: 26px;
    font-weight: 700;
    color: #111;
    margin-bottom: 6px;
}

.ai-features-subtitle {
    font-size: 14px;
    color: #777;
    margin-bottom: 20px;
}

/* ADD FORM */
.ai-features-add-form {
    display: block;
    margin-bottom: 20px;
}

.ai-features-input {
    flex: 0 0 100%;
    padding: 18px 16px;
    font-size: 18px;
    min-height: 48px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #fafafa;
    transition: all 0.2s ease;
}

.ai-features-input:focus {
    outline: none;
    background: #fff;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.15);
}

/* BUTTONS (LOCAL ONLY) */
.ai-features-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;

    border-radius: 8px;
    border: none;
    cursor: pointer;

    transition: all 0.2s ease;
    white-space: nowrap;
}

/* PRIMARY */
.ai-features-btn-primary {
    background: linear-gradient(135deg, #0073aa, #005f8d);
    color: #fff;
}

.ai-features-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0,115,170,0.25);
}

/* SMALL BUTTON (EDIT) */
.ai-features-btn-small {
    background: #2c2c2c;
    color: #fff;
}

.ai-features-btn-small:hover {
    background: #000;
    transform: translateY(-1px);
}

/* DANGER (DELETE) */
.ai-features-btn-danger {
    background: #e74c3c;
    color: #fff;
}

.ai-features-btn-danger:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

/* CARD */
.ai-features-card {
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 8px 22px rgba(0,0,0,0.05);
}

.ai-features-card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    color: #111;
}

/* ROW (THIS FIXES YOUR LAYOUT ISSUE) */
.ai-features-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f1f1;
}

/* LEFT SIDE (CHECKBOX + NAME) */
.ai-features-label {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.ai-features-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #0073aa;
    cursor: pointer;
}

.ai-features-name {
    font-size: 14px;
    color: #333;

    /* prevents long text breaking layout */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ACTION AREA (FIXED ALIGNMENT) */
.ai-features-actions {
    display: flex;
    align-items: center;
    gap: 8px;

    flex-shrink: 0;
}

/* EDIT INPUT (FIXED WIDTH ISSUE) */
.ai-features-edit-input {
    width: 140px;
    max-width: 140px;

    padding: 6px 8px;
    font-size: 13px;

    border-radius: 6px;
    border: 1px solid #ddd;
    background: #fafafa;

    transition: all 0.2s ease;
}

.ai-features-edit-input:focus {
    outline: none;
    background: #fff;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.15);
}

/* FOOTER */
.ai-features-footer {
    margin-top: 18px;
}

/* SUCCESS MESSAGE */
.ai-features-success {
    margin: 15px 0;
    padding: 12px 16px;

    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;

    color: #155724;
    font-size: 14px;
}

/* =====================================================
   BACK BUTTON (PROPERTY FEATURES ONLY)
   FULLY ISOLATED
===================================================== */

.ai-features-nav {
    margin-bottom: 16px;
}

.ai-features-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;

    background: #2c2c2c;
    color: #ffffff !important;

    border-radius: 8px;
    text-decoration: none !important;

    transition: all 0.2s ease;

    border: none;
    line-height: 1;
}

.ai-features-back-btn:hover {
    background: #000;
    transform: translateY(-1px);
}

.ai-features-back-btn:active {
    transform: scale(0.97);
}

/* =========================
   MOBILE RESPONSIVE FIX
========================= */
@media (max-width: 768px) {

    .ai-features-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .ai-features-label {
        width: 100%;
    }

    .ai-features-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .ai-features-edit-input {
        width: 100%;
        box-sizing: border-box;
    }

    .ai-features-instances {
        width: 100%;
        margin-top: 10px;
    }

    .ai-instance-row {
        display: flex;
        flex-direction: column;
        gap: 6px;
        width: 100%;
    }

    .ai-features-btn {
        width: 100%;
    }
}

.ai-add-item-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-add-item-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-add-item-heading {
    width: 100%;
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #555;
    margin-bottom: 5px;
}

.ai-add-item-card {
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.ai-add-item-heading {
    font-weight: 600;
    font-size: 14px;
    color: #444;
    margin-bottom: 10px;
}

.ai-add-item-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-note {
    margin-top: 8px;
    font-size: 13px;
    color: #444;
    background: #f6f7fb;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.ai-instance-note {
    margin-top: 6px;
    font-size: 13px;
    color: #555;
}

.ai-modal-general-notes {
    background: #fff8e6;
    border: 1px solid #ffe3a3;
    padding: 12px 14px;
    border-radius: 12px;
}

.ai-modal-general-notes h4 {
    margin: 0 0 6px 0;
    font-size: 14px;
    font-weight: 700;
}

/* =====================================================
   PROPERTY INSIGHTS MODULE (PREMIUM + FULLY ISOLATED)
   PREFIX: ai-insights-
===================================================== */

.ai-insights-module {
    max-width: 1100px;
    margin: 30px auto 0 auto;
    padding: 0 0 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* HEADER */
.ai-insights-header {
    margin-bottom: 16px;
}

.ai-insights-title {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    letter-spacing: 0.2px;
}

/* GRID */
.ai-insights-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 900px) {
    .ai-insights-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* CARD BASE */
.ai-insight-card {
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    transition: all 0.25s ease;
}

.ai-insight-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(0,0,0,0.08);
}

/* CARD TITLE */
.ai-insight-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
    letter-spacing: 0.3px;
}

/* LIST */
.ai-insight-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-insight-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 10px 12px;
    border-radius: 10px;

    background: #f8f9fb;
    border: 1px solid #eee;
}

/* TEXT */
.ai-insight-name {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

/* BADGE */
.ai-insight-badge {
    min-width: 28px;
    height: 24px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: 12px;
    font-weight: 700;

    background: #0073aa;
    color: #fff;

    border-radius: 999px;
}

/* EMPTY STATE */
.ai-insight-empty {
    font-size: 13px;
    color: #888;
    padding: 10px 0;
}

/* STATUS SECTION */
.ai-insight-status-row {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.ai-status-box {
    flex: 1;
    padding: 12px;
    border-radius: 12px;

    font-size: 13px;
    font-weight: 600;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* OPEN */
.ai-status-open {
    background: #fff5f5;
    border: 1px solid #ffd6d6;
    color: #c0392b;
}

/* RESOLVED */
.ai-status-resolved {
    background: #f1fbf5;
    border: 1px solid #c9f0d6;
    color: #1e8449;
}

.ai-insight-list + .ai-insight-subtitle {
    margin-top: 16px;
}

/* =====================================================
   GRAPH MODULE
===================================================== */

.ai-graph-module{
    margin-top:40px;
    background:#fff;
    border-radius:20px;
    padding:30px;
    box-shadow:0 4px 18px rgba(0,0,0,0.06);
    overflow-x:auto;
}

.ai-graph-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:30px;
    gap:20px;
    flex-wrap:wrap;
}

.ai-graph-title{
    font-size:22px;
    font-weight:700;
    color:#111827;
    margin:0;
}

.ai-graph-filters{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}

.ai-graph-filter{
    padding:10px 16px;
    border-radius:10px;
    background:#f3f4f6;
    color:#111827;
    text-decoration:none;
    font-size:14px;
    font-weight:600;
    transition:0.2s ease;
}

.ai-graph-filter:hover{
    background:#e5e7eb;
}

.ai-graph-filter.active{
    background:#111827;
    color:#fff;
}

.ai-graph-chart{
    display:flex;
    align-items:flex-end;
    gap:18px;
    min-height:320px;
    padding-top:30px;
    border-top:1px solid #e5e7eb;
}

.ai-graph-bar-group{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:flex-end;
    min-width:60px;
    flex:1;
}

.ai-graph-value{
    font-size:13px;
    font-weight:700;
    color:#111827;
    margin-bottom:10px;
}

.ai-graph-bar{
    width:100%;
    max-width:50px;
    background:linear-gradient(
        180deg,
        #3b82f6 0%,
        #1d4ed8 100%
    );
    border-radius:12px 12px 0 0;
    transition:0.3s ease;
}

.ai-graph-bar:hover{
    transform:translateY(-4px);
    opacity:0.9;
}

.ai-graph-label{
    margin-top:12px;
    font-size:12px;
    color:#6b7280;
    text-align:center;
    word-break:break-word;
}

@media(max-width:768px){

    .ai-graph-chart{
        min-width:700px;
    }

}

/* =========================================
   GRAPH AXIS + IMPROVED LAYOUT
========================================= */

.ai-graph-chart{
    display:flex;
    align-items:flex-end;
    gap:20px;
    min-height:340px;
    border-top:1px solid #e5e7eb;
    padding-top:30px;
}

.ai-graph-y-axis{
    width:50px;
    height:260px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    align-items:flex-end;
    padding-right:10px;
}

.ai-graph-y-label{
    font-size:12px;
    color:#6b7280;
    font-weight:600;
}

.ai-graph-bars-wrapper{
    flex:1;
    display:flex;
    align-items:flex-end;
    gap:12px;
    height:260px;
    border-left:2px solid #d1d5db;
    border-bottom:2px solid #d1d5db;
    padding-left:14px;
    padding-bottom:10px;
    overflow-x:auto;
}

.ai-graph-bar-group{
    flex:1;
    display:flex;
    flex-direction:column;
    justify-content:flex-end;
    align-items:center;
    height:100%;
    min-width:28px;
}

.ai-graph-value{
    margin-bottom:8px;
    font-size:12px;
    font-weight:700;
    color:#111827;
}

.ai-graph-bar{
    width:100%;
    max-width:40px;
    border-radius:10px 10px 0 0;
    background:linear-gradient(
        180deg,
        #3b82f6 0%,
        #1d4ed8 100%
    );
    transition:0.25s ease;
}

.ai-graph-bar:hover{
    transform:translateY(-3px);
    opacity:0.9;
}

.ai-graph-label{
    margin-top:10px;
    font-size:11px;
    color:#6b7280;
    text-align:center;
    font-weight:600;
    white-space:nowrap;
}

.ai-graph-chart {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    position: relative;
}

.ai-graph-y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 240px;
    padding-right: 10px;
    font-size: 11px;
    color: #666;
}

.ai-graph-bars-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.ai-graph-x-axis {
    position: absolute;
    bottom: 0;
    left: 40px;
    right: 0;
    height: 1px;
    background: #ddd;
}

@media (max-width: 768px) {

    .ai-graph-chart {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ai-graph-bars-wrapper {
        min-width: 700px; /* forces wider chart */
    }

    .ai-graph-main {
        min-width: 700px;
    }
}

/* =====================================================
   GLOBAL
===================================================== */

.ai-property-dashboard {
    padding: 40px;
    background: #f5f7fb;
    min-height: 100vh;
    font-family: Inter, sans-serif;
    color: #1e293b;
}

/* =====================================================
   HEADER
===================================================== */

.ai-property-dashboard-header {
    margin-bottom: 30px;
}

.ai-property-dashboard-title {
    font-size: 34px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #0f172a;
}

.ai-property-dashboard-address {
    color: #64748b;
    font-size: 15px;
}

/* =====================================================
   BUTTONS
===================================================== */

.ai-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s ease;
    cursor: pointer;
    border: none;
}

.ai-btn:hover {
    transform: translateY(-1px);
}

.ai-btn-secondary {
    background: white;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(15,23,42,.04);
}

.ai-btn-secondary:hover {
    background: #f8fafc;
}

.ai-view-inspection {
    background: #2563eb;
    color: white;
}

.ai-view-inspection:hover {
    background: #1d4ed8;
}

/* =====================================================
   TABLE
===================================================== */

.ai-inspection-table-wrapper {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow:
        0 4px 20px rgba(15,23,42,.05);
    margin-top: 25px;
}

.ai-inspection-table {
    width: 100%;
    border-collapse: collapse;
}

.ai-inspection-table thead {
    background: #f8fafc;
}

.ai-inspection-table th {
    text-align: left;
    padding: 18px 22px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    font-weight: 700;
}

.ai-inspection-table td {
    padding: 20px 22px;
    border-top: 1px solid #f1f5f9;
    font-size: 15px;
}

.ai-inspection-row {
    transition: background .2s ease;
}

.ai-inspection-row:hover {
    background: #f8fafc;
}

/* =====================================================
   PAGINATION
===================================================== */

.ai-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
}

.ai-page-info {
    color: #64748b;
    font-weight: 600;
}

/* =====================================================
   INSIGHTS MODULE
===================================================== */

.ai-insights-module {
    margin-top: 40px;
}

.ai-insights-header {
    margin-bottom: 22px;
}

.ai-insights-title {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
}

/* =====================================================
   INSIGHT GRID
===================================================== */

.ai-insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(320px,1fr));
    gap: 24px;
}

/* =====================================================
   INSIGHT CARD
===================================================== */

.ai-insight-card {
    background: rgba(255,255,255,.75);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,.4);
    border-radius: 24px;
    padding: 24px;
    box-shadow:
        0 10px 30px rgba(15,23,42,.06);
    transition: all .25s ease;
}

.ai-insight-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 18px 40px rgba(15,23,42,.10);
}

.ai-insight-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 18px;
}

.ai-insight-subtitle {
    margin-top: 22px;
}

/* =====================================================
   INSIGHT LISTS
===================================================== */

.ai-insight-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ai-insight-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.ai-insight-list-item:last-child {
    border-bottom: none;
}

.ai-insight-name {
    color: #334155;
    font-weight: 500;
}

.ai-insight-badge {
    background: #eff6ff;
    color: #2563eb;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.ai-insight-empty {
    color: #94a3b8;
    font-size: 14px;
}

/* =====================================================
   GRAPH MODULE
===================================================== */

.ai-graph-module {
    margin-top: 40px;
    background: white;
    border-radius: 24px;
    padding: 30px;
    box-shadow:
        0 8px 30px rgba(15,23,42,.05);
}

/* =====================================================
   GRAPH HEADER
===================================================== */

.ai-graph-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.ai-graph-title {
    font-size: 22px;
    font-weight: 700;
}

/* =====================================================
   FILTERS
===================================================== */

.ai-graph-filters {
    display: flex;
    gap: 10px;
}

.ai-graph-filter {
    padding: 10px 16px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #475569;
    text-decoration: none;
    font-weight: 600;
    transition: all .2s ease;
}

.ai-graph-filter:hover {
    background: #e2e8f0;
}

.ai-graph-filter.active {
    background: #2563eb;
    color: white;
}

/* =====================================================
   SELECT FILTER
===================================================== */

.ai-graph-item-filter {
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: white;
    min-width: 240px;
    font-weight: 500;
}

/* =====================================================
   GRAPH
===================================================== */

.ai-graph-chart {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    overflow-x: auto;
    padding-top: 20px;
}

/* Y AXIS */

.ai-graph-y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 280px;
}

.ai-graph-y-label {
    font-size: 12px;
    color: #94a3b8;
}

/* BARS */

.ai-graph-bars-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    flex: 1;
    min-height: 280px;
}

.ai-graph-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    min-width: 48px;
}

.ai-graph-value {
    margin-bottom: 10px;
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}

.ai-graph-bar {
    width: 42px;
    border-radius: 14px 14px 6px 6px;
    background: linear-gradient(
        180deg,
        #3b82f6 0%,
        #2563eb 100%
    );
    transition: all .25s ease;
    box-shadow:
        0 8px 20px rgba(37,99,235,.25);
}

.ai-graph-bar:hover {
    transform: scaleY(1.04);
    filter: brightness(1.05);
}

.ai-graph-label {
    margin-top: 12px;
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}

/* =====================================================
   MODAL
===================================================== */

.ai-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: rgba(15,23,42,.6);
    backdrop-filter: blur(6px);
    padding: 40px;
}

.ai-modal-content {
    background: white;
    max-width: 900px;
    margin: auto;
    border-radius: 24px;
    padding: 35px;
    position: relative;
    box-shadow:
        0 20px 60px rgba(0,0,0,.25);
}

.ai-modal-close {
    position: absolute;
    top: 18px;
    right: 22px;
    font-size: 30px;
    cursor: pointer;
    color: #64748b;
}

/* =====================================================
   STATUS COLORS
===================================================== */

.ai-inspection-status {
    font-weight: 700;
}

.ai-inspection-status:contains("Issues") {
    color: #dc2626;
}

.ai-inspection-status:contains("Works") {
    color: #16a34a;
}

/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 768px) {

    .ai-property-dashboard {
        padding: 20px;
    }

    .ai-insights-grid {
        grid-template-columns: 1fr;
    }

    .ai-graph-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ai-inspection-table th,
    .ai-inspection-table td {
        padding: 14px;
    }
}

/* =====================================================
   MOBILE WIDTH FIXES
===================================================== */

@media (max-width: 768px) {

    /* DASHBOARD PADDING */
    .ai-property-dashboard {
        padding: 12px;
    }

    /* TABLE WRAPPER */
    .ai-inspection-table-wrapper {
        border-radius: 18px;
        overflow-x: auto;
        margin-left: -4px;
        margin-right: -4px;
    }

    /* TABLE SPACING */
    .ai-inspection-table th,
    .ai-inspection-table td {
        padding: 16px 14px;
        white-space: nowrap;
    }

    /* MODAL OVERLAY */
    .ai-modal {
        padding: 10px;
        align-items: center;
        justify-content: center;
    }

    /* MODAL CONTENT */
    .ai-modal-content {
        width: 96vw;
        max-width: 96vw;
        max-height: 92vh;
        overflow-y: auto;

        padding: 22px;
        border-radius: 20px;
    }

    /* MODAL BODY */
    #ai-modal-body {
        width: 100%;
        overflow-x: auto;
    }

    /* CLOSE BUTTON */
    .ai-modal-close {
        top: 14px;
        right: 16px;
        font-size: 26px;
    }

    /* GRAPH MODULE */
    .ai-graph-module {
        padding: 18px;
        overflow-x: auto;
    }

    /* INSIGHT CARDS */
    .ai-insight-card {
        padding: 20px;
    }
}

/* =========================
   CLEAN MOBILE TABLE FIX
========================= */
@media (max-width: 768px) {

    /* Wrapper */
    .ai-inspection-table-wrapper {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Table */
    .ai-inspection-table {
        width: 100%;
        border-collapse: collapse;
        table-layout: auto;
    }

    /* Hide unnecessary columns */
    .ai-inspection-table th:nth-child(2),
    .ai-inspection-table td:nth-child(2),
    .ai-inspection-table th:nth-child(3),
    .ai-inspection-table td:nth-child(3) {
        display: none !important;
    }

    /* Core cells */
    .ai-inspection-table th,
    .ai-inspection-table td {
        padding: 10px 8px;
        font-size: 13px;
        white-space: nowrap;
    }

    /* Date column */
    .ai-inspection-table th:nth-child(1),
    .ai-inspection-table td:nth-child(1) {
        white-space: nowrap;
    }

    /* Action column */
    .ai-inspection-table th:nth-child(4),
    .ai-inspection-table td:nth-child(4) {
        text-align: right;
        white-space: nowrap;
    }

    /* =========================
       BUTTON (RESTORED + FULL WIDTH LOOK)
    ========================= */
    .ai-view-inspection {
        display: inline-flex;
        align-items: center;
        justify-content: center;

        padding: 10px 14px;
        font-size: 13px;

        min-width: 120px;
        width: 100%;

        white-space: nowrap;
        border-radius: 10px;
        box-sizing: border-box;
    }
}

/* =====================================================
   GLOBAL
===================================================== */

.ai-dashboard-wrapper *{
    box-sizing:border-box;
}

.ai-dashboard-wrapper{
    background:#f4f7fb;
    min-height:100vh;
    padding:30px;
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
}

.ai-dashboard-wrapper a{
    text-decoration:none;
}

/* =====================================================
   HEADER
===================================================== */

.ai-dashboard-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:30px;
    gap:20px;
    flex-wrap:wrap;
}

.ai-dashboard-title-wrap h1{
    margin:0;
    font-size:32px;
    font-weight:700;
    color:#111827;
}

.ai-dashboard-title-wrap p{
    margin-top:8px;
    color:#6b7280;
    font-size:15px;
}

/* =====================================================
   BUTTONS
===================================================== */

.ai-btn{
    display:inline-block;
    padding:10px 14px;
    border-radius:8px;
    font-size:14px;
    font-weight:600;
    text-decoration:none;
    transition:all 0.2s ease;
    border:none;
    cursor:pointer;
}

.ai-btn-primary{
    background:#2563eb;
    color:#fff;
}

.ai-btn-primary:hover{
    background:#1d4ed8;
    transform:translateY(-1px);
    color: #fff;
}

.ai-btn-secondary{
    background:#FFD21F;
    color:#fff;
}

.ai-btn-secondary:hover{
    background:#E6BC00;
}

.ai-btn-dark{
    background:#FFD21F;
    color:#fff;
}

.ai-btn-dark:hover{
    background:#E6BC12;
}

/* =====================================================
   STATS
===================================================== */

.ai-stats-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:20px;
    margin-bottom:35px;
}

.ai-stat-card{
    background:#fff;
    border-radius:22px;
    padding:24px;
    box-shadow:0 2px 12px rgba(0,0,0,0.05);
}

.ai-stat-label{
    font-size:14px;
    color:#6b7280;
    margin-bottom:10px;
}

.ai-stat-value{
    font-size:32px;
    font-weight:700;
    color:#111827;
}

/* =====================================================
   PROPERTY GRID
===================================================== */

.ai-properties-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(340px,1fr));
    gap:24px;
}

/* =====================================================
   PROPERTY CARD
===================================================== */

.ai-property-card{
    background:#fff;
    border-radius:24px;
    padding:24px;
    box-shadow:0 4px 20px rgba(0,0,0,0.05);
    transition:all .25s ease;
    position:relative;
    overflow:hidden;
}

.ai-property-card:hover{
    transform:translateY(-4px);
    box-shadow:0 10px 30px rgba(0,0,0,0.08);
}

.ai-property-top{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    margin-bottom:20px;
    gap:20px;
}

.ai-property-name{
    font-size:22px;
    font-weight:700;
    color:#111827;
    margin-bottom:8px;
    line-height:1.3;
}

.ai-property-address{
    color:#6b7280;
    font-size:14px;
    line-height:1.5;
}

.ai-status-badge{
    background:#dcfce7;
    color:#166534;
    padding:8px 12px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
    white-space:nowrap;
}

/* =====================================================
   META
===================================================== */

.ai-property-meta{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:16px;
    margin-bottom:24px;
}

.ai-meta-box{
    background:#f9fafb;
    padding:16px;
    border-radius:16px;
}

.ai-meta-label{
    font-size:12px;
    color:#6b7280;
    margin-bottom:6px;
}

.ai-meta-value{
    font-size:15px;
    font-weight:600;
    color:#111827;
    word-break:break-word;
}

/* =====================================================
   ACTIONS
===================================================== */

.ai-property-actions{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    margin-bottom:20px;
}

/* =====================================================
   ASSIGN FORM
===================================================== */

.ai-assign-wrapper{
    border-top:1px solid #eef2f7;
    padding-top:20px;
}

.ai-assign-title{
    font-size:14px;
    font-weight:600;
    margin-bottom:12px;
    color:#111827;
}

.ai-assign-form{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.ai-input{
    width:100%;
    padding:14px 16px;
    border:1px solid #d1d5db;
    border-radius:14px;
    font-size:14px;
    outline:none;
    transition:border .2s ease;
    background:#fff;
}

.ai-input:focus{
    border-color:#2563eb;
}

/* =====================================================
   EMPTY STATE
===================================================== */

.ai-empty-state{
    text-align:center;
    padding:100px 20px;
    background:#fff;
    border-radius:24px;
}

/* =====================================================
   MOBILE
===================================================== */

@media(max-width:768px){

    .ai-dashboard-wrapper{
        padding:18px;
    }

    .ai-dashboard-title-wrap h1{
        font-size:26px;
    }

    .ai-property-card{
        padding:20px;
    }

    .ai-property-top{
        flex-direction:column;
        align-items:flex-start;
    }

    .ai-property-actions{
        flex-direction:column;
    }

    .ai-property-actions .ai-btn{
        width:100%;
    }

    .ai-property-meta{
        grid-template-columns:1fr;
    }

    .ai-stats-grid{
        grid-template-columns:1fr;
    }

    .ai-properties-grid{
        grid-template-columns:1fr;
    }

}

/* =====================================================
   FINAL FIX: UNIFY ALL BUTTON SIZES
   (FORCES Manage Property + Start Inspection + View Inspections TO MATCH)
===================================================== */

.ai-btn,
.ai-btn-primary,
.ai-btn-secondary,
.ai-btn-dark,
.ai-btn-manage,
.ai-view-inspection {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    padding: 12px 18px !important;
    font-size: 14px !important;
    line-height: 1 !important;

    border-radius: 12px !important;
    box-sizing: border-box !important;
}

/* FORCE VIEW INSPECTIONS TO MATCH ALL BUTTONS */
.ai-view-inspection,
.ai-btn-primary {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    padding: 12px 18px !important;
    font-size: 14px !important;
    line-height: 1 !important;

    border-radius: 12px !important;
    box-sizing: border-box !important;

    width: auto !important;
    min-width: unset !important;
}

/* MOBILE OVERRIDE (THIS WAS MAKING IT DIFFERENT) */
@media (max-width: 768px) {
    .ai-view-inspection {
        width: 100% !important;
    }
}

/* =====================================================
   HARD RESET: UNIFY OWNER DASHBOARD BUTTON ROW
===================================================== */

.ai-property-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    align-items: stretch !important;
}

/* FORCE ALL BUTTONS INSIDE ACTION ROW TO BE IDENTICAL */
.ai-property-actions a,
.ai-property-actions button {
    flex: 1 1 0 !important;
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center;
    color: #fff !important;

    padding: 12px 14px !important;
    font-size: 14px !important;
    line-height: 1 !important;

    border-radius: 12px !important;
    box-sizing: border-box !important;
    width: auto !important;
    min-width: 0 !important;
}

/* REMOVE THE ONLY THING MAKING PRIMARY DIFFERENT */
.ai-btn-primary {
    margin-bottom: 0 !important;
}

/* MOBILE: STACK CLEANLY */
@media (max-width: 768px) {
    .ai-property-actions {
        flex-direction: column !important;
    }

    .ai-property-actions a,
    .ai-property-actions button {
        width: 100% !important;
        flex: none !important;
    }
}

/* =====================================================
   AGENT DASHBOARD (MODERN SAAS UI)
===================================================== */

.ai-agent-dashboard-wrapper *{
    box-sizing:border-box;
}

.ai-agent-dashboard-wrapper{
    background:#f4f7fb;
    min-height:100vh;
    padding:30px;
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
}

.ai-agent-dashboard-wrapper a{
    text-decoration:none;
}

/* =====================================================
   HEADER
===================================================== */

.ai-agent-dashboard-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:30px;
    gap:20px;
    flex-wrap:wrap;
}

.ai-agent-dashboard-title-wrap h1{
    margin:0;
    font-size:32px;
    font-weight:700;
    color:#111827;
}

.ai-agent-dashboard-title-wrap p{
    margin-top:8px;
    color:#6b7280;
    font-size:15px;
}

/* =====================================================
   STATS
===================================================== */

.ai-agent-stats-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:20px;
    margin-bottom:35px;
}

.ai-agent-stat-card{
    background:#fff;
    border-radius:22px;
    padding:24px;
    box-shadow:0 2px 12px rgba(0,0,0,0.05);
}

.ai-agent-stat-label{
    font-size:14px;
    color:#6b7280;
    margin-bottom:10px;
}

.ai-agent-stat-value{
    font-size:32px;
    font-weight:700;
    color:#111827;
}

/* =====================================================
   OWNER GROUP
===================================================== */

.ai-agent-owner-group{
    margin-bottom:40px;
}

.ai-agent-owner-title{
    font-size:22px;
    font-weight:700;
    color:#111827;
    margin-bottom:20px;
}

/* =====================================================
   PROPERTY GRID
===================================================== */

.ai-agent-properties-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(340px,1fr));
    gap:24px;
}

/* =====================================================
   PROPERTY CARD
===================================================== */

.ai-agent-card{
    background:#fff;
    border-radius:24px;
    padding:24px;
    box-shadow:0 4px 20px rgba(0,0,0,0.05);
    transition:all .25s ease;
    overflow:hidden;
}

.ai-agent-card:hover{
    transform:translateY(-4px);
    box-shadow:0 10px 30px rgba(0,0,0,0.08);
}

.ai-agent-card-top{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:20px;
    margin-bottom:20px;
}

.ai-agent-card-name{
    font-size:22px;
    font-weight:700;
    color:#111827;
    margin-bottom:8px;
    line-height:1.3;
}

.ai-agent-card-address{
    color:#6b7280;
    font-size:14px;
    line-height:1.5;
}

.ai-agent-status-badge{
    background:#dcfce7;
    color:#166534;
    padding:8px 12px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
    white-space:nowrap;
}

/* =====================================================
   META
===================================================== */

.ai-agent-meta{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:16px;
    margin-bottom:24px;
}

.ai-agent-meta-box{
    background:#f9fafb;
    padding:16px;
    border-radius:16px;
}

.ai-agent-meta-label{
    font-size:12px;
    color:#6b7280;
    margin-bottom:6px;
}

.ai-agent-meta-value{
    font-size:15px;
    font-weight:600;
    color:#111827;
    word-break:break-word;
}

/* =====================================================
   BUTTONS
===================================================== */

.ai-agent-actions{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
}

.ai-agent-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:12px 18px;
    border-radius:14px;
    font-size:14px;
    font-weight:600;
    transition:all .2s ease;
    cursor:pointer;
    border:none;
}

.ai-agent-btn-primary{
    background:#2563eb;
    color:#fff;
}

.ai-agent-btn-primary:hover{
    background:#1d4ed8;
    transform:translateY(-1px);
    color:#fff;
}

/* =====================================================
   EMPTY STATE
===================================================== */

.ai-empty-state{
    text-align:center;
    padding:100px 20px;
    background:#fff;
    border-radius:24px;
}

/* =====================================================
   MOBILE
===================================================== */

@media(max-width:768px){

    .ai-agent-dashboard-wrapper{
        padding:18px;
    }

    .ai-agent-dashboard-title-wrap h1{
        font-size:26px;
    }

    .ai-agent-card{
        padding:20px;
    }

    .ai-agent-card-top{
        flex-direction:column;
        align-items:flex-start;
    }

    .ai-agent-meta{
        grid-template-columns:1fr;
    }

    .ai-agent-stats-grid{
        grid-template-columns:1fr;
    }

    .ai-agent-properties-grid{
        grid-template-columns:1fr;
    }

    .ai-agent-actions{
        flex-direction:column;
    }

    .ai-agent-actions .ai-agent-btn{
        width:100%;
    }
}

/* =====================================================
   GLOBAL
===================================================== */

.ai-features-wrapper *{
    box-sizing:border-box;
}

.ai-features-wrapper{
    background:#f4f7fb;
    min-height:100vh;
    padding:30px;
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
}

/* =====================================================
   HEADER
===================================================== */

.ai-features-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:20px;
    flex-wrap:wrap;
    margin-bottom:30px;
}

.ai-features-title{
    margin:0;
    font-size:34px;
    font-weight:700;
    color:#111827;
}

.ai-features-subtitle{
    margin-top:10px;
    color:#6b7280;
    font-size:16px;
}

/* =====================================================
   BACK BUTTON
===================================================== */

.ai-features-nav{
    margin-bottom:24px;
}

.ai-features-back-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:12px 18px;
    border-radius:14px;
    background:#FFD21F;
    color:#FFD21F;
    font-size:14px;
    font-weight:600;
    text-decoration:none;
    transition:all .2s ease;
}

.ai-features-back-btn:hover{
    background:#E6BC12;
}

/* =====================================================
   CARD
===================================================== */

.ai-features-card,
.ai-add-item-card{
    background:#fff;
    border-radius:24px;
    padding:28px;
    box-shadow:0 4px 20px rgba(0,0,0,0.05);
    margin-bottom:24px;
}

.ai-features-card-title,
.ai-add-item-heading{
    font-size:20px;
    font-weight:700;
    color:#111827;
    margin-bottom:20px;
}

/* =====================================================
   SUCCESS
===================================================== */

.ai-features-success{
    background:#dcfce7;
    color:#166534;
    border:1px solid #bbf7d0;
    padding:16px 18px;
    border-radius:16px;
    margin-bottom:24px;
    font-size:14px;
    font-weight:600;
}

/* =====================================================
   INPUTS
===================================================== */

.ai-features-input,
.ai-features-edit-input{
    width:100%;
    padding:14px 16px;
    border:1px solid #d1d5db;
    border-radius:16px;
    font-size:14px;
    outline:none;
    transition:all .2s ease;
    background:#fff;
}

.ai-features-input:focus,
.ai-features-edit-input:focus{
    border-color:#2563eb;
    box-shadow:0 0 0 4px rgba(37,99,235,0.08);
}

/* =====================================================
   ADD ITEM
===================================================== */

.ai-add-item-wrapper{
    display:grid;
    grid-template-columns:1fr 1fr auto;
    gap:14px;
    align-items:center;
}

/* =====================================================
   ITEM ROW
===================================================== */

.ai-features-row{
    border:1px solid #eef2f7;
    border-radius:20px;
    padding:22px;
    margin-bottom:18px;
    background:#fafbfd;
}

.ai-features-label{
    display:flex;
    align-items:center;
    gap:14px;
    margin-bottom:18px;
}

.ai-features-checkbox{
    width:18px;
    height:18px;
}

.ai-features-name{
    font-size:18px;
    font-weight:700;
    color:#111827;
}

/* =====================================================
   ACTIONS
===================================================== */

.ai-features-actions{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    margin-bottom:18px;
}

/* =====================================================
   INSTANCES
===================================================== */

.ai-features-instances{
    display:flex;
    flex-direction:column;
    gap:12px;
    margin-top:14px;
}

.ai-instance-row{
    display:flex;
    gap:12px;
    align-items:center;
}

/* =====================================================
   BUTTONS
===================================================== */

.ai-features-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:12px 18px;
    border:none;
    border-radius:14px;
    font-size:14px;
    font-weight:600;
    cursor:pointer;
    transition:all .2s ease;
    text-decoration:none;
    white-space:nowrap;
}

.ai-features-btn-primary{
    background:#2563eb;
    color:#fff;
}

.ai-features-btn-primary:hover{
    background:#1d4ed8;
}

.ai-features-btn-small{
    background:#111827;
    color:#fff;
}

.ai-features-btn-small:hover{
    background:#000;
}

.ai-features-btn-danger{
    background:#fee2e2;
    color:#b91c1c;
}

.ai-features-btn-danger:hover{
    background:#fecaca;
}

/* =====================================================
   FOOTER
===================================================== */

.ai-features-footer{
    margin-top:30px;
    display:flex;
    justify-content:flex-end;
}

/* =====================================================
   DELETE PROPERTY
===================================================== */

.ai-delete-property-wrap{
    margin-top:40px;
    padding-top:24px;
    border-top:1px solid #e5e7eb;
    text-align:center;
}

/* =====================================================
   MOBILE
===================================================== */

@media(max-width:768px){

    .ai-features-wrapper{
        padding:18px;
    }

    .ai-features-title{
        font-size:28px;
    }

    .ai-features-card,
    .ai-add-item-card{
        padding:20px;
    }

    .ai-add-item-wrapper{
        grid-template-columns:1fr;
    }

    .ai-features-actions{
        flex-direction:column;
    }

    .ai-features-actions .ai-features-btn{
        width:100%;
    }

    .ai-instance-row{
        flex-direction:column;
        align-items:stretch;
    }

    .ai-features-footer{
        justify-content:stretch;
    }

    .ai-features-footer .ai-features-btn{
        width:100%;
    }
}

/* =====================================================
   PROPERTY FORM (MODERN SAAS UI)
   ===================================================== */

/* GLOBAL */
.ai-property-form-wrapper * {
    box-sizing: border-box;
}

.ai-property-form-wrapper {
    background: #f4f7fb;
    min-height: 100vh;
    padding: 30px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* CONTAINER */
.ai-property-form-container {
    max-width: 720px;
    margin: 0 auto;
}

/* HEADER */
.ai-property-form-header {
    margin-bottom: 30px;
}

.ai-property-form-header h1 {
    margin: 0;
    font-size: 34px;
    font-weight: 700;
    color: #111827;
}

.ai-property-form-header p {
    margin-top: 10px;
    color: #6b7280;
    font-size: 15px;
}

/* CARD */
.ai-property-form-card {
    background: #fff;
    border-radius: 28px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

/* SUCCESS */
.ai-success-message {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    padding: 16px 18px;
    border-radius: 16px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 600;
}

/* FORM */
.ai-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ai-field {
    margin: 0;
}

.ai-label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

/* INPUTS */
.ai-input,
.ai-textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 16px;
    padding: 16px 18px;
    font-size: 15px;
    color: #111827;
    outline: none;
    transition: all .2s ease;
}

.ai-input:focus,
.ai-textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37,99,235,0.08);
}

.ai-textarea {
    min-height: 140px;
    resize: vertical;
}

/* BUTTON */
.ai-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #2563eb;
    color: #fff;
    padding: 14px 22px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
    width: 100%;
}

.ai-button:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

/* MOBILE */
@media (max-width: 768px) {

    .ai-property-form-wrapper {
        padding: 18px;
    }

    .ai-property-form-header h1 {
        font-size: 28px;
    }

    .ai-property-form-card {
        padding: 22px;
        border-radius: 22px;
    }

}

/* =====================================================
   INSPECTION FORM (INLINE STYLES EXTRACTED)
   ===================================================== */

/* EMAIL WRAPPERS */
.email-wrapper {
    font-family: Arial;
    background: #f4f6f8;
    padding: 30px;
}

.email-card {
    max-width: 600px;
    margin: auto;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
}

/* EMAIL BUTTON (DEFAULT BLUE) */
.button {
    display: inline-block;
    padding: 12px 18px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
}

/* EMAIL BUTTON (ISSUE STATE - RED) */
.button-issue {
    display: inline-block;
    padding: 12px 18px;
    background: #d63638;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
}

/* BACK BUTTON WRAPPER */
.ai-inspection-back-wrapper {
    margin-bottom: 20px;
}

/* BACK BUTTON */
.ai-inspection-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: 14px;
    background: #FFD21F;
    color: #111827;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s ease;
}

.ai-inspection-back-btn:hover {
    background: #E6BC12;
}

/* SUCCESS / COMPLETION CARD (FROM INLINE RETURN HTML) */
.ai-inspection-success-card {
    max-width: 520px;
    margin: 40px auto;
    padding: 28px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    text-align: center;
}

/* SUCCESS ICON */
.ai-inspection-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px auto;
    border-radius: 50%;
    background: #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
}

/* SUCCESS TITLE */
.ai-inspection-success-title {
    margin: 0 0 10px 0;
    font-size: 22px;
    color: #0f172a;
    font-weight: 700;
}

/* SUCCESS TEXT */
.ai-inspection-success-text {
    margin: 0 0 18px 0;
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
}

/* INFO BOX */
.ai-inspection-info-box {
    padding: 12px 14px;
    background: #f1f5f9;
    border-radius: 12px;
    font-size: 13px;
    color: #334155;
    margin-bottom: 18px;
}

/* DASHBOARD BUTTON */
.ai-inspection-dashboard-btn {
    display: inline-block;
    padding: 12px 18px;
    background: #2563eb;
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
}

/* =====================================================
   INSPECTION START SCREEN (MODERN SAAS UI)
===================================================== */

/* GLOBAL */
.inspection-saas-wrapper *{
    box-sizing:border-box;
}

.inspection-saas-wrapper{
    background:#f4f7fb;
    min-height:100vh;
    padding:30px;
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
}

.inspection-saas-container{
    max-width:760px;
    margin:0 auto;
}

/* BACK BUTTON WRAP */
.inspection-back-wrap{
    margin-bottom:24px;
}

/* CARD */
.inspection-start-screen{
    background:#fff;
    border-radius:28px;
    padding:40px;
    box-shadow:0 4px 20px rgba(0,0,0,0.05);
    text-align:center;
}

/* TITLE */
.inspection-start-title{
    margin:0 0 12px;
    font-size:34px;
    font-weight:700;
    color:#111827;
    line-height:1.2;
}

.inspection-start-address{
    color:#6b7280;
    font-size:16px;
    line-height:1.6;
    margin-bottom:40px;
}

/* FORM */
.inspection-start-form{
    display:flex;
    flex-direction:column;
    gap:16px;
}

/* BUTTON BASE */
.btn-ok,
.btn-issues{
    display:flex;
    align-items:center;
    justify-content:center;
    width:100%;
    padding:16px 20px;
    border-radius:18px;
    font-size:16px;
    font-weight:700;
    text-decoration:none;
    border:none;
    cursor:pointer;
    transition:all .2s ease;
}

/* PRIMARY BUTTON */
.btn-ok{
    background:#FFD21F;
    color:#111827;
}

.btn-ok:hover{
    background:#E6BC12;
    transform:translateY(-1px);
}

/* SECONDARY BUTTON */
.btn-issues{
    background:#111827;
    color:#fff;
}

.btn-issues:hover{
    background:#000;
    transform:translateY(-1px);
}

/* MOBILE */
@media(max-width:768px){

    .inspection-saas-wrapper{
        padding:18px;
    }

    .inspection-start-screen{
        padding:28px 22px;
        border-radius:24px;
    }

    .inspection-start-title{
        font-size:28px;
    }

    .inspection-start-address{
        font-size:15px;
    }
}

/* =========================================
SAAS SUCCESS TOAST
========================================= */

.ai-success-toast{
    display:flex;
    align-items:flex-start;
    gap:14px;

    background:linear-gradient(
        135deg,
        #ecfdf5 0%,
        #f0fdf4 100%
    );

    border:1px solid #bbf7d0;

    padding:18px 20px;
    border-radius:18px;

    margin-bottom:24px;

    box-shadow:
        0 10px 25px rgba(16,185,129,0.08);

    animation:aiFadeIn .35s ease;
}

.ai-success-icon{
    width:42px;
    height:42px;

    min-width:42px;

    border-radius:12px;

    background:#10b981;
    color:#fff;

    display:flex;
    align-items:center;
    justify-content:center;

    font-size:20px;
    font-weight:700;

    box-shadow:
        0 6px 14px rgba(16,185,129,0.25);
}

.ai-success-title{
    font-size:15px;
    font-weight:700;
    color:#065f46;
    margin-bottom:4px;
}

.ai-success-text{
    font-size:14px;
    line-height:1.5;
    color:#047857;
}

@keyframes aiFadeIn{
    from{
        opacity:0;
        transform:translateY(-8px);
    }
    to{
        opacity:1;
        transform:translateY(0);
    }
}

/* =========================
   INSIGHTS SAAS PANEL BASE
   ========================= */

.ai-insights-saas-panel {
    width: 100%;
    background: #0f172a; /* dark SaaS navy */
    border: 1px solid #1e293b;
    border-radius: 16px;
    padding: 24px;
    margin-top: 20px;
    color: #e2e8f0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

/* Header */
.ai-insights-header {
    margin-bottom: 20px;
}

.ai-insights-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: #ffffff;
}

.ai-insights-subtitle {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 4px;
}

/* =========================
   SECTION WRAPPER
   ========================= */

.ai-insights-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #1e293b;
}

.ai-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* =========================
   GRID LAYOUT
   ========================= */

.ai-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

/* =========================
   RISK ITEM CARD
   ========================= */

.ai-risk-item {
    background: #111c33;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 12px 14px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    transition: all 0.2s ease;
}

.ai-risk-item:hover {
    transform: translateY(-2px);
    border-color: #334155;
    background: #13203a;
}

.ai-risk-name {
    font-size: 13px;
    color: #e2e8f0;
    max-width: 70%;
}

.ai-risk-score {
    font-size: 12px;
    font-weight: 600;
    color: #38bdf8;
    background: rgba(56,189,248,0.1);
    padding: 4px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

/* =========================
   STATUS LABELS
   ========================= */

.ai-risk-warning .ai-risk-score {
    background: rgba(251,146,60,0.12);
    color: #fb923c;
}

.ai-risk-critical .ai-risk-score {
    background: rgba(239,68,68,0.12);
    color: #ef4444;
}

/* =========================
   EMPTY STATE
   ========================= */

.ai-empty-state {
    padding: 14px;
    background: #111c33;
    border: 1px dashed #334155;
    border-radius: 12px;
    color: #64748b;
    font-size: 13px;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 768px) {
    .ai-insights-saas-panel {
        padding: 16px;
    }

    .ai-section-grid {
        grid-template-columns: 1fr;
    }

    .ai-risk-name {
        font-size: 12px;
    }
}

/* clickable behavior */
.ai-drill-item {
    cursor: pointer;
    position: relative;
}

/* hover depth */
.ai-drill-item:hover {
    transform: translateY(-3px);
    border-color: #38bdf8;
}

/* small metadata line */
.ai-risk-meta {
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
}

/* active highlight */
.ai-drill-item.active {
    border: 1px solid #38bdf8;
    box-shadow: 0 0 0 2px rgba(56,189,248,0.15);
}



/* =====================================================
   AI MODAL - UNIFIED SAAS DARK SYSTEM (FINAL)
===================================================== */

.ai-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(10, 12, 18, 0.75);
    backdrop-filter: blur(12px);
}

/* MAIN MODAL CONTAINER */
.ai-modal-content {
    background: rgba(18, 22, 32, 0.92);
    border: 1px solid rgba(255,255,255,0.08);

    margin: 3% auto;
    width: 92%;
    max-width: 1000px;

    border-radius: 18px;
    overflow: hidden;

    box-shadow: 0 35px 90px rgba(0,0,0,0.65);

    color: #eaf0ff;
    font-family: inherit;
    position: relative;
}

/* CLOSE BUTTON */
.ai-modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 26px;
    cursor: pointer;

    color: rgba(255,255,255,0.6);
    transition: 0.2s ease;
    z-index: 10;
}

.ai-modal-close:hover {
    color: #fff;
}

/* MODAL BODY */
#ai-modal-body {
    padding: 22px;
    max-height: 75vh;
    overflow-y: auto;
    background: rgba(15, 18, 28, 0.65);
}

/* =====================================================
   GLOBAL TEXT FIX
===================================================== */

.ai-modal * {
    color: #eaf0ff;
}

.ai-modal strong {
    color: #ffffff;
}

.ai-modal p,
.ai-modal li {
    color: rgba(234, 240, 255, 0.82);
    line-height: 1.5em;
}

/* =====================================================
   SHARED LAYOUT SYSTEM
===================================================== */

.ai-inspection-details,
.ai-risk-detail {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* =====================================================
   SUMMARY HEADER CARD
===================================================== */

.ai-modal-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;

    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);

    padding: 14px 16px;
    border-radius: 14px;

    font-size: 13px;
}

/* =====================================================
   INSPECTION ITEM CARD
===================================================== */

.ai-modal-item {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);

    border-radius: 14px;
    padding: 16px;

    transition: 0.2s ease;
}

.ai-modal-item:hover {
    transform: translateY(-2px);
    border-color: rgba(125, 211, 252, 0.25);
}

/* ITEM TITLE */
.ai-item-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #ffffff;
}

/* =====================================================
   INSTANCE BLOCKS
===================================================== */

.ai-modal-instances {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-modal-instance {
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 10px 12px;
}

/* =====================================================
   NOTES (UNIFIED FIX FOR ITEM + INSTANCE + FALLBACK)
===================================================== */

.ai-modal-note,
.ai-instance-note,
.ai-item-note,
.ai-modal [class*="note"] {
    background: rgba(17, 28, 51, 0.95);
    border: 1px solid #1e293b;

    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 8px;

    font-size: 13px;
    line-height: 1.5em;

    color: #cbd5e1 !important;
}

/* force readable text inside notes */
.ai-modal-note *,
.ai-instance-note *,
.ai-item-note *,
.ai-modal [class*="note"] * {
    color: #cbd5e1 !important;
}

/* headings inside notes */
.ai-modal-note strong,
.ai-instance-note strong,
.ai-item-note strong,
.ai-modal [class*="note"] strong {
    color: #ffffff !important;
}

/* =====================================================
   BADGES
===================================================== */

.ai-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}

.ai-badge-danger {
    background: rgba(255, 80, 80, 0.15);
    color: #ff8080;
    border: 1px solid rgba(255, 80, 80, 0.25);
}

.ai-badge-ok {
    background: rgba(80, 200, 120, 0.12);
    color: #7ee2a8;
    border: 1px solid rgba(80, 200, 120, 0.25);
}

/* =====================================================
   RISK / ANALYTICS CARDS
===================================================== */

.ai-risk-item {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);

    border-radius: 14px;
    padding: 14px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    transition: 0.2s ease;
}

.ai-risk-item:hover {
    transform: translateY(-2px);
    border-color: rgba(125, 211, 252, 0.3);
}

.ai-risk-score {
    font-weight: 700;
    color: #7dd3fc;
}

/* WARNING STATE */
.ai-risk-warning {
    border-color: rgba(255, 80, 80, 0.25);
    background: rgba(255, 80, 80, 0.08);
}

/* =====================================================
   DRILL-DOWN FIX
===================================================== */

.ai-risk-detail {
    background: rgba(15, 18, 28, 0.88);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;

    padding: 16px;
    color: #ffffff;
}

.ai-risk-detail h3 {
    color: #ffffff !important;
    font-weight: 700;
    margin-bottom: 12px;
}

.ai-risk-detail .ai-modal-summary {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}

/* =====================================================
   GENERAL INSPECTION NOTES (BEIGE FIX)
===================================================== */

.ai-modal-general-notes {
    background: #111c33;   /* replaces beige */
    border: 1px solid #1e293b;

    border-radius: 14px;
    padding: 14px;
    margin-top: 14px;

    color: #cbd5e1 !important;
}

.ai-modal-general-notes strong {
    color: #ffffff !important;
}

.ai-modal-general-notes p,
.ai-modal-general-notes span,
.ai-modal-general-notes div,
.ai-modal-general-notes li {
    color: #cbd5e1 !important;
}

/* =====================================================
   EMPTY STATES
===================================================== */

.ai-empty-state,
.ai-insight-empty {
    padding: 14px;
    border-radius: 12px;

    background: rgba(255,255,255,0.03);
    border: 1px dashed rgba(255,255,255,0.12);

    color: rgba(234,240,255,0.6);
}

/* =====================================================
   SECTION TITLES
===================================================== */

.ai-section-title {
    font-size: 14px;
    font-weight: 700;
    margin: 6px 0 12px;
    color: #ffffff;
}

.ai-insights-section {
    margin-bottom: 18px;
}

/* =====================================================
   SCROLLBAR
===================================================== */

#ai-modal-body::-webkit-scrollbar {
    width: 8px;
}

#ai-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 8px;
}

#ai-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 768px) {

    .ai-modal-content {
        width: 96%;
        margin: 5% auto;
    }

    #ai-modal-body {
        padding: 16px;
    }

    .ai-modal-summary {
        grid-template-columns: 1fr;
    }

    .ai-item-title {
        font-size: 14px;
    }
}

/* =====================================================
   AI GRAPH MODULE - SAAS DARK GLASS THEME
   ===================================================== */

.ai-graph-module {
    margin-top: 30px;
    padding: 20px;
    border-radius: 18px;

    background: rgba(15, 15, 20, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(14px);

    color: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

/* =====================================================
   HEADER
   ===================================================== */

.ai-graph-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;

    margin-bottom: 20px;
}

.ai-graph-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.ai-graph-filters {
    display: flex;
    gap: 8px;
}

/* =====================================================
   FILTER PILLS (Week / Month / Year)
   ===================================================== */

.ai-graph-filter {
    padding: 6px 12px;
    border-radius: 999px;

    font-size: 12px;
    font-weight: 500;
    text-decoration: none;

    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);

    transition: all 0.2s ease;
}

.ai-graph-filter:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.ai-graph-filter.active {
    background: rgba(90, 140, 255, 0.18);
    border-color: rgba(90, 140, 255, 0.45);
    color: #ffffff;
}

/* =====================================================
   ITEM FILTER DROPDOWN
   ===================================================== */

.ai-graph-item-filter {
    padding: 6px 10px;
    border-radius: 10px;

    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);

    color: #ffffff;
    font-size: 13px;

    outline: none;
}

.ai-graph-item-filter option {
    background: #111;
    color: #fff;
}

/* =====================================================
   CHART AREA
   ===================================================== */

.ai-graph-chart {
    display: flex;
    gap: 12px;

    padding: 18px;
    border-radius: 16px;

    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* =====================================================
   Y AXIS
   ===================================================== */

.ai-graph-y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    min-width: 40px;
    padding-right: 8px;

    color: rgba(255, 255, 255, 0.55);
    font-size: 11px;
}

.ai-graph-y-label {
    line-height: 1;
}

/* =====================================================
   BARS WRAPPER
   ===================================================== */

.ai-graph-bars-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 10px;

    flex: 1;
    height: 260px;

    padding-bottom: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* =====================================================
   BAR GROUP
   ===================================================== */

.ai-graph-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;

    flex: 1;
    position: relative;
}

/* VALUE LABEL ABOVE BAR */

.ai-graph-value {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.65);

    margin-bottom: 6px;
}

/* ACTUAL BAR */

.ai-graph-bar {
    width: 14px;

    border-radius: 6px;

    background: linear-gradient(
        180deg,
        rgba(90, 140, 255, 0.95),
        rgba(90, 140, 255, 0.25)
    );

    box-shadow: 0 6px 18px rgba(90, 140, 255, 0.25);

    transition: all 0.25s ease;
}

.ai-graph-bar:hover {
    transform: scaleY(1.05);
    box-shadow: 0 10px 25px rgba(90, 140, 255, 0.35);
}

/* LABEL BELOW BAR */

.ai-graph-label {
    margin-top: 8px;

    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);

    text-align: center;
}

/* =====================================================
   X AXIS
   ===================================================== */

.ai-graph-x-axis {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);

    margin-top: 6px;
}

/* =====================================================
   EMPTY STATE
   ===================================================== */

.ai-insight-empty {
    padding: 20px;
    text-align: center;

    color: rgba(255, 255, 255, 0.6);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 768px) {

    .ai-graph-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ai-graph-bars-wrapper {
        gap: 6px;
    }

    .ai-graph-bar {
        width: 10px;
    }
}




/* =====================================================
   INSPECTIONS TABLE SAAS PANEL
===================================================== */

.ai-inspection-table-wrapper {
    width: 100%;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 16px;
    padding: 20px;
    margin-top: 20px;
    color: #e2e8f0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    overflow: hidden;
}

/* =========================
   TABLE SCROLL
========================= */

.ai-inspection-table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* =========================
   TABLE BASE
========================= */

.ai-inspection-table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
    background: #0f172a;
    color: #e2e8f0;
}

/* =========================
   TABLE HEADER
========================= */

.ai-inspection-table thead {
    background: #111c33;
}

.ai-inspection-table th {
    background: #111c33;
    color: #94a3b8;
    text-align: left;
    padding: 14px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;

    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    white-space: nowrap;
}

/* =========================
   TABLE BODY
========================= */

.ai-inspection-table tbody {
    background: #0f172a;
}

.ai-inspection-table tr {
    background: #0f172a;
    border-bottom: 1px solid rgba(148, 163, 184, 0.10);
    transition: all 0.2s ease;
}

.ai-inspection-table td {
    background: #0f172a;
    color: #e2e8f0;
    padding: 16px;
    font-size: 13px;
    vertical-align: middle;
    border: none;
}

/* alternating rows */

.ai-inspection-table tbody tr:nth-child(even) td {
    background: #111c33;
}

/* hover */

.ai-inspection-table tbody tr:hover td {
    background: #13203a;
}

/* =========================
   SOFT VERTICAL COLUMN LINES
========================= */

.ai-inspection-table th:not(:last-child),
.ai-inspection-table td:not(:last-child) {
    border-right: 1px solid rgba(148, 163, 184, 0.06);
}

.ai-inspection-table tbody tr:hover td:not(:last-child) {
    border-right-color: rgba(148, 163, 184, 0.12);
}

/* =========================
   COLUMN STYLING
========================= */

.ai-inspection-date {
    color: #cbd5e1;
    white-space: nowrap;
}

.ai-inspection-agent {
    color: #ffffff;
    font-weight: 500;
}

.ai-inspection-status {
    font-weight: 600;
    color: #38bdf8;
}

.ai-inspection-action {
    white-space: nowrap;
}

/* =========================
   STATUS COLORS
========================= */

.ai-inspection-status.ok {
    color: #22c55e;
}

.ai-inspection-status.works {
    color: #38bdf8;
}

.ai-inspection-status.issues {
    color: #ef4444;
}

/* =========================
   ACTION BUTTON
========================= */

.ai-view-inspection {
    background: #38bdf8;
    border: none;
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ai-view-inspection:hover {
    background: #0ea5e9;
    transform: translateY(-1px);
}

/* =========================
   PAGINATION
========================= */

.ai-pagination {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.ai-page-info {
    font-size: 13px;
    color: #94a3b8;
}

/* =========================
   PAGINATION BUTTONS
========================= */

.ai-pagination .ai-btn-secondary {
    background: #111c33;
    border: 1px solid rgba(148, 163, 184, 0.15);
    color: #e2e8f0;

    padding: 10px 14px;
    border-radius: 10px;

    text-decoration: none;
    font-size: 12px;
    font-weight: 600;

    transition: all 0.2s ease;
}

.ai-pagination .ai-btn-secondary:hover {
    background: #13203a;
    border-color: rgba(56, 189, 248, 0.5);
    color: #ffffff;
}

/* =========================
   FORCE INHERITED COLORS
========================= */

.ai-inspection-table td *,
.ai-inspection-table th * {
    color: inherit;
}

/* =========================
   RESPONSIVE (MOBILE FIX)
========================= */

@media (max-width: 768px) {

    /* better mobile scrolling */
    .ai-inspection-table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* allow proper overflow scrolling */
    .ai-inspection-table {
        min-width: 100%;
        width: max-content;
    }

    .ai-inspection-table-wrapper {
        padding: 16px;
    }

    .ai-inspection-table th,
    .ai-inspection-table td {
        padding: 12px;
        font-size: 12px;
    }

    /* ONLY SHOW DATE + ACTION */
    .ai-inspection-table th:nth-child(2),
    .ai-inspection-table td:nth-child(2),
    .ai-inspection-table th:nth-child(3),
    .ai-inspection-table td:nth-child(3) {
        display: none;
    }

    .ai-view-inspection {
        width: 100%;
        text-align: center;
    }

    .ai-pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .ai-pagination .ai-btn-secondary {
        text-align: center;
    }
}

/* =====================================================
   PROPERTY FEATURES SAAS PANEL (FINAL CARD VERSION)
   NO PAGE OVERRIDES — COMPONENT ONLY
===================================================== */

/* =========================
   MAIN WRAPPER
========================= */

.ai-features-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 20px auto;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 16px;
    padding: 22px;
    margin-top: 20px;
    color: #e2e8f0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

/* =========================
   HEADER
========================= */

.ai-features-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.ai-features-title {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.ai-features-subtitle {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 4px;
}

/* =========================
   NAV
========================= */

.ai-features-nav {
    margin-bottom: 18px;
}

.ai-features-back-btn {
    display: inline-block;
    background: #111c33;
    border: 1px solid rgba(148, 163, 184, 0.15);
    color: #e2e8f0;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.ai-features-back-btn:hover {
    background: #13203a;
    border-color: rgba(56, 189, 248, 0.5);
    color: #ffffff;
}

/* =========================
   ADD ITEM CARD
========================= */

.ai-add-item-card {
    background: #111c33;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}

.ai-add-item-heading {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 12px;
    font-weight: 600;
}

.ai-add-item-wrapper {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* =========================
   INPUT SYSTEM
========================= */

.ai-features-input,
.ai-features-edit-input {
    background: #0f172a !important;
    border: 1px solid rgba(148, 163, 184, 0.15) !important;
    color: #e2e8f0 !important;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    outline: none;
    box-shadow: none !important;
}

/* focus */
.ai-features-input:focus,
.ai-features-edit-input:focus {
    border-color: rgba(56, 189, 248, 0.6) !important;
}

/* autofill fix */
.ai-features-wrapper input:-webkit-autofill,
.ai-features-wrapper input:-webkit-autofill:hover,
.ai-features-wrapper input:-webkit-autofill:focus {
    -webkit-text-fill-color: #e2e8f0 !important;
    -webkit-box-shadow: 0 0 0px 1000px #0f172a inset !important;
}

/* =========================
   BUTTONS
========================= */

.ai-features-btn {
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ai-features-btn-primary {
    background: #38bdf8;
    color: #fff;
}

.ai-features-btn-primary:hover {
    background: #0ea5e9;
    transform: translateY(-1px);
}

.ai-features-btn-danger {
    background: #ef4444;
    color: #fff;
}

.ai-features-btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.ai-features-btn-small {
    background: #111c33;
    border: 1px solid rgba(148, 163, 184, 0.15);
    color: #e2e8f0;
}

/* =========================
   CARD LIST (IMPORTANT FIX AREA)
========================= */

.ai-features-card {
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 14px;
    padding: 16px;
}

.ai-features-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* =========================
   ITEM ROWS (FIXED: NO MORE WHITE LINES)
========================= */

.ai-features-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;

    padding: 16px;
    margin-bottom: 12px;

    background: #111c33;
    border: 1px solid rgba(148, 163, 184, 0.10);
    border-radius: 12px;

    position: relative;
}

/* remove old separator system completely */
.ai-features-row::after {
    display: none;
}

.ai-features-row:last-child {
    margin-bottom: 0;
}

/* =========================
   LABEL / CHECKBOX
========================= */

.ai-features-label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
}

.ai-features-checkbox {
    transform: scale(1.1);
}

.ai-features-name {
    font-size: 13px;
    color: #e2e8f0;
}

/* =========================
   ACTIONS
========================= */

.ai-features-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* keep action inputs dark */
.ai-features-actions input {
    background: #0f172a !important;
    border: 1px solid rgba(148, 163, 184, 0.15) !important;
    color: #e2e8f0 !important;
}

/* =========================
   INSTANCES
========================= */

.ai-features-instances {
    margin-top: 10px;
    padding-left: 30px;
}

.ai-instance-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

/* instance inputs */
.ai-instance-row input {
    background: #0f172a !important;
    border: 1px solid rgba(148, 163, 184, 0.15) !important;
    color: #e2e8f0 !important;
}

/* =========================
   FOOTER
========================= */

.ai-features-footer,
.ai-delete-property-wrap {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
}

/* =========================
   SUCCESS TOAST
========================= */

.ai-success-toast {
    background: #111c33;
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.ai-success-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #22c55e;
    font-weight: 700;
}

.ai-success-title {
    font-size: 13px;
    font-weight: 700;
    color: #22c55e;
}

.ai-success-text {
    font-size: 12px;
    color: #94a3b8;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 768px) {

    .ai-features-wrapper {
        max-width: 100%;
        width: 100%;
    }

    .ai-features-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .ai-features-actions {
        width: 100%;
    }

    .ai-features-input,
    .ai-features-edit-input {
        width: 100%;
    }

    .ai-add-item-wrapper {
        flex-direction: column;
    }

    .ai-features-footer,
    .ai-delete-property-wrap {
        justify-content: stretch;
    }

    .ai-features-btn,
    .ai-features-back-btn {
        width: 100%;
        text-align: center;
    }

    .ai-features-instances {
        padding-left: 12px;
    }
}

/* =====================================================
   OWNER DASHBOARD SAAS UI (UNIFIED FINAL VERSION)
===================================================== */

/* =========================
   MAIN OUTER WRAPPER
========================= */

.ai-dashboard-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 20px auto;
    padding: 20px;

    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 16px;

    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

/* =========================
   HEADER
========================= */

.ai-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 20px;
}

.ai-dashboard-title-wrap h1 {
    font-size: 24px;
    font-weight: 800;
    margin: 0;
    color: #ffffff !important;
}

.ai-dashboard-title-wrap p {
    font-size: 13px;
    margin-top: 4px;
    color: #94a3b8 !important;
}

/* =========================
   BUTTONS
========================= */

.ai-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 10px 14px;
    border-radius: 10px;

    font-size: 12px;
    font-weight: 600;

    text-decoration: none;
    cursor: pointer;

    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.ai-btn-primary {
    background: #38bdf8;
    color: #ffffff;
}

.ai-btn-primary:hover {
    background: #0ea5e9;
    transform: translateY(-1px);
}

.ai-btn-secondary {
    background: #111c33;
    border: 1px solid rgba(148, 163, 184, 0.15);
    color: #e2e8f0;
}

.ai-btn-secondary:hover {
    border-color: rgba(56, 189, 248, 0.5);
}

.ai-btn-dark {
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #e2e8f0;
}

.ai-btn-dark:hover {
    background: #111c33;
    border-color: rgba(56, 189, 248, 0.4);
}

/* =========================
   STATS GRID
========================= */

.ai-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.ai-stat-card {
    background: #111c33;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 14px;
    padding: 16px;
}

.ai-stat-label {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
}

.ai-stat-value {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
}

/* =========================
   PROPERTY GRID
========================= */

.ai-properties-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 900px) {
    .ai-properties-grid {
        grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    }
}

/* =========================
   PROPERTY CARD
========================= */

.ai-property-card {
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 16px;
    padding: 18px;

    display: flex;
    flex-direction: column;
    gap: 14px;

    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

/* =========================
   TOP SECTION
========================= */

.ai-property-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.ai-property-name {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

.ai-property-address {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

.ai-status-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;

    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.25);
}

/* =========================
   META BOXES
========================= */

.ai-property-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.ai-meta-box {
    background: #111c33;
    border: 1px solid rgba(148, 163, 184, 0.10);
    border-radius: 12px;
    padding: 12px;
}

.ai-meta-label {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.ai-meta-value {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
}

/* =========================
   ACTIONS
========================= */

.ai-property-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* =========================
   ASSIGN AGENT WRAPPER
========================= */

.ai-assign-wrapper {
    background: #111c33;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 14px;
    padding: 14px;
}

.ai-assign-title {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 10px;
}

/* =========================
   ASSIGN AGENT FORM
========================= */

.ai-assign-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* =========================
   INPUT FIXES
========================= */

.ai-input {
    flex: 1;
    min-width: 240px;

    background: #0f172a !important;
    color: #e2e8f0 !important;

    border: 1px solid rgba(148, 163, 184, 0.15) !important;
    border-radius: 10px;

    padding: 14px 16px;

    font-size: 14px;
    line-height: 1.4;

    min-height: 48px;

    outline: none !important;
    box-shadow: none !important;

    appearance: none;
    -webkit-appearance: none;
}

.ai-input:focus,
.ai-input:active,
.ai-input:hover {
    background: #0f172a !important;
    color: #e2e8f0 !important;

    border: 1px solid rgba(56, 189, 248, 0.45) !important;

    outline: none !important;
    box-shadow: none !important;
}

.ai-assign-form input {
    text-decoration: none !important;
    background-image: none !important;
}

/* =========================
   ASSIGN BUTTON FIX
========================= */

.ai-assign-form .ai-btn {
    width: auto !important;
    flex: 0 0 auto;

    padding: 10px 16px;

    white-space: nowrap;
}

/* =========================
   EMPTY STATE
========================= */

.ai-empty-state {
    background: #111c33;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

/* =========================
   SUCCESS TOAST
========================= */

.ai-success-toast {
    background: #111c33;
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 12px;
    padding: 14px;

    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.ai-success-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.15);

    display: flex;
    align-items: center;
    justify-content: center;

    color: #22c55e;
    font-weight: 700;
}

.ai-success-title {
    font-size: 13px;
    font-weight: 700;
    color: #22c55e;
}

.ai-success-text {
    font-size: 12px;
    color: #94a3b8;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1024px) {

    .ai-stats-grid {
        grid-template-columns: 1fr;
    }

    .ai-properties-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    .ai-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ai-property-actions {
        flex-direction: column;
    }

    .ai-btn {
        width: 100%;
    }

    .ai-assign-form {
        flex-direction: column;
        align-items: stretch;
    }

    .ai-input {
        width: 100%;
    }

    .ai-assign-form .ai-btn {
        width: 100% !important;
    }
}

/* =====================================================
   PROPERTY FORM SAAS UI (FULL FIXED VERSION)
===================================================== */

/* =========================
   OUTER WRAPPER
========================= */

.ai-property-form-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
}

/* =========================
   CONTAINER
========================= */

.ai-property-form-container {
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 16px;

    box-shadow: 0 10px 30px rgba(0,0,0,0.25);

    padding: 20px;
}

/* =========================
   HEADER
========================= */

.ai-property-form-header {
    margin-bottom: 20px;
}

.ai-property-form-header h1 {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
}

.ai-property-form-header p {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 6px;
}

/* =========================
   CARD (FIXED WHITE ISSUE)
========================= */

.ai-property-form-card {
    background: #111c33 !important;
    border: 1px solid rgba(148, 163, 184, 0.12) !important;
    border-radius: 14px;

    padding: 18px;

    color: #e2e8f0 !important;
}

/* prevent theme white bleed */
.ai-property-form-card,
.ai-property-form-card * {
    background-color: transparent;
}

/* restore correct internal structure */
.ai-property-form-card .ai-field {
    background: transparent !important;
}

/* =========================
   SUCCESS MESSAGE
========================= */

.ai-success-message {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #22c55e;

    padding: 12px 14px;
    border-radius: 10px;

    font-size: 13px;
    margin-bottom: 14px;
}

/* =========================
   FORM
========================= */

.ai-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* =========================
   FIELD BLOCKS
========================= */

.ai-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* =========================
   LABEL
========================= */

.ai-label {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
}

/* =========================
   INPUTS
========================= */

.ai-input {
    width: 100%;
    background: #0f172a !important;
    color: #e2e8f0 !important;

    border: 1px solid rgba(148, 163, 184, 0.15) !important;
    border-radius: 10px;

    padding: 14px 16px;
    font-size: 14px;

    outline: none !important;
    box-shadow: none !important;

    appearance: none;
    -webkit-appearance: none;
}

.ai-input:focus {
    border-color: rgba(56, 189, 248, 0.5) !important;
}

/* =========================
   TEXTAREA
========================= */

.ai-textarea {
    width: 100%;
    min-height: 120px;

    background: #0f172a !important;
    color: #e2e8f0 !important;

    border: 1px solid rgba(148, 163, 184, 0.15) !important;
    border-radius: 10px;

    padding: 14px 16px;
    font-size: 14px;

    outline: none !important;
    box-shadow: none !important;

    resize: vertical;
}

.ai-textarea:focus {
    border-color: rgba(56, 189, 248, 0.5) !important;
}

/* =========================
   BUTTON
========================= */

.ai-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: #38bdf8;
    color: #ffffff;

    border: none;
    border-radius: 10px;

    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;
}

.ai-button:hover {
    background: #0ea5e9;
    transform: translateY(-1px);
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 768px) {

    .ai-property-form-wrapper {
        padding: 10px;
    }

    .ai-property-form-container {
        padding: 16px;
    }

    .ai-button {
        width: 100%;
    }
}

/* =====================================================
   INSPECTION START SCREEN (SAAS UI)
===================================================== */

/* =========================
   OUTER WRAPPER
========================= */

.inspection-saas-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
}

/* =========================
   CONTAINER (GLASS CARD)
========================= */

.inspection-saas-container {
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 16px;

    box-shadow: 0 10px 30px rgba(0,0,0,0.25);

    padding: 20px;
}

/* =========================
   BACK BUTTON AREA
========================= */

.inspection-back-wrap {
    margin-bottom: 16px;
}

/* =========================
   START SCREEN CARD
========================= */

.inspection-start-screen {
    background: #111c33;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 14px;

    padding: 22px;

    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* =========================
   TEXT STYLING
========================= */

.inspection-start-title {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
}

.inspection-start-address {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
}

/* =========================
   FORM LAYOUT
========================= */

.inspection-start-form {
    margin-top: 18px;

    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* =========================
   BUTTON BASE STYLES
========================= */

.btn-ok,
.btn-issues {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 12px 16px;
    border-radius: 10px;

    font-size: 13px;
    font-weight: 600;

    text-decoration: none;
    cursor: pointer;

    transition: all 0.2s ease;

    border: 1px solid transparent;
}

/* =========================
   OK BUTTON (PRIMARY ACTION)
========================= */

.btn-ok {
    background: #22c55e;
    color: #ffffff;
    border-color: rgba(34, 197, 94, 0.25);
}

.btn-ok:hover {
    background: #16a34a;
    transform: translateY(-1px);
}

/* =========================
   ISSUES BUTTON (SECONDARY)
========================= */

.btn-issues {
    background: #0f172a;
    color: #e2e8f0;

    border: 1px solid rgba(148, 163, 184, 0.15);
}

.btn-issues:hover {
    border-color: rgba(56, 189, 248, 0.5);
    color: #ffffff;
    transform: translateY(-1px);
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 768px) {

    .inspection-saas-wrapper {
        padding: 10px;
    }

    .inspection-saas-container {
        padding: 16px;
    }

    .inspection-start-form {
        flex-direction: column;
    }

    .btn-ok,
    .btn-issues {
        width: 100%;
    }
}

/* =====================================================
   INSPECTION ISSUE FORM (SAAS UI)
===================================================== */

/* =========================
   OUTER WRAPPER (FIXED: GLASS SURFACE)
========================= */

.ai-inspection-issue-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 30px auto;
    padding: 20px;

    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 16px;

    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

/* =========================
   FORM LAYOUT
========================= */

.ai-inspection-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;

    align-items: start;
    align-content: start;
}

@media (max-width: 899px) {
    .ai-inspection-form {
        display: flex;
        flex-direction: column;
    }
}

/* =========================
   ITEM CARD
========================= */

.ai-inspection-item-card {
    background: #111c33;
    border: 1px solid rgba(148, 163, 184, 0.10);
    border-radius: 14px;

    padding: 16px;

    display: flex;
    flex-direction: column;
    gap: 10px;

    height: 100%;
}

/* =========================
   ITEM TITLE
========================= */

.ai-inspection-item-title {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
}

/* =========================
   LABEL ROW
========================= */

.ai-inspection-label {
    display: flex;
    align-items: center;
    gap: 10px;

    font-size: 13px;
    color: #e2e8f0;
}

/* =========================
   CHECKBOX
========================= */

.ai-inspection-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #38bdf8;
}

/* =========================
   INSTANCE / SIMPLE BLOCK
========================= */

.ai-inspection-instance,
.ai-inspection-simple {
    display: flex;
    flex-direction: column;
    gap: 8px;

    padding: 10px;

    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 10px;
}

/* =========================
   TEXTAREA (ISSUE NOTES)
========================= */

.ai-inspection-textarea {
    width: 100%;
    min-height: 80px;

    background: #0f172a !important;
    color: #e2e8f0 !important;

    border: 1px solid rgba(148, 163, 184, 0.15) !important;
    border-radius: 10px;

    padding: 10px;
    font-size: 13px;

    outline: none !important;
    resize: vertical;
}

.ai-inspection-textarea:focus {
    border-color: rgba(56, 189, 248, 0.5) !important;
}

/* =========================
   GENERAL NOTES
========================= */

.ai-general-notes-wrapper {
    margin-top: 10px;
}

.ai-general-notes-card {
    background: #111c33;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 14px;

    padding: 16px;
}

.ai-general-notes-card h3 {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
}

.ai-general-notes-input {
    width: 100%;
    min-height: 120px;

    background: #0f172a;
    color: #e2e8f0;

    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 10px;

    padding: 12px;
    font-size: 13px;

    outline: none;
}

.ai-general-notes-input:focus {
    border-color: rgba(56, 163, 248, 0.5);
}

/* =========================
   SUBMIT BUTTON
========================= */

.ai-inspection-submit-wrapper {
    margin-top: 10px;
}

.ai-inspection-submit-btn {
    width: 100%;

    padding: 14px 16px;

    background: #38bdf8;
    color: #ffffff;

    border: none;
    border-radius: 12px;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;
}

.ai-inspection-submit-btn:hover {
    background: #0ea5e9;
    transform: translateY(-1px);
}

.ai-inspection-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* =====================================================
   INSPECTION RESULT (SAAS UI)
===================================================== */

/* =========================
   OUTER WRAPPER
========================= */

.ai-inspection-result-wrapper {
    width: 100%;
    max-width: 520px;
    margin: 60px auto;
    padding: 20px;
}

/* =========================
   MAIN CARD
========================= */

.ai-inspection-result-card {
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 16px;

    padding: 28px;

    text-align: center;

    box-shadow: 0 10px 30px rgba(0,0,0,0.25);

    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* =========================
   TITLE
========================= */

.ai-inspection-result-card h2 {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

/* =========================
   DESCRIPTION TEXT
========================= */

.ai-inspection-result-card p {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0;
}

/* =========================
   ICON
========================= */

.ai-result-icon {
    width: 64px;
    height: 64px;

    margin: 0 auto;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

/* OK STATE */
.ai-result-icon.ok {
    background: #16a34a;
}

/* ISSUES STATE */
.ai-result-icon.issues {
    background: #ef4444;
}

/* =========================
   INFO BOX
========================= */

.ai-inspection-result-info {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.10);
    border-radius: 12px;

    padding: 12px 14px;

    font-size: 13px;
    color: #cbd5e1;
}

/* =========================
   BUTTON
========================= */

.ai-inspection-result-card .ai-btn,
.ai-inspection-result-card a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 12px 18px;

    background: #2563eb;
    color: #ffffff;

    border-radius: 10px;

    font-size: 14px;
    font-weight: 600;

    text-decoration: none;

    transition: all 0.2s ease;

    margin-top: 6px;
}

.ai-inspection-result-card .ai-btn:hover,
.ai-inspection-result-card a:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

/* =====================================================
   PROPERTY DASHBOARD SAAS UI (UNIFIED FINAL VERSION)
===================================================== */

/* =========================
   MAIN OUTER WRAPPER (MATCHED SYSTEM)
========================= */

.ai-property-dashboard {
    width: 100%;
    max-width: 1400px;
    margin: 20px auto;
    padding: 20px;

    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 16px;

    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    color: #e2e8f0;
}

/* =========================
   HEADER (MATCH OWNER DASHBOARD STYLE)
========================= */

.ai-property-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;

    margin-bottom: 20px;
}

.ai-property-dashboard-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0;
    color: #ffffff;
}

.ai-property-dashboard-address {
    font-size: 13px;
    margin-top: 4px;
    color: #94a3b8;
}

/* =========================
   EMPTY STATE (MATCHED CARD STYLE)
========================= */

.ai-no-inspections {
    margin-top: 16px;

    background: #111c33;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 14px;

    padding: 14px;
    color: #facc15;
    font-size: 13px;
}

/* =========================
   TABLE WRAPPER
========================= */

.ai-inspection-table-wrapper {
    margin-top: 20px;
    overflow-x: auto;
}

/* =========================
   TABLE CARD (MATCH PROPERTY CARDS)
========================= */

.ai-inspection-table {
    width: 100%;
    border-collapse: collapse;

    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 16px;

    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

/* =========================
   TABLE HEADER
========================= */

.ai-inspection-table thead {
    background: #111c33;
}

.ai-inspection-table th {
    padding: 14px 16px;

    font-size: 13px;
    font-weight: 700;
    text-align: left;

    color: #f1f5f9;
}

/* =========================
   TABLE ROWS
========================= */

.ai-inspection-table td {
    padding: 14px 16px;
    font-size: 13px;
    color: #cbd5e1;
}

.ai-inspection-table tbody tr {
    border-top: 1px solid rgba(148, 163, 184, 0.08);
    transition: background 0.2s ease;
}

.ai-inspection-table tbody tr:hover {
    background: rgba(17, 28, 51, 0.6);
}

/* =========================
   RESPONSIVE (MATCH OWNER DASHBOARD)
========================= */

@media (max-width: 1024px) {
    .ai-property-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {

    .ai-property-dashboard {
        padding: 16px;
    }

    .ai-inspection-table th,
    .ai-inspection-table td {
        padding: 12px;
        font-size: 12px;
    }
}

/* =====================================================
   AGENT DASHBOARD SAAS UI (FINAL - RESTORED COLOR)
===================================================== */

/* =========================
   MAIN WRAPPER
========================= */

.ai-agent-dashboard-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 20px auto;
    padding: 20px;

    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 16px;

    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

/* =========================
   HEADER
========================= */

.ai-agent-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;

    margin-bottom: 20px;
}

.ai-agent-dashboard-title-wrap h1 {
    font-size: 24px;
    font-weight: 800;
    margin: 0;
    color: #ffffff !important;
}

.ai-agent-dashboard-title-wrap p {
    font-size: 13px;
    margin-top: 4px;
    color: #94a3b8 !important;
}

/* =========================
   STATS GRID
========================= */

.ai-agent-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;

    margin-bottom: 20px;
}

.ai-agent-stat-card {
    background: #111c33;

    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 14px;

    padding: 16px;
}

.ai-agent-stat-label {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
}

.ai-agent-stat-value {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
}

/* =========================
   OWNER GROUP
========================= */

.ai-agent-owner-group {
    margin-bottom: 24px;
}

/* =========================
   OWNER TITLE
========================= */

.ai-agent-owner-title {
    font-size: 13px;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 14px;
    padding-left: 4px;
}

/* =========================
   PROPERTY GRID
========================= */

.ai-agent-properties-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 900px) {
    .ai-agent-properties-grid {
        grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    }
}

/* =========================
   PROPERTY CARD
========================= */

.ai-agent-card {
    background: #111c33;

    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 16px;

    padding: 18px;

    display: flex;
    flex-direction: column;
    gap: 14px;

    box-shadow: 0 10px 30px rgba(0,0,0,0.25);

    transition: all 0.2s ease;
}

.ai-agent-card:hover {
    transform: translateY(-2px);
    background: #1a2438;

    border-color: rgba(56, 189, 248, 0.25);
}

/* =========================
   CARD TOP
========================= */

.ai-agent-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

/* =========================
   PROPERTY NAME
========================= */

.ai-agent-card-name {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

/* =========================
   ADDRESS
========================= */

.ai-agent-card-address {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

/* =========================
   STATUS BADGE
========================= */

.ai-agent-status-badge {
    font-size: 11px;
    font-weight: 600;

    padding: 4px 10px;
    border-radius: 999px;

    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;

    border: 1px solid rgba(56, 189, 248, 0.25);

    white-space: nowrap;
}

/* =========================
   META GRID
========================= */

.ai-agent-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* =========================
   META BOX
========================= */

.ai-agent-meta-box {
    background: #111c33;

    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 12px;

    padding: 12px;
}

.ai-agent-meta-label {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.ai-agent-meta-value {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
}

/* =========================
   ACTIONS
========================= */

.ai-agent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* =========================
   BUTTONS
========================= */

.ai-agent-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 10px 14px;
    border-radius: 10px;

    font-size: 12px;
    font-weight: 600;

    text-decoration: none;
    cursor: pointer;

    transition: all 0.2s ease;

    border: 1px solid transparent;
}

.ai-agent-btn-primary {
    background: #38bdf8;
    color: #ffffff;
}

.ai-agent-btn-primary:hover {
    background: #0ea5e9;
    transform: translateY(-1px);
}

/* =========================
   EMPTY STATE
========================= */

.ai-empty-state {
    background: #111c33 !important;

    border: 1px solid rgba(148, 163, 184, 0.12) !important;
    border-radius: 24px !important;

    box-shadow: 0 10px 30px rgba(0,0,0,0.25) !important;
}

.ai-empty-state h2 {
    color: #ffffff !important;
}

.ai-empty-state p {
    color: #94a3b8 !important;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1024px) {

    .ai-agent-stats-grid {
        grid-template-columns: 1fr;
    }

    .ai-agent-properties-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    .ai-agent-dashboard-wrapper {
        padding: 16px;
    }

    .ai-agent-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ai-agent-card-top {
        flex-direction: column;
    }

    .ai-agent-meta {
        grid-template-columns: 1fr;
    }

    .ai-agent-actions {
        flex-direction: column;
    }

    .ai-agent-btn {
        width: 100%;
    }
}