:root {
    --primary: #006c35;
    --primary-dark: #004d26;
    --primary-light: #e8f5ee;

    --gold: #c9a227;
    --gold-dark: #a98516;
    --gold-light: #fff8df;

    --danger: #dc2626;
    --danger-light: #fee2e2;

    --warning: #f59e0b;
    --warning-light: #fef3c7;

    --success: #16a34a;
    --success-light: #dcfce7;

    --info: #0284c7;
    --info-light: #dbeafe;

    --dark: #10251a;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --bg: #f4f7f5;
    --white: #ffffff;

    --shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.05);

    --radius: 18px;
}

/* =========================
   Reset
========================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    max-width: 100%;
}

body {
    margin: 0;
    font-family: Tahoma, Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(0, 108, 53, 0.08), transparent 35%),
        linear-gradient(135deg, #f7faf8 0%, #eef5f1 100%);
    color: var(--text);
    direction: rtl;
    min-height: 100vh;
    max-width: 100%;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}

.layout-wrapper {
    min-height: 100vh;
}

/* =========================
   Mobile Topbar
========================= */

.mobile-topbar {
    display: none;
    height: 64px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 900;
}

.menu-toggle {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: var(--primary);
    color: var(--white);
    font-size: 22px;
    cursor: pointer;
}

.mobile-title {
    font-weight: bold;
    color: var(--primary-dark);
}

/* =========================
   Sidebar
========================= */

.sidebar {
    width: 285px;
    height: 100vh;
    background:
        linear-gradient(180deg, #004d26 0%, #06351e 100%);
    color: var(--white);
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1000;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.10);

    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

.brand-logo {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--gold), #f3d77b);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: bold;
    box-shadow: 0 8px 20px rgba(201, 162, 39, 0.28);
    flex-shrink: 0;
}

.brand-text {
    line-height: 1.5;
}

.brand-title {
    font-weight: bold;
    font-size: 15px;
}

.brand-subtitle {
    font-size: 12px;
    color: #d9efe3;
}

.sidebar-user-box {
    margin: 16px 14px 4px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
}

.sidebar-user-name {
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
}

.sidebar-user-role {
    font-size: 12px;
    color: #cce8d8;
    margin-top: 4px;
}

.sidebar-logout-btn {
    background: var(--danger);
    color: #ffffff;
    text-decoration: none;
    padding: 7px 11px;
    border-radius: 10px;
    font-size: 12px;
    white-space: nowrap;
    transition: 0.2s ease;
}

.sidebar-logout-btn:hover {
    background: #b91c1c;
}

.sidebar-nav {
    padding: 16px 14px 24px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
    width: 7px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(201, 162, 39, 0.75);
    border-radius: 10px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 162, 39, 1);
}

.nav-section-title {
    color: #b7d7c6;
    font-size: 12px;
    padding: 18px 12px 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 13px;
    margin-bottom: 6px;
    text-decoration: none;
    color: #edf7f1;
    border-radius: 14px;
    font-size: 14px;
    transition: 0.2s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(-3px);
}

.nav-icon {
    width: 24px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

.danger-link {
    color: #ffe1e1;
}

.logout-link {
    margin-top: 12px;
    background: rgba(220, 38, 38, 0.14);
    color: #ffd6d6;
}

.sidebar-overlay {
    display: none;
}

/* =========================
   Main Content
========================= */

.main-content {
    margin-right: 285px;
    padding: 28px;
    min-height: 100vh;
    max-width: 100%;
}

.page-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(229, 231, 235, 0.85);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    min-height: 260px;
    max-width: 100%;
}

.page-card h1 {
    margin: 0 0 12px;
    color: var(--primary-dark);
    font-size: 28px;
}

.under-construction {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gold-light);
    color: #7a5b00;
    border: 1px solid #efd17a;
    padding: 10px 16px;
    border-radius: 999px;
    margin: 12px 0 18px;
    font-weight: bold;
}

.under-construction::before {
    content: "🚧";
}

.page-role {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.9;
    max-width: 850px;
}

/* =========================
   Shared Components
========================= */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 22px;
}

.page-title {
    margin: 0;
    color: var(--primary-dark);
    font-size: 28px;
}

.page-subtitle {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.8;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border: 0;
    border-radius: 12px;
    padding: 10px 16px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-gold {
    background: var(--gold);
    color: #2b2100;
}

.btn-gold:hover {
    background: var(--gold-dark);
    color: #ffffff;
}

.btn-light {
    background: var(--white);
    color: var(--primary-dark);
    border: 1px solid var(--border);
}

.btn-light:hover {
    background: var(--primary-light);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #b91c1c;
}

/* =========================
   Grid
========================= */

.grid {
    display: grid;
    gap: 18px;
}

.grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* =========================
   Statistics Cards
========================= */

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    width: 90px;
    height: 90px;
    left: -30px;
    top: -30px;
    background: rgba(0, 108, 53, 0.08);
    border-radius: 50%;
}

.stat-title {
    color: var(--muted);
    font-size: 14px;
    position: relative;
    z-index: 1;
}

.stat-value {
    margin-top: 10px;
    font-size: 32px;
    font-weight: bold;
    color: var(--primary-dark);
    position: relative;
    z-index: 1;
}

.stat-note {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
    position: relative;
    z-index: 1;
}

/* =========================
   Tables
   شريط انزلاق أفقي أسفل كل جدول
========================= */

.table-wrapper {
    width: 100%;
    max-width: 100%;
    display: block;
    overflow-x: scroll;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
    padding-bottom: 6px;
}

.table-wrapper::-webkit-scrollbar {
    height: 12px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 20px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 20px;
    border: 2px solid #f1f5f9;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    text-align: right;
    font-size: 14px;
    vertical-align: middle;
}

.table th {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: bold;
}

.table tr:last-child td {
    border-bottom: 0;
}

.table a {
    text-decoration: none;
    color: var(--primary-dark);
    font-weight: bold;
}

.table a:hover {
    text-decoration: underline;
}

.danger-row {
    background: #fff1f2;
}

.danger-row td {
    border-bottom-color: #fecdd3;
}

.danger-row strong a {
    color: #991b1b;
}

small {
    font-size: 12px;
}

/* =========================
   Badges
========================= */

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.badge-success {
    background: var(--success-light);
    color: #166534;
}

.badge-warning {
    background: var(--warning-light);
    color: #92400e;
}

.badge-danger {
    background: var(--danger-light);
    color: #991b1b;
}

.badge-info {
    background: var(--info-light);
    color: #1e40af;
}

/* =========================
   Forms
========================= */

.form-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    max-width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-dark);
    font-weight: bold;
    font-size: 14px;
}

.form-control {
    width: 100%;
    min-height: 44px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    background: #fff;
    transition: 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 108, 53, 0.10);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

/* =========================
   Alerts
========================= */

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.7;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* =========================
   Public Pages
========================= */

.public-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 34px 18px;
}

/* =========================
   Login Page
========================= */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at top right, rgba(201, 162, 39, 0.18), transparent 34%),
        radial-gradient(circle at bottom left, rgba(0, 108, 53, 0.18), transparent 34%),
        linear-gradient(135deg, #f7faf8 0%, #e8f5ee 100%);
}

.login-card,
.login-box {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border-radius: 24px;
    padding: 34px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.12);
    border: 1px solid #e5e7eb;
}

.login-logo {
    width: 68px;
    height: 68px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: bold;
    margin: 0 auto 18px;
    box-shadow: 0 10px 25px rgba(0, 108, 53, 0.25);
}

.login-card h1,
.login-box h1 {
    text-align: center;
    margin: 0;
    color: var(--primary-dark);
    font-size: 28px;
}

.login-subtitle {
    text-align: center;
    color: var(--muted);
    line-height: 1.8;
    margin: 12px 0 24px;
}

.login-btn {
    width: 100%;
    margin-top: 8px;
}

/* =====================================================
   Public Report Page
===================================================== */

.public-report-page {
    min-height: 100vh;
    padding: 30px 16px;
    background:
        radial-gradient(circle at top right, rgba(201, 162, 39, 0.18), transparent 32%),
        radial-gradient(circle at bottom left, rgba(0, 108, 53, 0.16), transparent 34%),
        linear-gradient(135deg, #f7faf8 0%, #e8f5ee 100%);
}

.public-report-container,
.public-report-header {
    width: 100%;
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
}

.public-report-header {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 26px;
    padding: 24px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.public-report-logo {
    width: 68px;
    height: 68px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: 0 10px 25px rgba(0, 108, 53, 0.25);
}

.public-report-header h1 {
    margin: 0;
    color: var(--primary-dark);
    font-size: 30px;
    font-weight: bold;
}

.public-report-header p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.8;
}

.public-site-card,
.site-card {
    background: #ffffff;
    border: 1px solid #cce8d8;
    border-radius: 24px;
    padding: 22px 24px;
    margin-bottom: 20px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.05);
}

.public-site-label {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 6px;
}

.public-site-card h2,
.site-card h2 {
    margin: 0;
    color: var(--primary-dark);
    font-size: 24px;
}

.public-site-card p,
.site-card p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.public-report-form {
    width: 100%;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 26px;
    padding: 28px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.08);
}

.form-section-title {
    color: var(--primary-dark);
    font-size: 21px;
    font-weight: bold;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.public-report-form .form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.public-report-form .form-group {
    margin-bottom: 0;
}

.public-report-form .form-group.full {
    grid-column: 1 / -1;
}

.public-report-form .form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-dark);
    font-weight: bold;
    font-size: 14px;
}

.public-report-form .form-control {
    width: 100%;
    min-height: 48px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 11px 14px;
    font-family: Tahoma, Arial, sans-serif;
    font-size: 15px;
    background: #ffffff;
    color: var(--text);
}

.public-report-form .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 108, 53, 0.10);
}

.public-report-form textarea.form-control {
    min-height: 135px;
    resize: vertical;
    line-height: 1.8;
}

.public-report-form select.form-control {
    cursor: pointer;
}

.public-report-form input[type="file"].form-control {
    padding: 10px;
    background: #f9fafb;
}

.public-report-form small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.7;
}

.public-submit-btn {
    width: 100%;
    min-height: 52px;
    font-size: 17px;
    font-weight: bold;
    margin-top: 16px;
}

.public-report-page .alert {
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 16px;
    line-height: 1.8;
}

.success-container {
    max-width: 620px;
    background: #ffffff;
    border-radius: 28px;
    padding: 38px 28px;
    text-align: center;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    margin: 70px auto 0;
}

.success-icon {
    width: 82px;
    height: 82px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--success-light);
    color: #166534;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 46px;
    font-weight: bold;
}

.success-container h1 {
    color: var(--primary-dark);
    margin: 0 0 12px;
    font-size: 28px;
}

.success-container p {
    color: var(--muted);
    line-height: 1.8;
}

.ticket-number-box {
    background: var(--primary-light);
    border: 1px solid #cce8d8;
    border-radius: 18px;
    padding: 18px;
    margin: 24px 0;
}

.ticket-number-box div {
    color: var(--muted);
    margin-bottom: 8px;
}

.ticket-number-box strong {
    display: block;
    direction: ltr;
    font-size: 24px;
    color: var(--primary-dark);
}

/* =========================
   Details / Attachments / Timeline
========================= */

.details-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.details-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.details-item:last-child {
    border-bottom: 0;
}

.details-label {
    color: var(--muted);
    font-size: 14px;
    min-width: 150px;
}

.details-value {
    color: var(--text);
    font-weight: bold;
    text-align: left;
    direction: rtl;
    word-break: break-word;
}

.public-link-box {
    background: var(--primary-light);
    border: 1px solid #cce8d8;
    border-radius: 16px;
    padding: 18px;
}

.public-link-title {
    color: var(--primary-dark);
    font-weight: bold;
    margin-bottom: 10px;
}

.attachments-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.attachment-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.attachment-card img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    display: block;
    background: #f3f4f6;
}

.attachment-info {
    padding: 14px;
}

.attachment-name {
    color: var(--text);
    font-size: 13px;
    margin-bottom: 10px;
    word-break: break-word;
}

.timeline {
    position: relative;
    padding-right: 18px;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 0;
    right: 6px;
    width: 2px;
    height: 100%;
    background: var(--primary-light);
}

.timeline-item {
    position: relative;
    padding: 0 22px 18px 0;
}

.timeline-dot {
    position: absolute;
    right: 0;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.timeline-content {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 15px;
    box-shadow: var(--shadow-soft);
}

.timeline-title {
    color: var(--primary-dark);
    font-weight: bold;
    margin-bottom: 8px;
}

.timeline-comment {
    color: var(--text);
    line-height: 1.8;
    margin-bottom: 8px;
}

.timeline-meta {
    color: var(--muted);
    font-size: 12px;
}

/* =========================
   Responsive
========================= */

@media (max-width: 1100px) {
    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .attachments-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 850px) {
    .mobile-topbar {
        display: flex;
    }

    .sidebar {
        transform: translateX(110%);
        transition: 0.25s ease;
        width: 285px;
        height: 100vh;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 950;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-right: 0;
        padding: 18px;
        overflow-x: hidden;
    }

    .page-header {
        flex-direction: column;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .actions {
        width: 100%;
    }
}

@media (max-width: 768px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .main-content {
        max-width: 100%;
        overflow-x: hidden;
    }

    .page-card {
        max-width: 100%;
        overflow: hidden;
    }

    .table-wrapper {
        width: 100%;
        max-width: 100%;
        overflow-x: scroll !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 14px;
        margin-bottom: 8px;
        border-radius: 16px;
        position: relative;
    }

    .table {
        width: 950px !important;
        min-width: 950px !important;
        max-width: none !important;
        table-layout: auto;
    }

    .table th,
    .table td {
        white-space: nowrap;
        padding: 11px 12px;
        font-size: 13px;
    }

    .table td:nth-child(4),
    .table td:nth-child(5),
    .table th:nth-child(4),
    .table th:nth-child(5) {
        min-width: 170px;
        white-space: normal;
        line-height: 1.7;
    }

    .table .btn {
        min-height: 34px;
        padding: 7px 10px;
        font-size: 13px;
    }

    .table .actions {
        flex-wrap: nowrap;
        width: auto;
    }

    .table-wrapper::after {
        content: "اسحب الجدول يمينًا ويسارًا";
        display: block;
        position: sticky;
        right: 0;
        bottom: 0;
        width: fit-content;
        margin-top: 8px;
        padding: 6px 12px;
        border-radius: 999px;
        background: var(--primary-light);
        color: var(--primary-dark);
        font-size: 12px;
        font-weight: bold;
        pointer-events: none;
    }

    .public-report-page {
        padding: 16px 12px;
    }

    .public-report-header {
        border-radius: 22px;
        padding: 20px;
        align-items: flex-start;
    }

    .public-report-logo {
        width: 58px;
        height: 58px;
        border-radius: 18px;
        font-size: 28px;
    }

    .public-report-header h1 {
        font-size: 24px;
    }

    .public-report-header p {
        font-size: 14px;
    }

    .public-site-card,
    .site-card {
        border-radius: 22px;
        padding: 20px;
    }

    .public-site-card h2,
    .site-card h2 {
        font-size: 22px;
    }

    .public-report-form {
        border-radius: 22px;
        padding: 22px;
    }

    .public-report-form .form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .form-section-title {
        font-size: 19px;
    }

    .public-report-form .form-control {
        font-size: 15px;
        min-height: 48px;
    }

    .public-submit-btn {
        min-height: 52px;
        font-size: 16px;
    }

    .details-item {
        flex-direction: column;
        gap: 6px;
    }

    .details-value {
        text-align: right;
    }
}

@media (max-width: 560px) {
    body {
        font-size: 14px;
    }

    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .page-card {
        padding: 20px;
        border-radius: 16px;
    }

    .page-card h1,
    .page-title {
        font-size: 23px;
    }

    .page-subtitle {
        font-size: 14px;
    }

    .stat-card {
        padding: 18px;
    }

    .stat-value {
        font-size: 28px;
    }

    .btn {
        width: 100%;
    }

    .login-card,
    .login-box {
        padding: 24px;
        border-radius: 20px;
    }

    .login-card h1,
    .login-box h1 {
        font-size: 24px;
    }

    .attachments-grid {
        grid-template-columns: 1fr;
    }

    .attachment-card img {
        height: 210px;
    }
}

@media (max-width: 430px) {
    .table {
        width: 1000px !important;
        min-width: 1000px !important;
    }

    .table th,
    .table td {
        padding: 10px 10px;
        font-size: 12px;
    }

    .public-report-page {
        padding: 12px 10px;
    }

    .public-report-header {
        padding: 18px;
        gap: 12px;
    }

    .public-report-logo {
        width: 52px;
        height: 52px;
        font-size: 25px;
    }

    .public-report-header h1 {
        font-size: 21px;
    }

    .public-report-form {
        padding: 18px;
    }

    .success-container {
        margin-top: 35px;
        padding: 28px 20px;
    }
}

/* =========================
   Print
========================= */

@media print {
    .sidebar,
    .mobile-topbar,
    .sidebar-overlay,
    .actions,
    form,
    .table-wrapper::after {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    .page-card,
    .stat-card {
        box-shadow: none !important;
    }

    .table-wrapper {
        overflow: visible !important;
        border: 0 !important;
    }

    .table {
        width: 100% !important;
        min-width: 0 !important;
    }
}