/**
 * استایل یکپارچه فیلدهای فرم — پنل مدیریت و سامانه ملاقات
 * شامل تایم‌پیکر ۲۴ ساعته و UX حرفه‌ای
 */

.app-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.app-form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #334155;
    letter-spacing: -0.01em;
}

.app-form-hint {
    font-size: 0.6875rem;
    color: #94a3b8;
    line-height: 1.4;
}

.app-form-error {
    font-size: 0.75rem;
    color: #dc2626;
    font-weight: 500;
}

/* ——— پایه ——— */
.app-input,
input.app-input,
select.app-input,
textarea.app-input {
    width: 100%;
    min-height: 3rem;
    padding: 0.75rem 1rem;
    border-radius: 0.875rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1.5px solid #e2e8f0;
    font-size: 0.9375rem;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.15s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.app-input:hover {
    border-color: #cbd5e1;
    background: #ffffff;
}

.app-input:focus {
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14), 0 2px 8px rgba(59, 130, 246, 0.08);
}

.app-input::placeholder {
    color: #94a3b8;
}

.app-input-textarea {
    min-height: 5.5rem;
    resize: vertical;
    line-height: 1.6;
}

.app-input-date {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.03em;
    font-weight: 600;
}

.app-input-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.75rem center;
    background-size: 1.125rem;
    padding-left: 2.5rem;
}

.app-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.375rem;
    border: 1.5px solid #cbd5e1;
    accent-color: #3b82f6;
    cursor: pointer;
}

/* ——— انتخاب ساعت ۲۴ ساعته (Dropdown) ——— */
.app-time-select-group {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    width: 100%;
}

.app-time-select-group--range {
    flex-wrap: wrap;
}

.app-time-select-part-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.app-time-select-part-label {
    font-size: 0.625rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.app-time-select-sep {
    flex-shrink: 0;
    align-self: center;
    padding-bottom: 0.65rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: #64748b;
    line-height: 1;
}

.app-time-select-part {
    min-height: 3rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 1rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.app-time-hint {
    font-size: 0.6875rem;
    color: #94a3b8;
    margin-top: 0.125rem;
}

/* ——— ردیف بازه ساعتی (bulk create) ——— */
.app-time-range-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1rem 1rem 1.25rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    position: relative;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.app-time-range-row:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.app-time-range-row::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0.75rem;
    bottom: 0.75rem;
    width: 4px;
    border-radius: 4px 0 0 4px;
    background: linear-gradient(180deg, #10b981 0%, #14b8a6 100%);
}

.app-time-range-row-inner {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .app-time-range-row-inner {
        flex-direction: row;
        align-items: flex-end;
    }
}

.app-time-range-cell {
    flex: 1;
    min-width: 0;
}

.app-time-range-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.375rem;
}

.app-time-range-arrow {
    display: none;
    align-self: center;
    color: #94a3b8;
    font-size: 0.875rem;
    padding-bottom: 0.5rem;
}

@media (min-width: 640px) {
    .app-time-range-arrow {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 2rem;
        flex-shrink: 0;
    }
}

.app-time-range-remove {
    flex-shrink: 0;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    min-height: 3rem;
    padding: 0 1rem;
    border-radius: 0.75rem;
    border: 1.5px solid #fecaca;
    background: #fff;
    color: #dc2626;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.app-time-range-remove:hover {
    background: #fef2f2;
    border-color: #f87171;
}

@media (min-width: 640px) {
    .app-time-range-remove {
        align-self: flex-end;
        width: auto;
        min-width: 3rem;
        padding: 0;
    }

    .app-time-range-remove .remove-label {
        display: none;
    }
}

/* چک‌باکس روزهای هفته */
.app-weekday-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: 0.875rem;
    border: 1.5px solid #e2e8f0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
}

.app-weekday-chip:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.app-weekday-chip:has(input:checked) {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

.app-weekday-chip input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: #3b82f6;
    cursor: pointer;
}

.app-weekday-chip span {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
}

/* بنر راهنمای ۲۴ ساعته */
.app-time-format-banner {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    border-radius: 0.875rem;
    background: linear-gradient(90deg, #eff6ff 0%, #f0fdf4 100%);
    border: 1px solid #bfdbfe;
    font-size: 0.8125rem;
    color: #1e40af;
    font-weight: 600;
}

.app-time-format-banner i {
    color: #3b82f6;
    font-size: 1rem;
}
