/* ============================================
   نظام إدارة الموظفين والترقيات - CSS
   ============================================ */

/* Hijri Date Picker Component */
.hijri-date-group { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.hijri-input-row { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; }
.hijri-input {
    flex: 1; min-width: 0; height: 42px; direction: ltr; text-align: center; font-family: 'Courier New', monospace;
    font-size: 1em; letter-spacing: 1px; padding: 0 12px;
    border: 1px solid #ccc; border-radius: 6px;
    outline: none; transition: border-color 0.2s; position: relative; z-index: 1;
}
.hijri-input:focus { border-color: #1a73e8; }
.hijri-picker-btn {
    width: 42px; min-width: 42px; height: 42px;
    background: #fff; border: 1px solid #ccc; border-radius: 6px;
    padding: 0; cursor: pointer; display: inline-flex; align-items: center;
    justify-content: center; transition: background 0.2s; position: relative; z-index: 3; pointer-events: auto;
}
.hijri-picker-btn:hover { background: #e3f2fd; border-color: #1a73e8; }
.hijri-picker-btn img, .hijri-picker-btn i { width: 16px; height: 16px; font-size: 14px; color: #555; pointer-events: none; }
.hijri-hidden-date { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.hijri-feedback {
    font-size: 0.8em; padding: 2px 8px; border-radius: 4px; text-align: center;
    direction: rtl; min-height: 20px; line-height: 20px;
}
.hijri-calendar-modal {
    position: fixed;
    inset: 0;
    background: rgba(9, 18, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 16px;
}
.hijri-calendar-modal.active { display: flex; }
.hijri-calendar-dialog {
    width: min(100%, 360px);
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.18);
    overflow: hidden;
}
.hijri-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, #0d47a1, #1976d2);
    color: #fff;
}
.hijri-calendar-title {
    text-align: center;
    font-weight: 700;
    line-height: 1.4;
}
.hijri-calendar-nav {
    border: none;
    background: rgba(255,255,255,0.14);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    cursor: pointer;
}
.hijri-calendar-body { padding: 14px; }
.hijri-calendar-weekdays,
.hijri-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.hijri-calendar-weekdays span {
    text-align: center;
    font-size: 0.82rem;
    color: #546e7a;
    padding-bottom: 4px;
}
.hijri-calendar-day,
.hijri-calendar-empty {
    min-height: 42px;
}
.hijri-calendar-day {
    border: 1px solid #d7e3f4;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    color: #123;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.95rem;
}
.hijri-calendar-day:hover {
    border-color: #1976d2;
    background: #eef5ff;
}
.hijri-calendar-day.is-today {
    border-color: #ef6c00;
    color: #ef6c00;
}
.hijri-calendar-day.is-selected {
    background: #1976d2;
    border-color: #1976d2;
    color: #fff;
}
.hijri-calendar-caption {
    margin-top: 12px;
    text-align: center;
    color: #607d8b;
    font-size: 0.85rem;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    background: #f0f2f5;
    direction: rtl;
    color: #333;
    line-height: 1.6;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1a237e 0%, #283593 50%, #303f9f 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    box-shadow: -3px 0 15px rgba(0,0,0,0.2);
}

.sidebar .logo {
    text-align: center;
    padding: 25px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar .logo i {
    font-size: 2.5rem;
    margin-bottom: 8px;
    display: block;
}

.sidebar .logo h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.sidebar .logo small {
    opacity: 0.7;
    font-size: 0.85rem;
}

.sidebar nav {
    padding: 15px 0;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 12px;
    font-size: 0.95rem;
    border-right: 3px solid transparent;
}

.sidebar nav a:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.sidebar nav a.active {
    background: rgba(255,255,255,0.12);
    color: white;
    border-right-color: #64b5f6;
}

.sidebar nav a i {
    width: 22px;
    text-align: center;
    font-size: 1rem;
}

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 10px 20px;
}

/* Main Content */
.main-content {
    margin-right: 260px;
    flex: 1;
    padding: 30px;
    min-height: 100vh;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-header h1 {
    font-size: 1.7rem;
    color: #1a237e;
    font-weight: 700;
}

.page-header h1 i {
    margin-left: 8px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: 14px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card .stat-icon {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.stat-card .number {
    font-size: 2.2rem;
    font-weight: 700;
    color: #1a237e;
    line-height: 1.2;
}

.stat-card .number small {
    font-size: 0.9rem;
    opacity: 0.6;
}

.stat-card .label {
    color: #666;
    margin-top: 5px;
    font-size: 0.9rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 14px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.card h3 {
    color: #1a237e;
    margin-bottom: 20px;
    font-size: 1.15rem;
    padding-bottom: 12px;
    border-bottom: 2px solid #e8eaf6;
}

.card h3 i {
    margin-left: 8px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: #f5f5f5;
    padding: 12px 15px;
    text-align: right;
    font-weight: 600;
    color: #444;
    border-bottom: 2px solid #e0e0e0;
    font-size: 0.9rem;
    white-space: nowrap;
}

table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
    vertical-align: middle;
}

table tbody tr:hover {
    background: #f8f9ff;
}

.total-row td {
    background: #e8eaf6;
    font-size: 1.1rem;
    color: #1a237e;
}

/* Forms */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #444;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #3f51b5;
    outline: none;
    box-shadow: 0 0 0 3px rgba(63,81,181,0.12);
}

.form-group textarea {
    resize: vertical;
    min-height: 70px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Buttons */
.btn {
    padding: 10px 22px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary { background: #1a237e; color: white; }
.btn-primary:hover { background: #283593; }

.btn-success { background: #2e7d32; color: white; }
.btn-success:hover { background: #388e3c; }

.btn-danger { background: #c62828; color: white; }
.btn-danger:hover { background: #d32f2f; }

.btn-warning { background: #e65100; color: white; }
.btn-warning:hover { background: #ef6c00; }

.btn-block { width: 100%; justify-content: center; }

.btn-outline { background: transparent; color: #1a73e8; border: 1px solid #1a73e8; }
.btn-outline:hover { background: #1a73e8; color: white; }

.btn-lg {
    padding: 14px 30px;
    font-size: 1.05rem;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-icon-sm {
    background: none;
    border: none;
    color: #c62828;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 5px;
    font-weight: 700;
}

.actions-cell {
    white-space: nowrap;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* Alerts */
.alert {
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.alert-success { background: #e8f5e9; color: #1b5e20; border: 1px solid #c8e6c9; }
.alert-error { background: #ffebee; color: #b71c1c; border: 1px solid #ffcdd2; }
.alert-warning { background: #fff3e0; color: #e65100; border: 1px solid #ffe0b2; }

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-danger { background: #ffebee; color: #c62828; }
.badge-warning { background: #fff3e0; color: #e65100; }
.badge-info { background: #e3f2fd; color: #1565c0; }

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a237e 0%, #283593 40%, #3949ab 100%);
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    width: 420px;
    max-width: 100%;
    box-shadow: 0 25px 80px rgba(0,0,0,0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo i {
    font-size: 3.5rem;
    color: #1a237e;
    margin-bottom: 12px;
    display: block;
}

.login-logo h1 {
    color: #1a237e;
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.login-logo p {
    color: #888;
    font-size: 0.9rem;
}

.login-form {
    margin-bottom: 10px;
}

.demo-links {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.demo-links p {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.demo-links a {
    display: block;
    margin: 6px 0;
    color: #3f51b5;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.3s;
}

.demo-links a:hover {
    background: #e8eaf6;
}

.support-box {
    margin-top: 18px;
    padding: 18px;
    border-radius: 14px;
    background: #f1f8e9;
    border: 1px solid #c5e1a5;
}

.support-box h3 {
    margin-bottom: 8px;
    color: #2e7d32;
}

.support-box p {
    margin-bottom: 14px;
    color: #446;
}

/* Quick Links */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 25px 15px;
    background: white;
    border-radius: 14px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    text-align: center;
}

.quick-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.quick-link i {
    font-size: 2rem;
    margin-bottom: 12px;
    color: #1a237e;
}

.quick-link span {
    font-weight: 600;
    font-size: 0.95rem;
}

.quick-link small {
    color: #888;
    font-size: 0.8rem;
    margin-top: 5px;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e8eaf6;
}

.modal-header h3 {
    color: #1a237e;
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    padding: 5px;
    line-height: 1;
}

.btn-close:hover {
    color: #c62828;
}

/* Settings Elements */
.settings-elements {
    margin: 20px 0;
}

.settings-elements h4 {
    margin-bottom: 8px;
    color: #1a237e;
}

.element-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9ff;
    border-radius: 10px;
    margin-bottom: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #1a237e;
}

.weight-select {
    padding: 8px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-weight: 600;
    width: 80px;
    text-align: center;
}

.total-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #e8eaf6;
    border-radius: 10px;
    margin-top: 15px;
    font-weight: 600;
}

.total-weight {
    font-size: 1.3rem;
    font-weight: 700;
}

/* FAQ Items */
.faq-item {
    padding: 18px;
    background: #f8f9ff;
    border-radius: 12px;
    margin-bottom: 12px;
    border-right: 4px solid #3f51b5;
}

.faq-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.faq-question {
    margin-bottom: 8px;
    font-size: 0.95rem;
    line-height: 1.7;
}

.faq-answer {
    color: #2e7d32;
    background: #e8f5e9;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.7;
}

.inline-form {
    margin-top: 10px;
}

/* FAQ Accordion */
.faq-accordion {
    margin-bottom: 8px;
    border-radius: 10px;
    overflow: hidden;
    background: #f8f9ff;
    border: 1px solid #e8eaf6;
}

.faq-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    cursor: pointer;
    transition: background 0.3s;
}

.faq-toggle:hover {
    background: #e8eaf6;
}

.faq-toggle .fa-chevron-down {
    margin-right: auto;
    transition: transform 0.3s;
    font-size: 0.8rem;
    color: #999;
}

.faq-accordion.open .fa-chevron-down {
    transform: rotate(180deg);
}

.faq-q {
    font-weight: 500;
    flex: 1;
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 18px;
}

.faq-accordion.open .faq-content {
    max-height: 500px;
    padding: 0 18px 18px;
}

.faq-content p {
    color: #555;
    line-height: 1.8;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.info-item {
    padding: 15px;
    background: #f8f9ff;
    border-radius: 10px;
}

.info-item label {
    display: block;
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.info-item span {
    font-weight: 600;
    color: #1a237e;
    font-size: 1.05rem;
}

/* Rules List */
.rules-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rule-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: #f8f9ff;
    border-radius: 10px;
}

.rule-item i {
    margin-top: 3px;
    flex-shrink: 0;
}

/* Star Rating */
.star-rating {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.star-rating span {
    margin-right: 6px;
    font-size: 0.85rem;
    color: #666;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.topbar-start,
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.topbar-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.service-back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    color: #fff;
    padding: 10px 16px;
    min-height: 42px;
    border-radius: 8px;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 10px) 100%, 0 100%, 0 8px);
    box-shadow: 0 10px 20px rgba(183, 28, 28, 0.22);
    font-size: 0.9rem;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-back-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(183, 28, 28, 0.28);
}

.service-back-button__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    color: #fff;
}

.topbar-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #dbe4ff;
    color: #1a237e;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.85rem;
    box-shadow: 0 4px 14px rgba(26,35,126,0.08);
}

.topbar-chip.warning {
    border-color: #ffd180;
    color: #e65100;
}

.notification-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #1a237e, #3949ab);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 12px 24px rgba(26,35,126,0.18);
}

.notification-badge {
    position: absolute;
    top: -6px;
    left: -6px;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #d32f2f;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0 6px;
    border: 2px solid #f0f2f5;
}

.notification-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 14px;
    text-decoration: none;
    border: 1px solid #e8eaf6;
    background: #fafbff;
    color: inherit;
}

.notification-row p {
    margin-top: 4px;
    color: #556;
}

.notification-row.success {
    border-right: 4px solid #2e7d32;
}

.notification-row.warning {
    border-right: 4px solid #ef6c00;
}

.notification-row.error {
    border-right: 4px solid #c62828;
}

.notification-row.info {
    border-right: 4px solid #1565c0;
}

/* Text Helpers */
.text-muted {
    color: #999;
    font-size: 0.9rem;
    text-align: center;
    padding: 20px;
}

/* Result Table */
.result-table table {
    border: 2px solid #e8eaf6;
    border-radius: 10px;
    overflow: hidden;
}

.result-table table th {
    background: #1a237e;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .main-content {
        margin-right: 0;
        padding: 20px 15px;
    }

    .app-container {
        flex-direction: column;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar {
        align-items: stretch;
    }

    .topbar-start,
    .topbar-actions {
        justify-content: space-between;
    }

    .notification-row {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .quick-links {
        grid-template-columns: 1fr 1fr;
    }

    .login-card {
        padding: 25px;
    }

    .actions-cell {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .quick-links {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .sidebar, .btn, form {
        display: none !important;
    }

    .main-content {
        margin: 0;
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Khunaini-inspired portal refresh */
body {
    background:
        radial-gradient(circle at top right, rgba(27,131,84,0.12), transparent 24%),
        linear-gradient(180deg, #f8fbf9 0%, #eef7f1 44%, #f8fbf9 100%);
    color: #13211b;
}

.sidebar {
    background: linear-gradient(180deg, #074d31 0%, #14573a 48%, #1b8354 100%);
    box-shadow: -8px 0 24px rgba(7, 77, 49, 0.18);
}

.sidebar .logo,
.sidebar nav a {
    color: rgba(255,255,255,0.92);
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: rgba(255,255,255,0.1);
    border-right-color: #9fe0be;
}

.main-content {
    padding: 26px;
}

.page-header h1,
.section-heading,
.card h3 {
    color: #074d31;
}

.stat-card,
.card,
.quick-link,
.notification-row,
.faq-item,
.faq-accordion,
.info-item {
    border: 1px solid rgba(219,231,223,0.95);
    border-radius: 18px;
    box-shadow: 0 16px 38px rgba(7, 77, 49, 0.07);
}

.stat-card,
.card {
    background: rgba(255,255,255,0.94);
}

.quick-link {
    background: linear-gradient(180deg, #ffffff, #f8fbf9);
}

.quick-link i,
.stat-card .number,
.info-item span {
    color: #074d31;
}

.quick-link:hover,
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 42px rgba(7, 77, 49, 0.12);
}

.btn-primary {
    background: linear-gradient(135deg, #14573a, #1b8354);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0d4b30, #156f47);
}

.btn-secondary {
    background: #fff;
    color: #074d31;
    border: 1px solid rgba(20, 87, 58, 0.18);
}

.btn-secondary:hover {
    background: #f2faf5;
}

.topbar {
    margin-bottom: 22px;
}

.topbar-chip {
    border-color: rgba(20,87,58,0.14);
    color: #074d31;
}

.topbar-chip.warning {
    color: #b45309;
    border-color: rgba(217,119,6,0.22);
    background: #fff9ec;
}

.portal-switch-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(7,77,49,0.08);
    color: #074d31;
    border: 1px solid rgba(7,77,49,0.12);
    text-decoration: none;
    font-weight: 700;
}

.portal-switch-button--admin {
    background: linear-gradient(135deg, #14573a, #1b8354);
    border-color: transparent;
    color: #fff;
}

.service-back-button[hidden] {
    display: none !important;
}

.portal-hero {
    border: 1px solid rgba(219,231,223,0.95);
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 22px;
    background: linear-gradient(135deg, rgba(7,77,49,0.96), rgba(27,131,84,0.9));
    color: #fff;
    box-shadow: 0 28px 56px rgba(7, 77, 49, 0.18);
}

.portal-hero--employee {
    background: linear-gradient(135deg, rgba(7,77,49,0.92), rgba(32,114,74,0.86));
}

.portal-hero__eyebrow {
    margin: 0 0 10px;
    color: rgba(255,255,255,0.74);
    font-size: 0.82rem;
    font-weight: 700;
}

.portal-hero__content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    flex-wrap: wrap;
}

.portal-hero__title {
    margin: 0;
    font-size: clamp(1.35rem, 2.4vw, 2rem);
    color: #fff;
}

.portal-hero__description {
    margin: 10px 0 0;
    max-width: 760px;
    color: rgba(255,255,255,0.86);
    line-height: 1.85;
}

.portal-hero__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.portal-quickstats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.portal-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.14);
    font-size: 0.88rem;
}

.portal-stat-pill strong {
    color: #fff;
}

.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.portal-grid--compact {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.portal-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 210px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(219,231,223,0.95);
    background: linear-gradient(180deg, #ffffff, #f8fbf9);
    color: #13211b;
    text-decoration: none;
    box-shadow: 0 18px 38px rgba(7, 77, 49, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.portal-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 46px rgba(7, 77, 49, 0.14);
}

.portal-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: rgba(27,131,84,0.1);
    color: #1b8354;
    font-size: 1.25rem;
}

.portal-card strong {
    display: block;
    color: #074d31;
    margin-bottom: 8px;
    font-size: 1rem;
}

.portal-card p {
    margin: 0;
    color: #486056;
    line-height: 1.75;
}

.portal-card__badge {
    margin-top: auto;
    width: fit-content;
    padding: 7px 11px;
    border-radius: 999px;
    background: #eef7f1;
    color: #14573a;
    font-size: 0.82rem;
    font-weight: 700;
}

.portal-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.portal-card-surface {
    background: rgba(255,255,255,0.96);
}

@media (max-width: 920px) {
    .portal-split {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .portal-hero {
        padding: 18px;
        border-radius: 20px;
    }

    .portal-hero__actions,
    .portal-quickstats {
        width: 100%;
    }

    .portal-switch-button,
    .portal-hero__actions .btn {
        width: 100%;
        justify-content: center;
    }

    .portal-card {
        min-height: 0;
    }
}

/* Structure service */
.structure-surface {
    border-radius: 22px;
    border: 1px solid rgba(20, 87, 58, 0.12);
    box-shadow: 0 20px 44px rgba(7, 77, 49, 0.08);
}

.structure-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.structure-form .form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.structure-form .form-group {
    margin-bottom: 14px;
}

.structure-form label {
    display: block;
    font-weight: 700;
    color: #074d31;
    margin-bottom: 6px;
}

.structure-form input,
.structure-form select,
.structure-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(20, 87, 58, 0.18);
    border-radius: 14px;
    background: #fff;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.96rem;
}

.structure-form textarea {
    resize: vertical;
    min-height: 96px;
}

.structure-form input[readonly] {
    background: #f5f7f6;
    color: #587064;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.structure-manager-list,
.structure-objectives-list,
.structure-tree {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.structure-manager-card,
.objective-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid rgba(20, 87, 58, 0.12);
    border-radius: 18px;
    padding: 14px 16px;
    background: #f9fcfa;
}

.structure-unit-card {
    position: relative;
    border: 1px solid rgba(20, 87, 58, 0.14);
    border-radius: 24px;
    padding: 18px;
    background: linear-gradient(180deg, #fff, #fbfdfb);
    box-shadow: 0 16px 34px rgba(7, 77, 49, 0.06);
    margin-right: calc(var(--depth) * 22px);
}

.structure-unit-card::before {
    content: '';
    position: absolute;
    top: 18px;
    bottom: 18px;
    right: -14px;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(27,131,84,0.8), rgba(7,77,49,0.28));
    opacity: calc(0.2 + (var(--depth) * 0.08));
}

.structure-unit-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.structure-unit-header h4 {
    margin: 6px 0 4px;
    font-size: 1.18rem;
    color: #0a3b28;
}

.structure-depth-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #edf7f1;
    color: #14573a;
    font-size: 0.82rem;
    font-weight: 700;
}

.structure-unit-badges,
.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.structure-content-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.structure-content-panel {
    border: 1px solid rgba(20, 87, 58, 0.1);
    border-radius: 18px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.92);
}

.structure-content-panel h5 {
    margin: 0 0 14px;
    font-size: 1rem;
    color: #0a3b28;
}

.empty-state.compact {
    border: 1px dashed rgba(20, 87, 58, 0.22);
    border-radius: 18px;
    padding: 18px;
    text-align: center;
    background: #fcfefd;
    color: #587064;
}

@media (max-width: 1080px) {
    .structure-content-grid,
    .structure-form .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .structure-unit-card {
        margin-right: 0;
    }

    .structure-unit-card::before {
        display: none;
    }

    .structure-manager-card,
    .objective-item {
        flex-direction: column;
    }
}
