/* Dodoma Kadi Kidigitali — professional in-app feedback, confirmations and errors. */
:root {
    --dkk-feedback-green: #0b7a4b;
    --dkk-feedback-green-soft: #e9f7f0;
    --dkk-feedback-gold: #a66b05;
    --dkk-feedback-gold-soft: #fff7df;
    --dkk-feedback-red: #b42318;
    --dkk-feedback-red-soft: #fff0ee;
    --dkk-feedback-blue: #175cd3;
    --dkk-feedback-blue-soft: #eff6ff;
    --dkk-feedback-ink: #15231c;
    --dkk-feedback-muted: #66756d;
    --dkk-feedback-line: #dbe5df;
    --dkk-feedback-shadow: 0 18px 46px rgba(19, 45, 33, .16);
}

.dkk-alert-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2055;
    display: grid;
    gap: .75rem;
    width: min(430px, calc(100vw - 2rem));
    pointer-events: none;
}

.dkk-alert {
    --dkk-alert-accent: var(--dkk-feedback-green);
    --dkk-alert-soft: var(--dkk-feedback-green-soft);
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 32px;
    gap: .8rem;
    align-items: start;
    padding: .9rem .9rem .9rem .85rem;
    border: 1px solid color-mix(in srgb, var(--dkk-alert-accent) 22%, #fff);
    border-left: 4px solid var(--dkk-alert-accent);
    border-radius: 14px;
    background: rgba(255, 255, 255, .98);
    box-shadow: var(--dkk-feedback-shadow);
    color: var(--dkk-feedback-ink);
    pointer-events: auto;
    animation: dkkAlertIn .22s ease-out both;
    overflow: hidden;
}

.dkk-alert.is-success { --dkk-alert-accent: var(--dkk-feedback-green); --dkk-alert-soft: var(--dkk-feedback-green-soft); }
.dkk-alert.is-warning { --dkk-alert-accent: var(--dkk-feedback-gold); --dkk-alert-soft: var(--dkk-feedback-gold-soft); }
.dkk-alert.is-error,
.dkk-alert.is-danger { --dkk-alert-accent: var(--dkk-feedback-red); --dkk-alert-soft: var(--dkk-feedback-red-soft); }
.dkk-alert.is-info { --dkk-alert-accent: var(--dkk-feedback-blue); --dkk-alert-soft: var(--dkk-feedback-blue-soft); }

.dkk-alert-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--dkk-alert-soft);
    color: var(--dkk-alert-accent);
    font-size: 1.05rem;
    font-weight: 800;
}

.dkk-alert-copy { min-width: 0; padding-top: .05rem; }
.dkk-alert-title { display: block; margin: 0 0 .18rem; font-size: .93rem; line-height: 1.3; font-weight: 800; }
.dkk-alert-message { margin: 0; color: var(--dkk-feedback-muted); font-size: .87rem; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-line; }
.dkk-alert-close {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #708078;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}
.dkk-alert-close:hover { background: #f2f6f4; color: #21342a; }
.dkk-alert.is-leaving { animation: dkkAlertOut .18s ease-in both; }

@keyframes dkkAlertIn { from { opacity: 0; transform: translateY(-8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes dkkAlertOut { to { opacity: 0; transform: translateY(-6px) scale(.985); } }

.dkk-feedback-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2070;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: rgba(8, 24, 17, .52);
    backdrop-filter: blur(5px);
    animation: dkkBackdropIn .16s ease-out both;
}

.dkk-feedback-dialog {
    width: min(520px, 100%);
    max-height: min(760px, calc(100vh - 2.5rem));
    overflow: auto;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 30px 90px rgba(4, 25, 15, .28);
    animation: dkkDialogIn .2s cubic-bezier(.2,.8,.2,1) both;
}

.dkk-feedback-dialog-head { display: flex; gap: .9rem; padding: 1.35rem 1.35rem .45rem; }
.dkk-feedback-dialog-icon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--dkk-feedback-green-soft);
    color: var(--dkk-feedback-green);
    font-weight: 900;
    font-size: 1.15rem;
}
.dkk-feedback-dialog.is-danger .dkk-feedback-dialog-icon { background: var(--dkk-feedback-red-soft); color: var(--dkk-feedback-red); }
.dkk-feedback-dialog.is-warning .dkk-feedback-dialog-icon { background: var(--dkk-feedback-gold-soft); color: var(--dkk-feedback-gold); }
.dkk-feedback-dialog.is-info .dkk-feedback-dialog-icon { background: var(--dkk-feedback-blue-soft); color: var(--dkk-feedback-blue); }
.dkk-feedback-dialog h2 { margin: .05rem 0 .25rem; color: var(--dkk-feedback-ink); font-size: 1.16rem; line-height: 1.3; font-weight: 800; }
.dkk-feedback-dialog p { margin: 0; color: var(--dkk-feedback-muted); font-size: .92rem; line-height: 1.58; white-space: pre-line; }
.dkk-feedback-dialog-body { padding: .85rem 1.35rem .15rem; }
.dkk-feedback-dialog-actions { display: flex; justify-content: flex-end; gap: .7rem; padding: 1.15rem 1.35rem 1.35rem; }

.dkk-feedback-input-label { display: block; margin: .1rem 0 .45rem; color: #35473e; font-size: .82rem; font-weight: 700; }
.dkk-feedback-input {
    width: 100%;
    min-height: 46px;
    border: 1px solid #cddbd3;
    border-radius: 11px;
    background: #fbfdfc;
    color: #15231c;
    padding: .7rem .8rem;
    outline: none;
    box-shadow: none;
}
textarea.dkk-feedback-input { min-height: 150px; resize: vertical; font: inherit; }
.dkk-feedback-input:focus { border-color: #4ea27a; box-shadow: 0 0 0 3px rgba(11,122,75,.11); }
.dkk-feedback-phrase { display: inline-block; margin-top: .1rem; padding: .12rem .35rem; border-radius: 6px; background: #f2f5f3; color: #24372d; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 800; }

.dkk-feedback-btn {
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: .58rem .95rem;
    font-size: .88rem;
    font-weight: 750;
    cursor: pointer;
}
.dkk-feedback-btn:disabled { opacity: .45; cursor: not-allowed; }
.dkk-feedback-btn.is-secondary { border-color: #d5e0da; background: #fff; color: #35473e; }
.dkk-feedback-btn.is-secondary:hover { background: #f5f8f6; }
.dkk-feedback-btn.is-primary,
.dkk-feedback-btn.is-success { background: var(--dkk-feedback-green); color: #fff; }
.dkk-feedback-btn.is-danger { background: var(--dkk-feedback-red); color: #fff; }
.dkk-feedback-btn.is-warning { background: #8d5b06; color: #fff; }
.dkk-feedback-btn.is-info { background: var(--dkk-feedback-blue); color: #fff; }

body.dkk-feedback-modal-open { overflow: hidden; }
@keyframes dkkBackdropIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes dkkDialogIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

@media (max-width: 640px) {
    .dkk-alert-stack { top: .7rem; right: .7rem; width: calc(100vw - 1.4rem); }
    .dkk-alert { grid-template-columns: 36px minmax(0,1fr) 30px; padding: .78rem; border-radius: 12px; }
    .dkk-alert-icon { width: 36px; height: 36px; border-radius: 10px; }
    .dkk-feedback-backdrop { align-items: end; padding: .6rem; }
    .dkk-feedback-dialog { width: 100%; max-height: calc(100vh - 1.2rem); border-radius: 20px; }
    .dkk-feedback-dialog-actions { flex-direction: column-reverse; }
    .dkk-feedback-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .dkk-alert,
    .dkk-alert.is-leaving,
    .dkk-feedback-backdrop,
    .dkk-feedback-dialog { animation: none !important; }
}

/* Bring older page-level Bootstrap notices into the same visual system while they are gradually migrated. */
.admin-body .alert:not(.dkk-alert),
.dkk-auth-page .alert:not(.dkk-alert) {
    border: 1px solid #dce6e0 !important;
    border-left-width: 4px !important;
    border-radius: 14px !important;
    box-shadow: 0 10px 26px rgba(25, 55, 41, .08) !important;
    font-size: .9rem;
    line-height: 1.55;
}
.admin-body .alert-success:not(.dkk-alert), .dkk-auth-page .alert-success:not(.dkk-alert) { border-left-color: var(--dkk-feedback-green) !important; background: #f3fbf6 !important; color: #25543c !important; }
.admin-body .alert-warning:not(.dkk-alert), .dkk-auth-page .alert-warning:not(.dkk-alert) { border-left-color: var(--dkk-feedback-gold) !important; background: #fffaf0 !important; color: #684708 !important; }
.admin-body .alert-danger:not(.dkk-alert), .dkk-auth-page .alert-danger:not(.dkk-alert) { border-left-color: var(--dkk-feedback-red) !important; background: #fff6f4 !important; color: #7b2d25 !important; }
.admin-body .alert-info:not(.dkk-alert), .dkk-auth-page .alert-info:not(.dkk-alert) { border-left-color: var(--dkk-feedback-blue) !important; background: #f5f9ff !important; color: #234f91 !important; }
