/* ================================================================
   Permits Module — مجوزها و شهرداری ثمن
================================================================ */

/* ── Layout ────────────────────────────────────────────────────── */
.permit-wrap {
    display: flex;
    height: calc(100vh - 160px);
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
}

.permit-list-pane {
    width: 360px;
    min-width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e2e8f0;
    overflow: hidden;
}

.permit-toolbar {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-wrap: wrap;
}

.permit-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* ── Permit Card ───────────────────────────────────────────────── */
.permit-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s;
    direction: rtl;
}

.permit-card:hover { border-color: #3b82f6; box-shadow: 0 2px 8px rgba(59,130,246,.1); }
.permit-card--active { border-color: #3b82f6; background: #eff6ff; }

.permit-card-title { font-weight: 700; font-size: 14px; color: #1e293b; margin-bottom: 4px; }
.permit-card-meta  { font-size: 11px; color: #64748b; margin-bottom: 2px; }

/* ── Badges ────────────────────────────────────────────────────── */
.permit-type-badge, .permit-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
}

.permit-progress-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

/* ── Detail Panel ──────────────────────────────────────────────── */
.permit-detail-pane {
    flex: 1;
    width: 0;
    overflow: hidden;
    transition: width 0.3s ease;
    background: #f8fafc;
}

.permit-detail-pane--open {
    width: 100%;
    overflow-y: auto;
}

.permit-detail-inner { padding: 20px; direction: rtl; }

.permit-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.permit-tab-body { min-height: 200px; overflow-y: auto; }

/* ── Stepper ───────────────────────────────────────────────────── */
.permit-stepper { overflow-x: auto; padding: 8px 0; margin-bottom: 4px; }

.permit-stepper-track {
    display: flex;
    align-items: flex-start;
    gap: 0;
    min-width: max-content;
    padding: 8px 0;
}

.permit-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
}

.permit-step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    z-index: 1;
    position: relative;
    transition: all 0.2s;
    flex-shrink: 0;
}

.permit-step-label {
    font-size: 9px;
    text-align: center;
    margin-top: 4px;
    width: 44px;
    line-height: 1.3;
}

.permit-step-line {
    height: 2px;
    width: 20px;
    position: relative;
    top: 15px;
    flex-shrink: 0;
}

/* ── Step Row ──────────────────────────────────────────────────── */
.permit-step-row {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

/* ── Fee Row ───────────────────────────────────────────────────── */
.permit-fee-row {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

/* ── Dashboard ─────────────────────────────────────────────────── */
.permit-kpi-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.permit-kpi-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 16px;
    text-align: center;
    min-width: 80px;
}

.permit-alert-card {
    border-radius: 10px;
    padding: 14px;
    direction: rtl;
}

.permit-alert-card--warning { background: #fffbeb; border: 1px solid #fcd34d; }
.permit-alert-card--danger  { background: #fef2f2; border: 1px solid #fca5a5; }
.permit-alert-card--ok      { background: #f0fdf4; border: 1px solid #86efac; color: #166534; font-size: 13px; padding: 16px; }

.permit-alert-title {
    font-weight: 700;
    font-size: 13px;
    color: #1e293b;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(0,0,0,.06);
}

.permit-alert-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0,0,0,.04);
    font-size: 12px;
}

.permit-alert-row:last-child { border-bottom: none; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .permit-wrap { flex-direction: column; height: auto; }
    .permit-list-pane { width: 100%; border-left: none; border-bottom: 1px solid #e2e8f0; max-height: 40vh; }
    .permit-detail-pane--open { width: 100%; }
}
