@font-face {
    font-family: 'IRANSans';
    src: url('fonts/iransans-regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANSans';
    src: url('fonts/iransans-bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    font-family: 'IRANSans', Tahoma, Arial, sans-serif;
    color: #1f1f1f;
    background: #f5f6f8;
}

button, input, select, textarea {
    font-family: inherit;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-width: 320px;
    background: #f5f6f8;
    color: #1f1f1f;
}

a {
    color: inherit;
}

.skip-link {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 1000;
    padding: 0.65rem 0.9rem;
    background: #ffffff;
    border: 2px solid #1f1f1f;
    border-radius: 0.4rem;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    min-height: 4.25rem;
    display: flex;
    align-items: center;
    padding: 0.9rem 1.5rem;
    background: #ffffff;
    border-bottom: 1px solid #dedede;
}

.app-identity {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    line-height: 1.15;
}

.app-identity strong {
    font-size: 1.15rem;
}

.app-identity span {
    font-size: 0.82rem;
    color: #666666;
}

.app-workspace {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
}

.app-sidebar {
    background: #ffffff;
    border-right: 1px solid #dedede;
    padding: 1.25rem 1rem;
}

.foundation-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.foundation-nav-link {
    display: block;
    padding: 0.7rem 0.8rem;
    border-radius: 0.4rem;
    text-decoration: none;
}

.foundation-nav-link:hover,
.foundation-nav-link:focus-visible {
    background: #f0f1f3;
    outline: none;
}

.foundation-nav-link.active {
    background: #e8eaed;
    font-weight: 600;
}

.app-content {
    width: 100%;
    max-width: 76rem;
    min-width: 0;
    padding: 2rem 2.25rem 3rem;
}

.app-content:focus {
    outline: none;
}

.page-section {
    max-width: 60rem;
}

.page-kicker {
    margin: 0 0 0.45rem;
    color: #666666;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0.75rem;
    font-size: clamp(1.75rem, 3vw, 2.35rem);
}

h2 {
    font-size: 1.05rem;
}

.page-lead {
    max-width: 48rem;
    margin-bottom: 1.75rem;
    color: #555555;
    line-height: 1.6;
}

.foundation-panel,
.ui-state {
    background: #ffffff;
    border: 1px solid #dedede;
    border-radius: 0.6rem;
    padding: 1rem 1.1rem;
}

.foundation-panel p,
.ui-state p {
    margin-bottom: 0;
    color: #5b5b5b;
    line-height: 1.5;
}

.state-showcase {
    display: grid;
    gap: 0.8rem;
}

.ui-state {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
}

.ui-state-error {
    border-style: dashed;
}

.ui-state-indicator {
    width: 0.85rem;
    height: 0.85rem;
    flex: 0 0 auto;
    margin-top: 0.18rem;
    border: 2px solid #777777;
    border-top-color: transparent;
    border-radius: 50%;
    animation: ui-state-spin 0.9s linear infinite;
}

@keyframes ui-state-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ui-state-indicator {
        animation: none;
        border-top-color: #777777;
    }
}

@media (max-width: 900px) {
    .app-workspace {
        grid-template-columns: 12rem minmax(0, 1fr);
    }

    .app-content {
        padding: 1.5rem;
    }
}

@media (max-width: 640px) {
    .app-header {
        padding: 0.8rem 1rem;
    }

    .app-workspace {
        display: block;
    }

    .app-sidebar {
        border-right: 0;
        border-bottom: 1px solid #dedede;
        padding: 0.6rem 1rem;
    }

    .foundation-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .foundation-nav-link {
        padding: 0.6rem 0.75rem;
    }

    .app-content {
        padding: 1.25rem 1rem 2rem;
    }
}

.login-page {
    max-width: 34rem;
}

.login-form {
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
    background: #ffffff;
    border: 1px solid #dedede;
    border-radius: 0.6rem;
}

.form-field {
    display: grid;
    gap: 0.4rem;
}

.form-field label {
    font-weight: 600;
}

.form-field input {
    width: 100%;
    min-height: 2.7rem;
    padding: 0.6rem 0.7rem;
    border: 1px solid #b9b9b9;
    border-radius: 0.4rem;
    font: inherit;
}

.form-field input:focus-visible,
.primary-action:focus-visible {
    outline: 3px solid #444444;
    outline-offset: 2px;
}

.primary-action {
    width: fit-content;
    min-height: 2.7rem;
    padding: 0.6rem 1rem;
    border: 1px solid #222222;
    border-radius: 0.4rem;
    background: #222222;
    color: #ffffff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

a.primary-action {
    display: inline-block;
    text-decoration: none;
}

.login-message {
    margin-bottom: 1rem;
    padding: 0.8rem 0.9rem;
    background: #ffffff;
    border: 1px dashed #777777;
    border-radius: 0.5rem;
    line-height: 1.45;
}

.inspection-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.9rem;
    align-items: end;
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #dedede;
    border-radius: 0.6rem;
}

.form-field select {
    width: 100%;
    min-height: 2.7rem;
    padding: 0.6rem 0.7rem;
    border: 1px solid #b9b9b9;
    border-radius: 0.4rem;
    background: #ffffff;
    font: inherit;
}

.inspection-table-wrap {
    overflow-x: auto;
    background: #ffffff;
    border: 1px solid #dedede;
    border-radius: 0.6rem;
}

.inspection-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.inspection-table th,
.inspection-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e8e8e8;
    text-align: left;
}

.inspection-table th {
    background: #f4f4f4;
}

.inspection-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
}

.inspection-detail-link,
.inspection-back-link {
    display: inline-block;
}

.inspection-create-link {
    margin-bottom: 1rem;
}

.inspection-create-form {
    max-width: 38rem;
}

.inspection-detail-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 0.8rem;
    margin: 1.25rem 0;
}

.inspection-detail-summary div,
.inspection-section {
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #dedede;
    border-radius: 0.6rem;
}

.inspection-detail-summary dt {
    margin-bottom: 0.35rem;
    color: #666666;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
}

.inspection-detail-summary dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.inspection-sections {
    display: grid;
    gap: 1rem;
}

.inspection-section h2 {
    margin-bottom: 0.8rem;
}

.inspection-answer-workflow {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #dedede;
}

.inspection-checklist-version {
    margin: 1rem 0;
}

.inspection-answer-sections,
.inspection-answer-list {
    display: grid;
    gap: 1rem;
}

.inspection-answer-section {
    padding: 1rem;
    background: #f7f7f7;
    border: 1px solid #dedede;
    border-radius: 0.6rem;
}

.inspection-answer-section h3 {
    margin: 0 0 1rem;
}

.inspection-answer-form {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #dedede;
    border-radius: 0.5rem;
}

.inspection-answer-heading {
    display: grid;
    gap: 0.3rem;
}

.inspection-answer-heading label {
    font-weight: 600;
}

.inspection-answer-heading span,
.inspection-answer-form small {
    color: #666666;
    font-size: 0.85rem;
}

.inspection-answer-form input:not([type="hidden"]),
.inspection-answer-form select,
.inspection-answer-form textarea {
    width: 100%;
    min-height: 2.7rem;
    padding: 0.6rem 0.7rem;
    border: 1px solid #b9b9b9;
    border-radius: 0.4rem;
    background: #ffffff;
    font: inherit;
}

.inspection-answer-form textarea {
    min-height: 6rem;
    resize: vertical;
}

.inspection-answer-form input:focus-visible,
.inspection-answer-form select:focus-visible,
.inspection-answer-form textarea:focus-visible {
    outline: 3px solid #444444;
    outline-offset: 2px;
}

.inspection-completion-workflow {
    display: grid;
    gap: 0.75rem;
    margin: 1.25rem 0;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #dedede;
    border-radius: 0.6rem;
}

.inspection-completion-workflow h2,
.inspection-completion-workflow p {
    margin: 0;
}

.inspection-completion-form {
    margin-top: 0.25rem;
}
/* Persian, RTL shared presentation. Existing actions and access rules are unchanged. */
html { direction: rtl; }
body { font-size: 1.125rem; line-height: 1.6; }
bdi, code { unicode-bidi: isolate; overflow-wrap: anywhere; }
input[dir=ltr], input[type=number] { text-align: left; }
input, textarea { direction: rtl; color: #152e4b; }
input[dir=auto], textarea[dir=auto] { unicode-bidi: plaintext; }
button, select { color: #152e4b; }
.app-header { gap: .8rem; border-color: #e6edf5; }
.app-header img { object-fit: contain; }
.app-sidebar { border-right: 0; border-inline-end: 1px solid #e6edf5; }
.app-content { max-width: none; }
.page-section { max-width: 72rem; }
.mobile-navigation { display: none; }
.foundation-nav-link { color: #36506b; }
.foundation-nav-link:hover, .foundation-nav-link:focus-visible, .foundation-nav-link.active { background: #eaf3ff; color: #0759c9; }
.primary-action { background: #075bcc; border-color: #075bcc; font-weight: 700; }
.inspection-completion-form .primary-action:disabled {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #475569;
    cursor: not-allowed;
}
a { color: #075bcc; }
.inspection-filters, .inspection-table-wrap, .inspection-section, .inspection-detail-summary div { border-color: #e4ebf4; border-radius: 1rem; }
.inspection-filters { padding: 1.35rem; gap: 1.15rem; grid-template-columns: repeat(4,minmax(0,1fr)); }
.form-field { min-width: 0; }
.form-field label { color: #344a62; }
.form-field input, .form-field select { border-color: #dce4ed; background: white; }
.form-field small { color: #53677e; font-size: .9rem; }
.inspection-table th, .inspection-table td { text-align: start; }
.inspection-list-table { white-space: normal; }
.inspection-list-table th { background: #f6f9fd; color: #51657e; font-weight: 700; }
.inspection-list-table td { padding: 1rem .75rem; }
.inspection-list-table td bdi { overflow-wrap: anywhere; }
.ui-state-content { display: block; padding: 0; border: 0; background: transparent; }
.inspection-status-badge { display: inline-block; padding: .15rem .55rem; border-radius: .5rem; background: #eef2f7; }
.inspection-status-badge[data-status=DRAFT] { background: #fff4d9; color: #725516; }
.inspection-status-badge[data-status=COMPLETED] { background: #e7f0ff; color: #1959a1; }
.inspection-status-badge[data-status=APPROVED] { background: #e4f5ed; color: #226147; }
.inspection-status-badge[data-status=CANCELLED] { background: #fdecef; color: #942d43; }
.persian-calendar { position: relative; margin-top: .35rem; }
.persian-calendar summary { color: #075bcc; cursor: pointer; }
.persian-calendar-panel { position: absolute; top: 100%; inset-inline-start: 0; z-index: 20; width: min(21rem,85vw); background: white; padding: 1rem; border: 1px solid #dce4ed; border-radius: .8rem; box-shadow: 0 8px 28px #233e6622; }
.persian-calendar-heading { display: flex; gap: .3rem; align-items: center; }
.persian-calendar-heading label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.persian-calendar-heading input { width: 5.5rem; min-width: 0; }
.persian-calendar-heading select { flex: 1; min-width: 0; }
.persian-calendar-days { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: .2rem; margin-block: .5rem; text-align: center; }
.persian-calendar button { font: inherit; cursor: pointer; min-height: 2.5rem; border: 1px solid #dce4ed; border-radius: .4rem; background: white; }
.persian-calendar button:hover, .persian-calendar button[aria-pressed=true] { background: #eaf3ff; color: #075bcc; }
:focus-visible { outline: 3px solid #075bcc; outline-offset: 2px; }
@media(max-width:1100px) { .inspection-filters { grid-template-columns:repeat(2,minmax(0,1fr)); } .app-content { padding: 1.25rem; } }
@media(max-width:700px) {
    .app-workspace { display:block; }
    .app-sidebar { border-inline-end:0; border-bottom:1px solid #e6edf5; padding:.75rem 1rem; }
    .desktop-navigation { display:none; }
    .mobile-navigation { display:block; }
    .mobile-navigation summary { cursor:pointer; color:#075bcc; font-weight:700; }
    .foundation-nav { flex-direction:column; }
    .app-content { padding:1.25rem .8rem; }
    .inspection-filters { grid-template-columns:minmax(0,1fr); padding:1rem; }
    .inspection-list-table, .inspection-list-table tbody, .inspection-list-table tr, .inspection-list-table td { display:block; width:100%; }
    .inspection-list-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
    .inspection-list-table tr { padding:.8rem; margin-bottom:1rem; border:1px solid #e4ebf4; border-radius:1rem; background:white; }
    .inspection-list-table td { display:flex; align-items:baseline; justify-content:space-between; gap:1rem; padding:.4rem; border:0; }
    .inspection-list-table td::before { content:attr(data-label); font-weight:700; color:#51657e; flex:0 0 auto; }
    .inspection-list-table td > * { min-width:0; text-align:end; }
    .inspections-page .inspection-table-wrap { border:0; background:transparent; overflow:visible; }
}

.inspection-filters { align-items: start; }
.inspection-filters > button { align-self: end; }
button.foundation-nav-link { font: inherit; border: 0; background: transparent; cursor: pointer; text-align: start; }

input[dir="ltr"] { direction: ltr; text-align: left; }
