﻿@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');

:root {
    --navy: #0b3558;
    --blue: #0f6fae;
    --sky: #2ca8df;
    --ink: #152536;
    --muted: #64748b;
    --line: #dce6ef;
    --surface: #ffffff;
    --soft: #f2f7fb;
    --danger: #b42318;
}

* { box-sizing: border-box; }

body.portal-body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--soft);
    font-family: "Cairo", Tahoma, Arial, sans-serif;
}

a { color: var(--blue); }

.auth-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(360px, 42%) 1fr;
}

.auth-intro {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(28px, 5vw, 72px);
    color: #fff;
    background:
        radial-gradient(circle at 20% 20%, rgba(44,168,223,.38), transparent 35%),
        linear-gradient(145deg, #092b49, #0d5f91);
}

.portal-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--navy);
    text-decoration: none;
    font-weight: 800;
}

.portal-brand-light { color: #fff; }
.portal-brand img { width: 58px; height: 58px; object-fit: contain; }

.auth-intro h1,
.dashboard-heading h1 {
    margin: 10px 0 12px;
    font-size: clamp(30px, 4vw, 52px);
    line-height: 1.35;
}

.auth-intro p { max-width: 560px; color: rgba(255,255,255,.82); font-size: 17px; line-height: 1.9; }
.eyebrow { color: var(--sky); font-size: 13px; font-weight: 800; letter-spacing: .06em; }
.back-link { color: rgba(255,255,255,.88); text-decoration: none; font-weight: 600; }
.intro-links { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.language-link {
    min-width: 42px;
    padding: 6px 12px;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 999px;
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-weight: 800;
}
.mobile-language-link {
    display: none;
    float: inline-end;
    padding: 5px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
}

.auth-panel {
    display: grid;
    place-items: center;
    padding: 30px;
}

.auth-card {
    width: min(100%, 440px);
    padding: 42px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(17, 55, 85, .10);
}

.auth-card-wide { width: min(100%, 540px); }
.auth-card h2 { margin: 8px 0; font-size: 30px; }
.form-lead { margin: 0 0 24px; color: var(--muted); line-height: 1.8; }
.mobile-brand { display: none; }

label { display: block; margin: 16px 0 7px; font-size: 14px; font-weight: 700; }
input,
select,
textarea {
    width: 100%;
    min-height: 50px;
    padding: 0 14px;
    border: 1px solid #cad8e5;
    border-radius: 12px;
    color: var(--ink);
    background: #fff;
    font: inherit;
    outline: none;
}

textarea { min-height: 110px; padding-top: 12px; padding-bottom: 12px; resize: vertical; }
input:focus,
select:focus,
textarea:focus { border-color: var(--sky); box-shadow: 0 0 0 4px rgba(44,168,223,.13); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hint { display: block; margin-top: 8px; color: var(--muted); }

.primary-button {
    width: 100%;
    min-height: 50px;
    margin-top: 24px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--sky));
    font: 700 16px "Cairo", sans-serif;
    cursor: pointer;
    text-decoration: none;
}

.primary-button:hover { filter: brightness(.96); }
.inline-button { display: inline-flex; width: auto; align-items: center; padding: 0 24px; }
.form-foot { margin: 22px 0 0; text-align: center; color: var(--muted); }
.form-foot.secondary { margin-top: 10px; font-size: 14px; }

.alert { margin: 18px 0; padding: 12px 14px; border-radius: 10px; font-size: 14px; }
.alert-error { color: var(--danger); background: #fff0ee; border: 1px solid #f4c7c2; }
.alert-success { color: #166534; background: #ecfdf3; border: 1px solid #bbf7d0; }
.is-hidden { display: none !important; }

.portal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 82px;
    padding: 12px clamp(20px, 5vw, 72px);
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.portal-header nav { display: flex; align-items: center; gap: 22px; }
.portal-header nav a { color: var(--ink); text-decoration: none; font-weight: 600; }
.portal-header nav .logout-link { color: var(--blue); }
.portal-header-account { display: inline-block; max-width: 220px; overflow: hidden; color: var(--navy); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-shell { width: min(1180px, calc(100% - 32px)); margin: 42px auto; }
.dashboard-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.dashboard-heading h1 { font-size: clamp(30px, 4vw, 46px); }
.dashboard-heading p { margin: 0; color: var(--muted); }
.user-chip { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.user-chip span { color: var(--muted); font-size: 12px; }
.user-chip strong { direction: ltr; font-size: 13px; }
.complaints-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 15px 45px rgba(17,55,85,.07); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: right; }
th, td { padding: 16px 18px; border-bottom: 1px solid #e8eef4; white-space: nowrap; }
th { color: #536577; background: #f8fafc; font-size: 13px; }
td { font-size: 14px; }
td.tracking { color: var(--blue); direction: ltr; text-align: right; font-weight: 800; }
html[dir="ltr"] table { text-align: left; }
html[dir="ltr"] td.tracking { text-align: left; }
.tracking-cell { display: inline-flex; align-items: center; gap: 9px; }
.copy-tracking {
    min-height: 28px;
    padding: 3px 9px;
    border: 1px solid #b9d7ea;
    border-radius: 8px;
    color: var(--blue);
    background: #f0f9ff;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
}
.copy-tracking:hover { background: #e0f2fe; }
.status { display: inline-flex; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status-new { color: #075985; background: #e0f2fe; }
.status-progress { color: #92400e; background: #fef3c7; }
.status-done { color: #166534; background: #dcfce7; }
.empty-state { padding: 70px 24px; text-align: center; }
.empty-state h2 { margin: 0 0 8px; }
.empty-state p { color: var(--muted); }
.table-action {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 5px 12px;
    border: 1px solid #b9d7ea;
    border-radius: 9px;
    color: var(--blue);
    background: #f0f9ff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
}
.table-actions { display: flex; align-items: center; gap: 8px; }
.table-action-admin { color: #fff; border-color: var(--blue); background: var(--blue); }

.admin-detail-shell { width: min(1380px, calc(100% - 32px)); }
.detail-back { display: inline-flex; margin-bottom: 18px; color: var(--blue); text-decoration: none; font-weight: 700; }
.admin-detail-heading { align-items: center; }
.admin-detail-heading h1 { margin-bottom: 4px; font-size: clamp(26px, 3vw, 38px); }
.tracking-large { direction: ltr; color: var(--blue) !important; font-weight: 800; }
.admin-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 24px; align-items: start; }
.admin-detail-main { display: grid; gap: 20px; min-width: 0; }
.detail-card { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 12px 35px rgba(17,55,85,.06); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; color: var(--navy); font-size: 20px; }
.count-badge { display: inline-grid; min-width: 30px; min-height: 30px; place-items: center; border-radius: 999px; color: var(--blue); background: #e0f2fe; font-weight: 800; }
.details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.details-grid > div { min-width: 0; padding: 15px; border: 1px solid #e5edf4; border-radius: 13px; background: #fbfdff; }
.details-grid .details-span { grid-column: 1 / -1; }
.details-grid span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.details-grid strong { display: block; overflow-wrap: anywhere; font-size: 14px; }
.details-grid .multiline { line-height: 1.9; white-space: normal; }
.ltr-value { direction: ltr; text-align: start; }
.gps-coordinates { direction: ltr; unicode-bidi: isolate; }
.gps-map-link {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    margin-inline-start: 12px;
    padding: 5px 12px;
    border: 1px solid #b9d7ea;
    border-radius: 9px;
    color: var(--blue);
    background: #f0f9ff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
}
.gps-map-link:hover { background: #e0f2fe; }
.sticky-card { position: sticky; top: 20px; }
.sticky-card label { margin-top: 13px; }
.admin-form-hint { margin: 12px 0 0; color: var(--muted); text-align: center; font-size: 12px; }
.attachment-list { display: grid; gap: 10px; }
.attachment-item { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid #e4edf5; border-radius: 12px; color: var(--ink); text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
.attachment-item:hover { border-color: var(--sky); transform: translateY(-1px); }
.attachment-item.attachment-incomplete { border-color: #fecaca; background: #fff7f7; }
.attachment-item.attachment-incomplete:hover { transform: none; }
.attachment-icon { display: grid; width: 46px; height: 46px; flex: 0 0 46px; place-items: center; border-radius: 11px; color: var(--blue); background: #eaf7fd; font-size: 10px; font-weight: 800; }
.attachment-copy { min-width: 0; flex: 1; }
.attachment-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-copy small { display: block; margin-top: 3px; color: var(--muted); }
.privacy-badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; color: #166534; background: #dcfce7; font-size: 10px; font-weight: 800; white-space: nowrap; }
.privacy-badge.private { color: #9f1239; background: #ffe4e6; }
.privacy-badge.broken { color: #991b1b; background: #fee2e2; }
.timeline { position: relative; display: grid; gap: 0; }
.timeline-item { position: relative; display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding-bottom: 20px; }
.timeline-item:not(:last-child)::before { content: ""; position: absolute; inset-inline-start: 7px; top: 16px; bottom: 0; width: 2px; background: #dce8f1; }
.timeline-dot { z-index: 1; width: 16px; height: 16px; margin-top: 3px; border: 4px solid #dff4fd; border-radius: 50%; background: var(--sky); }
.timeline-item strong { display: block; }
.timeline-item small { display: block; margin-top: 3px; color: var(--muted); }
.timeline-item p { margin: 7px 0 0; color: #435568; }
.message-list { display: grid; gap: 12px; }
.message-item { padding: 15px; border: 1px solid #e4edf5; border-radius: 12px; background: #fbfdff; }
.message-item.internal { border-color: #f4c7d1; background: #fff8fa; }
.message-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.message-meta span { color: var(--muted); font-size: 12px; }
.message-item p { margin: 9px 0 0; line-height: 1.8; white-space: pre-wrap; }
.detail-empty { padding: 28px 15px; border: 1px dashed #cad8e5; border-radius: 12px; color: var(--muted); text-align: center; }

@media (max-width: 860px) {
    .auth-layout { display: block; }
    .auth-intro { display: none; }
    .auth-panel { min-height: 100vh; padding: 18px; }
    .auth-card { padding: 28px 22px; }
    .mobile-brand { display: block; text-align: center; }
    .mobile-brand img { width: 72px; height: 72px; object-fit: contain; }
    .mobile-language-link { display: inline-flex; }
    .form-grid { grid-template-columns: 1fr; gap: 0; }
    .portal-header { align-items: flex-start; flex-direction: column; }
    .portal-header nav { width: 100%; justify-content: space-between; gap: 10px; }
    .dashboard-heading { align-items: flex-start; flex-direction: column; }
    .user-chip { width: 100%; }
    .admin-detail-grid { grid-template-columns: 1fr; }
    .sticky-card { position: static; }
}

@media (max-width: 520px) {
    .portal-brand span { font-size: 13px; }
    .portal-brand img { width: 48px; height: 48px; }
    .portal-header nav { font-size: 13px; }
    .details-grid { grid-template-columns: 1fr; }
    .details-grid .details-span { grid-column: auto; }
    .attachment-item { align-items: flex-start; flex-wrap: wrap; }
}
