/* =====================================================================
   AILEENN Healthcare — XCrud reusable CRUD dialog (styles)
   Self-contained token layer so the dialog renders solidly on any host
   page (inherits the host's design tokens where defined, else a dark
   default). Distinct names avoid custom-property cycles.
   ===================================================================== */
.xcr-ov {
    --xcr-surface: var(--bg-surface, #0e1620);
    --xcr-card: var(--bg-card, #131f2b);
    --xcr-elevated: var(--bg-elevated, #0b1219);
    --xcr-border: var(--border, #2a3a4a);
    --xcr-text: var(--text-primary, #e6eef5);
    --xcr-text2: var(--text-secondary, #9fb3c6);
    --xcr-teal: var(--teal, #0cc2c2);
    position: fixed; inset: 0; background: rgba(2,6,14,.66); backdrop-filter: blur(3px); z-index: 10000;
    display: flex; align-items: center; justify-content: center; padding: 20px; }
.xcr-modal { width: min(640px, 96vw); max-height: 92vh; display: flex; flex-direction: column; overflow: hidden;
    background: var(--xcr-surface); color: var(--xcr-text); border: 1px solid var(--xcr-border);
    border-radius: var(--radius-lg, 14px); box-shadow: 0 24px 70px rgba(0,0,0,.5); }
.xcr-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--xcr-border); background: var(--xcr-card); }
.xcr-t { font-size: 14px; font-weight: 700; }
.xcr-x { margin-left: auto; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--xcr-border); background: transparent; color: var(--xcr-text); font-size: 15px; cursor: pointer; }
.xcr-x:hover { border-color: var(--accent-rose, #f43f5e); color: var(--accent-rose, #f43f5e); }
.xcr-b { padding: 16px 18px; overflow-y: auto; }
.xcr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.xcr-f { display: flex; flex-direction: column; gap: 5px; }
.xcr-f.full, .xcr-checks { grid-column: 1 / -1; }
.xcr-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--xcr-text2); }
.xcr-f input, .xcr-f select, .xcr-f textarea { width: 100%; box-sizing: border-box; background: var(--xcr-elevated);
    border: 1px solid var(--xcr-border); border-radius: 9px; color: var(--xcr-text); padding: 9px 12px; font: inherit; font-size: 13px; outline: none; }
.xcr-f input:focus, .xcr-f select:focus, .xcr-f textarea:focus { border-color: var(--xcr-teal); }
.xcr-f textarea { resize: vertical; min-height: 56px; }
.xcr-checks { display: flex; flex-direction: column; gap: 5px; }
.xcr-checks-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 6px 12px; margin-top: 4px; }
.xcr-chk { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--xcr-text); }
.xcr-chk input { width: auto; }
.xcr-f-bar { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-top: 1px solid var(--xcr-border); background: var(--xcr-card); }
.xcr-msg { font-size: 12px; color: var(--accent-rose, #f43f5e); margin-right: auto; }
.xcr-btn { border: 1px solid var(--xcr-border); background: var(--xcr-elevated); color: var(--xcr-text); border-radius: 9px;
    padding: 9px 18px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.xcr-btn:hover { border-color: var(--xcr-teal); }
.xcr-btn.xcr-primary { background: var(--xcr-teal); border-color: var(--xcr-teal); color: #04211f; }
.xcr-btn:disabled { opacity: .55; cursor: not-allowed; }
/* Notes field: readonly running log + "Add note" button; and the note capture modal */
.xcr-f textarea.xcr-notes { min-height: 150px; resize: vertical; font-family: 'DM Mono', ui-monospace, Consolas, monospace;
    font-size: 12px; line-height: 1.5; white-space: pre-wrap; background: var(--xcr-elevated); color: var(--xcr-text2); }
.xcr-addnote { align-self: flex-start; margin-top: 6px; border: 1px solid var(--xcr-border); background: var(--xcr-elevated);
    color: var(--xcr-text); border-radius: 9px; padding: 7px 14px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.xcr-addnote:hover { border-color: var(--xcr-teal); color: var(--xcr-teal); }
.xcr-note-wrap { position: relative; }
.xcr-note-input { width: 100%; box-sizing: border-box; min-height: 130px; resize: vertical; background: var(--xcr-elevated);
    border: 1px solid var(--xcr-border); border-radius: 9px; color: var(--xcr-text); padding: 10px 46px 10px 12px; font: inherit; font-size: 13px; outline: none; }
.xcr-note-input:focus { border-color: var(--xcr-teal); }
/* mic (voice dictation) button — top-right of the note textarea */
.xmic-btn { position: absolute; right: 8px; top: 8px; width: 34px; height: 34px; border-radius: 50%;
    border: 1px solid var(--xcr-border); background: var(--xcr-card); color: var(--xcr-text); cursor: pointer; font-size: 14px;
    display: grid; place-items: center; transition: all .15s; }
.xmic-btn:hover { border-color: var(--xcr-teal); color: var(--xcr-teal); }
.xmic-btn.xmic-on { background: var(--accent-rose, #f43f5e); border-color: var(--accent-rose, #f43f5e); color: #fff;
    animation: xmic-pulse 1.2s infinite; }
.xmic-btn.xmic-unsupported, .xmic-btn:disabled { opacity: .4; cursor: not-allowed; }
@keyframes xmic-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(244,63,94,.5); } 50% { box-shadow: 0 0 0 6px rgba(244,63,94,0); } }

/* single boolean checkbox field */
.xcr-bool { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--xcr-text); cursor: pointer; }
.xcr-bool input { width: auto; }

/* image upload field */
.xcr-upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.xcr-upimg { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; border: 1px solid var(--xcr-border); background: var(--xcr-elevated); }
.xcr-upbtn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--xcr-border); background: var(--xcr-elevated);
    color: var(--xcr-text); border-radius: 9px; padding: 8px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.xcr-upbtn:hover { border-color: var(--xcr-teal); color: var(--xcr-teal); }
.xcr-upmsg { font-size: 12px; color: var(--xcr-text2); }

@media (max-width: 560px) { .xcr-grid { grid-template-columns: 1fr; } }
