/* General Form Styles */
.personelyar-form, .personelyar-profile, .personelyar-dashboard {
    max-width: 700px;
    margin: 20px auto;
    padding: 25px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.personelyar-form h3, .personelyar-profile h3, .personelyar-dashboard h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2c3e50;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* Form Groups and Rows */
.py-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.py-form-group {
    flex: 1 1 calc(50% - 10px); /* Two columns layout */
    display: flex;
    flex-direction: column;
}

.py-form-group.full-width {
    flex-basis: 100%;
}

/* Labels */
.py-form-group label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
}

/* Inputs, Textarea, Select */
.personelyar-form input[type="text"],
.personelyar-form input[type="email"],
.personelyar-form input[type="password"],
.personelyar-profile input[type="text"],
.personelyar-profile input[type="email"],
.personelyar-profile input[type="password"],
.personelyar-profile textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box; /* Important for consistent sizing */
}

.personelyar-profile input[readonly] {
    background-color: #ececec;
    cursor: not-allowed;
}

.personelyar-form input:focus,
.personelyar-profile input:focus,
.personelyar-profile textarea:focus {
    outline: none;
    border-color: #007cba; /* WordPress blue */
    box-shadow: 0 0 0 1px #007cba;
    background-color: #fff;
}

/* Buttons */
.personelyar-form .button,
.personelyar-profile .button {
    background-color: #2271b1; /* WordPress primary button color */
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.personelyar-form .button:hover,
.personelyar-profile .button:hover {
    background-color: #1e639a;
}

/* Messages (Success/Error) */
.personelyar-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    border-left-width: 5px;
    border-left-style: solid;
}

.personelyar-message.success {
    background-color: #f0fff4;
    border-color: #4caf50;
    color: #2e7d32;
}

.personelyar-message.error {
    background-color: #fff0f0;
    border-color: #f44336;
    color: #c62828;
}
.personelyar-message.error p {
    margin: 0;
}

/* Table Styles */
.personelyar-table-container {
    margin-top: 20px;
}

.personelyar-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.personelyar-table th, .personelyar-table td {
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.personelyar-table th {
    background-color: #f7f7f7;
    font-weight: 600;
}

.personelyar-table tbody tr:nth-child(even) {
    background-color: #fdfdfd;
}

.personelyar-table tbody tr:hover {
    background-color: #f0f8ff;
}

/* Status Badges */
.personelyar-table span[class^="status-"] {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
    color: #fff;
}

span.status-pending, span.status-unread {
    background-color: #ff9800; /* Orange */
}

span.status-approved, span.status-read {
    background-color: #4caf50; /* Green */
}

/* Conversation / Chat View Styles */
#py-thread-messages-container {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    margin-bottom: 20px;
    border-radius: 5px;
}
.py-message-bubble {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    margin-bottom: 10px;
    clear: both;
}
.py-message-bubble.sent {
    background-color: #dcf8c6; /* Light green */
    float: right;
    border-bottom-right-radius: 3px;
}
.py-message-bubble.received {
    background-color: #ffffff;
    float: left;
    border-bottom-left-radius: 3px;
    border: 1px solid #eee;
}
.py-message-sender {
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 5px;
    color: #333;
}
.py-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    text-align: right;
}
.button-back {
    display: inline-block;
    margin-bottom: 15px;
    color: #2271b1;
    text-decoration: none;
    font-weight: 500;
}

/* ==========================================================================
   NEW: App-Like Dashboard Layout
   ========================================================================== */

/* Main Layout Container */
.personelyar-app-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 1200px;
    margin: 40px auto;
    background-color: #f8f9fa; /* Light grey background */
    padding: 20px;
    border-radius: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Main Content Area */
.py-main-content {
    flex: 1;
    min-width: 65%;
}

.py-header-title {
    font-size: 32px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 4px;
}

.py-header-subtitle {
    font-size: 18px;
    color: #6c757d;
    margin-top: 0;
    margin-bottom: 30px;
}

/* Stats Cards Section */
.py-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.py-stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
}

.py-stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.py-stat-card .stat-icon svg {
    width: 24px;
    height: 24px;
}

.py-stat-card h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

.py-stat-card p {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #212529;
}
.py-stat-card p strong {
    font-size: 28px;
}

/* Action Cards Section */
.py-action-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.py-action-card {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.py-action-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.py-action-card h3 {
    margin: 0 0 8px 0;
    color: #212529;
    font-size: 18px;
}

.py-action-card p {
    margin: 0;
    color: #6c757d;
    font-size: 15px;
}

.py-action-card .action-arrow {
    position: absolute;
    top: 50%;
    right: 25px;
    transform: translateY(-50%);
    font-size: 24px;
    color: #adb5bd;
    transition: right 0.2s ease, color 0.2s ease;
}

.py-action-card:hover .action-arrow {
    right: 20px;
    color: #2271b1;
}

/* Sidebar */
.py-sidebar {
    width: 100%;
    max-width: 300px;
    flex-shrink: 0;
}

.py-profile-card {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
}

.py-profile-card img {
    border-radius: 50%;
    margin-bottom: 15px;
}

.py-profile-card h4 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
    color: #212529;
}

.py-profile-card p {
    margin: 0 0 20px 0;
    color: #6c757d;
    font-size: 14px;
}

.py-btn-secondary {
    display: inline-block;
    width: 100%;
    padding: 10px;
    background-color: #f1f3f5;
    color: #495057;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.py-btn-secondary:hover {
    background-color: #e9ecef;
}

/* Sidebar Quick Navigation */
.py-quick-nav {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
}

.py-quick-nav h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    color: #495057;
}

.py-quick-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.py-quick-nav li a {
    display: flex;
    align-items: center;
    padding: 12px 0;
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid #f1f3f5;
    transition: color 0.2s ease;
}
.py-quick-nav li:last-child a {
    border-bottom: none;
}

.py-quick-nav li a:hover {
    color: #2271b1;
}

.py-quick-nav li a svg {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    color: #adb5bd;
}

/* RTL Specific Styles for the new dashboard */
.rtl .py-action-card .action-arrow {
    left: 25px;
    right: auto;
    transform: translateY(-50%) rotate(180deg);
}
.rtl .py-action-card:hover .action-arrow {
    left: 20px;
    right: auto;
}
.rtl .py-quick-nav li a svg {
    margin-left: 15px;
    margin-right: 0;
}

/* Responsive adjustments */
@media (max-width: 960px) {
    .py-sidebar {
        max-width: 100%;
        order: -1; /* Move sidebar to top on smaller screens */
    }
}
@media (max-width: 768px) {
    .py-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}


/* ==========================================================================
   NEW: Modern Content & List Layout (for Payslips, Rulings, etc.)
   ========================================================================== */

.personelyar-content-layout {
    max-width: 900px;
    margin: 40px auto;
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Re-using header styles from dashboard */
.personelyar-content-layout .py-header {
    margin-bottom: 30px;
}

.py-list-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
    padding: 20px;
}

.py-document-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.py-document-item {
    display: flex;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #f1f3f5;
}

.py-document-item:last-child {
    border-bottom: none;
}

.py-document-item .document-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    margin-right: 20px;
    background-color: #e7f5ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.py-document-item .document-icon svg {
    width: 24px;
    height: 24px;
    color: #1c7ed6;
}

.py-document-item .document-details {
    flex-grow: 1;
}

.py-document-item .document-title {
    margin: 0 0 4px 0;
    font-size: 17px;
    font-weight: 600;
    color: #343a40;
}

.py-document-item .document-date {
    margin: 0;
    font-size: 14px;
    color: #868e96;
}

.py-document-item .document-action {
    margin-left: 20px;
}

.py-btn-primary {
    display: inline-flex;
    align-items: center;
    background-color: #2271b1;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid #2271b1;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.py-btn-primary:hover {
    background-color: #1e639a;
    color: #fff;
}

.py-btn-primary svg {
    width: 18px;
    height: 18px;
    margin-right: 8px;
}

/* Empty State Styles */
.py-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.py-empty-state .empty-state-icon {
    width: 64px;
    height: 64px;
    background-color: #f1f3f5;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.py-empty-state .empty-state-icon svg {
    width: 32px;
    height: 32px;
    color: #adb5bd;
}

.py-empty-state h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #343a40;
}

.py-empty-state p {
    margin: 0;
    color: #868e96;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* RTL Styles for list */
.rtl .py-document-item .document-icon {
    margin-left: 20px;
    margin-right: 0;
}
.rtl .py-document-item .document-action {
    margin-right: 20px;
    margin-left: 0;
}
.rtl .py-btn-primary svg {
    margin-left: 8px;
    margin-right: 0;
}

/* Responsive for list */
@media (max-width: 600px) {
    .py-document-item {
        flex-wrap: wrap;
    }
    .py-document-item .document-details {
        flex-basis: 100%;
        order: 1;
        margin-left: 0;
        margin-top: 15px;
    }
    .py-document-item .document-icon {
        order: 2;
    }
    .py-document-item .document-action {
        order: 3;
        margin-left: auto;
    }
}


/* ==========================================================================
   NEW: Modern Form & Table Layout (for Leaves, Certificates, etc.)
   ========================================================================== */

/* Modern Form Container */
.py-form-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
    padding: 30px;
}

.py-form-title {
    font-size: 20px;
    font-weight: 600;
    color: #212529;
    margin-top: 0;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

/* Modern Form Fields Styling */
.personelyar-form.modern label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
}

.personelyar-form.modern input[type="text"],
.personelyar-form.modern input[type="email"],
.personelyar-form.modern input[type="password"],
.personelyar-form.modern select,
.personelyar-form.modern textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    background-color: #f8f9fa;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-size: 16px;
}

#leave_type{
    height: auto !important;
}

.personelyar-form.modern input:focus,
.personelyar-form.modern select:focus,
.personelyar-form.modern textarea:focus {
    outline: none;
    border-color: #2271b1;
    background-color: #fff;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

.py-form-submit {
    margin-top: 20px;
}

.py-btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #2271b1;
    color: #fff;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s ease;
}
.py-btn-submit:hover {
    background-color: #1e639a;
}
.py-btn-submit svg {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

/* Modern Table for History */
.py-list-title {
    font-size: 20px;
    font-weight: 600;
    color: #212529;
    margin: 0 0 20px 0;
}

.py-modern-table {
    width: 100%;
    border-collapse: collapse;
}

.py-modern-table thead {
    border-bottom: 2px solid #dee2e6;
}

.py-modern-table th {
    padding: 15px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.py-modern-table tbody tr {
    border-bottom: 1px solid #f1f3f5;
}
.py-modern-table tbody tr:last-child {
    border-bottom: none;
}

.py-modern-table td {
    padding: 15px;
    font-size: 15px;
    color: #495057;
}

/* Status Badges */
.py-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.py-status-badge.status-approved {
    background-color: #dcfce7;
    color: #166534;
}
.py-status-badge.status-pending {
    background-color: #ffedd5;
    color: #9a3412;
}
.py-status-badge.status-rejected {
    background-color: #fee2e2;
    color: #991b1b;
}

/* RTL for Forms */
.rtl .py-btn-submit svg {
    margin-left: 10px;
    margin-right: 0;
}
.rtl .py-modern-table th, .rtl .py-modern-table td {
    text-align: right;
}

/* Responsive for Table */
@media (max-width: 768px) {
    .py-modern-table thead {
        display: none;
    }
    .py-modern-table tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #e9ecef;
        border-radius: 8px;
        padding: 10px;
    }
    .py-modern-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 5px;
        border-bottom: 1px solid #f1f3f5;
    }
    .py-modern-table td:last-child {
        border-bottom: none;
    }
    .py-modern-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #343a40;
    }
    .rtl .py-modern-table td {
        flex-direction: row-reverse;
    }
}

/* ==========================================================================
   NEW: Modern Auth Pages Layout (Login, Register, Recovery)
   ========================================================================== */

.py-auth-layout {
    display: flex;
    flex-direction: row;
    min-height: 80vh;
    width: 100%;
    margin: 40px auto;
    max-width: 1100px;
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.07);
    overflow: hidden;
}

.py-auth-form-container {
    flex-basis: 55%;
    padding: 40px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.py-auth-form-container .personelyar-form {
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

.py-auth-form-container h3 {
    font-size: 28px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 10px;
    border: none;
    padding: 0;
}

.py-auth-form-container .form-subtitle {
    font-size: 16px;
    color: #6c757d;
    margin-bottom: 30px;
}

.py-form-group-auth {
    margin-bottom: 20px;
}

.py-form-group-auth label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
}

.py-form-group-auth .input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    background-color: #f8f9fa;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-size: 16px;
}

.py-form-group-auth .input:focus {
    outline: none;
    border-color: #2271b1;
    background-color: #fff;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

.py-btn-submit-auth {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 8px;
    background-color: #2271b1;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 10px;
}

.py-btn-submit-auth:hover {
    background-color: #1e639a;
}

.py-auth-form-container .py-form-links {
    margin-top: 25px;
    text-align: center;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
}

.py-auth-form-container .py-form-links a {
    color: #2271b1;
    text-decoration: none;
    font-weight: 500;
}

/* Branding Panel */
.py-auth-branding-panel {
    flex-basis: 45%;
    background: linear-gradient(45deg, #2271b1, #1e639a);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    text-align: center;
}

.py-auth-branding-panel h2 {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 15px 0;
}

.py-auth-branding-panel p {
    font-size: 18px;
    opacity: 0.9;
    max-width: 300px;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 900px) {
    .py-auth-branding-panel {
        display: none;
    }
    .py-auth-form-container {
        flex-basis: 100%;
    }
    .py-auth-layout {
        min-height: auto;
    }
}


/* NEW Styles for advanced message statuses */
.py-status-badge.status-pending_reply {
    background-color: #ffedd5; /* Light Orange */
    color: #9a3412; /* Dark Orange */
}

.py-status-badge.status-answered {
    background-color: #dcfce7; /* Light Green */
    color: #166534; /* Dark Green */
}


/* ==========================================================================
   NEW: Input Group for Currency Fields
   ========================================================================== */

.py-input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.py-input-group .py-currency-input {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    text-align: left; /* Numbers look better aligned left */
    direction: ltr;
}

.py-input-group .py-input-group-text {
    display: flex;
    align-items: center;
    padding: 0 15px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    text-align: center;
    white-space: nowrap;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-right: 0;
    border-radius: 8px 0 0 8px;
}

/* RTL Specifics */
.rtl .py-input-group .py-currency-input {
    border-radius: 8px 0 0 8px;
}

.rtl .py-input-group .py-input-group-text {
    border-radius: 0 8px 8px 0;
    border-left: 0;
    border-right: 1px solid #ced4da;
}

.formatted-value {
    display: block;
    margin-top: 4px;
    color: #555;
    font-size: 0.9em;
}
.py-form-group {
    margin-bottom: 16px;
}



/* * Personelyar General Styles
 */

/* استایل پیام‌های فرم */
.personelyar-form-message {
    display: none;
    padding: 15px;
    margin-top: 15px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
}

.personelyar-form-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.personelyar-form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* استایل تب‌ها (در صورت استفاده در داشبورد) */
.personelyar-tabs {
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
}

.personelyar-tab-link {
    padding: 10px 15px;
    cursor: pointer;
    text-decoration: none;
    color: #495057;
    border: 1px solid transparent;
    border-bottom: none;
    margin-bottom: -1px;
    border-radius: 4px 4px 0 0;
}

.personelyar-tab-link:hover {
    background-color: #e9ecef;
    text-decoration: none;
}

.personelyar-tab-link.active {
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
    color: #007bff;
    font-weight: bold;
}

.personelyar-tab-content {
    display: none;
}

.personelyar-tab-content.active {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* استایل فیلدهای شرطی */
.py-conditional-fields {
    display: none; /* پیش‌فرض مخفی */
    margin-top: 15px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px dashed #ccc;
    border-radius: 5px;
}


/* * Personelyar General Styles
 */

/* استایل پیام‌های فرم */
.personelyar-form-message {
    display: none;
    padding: 15px;
    margin-top: 15px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
}

.personelyar-form-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.personelyar-form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* استایل تب‌ها (در صورت استفاده در داشبورد) */
.personelyar-tabs {
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
}

.personelyar-tab-link {
    padding: 10px 15px;
    cursor: pointer;
    text-decoration: none;
    color: #495057;
    border: 1px solid transparent;
    border-bottom: none;
    margin-bottom: -1px;
    border-radius: 4px 4px 0 0;
}

.personelyar-tab-link:hover {
    background-color: #e9ecef;
    text-decoration: none;
}

.personelyar-tab-link.active {
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
    color: #007bff;
    font-weight: bold;
}

.personelyar-tab-content {
    display: none;
}

.personelyar-tab-content.active {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* استایل فیلدهای شرطی */
.py-conditional-fields {
    display: none; /* پیش‌فرض مخفی */
    margin-top: 15px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px dashed #ccc;
    border-radius: 5px;
}

/* * استایل اختصاصی برای فیلد ورودی تاریخ (باکس اصلی)
 * این بخش باعث می‌شود اینپوت شبیه بقیه فیلدهای قالب شود
 */
input.py-date-picker {
    display: block !important;
    width: 100% !important;
    height: 45px !important; /* ارتفاع استاندارد */
    padding: 0 15px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #495057 !important;
    background-color: #fff !important;
    background-clip: padding-box !important;
    border: 1px solid #ced4da !important;
    border-radius: 4px !important;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out !important;
    box-shadow: none !important;
    margin: 0 !important;
}

input.py-date-picker:focus {
    border-color: #80bdff !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25) !important;
}

/*
 * --------------------------------------------------------------------------
 * FIX KAMA DATEPICKER CONFLICTS (رفع مشکل تقویم با آی‌دی‌های پویا)
 * --------------------------------------------------------------------------
 */


/* استفاده از [id^="bd-root-"] به جای #bd-root چون آی‌دی داینامیک است */
div[id^="bd-root-"] {
    z-index: 999999 !important;
    direction: rtl !important;
    text-align: right !important;
    position: relative !important;
    display: block !important; /* اطمینان از نمایش بلاک برای پر کردن عرض */
    width: 100% !important;
}

div[id^="bd-root-"] .bd-year , .bd-month{
    height: auto !important;
}
/* فیکس کردن باکس تقویم */
div[id^="bd-root-"] .bd-calendar {
    width: 220px !important;
    box-sizing: content-box !important;
    font-family: tahoma, sans-serif !important;
    font-size: 12px !important;
    background-color: #fff !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    max-width: none !important;
    padding: 5px !important;
}

/* جلوگیری از اعمال استایل‌های جدول قالب روی تقویم */
div[id^="bd-root-"] table {
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    height: 250px !important;
}

/* استایل سلول‌ها و ردیف‌ها */
div[id^="bd-root-"] table tr,
div[id^="bd-root-"] table td,
div[id^="bd-root-"] table th {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    line-height: normal !important;
    vertical-align: middle !important;
    text-align: center !important;
    width: auto !important;
    height: auto !important;
}

/* استایل عمومی دکمه‌های روزها */
div[id^="bd-root-"] .bd-table-days button {
    background: transparent; /* حذف !important برای اجازه دادن به رنگ‌های دیگر */
    border: none !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    color: #333; /* حذف !important */
    cursor: pointer !important;
    border-radius: 50% !important;
    font-size: 12px !important;
    box-shadow: none !important;
    transition: all 0.2s ease;
}

/* هاور */
div[id^="bd-root-"] .bd-table-days button:not(.bd-selected-day):not(.bd-holiday):hover {
    background-color: #f0f0f0 !important;
}

/* --- فیکس: روز انتخاب شده (highlightSelectedDay) --- */
div[id^="bd-root-"] .bd-table-days button.bd-selected-day {
    background-color: #007bff !important;
    color: #fff !important;
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.4) !important;
}

/* --- فیکس: روز امروز (markToday) --- */
div[id^="bd-root-"] .bd-table-days button.bd-today {
    border: 1px solid #007bff !important;
    color: #007bff !important; /* رنگ متن آبی */
    font-weight: bold !important;
}
/* اگر می‌خواهید امروز هم رنگ پس‌زمینه داشته باشد این خط را فعال کنید: */
 div[id^="bd-root-"] .bd-table-days button.bd-today { background-color: #e3f2fd !important; }


/* --- فیکس: تعطیلات (markHolidays) --- */
div[id^="bd-root-"] .bd-table-days button.bd-holiday {
    background-color: #ffebee !important; /* پس زمینه قرمز روشن */
    color: #c62828 !important; /* متن قرمز */
}

/* حالت انتخاب شده برای تعطیلات */
div[id^="bd-root-"] .bd-table-days button.bd-holiday.bd-selected-day {
    background-color: #d32f2f !important; /* قرمز تیره */
    color: #fff !important;
}

/* end shamsi */


/* --- اصلاح ریسپانسیو فرم درخواست مرخصی --- */

/* اطمینان از شکستن خطوط در صورت کمبود فضا */
.py-form-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -10px;
    margin-left: -10px;
}

/* تنظیم فاصله و اندازه فیلدها */
.py-form-group {
    padding-right: 10px;
    padding-left: 10px;
    box-sizing: border-box;
    flex: 1; /* باعث می‌شود فیلدها فضای خالی را پر کنند */
    min-width: 0; /* جلوگیری از سرریز شدن محتوا */
}

/* استایل مخصوص موبایل (صفحات کمتر از 768 پیکسل) */
@media screen and (max-width: 768px) {
    .py-form-group.half-width {
        flex: 0 0 100% !important; /* اجبار به تمام عرض بودن */
        width: 100% !important;
        max-width: 100% !important;
    }

    /* فاصله عمودی بین فیلدها در حالت موبایل */
    .py-form-group {
        margin-bottom: 15px;
    }
}
