/* متغیرهای رنگ - تم اداری */
:root {
    --primary-color: #1a365d;
    --primary-light: #2c5282;
    --primary-dark: #0d1b2a;
    --secondary-color: #2d3748;
    --accent-color: #3182ce;
    --success-color: #276749;
    --warning-color: #c05621;
    --danger-color: #c53030;
    --bg-light: #f7fafc;
    --bg-card: #ffffff;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background: var(--bg-light);
    min-height: 100vh;
    direction: rtl;
    color: var(--text-primary);
    line-height: 1.6;
}

/* صفحه لاگین */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 50%, var(--primary-light) 100%);
}

.login-box {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 40px 35px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    border-top: 4px solid var(--accent-color);
}

.login-box h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 22px;
    font-weight: 700;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    background: var(--bg-light);
    min-height: 50px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 54px;
}

.btn-login:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.btn-login:active {
    transform: translateY(0);
}

/* پیام‌های هشدار */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
    font-size: 14px;
}

.alert-success {
    background: #c6f6d5;
    color: var(--success-color);
    border-right: 4px solid var(--success-color);
}

.alert-error {
    background: #fed7d7;
    color: var(--danger-color);
    border-right: 4px solid var(--danger-color);
}

/* داشبورد */
.dashboard-container {
    min-height: 100vh;
    background: var(--bg-light);
}

.dashboard-header {
    background: var(--primary-color);
    padding: 16px 30px;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    height: 45px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
}

.dashboard-header h1 {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info span {
    color: rgba(255,255,255,0.9);
    font-weight: 500;
    font-size: 14px;
}

.btn-change-password {
    padding: 10px 18px;
    background: var(--success-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
}

.btn-change-password:hover {
    background: #22543d;
}

.btn-logout {
    padding: 10px 18px;
    background: var(--danger-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
}

.btn-logout:hover {
    background: #9b2c2c;
}

.btn-back {
    padding: 10px 18px;
    background: var(--text-muted);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
}

.btn-back:hover {
    background: var(--text-secondary);
}

.btn-edit-header {
    padding: 10px 18px;
    background: var(--warning-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
}

.btn-edit-header:hover {
    background: #9c4221;
}

.dashboard-content {
    padding: 25px;
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-content h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 700;
}

.month-selector-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.month-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 10px 16px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.month-selector label {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
}

.month-selector select {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    background: white;
    cursor: pointer;
    min-width: 160px;
}

.month-selector select:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* کارت اطلاعات */
.info-card {
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.info-section {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.info-section:last-child {
    border-bottom: none;
}

.info-section h3 {
    color: var(--primary-color);
    margin-bottom: 18px;
    font-size: 16px;
    font-weight: 700;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-light);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.info-item .label {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
}

.info-item .value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.info-item .highlight-text {
    color: var(--accent-color);
    font-weight: 700;
}

.section-total {
    display: flex;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--primary-color);
    border-radius: 6px;
    margin-top: 16px;
}

.section-total .label {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.section-total .value {
    color: white;
    font-weight: 700;
    font-size: 15px;
}

.total-section {
    padding: 28px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    text-align: center;
}

.total-section h3 {
    color: white;
    margin-bottom: 12px;
    font-size: 16px;
    border-bottom: none;
    display: block;
}

.total-amount {
    color: white;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
}

.total-breakdown {
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 12px;
}

.total-breakdown p {
    margin: 4px 0;
}

/* جدول */
.table-container {
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.employees-table {
    width: 100%;
    border-collapse: collapse;
}

.employees-table thead {
    background: var(--primary-color);
    color: white;
}

.employees-table th {
    padding: 14px 12px;
    text-align: right;
    font-weight: 600;
    font-size: 13px;
}

.employees-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.employees-table tbody tr:hover {
    background: var(--bg-light);
}

.employees-table td {
    padding: 12px;
    text-align: right;
    color: var(--text-secondary);
    font-size: 13px;
}

.employees-table td.highlight {
    font-weight: 700;
    color: var(--accent-color);
}

.stats {
    margin-top: 16px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.stats p {
    color: var(--text-secondary);
    font-size: 14px;
}

.stats strong {
    color: var(--primary-color);
    font-size: 16px;
}

/* دکمه‌های اکشن */
.btn-action {
    display: inline-block;
    padding: 7px 12px;
    margin: 2px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    min-height: 32px;
}

.btn-view {
    background: var(--accent-color);
    color: white;
}

.btn-view:hover {
    background: #2b6cb0;
}

.btn-edit {
    background: var(--warning-color);
    color: white;
}

.btn-edit:hover {
    background: #9c4221;
}

.btn-password {
    background: #6b46c1;
    color: white;
}

.btn-password:hover {
    background: #553c9a;
}

/* فرم */
.form-card {
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.form-section {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.form-section h3 {
    color: var(--primary-color);
    margin-bottom: 18px;
    font-size: 16px;
    font-weight: 700;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.form-actions {
    padding: 24px;
    background: var(--bg-light);
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-save {
    padding: 14px 36px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 50px;
}

.btn-save:hover {
    background: var(--primary-light);
}

.btn-cancel {
    padding: 14px 36px;
    background: var(--text-muted);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
}

.btn-cancel:hover {
    background: var(--text-secondary);
}

/* صفحه مدیریت رمز */
.password-management-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 700px;
    margin: 0 auto;
}

.password-info-card,
.password-action-card {
    background: white;
    padding: 24px;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.password-info-card h3,
.password-action-card h3 {
    color: var(--primary-color);
    margin-bottom: 18px;
    font-size: 16px;
    font-weight: 700;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-color);
}

.password-display {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: var(--bg-light);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.info-row .label {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
}

.info-row .value {
    color: var(--text-primary);
    font-weight: 600;
}

.password-value {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hidden-password {
    font-size: 18px;
    letter-spacing: 2px;
}

.btn-toggle-password {
    padding: 6px 12px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
}

.btn-toggle-password:hover {
    background: #2b6cb0;
}

.password-action-card.danger {
    border: 1px solid var(--danger-color);
}

.password-action-card.danger h3 {
    color: var(--danger-color);
    border-bottom-color: var(--danger-color);
}

.warning-text {
    color: #744210;
    background: #fefcbf;
    padding: 12px;
    border-radius: 6px;
    border-right: 3px solid var(--warning-color);
    margin-bottom: 16px;
    font-size: 13px;
}

.btn-reset {
    width: 100%;
    padding: 14px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.btn-reset:hover {
    background: #9b2c2c;
}

/* ========== ریسپانسیو موبایل ========== */
@media (max-width: 768px) {
    /* صفحه لاگین */
    .container {
        padding: 15px;
    }
    
    .login-box {
        padding: 30px 20px;
        border-radius: 10px;
    }
    
    .login-box h1 {
        font-size: 18px;
        margin-bottom: 24px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-group label {
        font-size: 13px;
    }
    
    .form-group input {
        padding: 14px;
        font-size: 16px;
        min-height: 50px;
    }
    
    .btn-login {
        padding: 16px;
        font-size: 15px;
        min-height: 52px;
    }
    
    /* هدر */
    .dashboard-header {
        flex-direction: column;
        gap: 12px;
        padding: 14px 16px;
        position: relative;
    }
    
    .header-left {
        flex-direction: row;
        gap: 10px;
        width: 100%;
        justify-content: center;
    }
    
    .header-logo {
        height: 36px;
    }
    
    .dashboard-header h1 {
        font-size: 15px;
    }

    .user-info {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        width: 100%;
    }
    
    .user-info span {
        width: 100%;
        text-align: center;
        font-size: 13px;
        padding-bottom: 6px;
        border-bottom: 1px solid rgba(255,255,255,0.2);
    }
    
    .btn-change-password,
    .btn-logout,
    .btn-back,
    .btn-edit-header {
        flex: 1;
        min-width: 80px;
        padding: 10px 12px;
        font-size: 12px;
        min-height: 40px;
        justify-content: center;
        text-align: center;
    }
    
    /* محتوا */
    .dashboard-content {
        padding: 16px;
    }
    
    .dashboard-content h2 {
        font-size: 17px;
        margin-bottom: 16px;
    }
    
    .month-selector-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .month-selector {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        gap: 8px;
    }
    
    .month-selector label {
        font-size: 13px;
    }
    
    .month-selector select {
        width: 100%;
        padding: 12px;
        font-size: 14px;
        min-height: 46px;
    }
    
    /* کارت اطلاعات */
    .info-card {
        border-radius: 8px;
    }
    
    .info-section {
        padding: 16px;
    }
    
    .info-section h3 {
        font-size: 14px;
        margin-bottom: 14px;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .info-item {
        padding: 10px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .info-item .label {
        font-size: 12px;
    }
    
    .info-item .value {
        font-size: 14px;
    }
    
    .section-total {
        padding: 12px 14px;
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }
    
    .section-total .label {
        font-size: 13px;
    }
    
    .section-total .value {
        font-size: 15px;
    }
    
    .total-section {
        padding: 20px 16px;
    }
    
    .total-section h3 {
        font-size: 14px;
    }
    
    .total-amount {
        font-size: 24px;
    }
    
    .total-breakdown {
        font-size: 12px;
    }
    
    /* جدول */
    .table-container {
        overflow-x: auto;
        border-radius: 8px;
    }
    
    .employees-table {
        min-width: 700px;
        font-size: 12px;
    }
    
    .employees-table th,
    .employees-table td {
        padding: 10px 8px;
    }
    
    .btn-action {
        padding: 6px 10px;
        font-size: 11px;
        min-height: 30px;
    }
    
    /* فرم */
    .form-section {
        padding: 16px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .form-actions {
        flex-direction: column;
        gap: 10px;
        padding: 16px;
    }
    
    .btn-save,
    .btn-cancel {
        width: 100%;
        padding: 14px;
        font-size: 14px;
        min-height: 48px;
        justify-content: center;
    }
    
    /* مدیریت رمز */
    .password-management-container {
        padding: 0;
    }
    
    .password-info-card,
    .password-action-card {
        padding: 16px;
        border-radius: 8px;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 12px;
    }
    
    .password-value {
        width: 100%;
        justify-content: space-between;
    }
    
    .btn-toggle-password {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    /* آلرت */
    .alert {
        padding: 12px 14px;
        font-size: 13px;
        margin: 12px 16px;
    }
    
    .stats {
        padding: 14px;
    }
    
    .stats p {
        font-size: 13px;
    }
}

/* موبایل کوچک */
@media (max-width: 400px) {
    .login-box {
        padding: 24px 16px;
    }
    
    .login-box h1 {
        font-size: 16px;
    }
    
    .dashboard-header h1 {
        font-size: 14px;
    }
    
    .btn-change-password,
    .btn-logout,
    .btn-back,
    .btn-edit-header {
        font-size: 11px;
        padding: 8px 10px;
    }
    
    .total-amount {
        font-size: 20px;
    }
}
