/* ============================================================
   Permits System – CSS  (LTR / English version)
   Inherits project variables from JobPosition.css
   --primary-color: #001c43
   --accent-color:  #f6aa02
   ============================================================ */

/* ── Navbar / Header ── */
.permits-navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a2d5a 100%);
    padding: 0.9rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 20px rgba(0, 28, 67, 0.35);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.permits-navbar .brand {
    text-align: left;
    line-height: 1.25;
}

.permits-navbar .brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.3px;
    display: block;
}

.permits-navbar .brand-sub {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.72);
    display: block;
    margin-top: 2px;
}

.permits-navbar .nav-action-btn {
    background: rgba(255,255,255,0.12);
    border: 1.5px solid rgba(255,255,255,0.3);
    color: #fff;
    border-radius: 8px;
    padding: 0.45rem 1.1rem;
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
    white-space: nowrap;
}

.permits-navbar .nav-action-btn:hover {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.55);
    color: #fff;
    transform: translateY(-1px);
}

/* ── Page Wrapper ── */
.permits-page {
    background-color: #f0f3f8;
    padding: 2.5rem 0 3rem;
}

/* ── Page Title Block ── */
.permits-page-title {
    text-align: center;
    margin-bottom: 2.2rem;
}

.permits-page-title h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.35rem;
}

.permits-page-title p {
    font-size: 0.95rem;
    color: #5a6a7e;
    margin: 0;
}

/* ── Permit Type Cards (Index) ── */
.permit-types-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.1rem;
    margin-bottom: 2.5rem;
}

@media (max-width: 576px) {
    .permit-types-grid { grid-template-columns: 1fr; }
}

.permit-type-card {
    background: #ffffff;
    border: 1.5px solid #dde4ef;
    border-radius: 14px;
    padding: 1.35rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.permit-type-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 6px 24px rgba(0, 28, 67, 0.13);
    transform: translateY(-2px);
    color: inherit;
    text-decoration: none;
}

.permit-type-card .card-text {
    text-align: left;
    flex: 1;
}

.permit-type-card .card-text h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.3rem;
}

.permit-type-card .card-text p {
    font-size: 0.82rem;
    color: #6b7a8d;
    margin: 0;
    line-height: 1.45;
}

.permit-type-card .card-icon {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, #e8edf5 0%, #dde4ef 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;      /* LTR: icon on the right */
    margin-right: 0;
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.permit-type-card:hover .card-icon {
    background: linear-gradient(135deg, #e8edf5 0%, #dde4ef 100%);
}

.permit-type-card .card-icon i {
    font-size: 1.2rem;
    color: var(--primary-color);
    transition: color 0.25s ease;
}

.permit-type-card:hover .card-icon i {
    color: var(--primary-color);
}

/* ── Track Request Section ── */
.track-section {
    background: #e8ecf4;
    border-radius: 16px;
    padding: 2rem 2.5rem;
    text-align: center;
}

.track-section h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.4rem;
}

.track-section p {
    font-size: 0.88rem;
    color: #5a6a7e;
    margin-bottom: 1.1rem;
}

.track-input-group {
    display: flex;
    flex-direction: row;        /* LTR: input left, button right */
    gap: 0.6rem;
    max-width: 620px;
    margin: 0 auto;
}

.track-section .form-control {
    border-radius: 9px !important;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem !important;
    text-align: left;
    direction: ltr;
    letter-spacing: 0.3px;
}

.btn-track {
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 9px;
    padding: 0 1.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-track:hover {
    background: #0a2d5a;
    color: #fff;
    transform: translateY(-1px);
}

/* ── Form Pages Layout ── */
.permit-form-page {
    background: #f0f3f8;
    min-height: calc(100vh - 62px);
    padding: 2rem 0 3rem;
}

/* ── Sub-page Title ── */
.form-page-title {
    text-align: left;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
}

.form-page-title h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.2rem;
}

.form-page-title p {
    font-size: 0.88rem;
    color: #6b7a8d;
    margin: 0;
}

/* ── Notice / Alert ── */
.permit-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    background: #fffbea;
    border: 1.5px solid #f6c842;
    border-radius: 10px;
    padding: 0.85rem 1.1rem;
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
    color: #7a5800;
    text-align: left;
}

.permit-notice i {
    color: #d4a000;
    font-size: 1rem;
    margin-top: 1px;
    flex-shrink: 0;
}

/* ── Form Section Card ── */
.permit-section-card {
    background: #ffffff;
    border: 1px solid #dde4ef;
    border-radius: 14px;
    padding: 1.75rem 2rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.035);
    text-align: left;
}

.permit-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 1.25rem;
    padding-bottom: 0.6rem;
    border-bottom: 1.5px solid #f0e8c8;
}

/* ── Form Controls inside permit cards ── */
.permit-section-card .form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.4rem;
    display: block;
}

.permit-section-card .form-label .req {
    color: #e53e3e;
    margin-left: 2px;
}

.permit-section-card .form-control,
.permit-section-card .form-select {
    border: 1.5px solid #dde4ef !important;
    border-radius: 9px !important;
    padding: 0.65rem 0.9rem !important;
    font-size: 0.9rem !important;
    background: #fafbfd !important;
    text-align: left;
    height: auto !important;
}

.permit-section-card .form-control:focus,
.permit-section-card .form-select:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(0, 28, 67, 0.09) !important;
    background: #fff !important;
}

.permit-section-card textarea.form-control {
    height: auto !important;
    min-height: 90px;
    resize: vertical;
}

/* ── File Upload Area ── */
.file-upload-area {
    border: 2px dashed #c6d0e0;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: #fafbfd;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: #f0f4fb;
}

.file-upload-area i {
    font-size: 1.8rem;
    color: #a0aec0;
    display: block;
    margin-bottom: 0.6rem;
}

.file-upload-area .upload-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.25rem;
}

.file-upload-area .upload-hint {
    font-size: 0.78rem;
    color: #8a9ab0;
}

/* ── Materials / Repeatable Rows ── */
.material-row {
    display: grid;
    grid-template-columns: 2fr 80px 120px 2fr 34px;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

[dir="rtl"] .material-row {
}

[dir="rtl"] .entry-exit-option:first-child span {
    border-radius: 0 7px 7px 0;
    border-right-width: 1.5px;
    border-left-width: 0.75px;
}

[dir="rtl"] .entry-exit-option:last-child span {
    border-radius: 7px 0 0 7px;
    border-left-width: 1.5px;
    border-right-width: 0.75px;
}

.btn-remove-row {
    width: 34px;
    height: 34px;
    background: #fff0f0;
    border: 1.5px solid #fca5a5;
    border-radius: 8px;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

    .btn-remove-row:hover {
        background: #dc2626;
        color: #fff;
        border-color: #dc2626;
    }

.btn-add-row {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    border: 1.5px dashed #c6d0e0;
    border-radius: 9px;
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.25rem;
}

    .btn-add-row:hover {
        border-color: var(--primary-color);
        background: #f0f4fb;
    }

.individual-row {
    display: grid;
    grid-template-columns: 2fr 2fr 2fr 34px;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

/* Entry/Exit Toggle Button Group */
.entry-exit-group {
    display: flex;
    align-items: center;
}

.entry-exit-option {
    cursor: pointer;
    margin: 0;
    padding: 0;
}

    .entry-exit-option input[type="radio"] {
        display: none;
    }

    .entry-exit-option span {
        display: inline-block;
        padding: 0.60rem 0.85rem;
        font-size: 0.82rem;
        font-weight: 600;
        background: #fff !important; /* ← add !important here too */
        border: 1.5px solid #c6d0e0;
        color: #6b7280;
        cursor: pointer;
        transition: all 0.18s ease;
        white-space: nowrap;
        line-height: 1.5;
        height: 45px;
    }

    /* First button — rounded left corners */
    .entry-exit-option:first-child span {
        border-radius: 7px 0 0 7px;
        border-right-width: 0.75px;
    }

    /* Last button — rounded right corners */
    .entry-exit-option:last-child span {
        border-radius: 0 7px 7px 0;
        border-left-width: 0.75px;
    }

    /* Checked state */
    .entry-exit-option input[type="radio"]:checked + span {
        background: #fef9ee !important;
        border-color: #b18b34;
        color: #6b7280;
        position: relative;
        z-index: 1;
    }

    .entry-exit-option span:hover {
        border-color: var(--primary-color);
        color: #6b7280;
    }

    .entry-exit-option input[type="radio"]:checked + span:hover {
        color: #6b7280;
    }


/* ── Checkbox Confirmation ── */
.permit-confirm-box {
    background: #ffffff;
    border: 1px solid #dde4ef;
    border-radius: 14px;
    padding: 1.1rem 1.5rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-align: left;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.permit-confirm-box .form-check-input {
    width: 1.15rem !important;
    height: 1.15rem !important;
    border: 2px solid #a0aec0 !important;
    border-radius: 4px !important;
    flex-shrink: 0;
    margin: 0 !important;
    cursor: pointer;
}

.permit-confirm-box label {
    font-size: 0.88rem;
    color: #374151;
    cursor: pointer;
    margin: 0 !important;
    line-height: 1.5;
}

/* ── Action Buttons ── */
.permit-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.5rem;
}

.btn-permit-submit {
    background: #0a2d5a;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.7rem 2rem;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(0, 28, 67, 0.25);
}

.btn-permit-submit:hover {
    background: #0a2d5a;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 28, 67, 0.35);
}

.btn-permit-cancel {
    background: transparent;
    border: 1.5px solid #c6d0e0;
    color: #6b7a8d;
    border-radius: 10px;
    padding: 0.68rem 1.5rem;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-permit-cancel:hover {
    border-color: #9aabb8;
    color: #374151;
    background: #f8fafc;
}

/* ── Status Result Card ── */
.status-result-card {
    background: #ffffff;
    border: 1px solid #dde4ef;
    border-radius: 16px;
    padding: 1.75rem 2rem;
    text-align: left;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    position: relative;
}

.status-badge {
    display: inline-block;
    padding: 0.3rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.status-badge.pending    { background: #fef3c7; color: #92400e; }
.status-badge.approved   { background: #d1fae5; color: #065f46; }
.status-badge.rejected   { background: #fee2e2; color: #991b1b; }
.status-badge.forwarded  { background: #e0e7ff; color: #3730a3; }
.status-badge.issued     { background: #ccfbf1; color: #134e4a; }

.status-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 2rem;
}

@media (max-width: 576px) {
    .status-field-grid { grid-template-columns: 1fr; }
}

.status-field label {
    font-size: 0.78rem;
    color: #8a9ab0;
    display: block;
    margin-bottom: 0.2rem;
    font-weight: 500;
}

.status-field .value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-color);
}

.status-field .value.permit-no {
    font-family: 'Courier New', monospace;
    font-size: 1.05rem;
    color: var(--accent-color);
}

.btn-print-permit {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.6rem 1.4rem;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 1.25rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-print-permit:hover {
    background: #0a2d5a;
    color: #fff;
    transform: translateY(-1px);
}

/* ── Material row label widths ── */
.mat-label-name { font-size: 0.8rem; color: #6b7a8d; margin-bottom: 0.2rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .track-section { padding: 1.5rem 1.2rem; }
    .permit-section-card { padding: 1.35rem 1.2rem; }
    .track-input-group { flex-direction: column; }
    .btn-track { padding: 0.65rem 1.2rem; width: 100%; }
    .material-row {
        grid-template-columns: 1fr;
    }

    .individual-row {
        grid-template-columns: 1fr 1fr;
    }
    .status-field-grid { grid-template-columns: 1fr; }
    .permit-types-grid { grid-template-columns: 1fr; }
    .permits-navbar .brand-name { font-size: 1rem; }
}

