/* --- 1. Stats Cards (Modern) --- */
.pnm-stats-row { display: flex; gap: 20px; margin: 25px 0; }

.pnm-stat-card {
    background: #fff; border: 1px solid #dcdcde; border-radius: 8px; padding: 20px;
    min-width: 180px; display: flex; align-items: center; gap: 15px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.pnm-stat-icon {
    font-size: 20px; color: #2271b1; background: #f0f6fc;
    width: 45px; height: 45px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
}
.pnm-stat-icon.red { color: #d63638; background: #fcf0f1; }

.pnm-stat-info h3 { margin: 0; font-size: 26px; font-weight: 700; color: #1d2327; line-height: 1; }
.pnm-stat-info span { color: #646970; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

/* --- 2. The Task Table --- */
.pnm-table-container {
    background: #fff; border: 1px solid #c3c4c7; border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05); overflow: hidden;
}
table.pnm-table { width: 100%; border-collapse: collapse; text-align: left; }

/* Header */
.pnm-table thead tr { background: #f6f7f7; border-bottom: 1px solid #c3c4c7; }
.pnm-table th { padding: 15px; font-weight: 600; color: #1d2327; font-size: 13px; text-transform: uppercase; }

/* Rows */
.pnm-table tbody tr { border-bottom: 1px solid #f0f0f1; transition: background 0.1s; }
.pnm-table tbody tr:last-child { border-bottom: none; }
.pnm-table tbody tr:hover { background: #fcfcfc; }
.pnm-table td { padding: 16px 15px; vertical-align: top; color: #50575e; }

/* Column Specifics */
.col-content { width: 45%; }
.col-context { width: 20%; }
.col-integrations { width: 25%; }
.col-actions { width: 10%; text-align: right; }

/* Content Styling */
.note-text { font-size: 14px; color: #1d2327; font-weight: 500; line-height: 1.5; margin-bottom: 6px; display: block;}
.note-meta { font-size: 12px; color: #8c8f94; display: flex; gap: 8px; align-items: center; margin-top: 4px; }

/* Status Pill (The "Open Task" Badge) */
.status-pill {
    background: #fff8e5; color: #996800; border: 1px solid #f0c330;
    padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 4px;
}

/* Context Links */
.context-link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: #2271b1; font-weight: 500; font-size: 13px; }
.context-link:hover { text-decoration: underline; }
.context-global { color: #8c8f94; font-style: italic; font-size: 13px; }

/* --- 3. Integration Rail --- */
.integration-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Ghost Button (Sync) */
.btn-sync {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fff; border: 1px solid #dcdcde; color: #646970;
    padding: 5px 10px; border-radius: 4px; font-size: 12px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.btn-sync:hover { border-color: #2271b1; color: #2271b1; background: #f0f6fc; }

/* Active Badge (Linked) */
.badge-jira { background: #e3fcef; border: 1px solid #006644; color: #006644; padding: 5px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.badge-trello { background: #e6fcff; border: 1px solid #0079bf; color: #0079bf; padding: 5px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }

/* Action Buttons (Right Rail) */
.action-btn {
    background: none; border: none; color: #8c8f94; cursor: pointer;
    padding: 6px; border-radius: 4px; transition: color 0.2s, background 0.2s;
    font-size: 14px;
}
.action-btn:hover { background: #f0f0f1; }
.action-btn.delete:hover { color: #d63638; background: #fcf0f1; }
.action-btn.email:hover { color: #2271b1; background: #f0f6fc; }

/* --- 4. The Modal (Restoring Missing Styles) --- */

/* Background Overlay */
.pnm-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100000; /* Super high to sit above Admin Bar */
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px); /* Modern nice-to-have */
}

/* The Box */
.pnm-modal-content {
    background: #fff;
    width: 500px;
    max-width: 90%;
    border-radius: 8px; /* Matching new dashboard radius */
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Header */
.pnm-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fcfcfc;
}
.pnm-modal-header h2 { margin: 0; font-size: 18px; color: #1d2327; }

/* Close Button */
.pnm-close-btn {
    background: none; border: none; font-size: 24px; line-height: 1;
    cursor: pointer; color: #646970; padding: 0 5px;
}
.pnm-close-btn:hover { color: #d63638; }

/* Body & Footer */
.pnm-modal-body { padding: 20px; }
.pnm-modal-footer { margin-top: 15px; text-align: right; }

/* Form Elements (Frontend Compatibility) */
.pnm-modal-content textarea {
    width: 100%;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    padding: 10px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
    min-height: 120px;
    margin-bottom: 15px;
    display: block;
}

.pnm-modal-content input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.1);
}

.pnm-modal-content label {
    font-size: 14px;
    font-weight: 500;
    color: #3c434a;
}

/* FORCE Dashicon on Admin Bar (Bulletproof Version) */
#wp-admin-bar-pnm_quick_note .ab-item .dashicons,
#wp-admin-bar-pnm_quick_note .dashicons {
    font-family: "dashicons" !important;
    content: "\f107" !important; /* The Code for Paperclip */
    font-size: 18px !important;
    width: 20px !important;
    height: 20px !important;
    display: inline-block !important;
    vertical-align: middle !important;
    margin-top: -3px !important;
    margin-right: 5px !important;
    color: inherit !important;
    line-height: 1 !important;
    /* Reset any FontAwesome interference */
    font-weight: normal !important;
    font-variant: normal !important;
    text-transform: none !important;
    -webkit-font-smoothing: antialiased;
}

/* 3. Bulletproof Primary Button (Frontend & Backend) */
.pnm-modal-footer .button-primary,
#pnm-new-note-form button[type="submit"] {
    display: inline-block !important;
    text-decoration: none !important;
    font-size: 13px !important;
    line-height: 2.15 !important;
    min-height: 30px !important;
    margin: 0 !important;
    padding: 0 10px !important;
    cursor: pointer !important;
    border-width: 1px !important;
    border-style: solid !important;
    -webkit-appearance: none !important;
    border-radius: 3px !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    
    /* The Official WP Blue */
    background: #2271b1 !important;
    border-color: #2271b1 !important;
    color: #fff !important;
    font-weight: 600 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

.pnm-modal-footer .button-primary:hover,
#pnm-new-note-form button[type="submit"]:hover {
    background: #135e96 !important;
    border-color: #135e96 !important;
}

/* SVG Icon Alignment */
.btn-sync svg,
.badge-jira svg,
.badge-trello svg {
    display: inline-block;
    vertical-align: middle;
    margin-top: -2px; /* Fine tune vertical center */
}

/* Adjust button padding to accommodate the icon */
.btn-sync {
    display: inline-flex; align-items: center; gap: 4px;
    background: #fff; border: 1px solid #dcdcde; color: #646970;
    padding: 8px 8px; /* Slightly tighter */
    border-radius: 4px; font-size: 12px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
    line-height: 1;
}

/* Ensure the SVG inherits or sets color correctly */
.btn-sync:hover svg path { fill-opacity: 1; }