/**
 * استایل‌های ماژول مدیریت دفاتر
 *
 * @package Anjoman2\Modules\Offices
 */

/* ==============================
   جدول افقی مقایسه‌ای دفاتر
   ============================== */
.anjoman-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.anjoman-table-offices {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.7;
}

.anjoman-table-offices thead th {
    background: #4a5568;
    color: #fff;
    padding: 10px 8px;
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
    font-size: 13px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.anjoman-table-offices tbody td {
    padding: 10px 8px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid #e2e8f0;
}

.anjoman-table-offices tbody tr:hover {
    background: #edf2f7;
}

.anjoman-table-offices tbody tr:nth-child(even) {
    background: #f7fafc;
}

.anjoman-table-offices tbody tr:nth-child(even):hover {
    background: #edf2f7;
}

.office-title-cell {
    text-align: right !important;
    min-width: 150px;
}

.office-actions-cell {
    white-space: nowrap;
    min-width: 200px;
}

/* ==============================
   وضعیت: فعال / غیرفعال (toggle)
   ============================== */
.anjoman-toggle-status {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    outline: none;
}

.anjoman-status-active {
    background: #c6f6d5;
    color: #22543d;
    border-color: #68d391;
}

.anjoman-status-active:hover {
    background: #9ae6b4;
    border-color: #48bb78;
}

.anjoman-status-inactive {
    background: #fed7d7;
    color: #742a2a;
    border-color: #fc8181;
}

.anjoman-status-inactive:hover {
    background: #feb2b2;
    border-color: #f56565;
}

/* ==============================
   مودال
   ============================== */
.anjoman-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 100000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 60px;
    overflow-y: auto;
}

.anjoman-modal-content {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 620px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: anjomanSlideDown 0.25s ease;
    margin-bottom: 40px;
}

@keyframes anjomanSlideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.anjoman-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #f7fafc;
    border-radius: 12px 12px 0 0;
}

.anjoman-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #2d3748;
}

.anjoman-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #a0aec0;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.2s;
}

.anjoman-modal-close:hover {
    color: #e53e3e;
}

.anjoman-modal-body {
    padding: 24px;
}

/* ==============================
   فرم داخل مودال
   ============================== */
.anjoman-form-row {
    margin-bottom: 16px;
}

.anjoman-form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #2d3748;
    font-size: 14px;
}

.anjoman-form-row label .required {
    color: #e53e3e;
}

.anjoman-form-row input[type="text"],
.anjoman-form-row input[type="email"],
.anjoman-form-row input[type="number"],
.anjoman-form-row input[type="password"],
.anjoman-form-row select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.anjoman-form-row input:focus,
.anjoman-form-row select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

.anjoman-form-row input.error,
.anjoman-form-row select.error {
    border-color: #fc8181;
    box-shadow: 0 0 0 3px rgba(252, 129, 129, 0.2);
}

.anjoman-hint {
    display: block;
    color: #718096;
    font-size: 12px;
    margin-top: 4px;
}

.anjoman-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

/* ==============================
   دکمه‌های کمکی
   ============================== */
.anjoman-btn-green {
    background: #48bb78;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.anjoman-btn-green:hover {
    background: #38a169;
}

.anjoman-btn-gray {
    background: #a0aec0;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.anjoman-btn-gray:hover {
    background: #718096;
}

.anjoman-btn-purple {
    background: #9f7aea;
    color: #fff;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}

.anjoman-btn-purple:hover {
    background: #805ad5;
}

.anjoman-text-muted {
    color: #a0aec0;
    font-size: 13px;
}

/* ==============================
   دکمه‌های sm (اشتراکی با admin.css)
   ============================== */
.anjoman-btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    margin: 1px 2px;
}

/* ==============================
   ریسپانسیو
   ============================== */
@media (max-width: 768px) {
    .anjoman-modal-content {
        margin: 0 10px;
        max-width: 100%;
        border-radius: 8px;
    }

    .anjoman-modal-body {
        padding: 16px;
    }

    .anjoman-form-actions {
        flex-direction: column;
    }

    .anjoman-form-actions button {
        width: 100%;
    }
}

/* اضافه کردن استایل‌های جدید برای بهبود ظاهر */

/* بهبود فیلدهای فرم */
.anjoman-form-input,
.anjoman-form-select {
    width: 100%;
    padding: -12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
}

.anjoman-form-input:focus,
.anjoman-form-select:focus {
    border-color: #4CAF50;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
    outline: none;
}

/* بهبود برچسب‌ها */
.anjoman-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

/* بهبود راهنمایی‌ها */
.anjoman-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* بهبود دکمه‌ها */
.anjoman-btn {
    padding: 12px 24px;
    border-radius: -6px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-align: center;
    min-width: 120px;
}

.anjoman-btn-green {
    background-color: #4CAF50;
    color: white;
}

.anjoman-btn-green:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.anjoman-btn-gray {
    background-color: #757575;
    color: white;
}

.anjoman-btn-gray:hover {
    background-color: #616161;
    transform: translateY(-2px);
}

/* بهبود Media Queries برای موبایل */
@media (max-width: 480px) {
    .anjoman-modal-content {
        margin: 5px;
        border-radius: 6px;
    }
    
    .anjoman-form-row {
        margin-bottom: 20px;
    }
    
    .anjoman-form-input,
    .anjoman-form-select {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .anjoman-btn {
        padding: 10px 16px;
        font-size: 14px;
        min-width: 100%;
        margin-bottom: 8px;
    }
    
    .anjoman-form-actions {
        flex-direction: column;
        gap: 10px;
    }
}

/* برای تبلت‌ها */
@media (max-width: 768px) and (min-width: 481px) {
    .anjoman-modal-content {
        max-width: 90%;
    }
    
    .anjoman-form-row {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
}
/* =============================================
   GRID ۲-ستونه برای فرم افزودن/ویرایش دفتر
   ============================================= */
.anjoman-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 24px;
    margin-bottom: 8px;
}

/* ردیفی که یک فیلد تمام‌عرض می‌شود (مثل رمز عبور) */
.anjoman-form-row-full {
    grid-column: 1 / -1;
    max-width: 50%; /* نیم‌صفحه برای رمز عبور - متقارن */
}

/* ---------- استایل فیلدهای داخل گرید ---------- */
.anjoman-form-grid .anjoman-form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.anjoman-form-grid .anjoman-form-row label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 0;
}

.anjoman-form-grid .anjoman-form-row .required {
    color: #c00;
    margin-right: 2px;
}

.anjoman-form-grid .anjoman-form-row .optional-label {
    color: #c00;
}

.anjoman-form-grid .anjoman-form-row .optional-label small {
    color: #888;
    font-weight: 400;
}

/* ---------- input / select های بزرگ و خوانا ---------- */
.anjoman-form-grid input[type="text"],
.anjoman-form-grid input[type="number"],
.anjoman-form-grid input[type="email"],
.anjoman-form-grid input[type="password"],
.anjoman-form-grid select {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border: 2px solid #d0d5dd;
    border-radius: 8px;
    background: #fff;
    color: #1a1a1a;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    height: 46px;
    line-height: 1.4;
}

.anjoman-form-grid input:focus,
.anjoman-form-grid select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.anjoman-form-grid input::placeholder,
.anjoman-form-grid select::placeholder {
