/* ============================================
   Fault Dashboard — additive styles
   Loaded after templatemo-glass-admin-style.css
============================================ */

.fault-intro {
    color: var(--text-secondary, rgba(255,255,255,0.65));
    font-size: 14px;
    margin: -8px 0 20px;
}

.stat-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.stat-card-link .stat-card {
    cursor: pointer;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.stat-card-link:hover .stat-card {
    border-color: var(--emerald-light);
    box-shadow: 0 12px 40px rgba(52, 211, 153, 0.18);
}

/* Icon pinned to the top-right corner of each card */
.stat-card-inner {
    position: relative;
}

.stat-card-inner .stat-info {
    padding-right: 68px;
}

.stat-card-inner .stat-icon {
    position: absolute;
    top: 0;
    right: 0;
}

.stat-card-cta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 13px;
    font-weight: 500;
    color: var(--emerald-light);
}

.stat-card-link:hover .stat-card-cta svg {
    transform: translateX(3px);
}

.stat-card-cta svg {
    transition: transform 0.2s ease;
}

.content-grid.single-col {
    display: grid;
    grid-template-columns: 1fr;
}

/* Status summary chips (Recent Reports) */
.status-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 6px;
}

.fault-status-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 0 24px 20px;
}

.fault-status-chip-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.fault-status-chip {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
}

.fault-status-chip-link:hover .fault-status-chip {
    border-color: var(--emerald-light);
    box-shadow: 0 10px 30px rgba(52, 211, 153, 0.15);
    transform: translateY(-2px);
}

.fault-status-chip .chip-value {
    font-family: 'Space Mono', monospace;
    font-size: 24px;
    font-weight: 700;
}

.fault-status-chip .chip-label {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 4px;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .fault-status-summary {
        padding: 0 14px 16px;
        gap: 8px;
    }

    .fault-status-chip {
        padding: 10px 8px;
        text-align: center;
    }

    .fault-status-chip .chip-value {
        font-size: 18px;
    }

    .fault-status-chip .chip-label {
        font-size: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: 2px;
    }
}

/* ============================================
   Mobile: keep the 4 service cards as a 2x2 grid
   instead of the template's default single column
============================================ */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card-inner .stat-info {
        padding-right: 46px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
    }

    .stat-icon svg {
        width: 18px;
        height: 18px;
    }

    .stat-info h3 {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .stat-value {
        font-size: 22px;
        margin-bottom: 6px;
    }

    .stat-change {
        font-size: 11px;
        padding: 3px 8px;
        white-space: nowrap;
    }

    .stat-card-cta {
        font-size: 11px;
        margin-top: 10px;
        padding-top: 10px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .glass-card.stat-card {
        padding: 14px;
    }

    .stat-value {
        font-size: 19px;
    }

    .stat-card-cta span,
    .stat-card-cta {
        font-size: 10px;
    }
}

/* ============================================
   Navbar fault search
============================================ */
.fault-search-box {
    position: relative;
}

.fault-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 320px;
    overflow-y: auto;
    background: #1e1e2f;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    z-index: 30;
}

.fault-search-result {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.fault-search-result:last-child { border-bottom: none; }

.fault-search-result:hover {
    background: rgba(52, 211, 153, 0.1);
}

.fault-search-result-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.fault-search-ref {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    font-weight: 700;
}

.fault-search-desc {
    font-size: 12px;
    opacity: 0.7;
}

.fault-search-empty {
    padding: 14px;
    font-size: 13px;
    opacity: 0.55;
    text-align: center;
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.status-badge-sm {
    font-size: 10px;
    padding: 2px 8px;
    flex-shrink: 0;
}

/* ============================================
   Recent Reports — clickable items
============================================ */
.activity-item-clickable {
    cursor: pointer;
    border-radius: 12px;
    transition: background 0.15s ease;
    padding: 6px 8px;
    margin: 0 -8px;
}

.activity-item-clickable:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* ============================================
   Fault detail modal
============================================ */
.fault-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.fault-modal-overlay.open {
    display: flex;
}

.fault-modal {
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
}

.fault-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: var(--text-primary, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.fault-modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.fault-modal-ref {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    opacity: 0.6;
    margin-bottom: 8px;
}

.fault-modal-type {
    font-size: 19px;
    margin: 10px 0 18px;
}

.fault-modal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 13px;
    text-align: left;
}

.fault-modal-row span {
    opacity: 0.55;
}

.fault-modal-reporter {
    display: none;
    margin-top: 18px;
    padding-top: 4px;
}

.fault-modal-reporter-label {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.5;
    margin: 14px 0 4px;
}

.fault-modal-note {
    display: none;
    font-size: 12px;
    opacity: 0.5;
    margin-top: 18px;
    line-height: 1.5;
}

.fault-modal-attachment {
    margin-top: 18px;
}

.fault-modal-attachment img,
.fault-modal-attachment video {
    display: block;
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.fault-modal-attachment-note {
    font-size: 12px;
    opacity: 0.5;
    line-height: 1.5;
    text-align: left;
}

/* ============================================
   Fault Logging page
============================================ */
.log-form-card {
    margin-bottom: 22px;
}

.log-form-card .card-header {
    margin-bottom: 18px;
}

.log-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--emerald), var(--gold));
    font-size: 12px;
    font-weight: 700;
    margin-right: 8px;
    flex-shrink: 0;
}

.log-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 24px;
}

.log-form-grid .form-group.full-width {
    grid-column: 1 / -1;
}

textarea.form-input {
    resize: vertical;
    min-height: 70px;
    font-family: inherit;
}

/* Address autocomplete */
.address-autocomplete {
    position: relative;
}

.address-suggestions {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    background: #1e1e2f;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    z-index: 20;
}

.address-suggestion {
    padding: 10px 14px;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.address-suggestion:last-child {
    border-bottom: none;
}

.address-suggestion:hover,
.address-suggestion.active {
    background: rgba(52, 211, 153, 0.12);
}

.address-suggestion strong {
    color: var(--emerald-light);
    font-weight: 700;
}

.field-error {
    display: none;
    color: #ff6b6b;
    font-size: 12px;
    margin-top: 6px;
}

.form-group.has-error .form-input {
    border-color: #ff6b6b;
}

.form-group.has-error .field-error {
    display: block;
}

/* Service type picker */
.service-picker {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.service-pick {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 10px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
    font-family: inherit;
    color: var(--text-primary, #fff);
}

.service-pick:hover {
    border-color: var(--emerald-light);
    transform: translateY(-2px);
}

.service-pick.active {
    border-color: var(--emerald-light);
    background: rgba(52, 211, 153, 0.1);
    box-shadow: 0 8px 24px rgba(52, 211, 153, 0.18);
}

.service-pick .service-pick-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-pick span {
    font-size: 13px;
    font-weight: 500;
}

.stat-icon.slate {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.2), rgba(148, 163, 184, 0.05));
    box-shadow: 0 8px 32px rgba(148, 163, 184, 0.2);
}

/* Fault type picker */
.fault-type-hint {
    font-size: 13px;
    opacity: 0.55;
    padding: 20px 0;
    text-align: center;
}

.fault-type-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.fault-type-pill {
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary, #fff);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.fault-type-pill:hover {
    border-color: var(--emerald-light);
}

.fault-type-pill.active {
    border-color: var(--emerald-light);
    background: linear-gradient(135deg, var(--emerald), var(--gold));
    color: #0b1210;
    font-weight: 600;
}

.fault-type-other-input {
    margin-top: 14px;
}

/* Submit */
.log-submit-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

#submit-fault-btn {
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 480px) {
    .log-submit-row {
        flex-direction: column;
        align-items: stretch;
    }
}

.log-submit-error {
    color: #ff6b6b;
    font-size: 13px;
    display: none;
}

/* Confirmation panel */
.log-confirm {
    display: none;
    text-align: center;
    padding: 10px;
}

.log-confirm-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(34,197,94,0.25), rgba(34,197,94,0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.log-confirm-ref {
    font-family: 'Space Mono', monospace;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin: 8px 0 4px;
    color: var(--emerald-light);
}

.log-confirm-sms {
    max-width: 420px;
    margin: 18px auto 0;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    text-align: left;
    font-size: 13px;
    line-height: 1.5;
}

.log-confirm-sms strong {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.6;
}

.log-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 22px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .log-form-grid {
        grid-template-columns: 1fr;
    }

    .service-picker {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .service-picker {
        grid-template-columns: repeat(2, 1fr);
    }

    .service-pick .service-pick-icon {
        width: 36px;
        height: 36px;
    }

    .service-pick span {
        font-size: 12px;
    }
}

/* Photo / video attachment */
.attachment-preview {
    position: relative;
    margin-top: 16px;
    max-width: 320px;
}

.attachment-preview img,
.attachment-preview video {
    display: block;
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.attachment-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.attachment-status {
    font-size: 12px;
    opacity: 0.65;
    margin: 10px 0 0;
    line-height: 1.5;
}

/* ============================================
   Registered Users dashboard
============================================ */
.users-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}

.users-summary .fault-status-chip .chip-value {
    font-size: 26px;
}

.users-cta-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 26px;
}

.users-cta-row .btn {
    text-decoration: none;
}

.breakdown-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.breakdown-search {
    position: relative;
    flex: 1 1 220px;
}

.breakdown-search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    opacity: 0.5;
    pointer-events: none;
}

.breakdown-search input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary, #fff);
    font-family: inherit;
    font-size: 13px;
}

.breakdown-search input:focus {
    outline: none;
    border-color: var(--emerald-light);
}

.breakdown-sort {
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary, #fff);
    font-family: inherit;
    font-size: 12px;
}

.breakdown-match-count {
    font-size: 12px;
    opacity: 0.55;
    white-space: nowrap;
}

/* Ranked bar list */
.bar-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bar-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.bar-row-label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.bar-row-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-row-name .bar-row-sub {
    font-size: 11px;
    opacity: 0.5;
    margin-left: 6px;
}

.bar-track {
    height: 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--emerald), var(--gold));
}

.bar-row-value {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 13px;
    min-width: 34px;
    text-align: right;
}

.breakdown-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.breakdown-empty {
    text-align: center;
    padding: 24px;
    opacity: 0.55;
    font-size: 13px;
}

.suburb-page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary, #fff);
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.suburb-page-btn:hover:not(:disabled) {
    border-color: var(--emerald-light);
}

.suburb-page-btn.active {
    background: linear-gradient(135deg, var(--emerald), var(--gold));
    border-color: transparent;
    font-weight: 600;
}

.suburb-page-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

@media (max-width: 900px) {
    .users-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .users-cta-row {
        flex-direction: column;
    }

    .users-cta-row .btn {
        width: 100%;
        justify-content: center;
    }
}
