:root {
    --main-blue: #15577a;
    --main-blue-dark: #10445f;
    --main-border: #d9e1e8;
    --page-bg: #f2f5f8;
    --text: #2f3f50;
    --muted: #778899;
    --white: #ffffff;
    --shadow: 0 2px 9px rgba(0, 0, 0, 0.12);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body.modal-open {
    overflow: hidden;
}

body {
    margin: 0;
    direction: rtl;
    font-family: Tahoma, Arial, sans-serif;
    background: var(--page-bg);
    color: var(--text);
    font-size: 13px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main {
    flex: 1;
}

a {
    text-decoration: none;
    color: inherit;
}

.page-container {
    width: 1420px;
    max-width: calc(100% - 32px);
    margin: 0 auto;
}

/* Top header */
.site-top {
    background: #fff;
    border-top: 4px solid #2b3543;
}

.site-top-inner {
    height: 86px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-brand img {
    height: 50px;
    width: auto;
}

.brand-text strong {
    display: block;
    color: var(--main-blue);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
}

.brand-text span {
    display: block;
    color: #6c7a86;
    font-size: 12px;
    margin-top: 3px;
}

.top-tools {
    text-align: left;
}

.login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--main-blue);
    color: #fff;
    border-radius: 4px;
    padding: 8px 15px;
    font-weight: 700;
    margin-bottom: 8px;
}

.date-text {
    color: var(--muted);
    font-size: 12px;
}

/* Navigation */
.site-nav {
    background: var(--main-blue);
    border-bottom: 1px solid #0d3a52;
}

.nav-inner {
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-inner a {
    height: 52px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    color: #fff;
    font-weight: 700;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-inner a:hover,
.nav-inner a.active {
    background: rgba(0, 0, 0, 0.16);
}

/* Main page */
.site-main {
    min-height: 520px;
}

.content-section {
    padding: 28px 0 68px;
}

.list-card {
    background: #fff;
    border: 1px solid var(--main-border);
    border-radius: 4px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.list-card-title {
    padding: 16px 18px;
    border-bottom: 1px solid var(--main-border);
    background: #fff;
}

.list-card-title h1 {
    margin: 0;
    color: var(--main-blue);
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 7px;
}

/* Search row */
.table-filter {
    padding: 14px 18px;
    border-bottom: 1px solid var(--main-border);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
    background: #fff;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    height: 34px;
    border: 1px solid var(--main-border);
    border-radius: 4px;
    padding: 6px 34px 6px 10px;
    font-family: inherit;
    outline: none;
    color: var(--text);
}

.search-box input:focus {
    border-color: var(--main-blue);
}

.search-box span {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 12px;
}

.small-btn {
    height: 34px;
    border-radius: 4px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
}

.small-btn.primary {
    background: var(--main-blue);
    color: #fff;
}

.small-btn.light {
    background: #fff;
    color: var(--main-blue);
    border-color: var(--main-border);
}

/* Table */
.table-wrap {
    overflow-x: auto;
}

.main-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.main-table thead th {
    background: var(--main-blue);
    color: #fff;
    padding: 13px 14px;
    font-weight: 700;
    text-align: right;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.main-table tbody td {
    padding: 15px 14px;
    border-bottom: 1px solid var(--main-border);
    vertical-align: middle;
    color: var(--text);
    background: #fff;
}

.main-table tbody tr:hover td {
    background: #f7fafc;
}

.table-title-link {
    color: var(--main-blue);
    font-weight: 700;
}

.table-title-link:hover {
    text-decoration: underline;
}

.empty-cell {
    text-align: center;
    color: var(--muted);
    padding: 36px !important;
}

/* Footer under table */
.list-card-footer {
    padding: 14px 18px;
    border-top: 1px solid var(--main-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: #fff;
}

.results-text {
    color: var(--muted);
    font-size: 12px;
}

/* Pagination */
.pagination-wrap {
    display: flex;
    justify-content: flex-start;
}

.front-pagination {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    direction: ltr;
}

.front-page-btn,
.front-page-dots {
    min-width: 34px;
    height: 34px;
    border-radius: 4px;
    border: 1px solid var(--main-border);
    background: #fff;
    color: var(--main-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.front-page-btn.active {
    background: var(--main-blue);
    color: #fff;
    border-color: var(--main-blue);
}

.front-page-btn.disabled {
    opacity: 0.45;
    background: #f8fafc;
}

.front-page-dots {
    border: none;
    background: transparent;
}

/* Details page compatibility */
.section {
    padding: 28px 0 68px;
}

.details-card {
    background: #fff;
    border: 1px solid var(--main-border);
    border-radius: 4px;
    box-shadow: var(--shadow);
    padding: 22px;
}

.details-title {
    margin: 0;
    color: var(--main-blue);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.5;
}

.details-meta {
    margin-top: 16px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.meta-badge {
    background: #f2f5f8;
    border: 1px solid var(--main-border);
    color: var(--text);
    border-radius: 4px;
    padding: 7px 10px;
    font-weight: 700;
}

.details-description {
    margin-top: 24px;
    line-height: 2;
    color: var(--text);
    white-space: pre-line;
}

.front-btn {
    border-radius: 4px;
    padding: 9px 14px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.front-btn-primary {
    background: var(--main-blue);
    color: #fff;
}

.front-btn-light {
    background: #fff;
    color: var(--main-blue);
    border: 1px solid var(--main-border);
}

.files-list {
    margin-top: 22px;
    display: grid;
    gap: 8px;
}

.file-item {
    border: 1px solid var(--main-border);
    border-radius: 4px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.file-name {
    font-weight: 700;
}

/* Footer */
.site-footer {
    background: #fff;
    border-top: 1px solid var(--main-border);
    padding: 28px 0 16px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--main-border);
}

.footer-col h3 {
    margin: 0 0 10px;
    color: var(--main-blue);
    font-size: 15px;
}

.footer-col p,
.footer-col a {
    display: block;
    margin: 7px 0;
    color: var(--muted);
    line-height: 1.8;
    font-size: 12px;
}

.footer-bottom {
    padding-top: 14px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .site-top-inner {
        height: auto;
        padding: 14px 0;
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .top-tools {
        text-align: right;
    }

    .nav-inner {
        justify-content: flex-start;
        overflow-x: auto;
    }

    .table-filter {
        grid-template-columns: 1fr;
    }

    .small-btn {
        width: 100%;
    }

    .list-card-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .file-item {
        flex-direction: column;
    }
}

/* Tender Details Page */
.details-layout {
    width: 100%;
}

.details-card {
    background: #fff;
    border: 1px solid var(--main-border);
    border-radius: 4px;
    box-shadow: var(--shadow);
    overflow: hidden;
    padding: 0;
}

.details-card-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--main-border);
    background: #fff;
}

.back-link {
    display: inline-flex;
    color: var(--main-blue);
    font-weight: 700;
    margin-bottom: 12px;
}

.back-link:hover {
    text-decoration: underline;
}

.details-title {
    margin: 0;
    color: var(--main-blue);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.6;
}

.details-info-table {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid var(--main-border);
    background: #f8fafc;
}

.details-info-row {
    padding: 14px 18px;
    border-left: 1px solid var(--main-border);
}

.details-info-row:last-child {
    border-left: 0;
}

.details-info-label {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 6px;
}

.details-info-value {
    color: var(--text);
    font-weight: 700;
}

.public-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 700;
}

.public-status.active {
    background: #dcfce7;
    color: #166534;
}

.details-section-block {
    padding: 20px;
    border-bottom: 1px solid var(--main-border);
}

.details-section-block:last-child {
    border-bottom: 0;
}

.details-section-block h2 {
    margin: 0 0 14px;
    color: var(--main-blue);
    font-size: 18px;
    font-weight: 700;
}

.details-description {
    color: var(--text);
    line-height: 2;
    font-size: 14px;
    white-space: pre-line;
}

.empty-inline {
    color: var(--muted);
    background: #f8fafc;
    border: 1px solid var(--main-border);
    border-radius: 4px;
    padding: 14px;
}

.files-table {
    min-width: 650px;
}

.file-title {
    color: var(--text);
    font-weight: 700;
}

@media (max-width: 768px) {
    .details-info-table {
        grid-template-columns: 1fr;
    }

    .details-info-row {
        border-left: 0;
        border-bottom: 1px solid var(--main-border);
    }

    .details-info-row:last-child {
        border-bottom: 0;
    }

    .details-title {
        font-size: 21px;
    }
}
/* Public Application Form */
.public-application-form {
    margin-top: 18px;
}

.public-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 22px;
    align-items: start;
}

.public-form-group {
    display: flex;
    flex-direction: column;
}

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

.public-form-group label {
    margin-bottom: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.public-form-group label span {
    color: #dc2626;
}

.public-form-group input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--main-border);
    border-radius: 4px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    background: #fff;
}

.public-form-group input:focus {
    border-color: var(--main-blue);
    box-shadow: 0 0 0 3px rgba(21, 87, 122, 0.10);
}

.public-help {
    margin-top: 6px;
    min-height: 20px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.6;
}

.public-error {
    margin-top: 6px;
    font-size: 12px;
    color: #b91c1c;
    line-height: 1.6;
}

.public-form-actions {
    margin-top: 22px;
    display: flex;
    justify-content: flex-start;
}

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

    .public-form-actions .front-btn {
        width: 100%;
    }
}

.admin-search-select-option {
    text-align: right;
    line-height: 1.5;
}

.admin-search-select-option strong {
    display: block;
    font-size: 13px;
    color: var(--dark);
}

.admin-search-select-option small {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    color: var(--muted);
    font-weight: 700;
}
.public-modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.public-modal.is-open {
    display: flex;
}

.public-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.public-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 24px;
    padding: 30px 26px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
    z-index: 1;
}

.public-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #dcfce7;
    color: #166534;
    display: grid;
    place-items: center;
    font-size: 34px;
    font-weight: 900;
}

.public-modal-dialog h2 {
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 900;
    color: #0f172a;
}

.public-modal-dialog p {
    margin: 0 0 12px;
    color: #64748b;
    line-height: 1.8;
}

.public-modal-tender-name {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 12px 14px;
    margin: 14px 0 20px;
    font-weight: 900;
    color: #0f4c81;
    line-height: 1.7;
}
.public-help {
    margin-top: 6px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.7;
}

.tender-simple-filter {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 180px 160px 160px auto;
    gap: 10px;
    align-items: end;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-item label {
    font-size: 12px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}

.filter-item .admin-input,
.filter-item .admin-select {
    width: 100%;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.filter-buttons .admin-btn {
    height: 44px;
    min-width: 58px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.tender-count-strip {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    color: #1f2937;
}

.tender-count-strip div {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tender-count-strip strong {
    color: #0f172a;
    font-weight: 800;
}

.tender-count-strip span {
    color: var(--main-blue);
    font-weight: 800;
}

@media (max-width: 1100px) {
    .tender-simple-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-search,
    .filter-actions-item {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .tender-simple-filter {
        grid-template-columns: 1fr;
    }

    .filter-search,
    .filter-actions-item {
        grid-column: auto;
    }

    .filter-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-buttons .admin-btn {
        width: 100%;
    }

    .tender-count-strip {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}
