/* Admin Panel Styles */

:root {
    --admin-primary: #1e3a5f;
    --admin-secondary: #2c5282;
    --admin-accent: #3182ce;
    --admin-success: #38a169;
    --admin-warning: #d69e2e;
    --admin-danger: #e53e3e;
    --admin-light: #f7fafc;
    --admin-white: #ffffff;
    --admin-text: #2d3748;
    --admin-border: #e2e8f0;
}

.admin-body {
    margin: 0;
    padding: 0;
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--admin-light);
}

[dir="rtl"] .admin-body {
    direction: rtl;
}

[dir="ltr"] .admin-body {
    direction: ltr;
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background: var(--admin-primary);
    color: var(--admin-white);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-title {
    padding: 15px 20px 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-title h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--admin-white);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.sidebar-header h2 {
    margin: 0 0 10px 0;
    font-size: 1.3rem;
}

.sidebar-header p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
    border-right: 3px solid transparent;
    line-height: 1.3;
    font-size: 0.95rem;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: var(--admin-white);
}

.sidebar-nav a.active {
    background: rgba(255,255,255,0.15);
    color: var(--admin-white);
    border-right-color: var(--admin-white);
}

.sidebar-divider {
    height: 1px;
    background: rgb(255, 255, 255);
    margin: 8px 20px;
    list-style: none;
    padding: 0;
}

.sidebar-nav i {
    width: 20px;
    font-size: 0.9rem;
    flex-shrink: 0;
}

[dir="rtl"] .sidebar-nav i {
    margin-left: 10px;
}

[dir="ltr"] .sidebar-nav i {
    margin-right: 10px;
}

/* Main Content Area */
.admin-main {
    flex: 1;
    min-height: 100vh;
}

[dir="rtl"] .admin-main {
    margin-right: 260px;
}

[dir="ltr"] .admin-main {
    margin-left: 260px;
}

.admin-header {
    background: var(--admin-white);
    padding: 20px 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    margin: 0;
    color: var(--admin-primary);
    font-size: 1.8rem;
}

.admin-user-info {
    color: var(--admin-text);
    font-size: 0.9rem;
}

.admin-content {
    padding: 30px;
}

/* Dashboard */
.dashboard {
    max-width: 1400px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--admin-white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    gap: 20px;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    border: 1px solid var(--admin-border);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--admin-primary), var(--admin-accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border-color: var(--admin-accent);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--admin-white);
    flex-shrink: 0;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
}

.stat-icon.news {
    background: linear-gradient(135deg, var(--admin-primary) 0%, var(--admin-secondary) 100%);
}

.stat-icon.announcements {
    background: linear-gradient(135deg, var(--admin-warning) 0%, #e5a12e 100%);
}

.stat-icon.photos {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon.videos {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-icon.issues {
    background: linear-gradient(135deg, #FF512F 0%, #DD2476 100%);
}

.stat-icon.documents {
    background: linear-gradient(135deg, var(--admin-accent) 0%, #4a9fe8 100%);
}

.stat-icon.projects {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-icon.users {
    background: linear-gradient(135deg, var(--admin-success) 0%, #48c78e 100%);
}

.stat-info {
    flex: 1;
}

.stat-info h3 {
    margin: 0 0 10px 0;
    color: var(--admin-text);
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--admin-primary);
    margin: 0;
}

.stat-label {
    font-size: 0.85rem;
    color: #718096;
}


.dashboard-section {
    background: var(--admin-white);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

.dashboard-section h2 {
    color: var(--admin-primary);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--admin-border);
}

/* Admin Page */
.admin-page {
    max-width: 100%;
    width: 100%;
}

.page-actions {
    margin-bottom: 25px;
}

/* Split Layout for Admin Pages (like users, documents) */
.admin-split-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
    align-items: start;
    width: 100%;
}

.admin-list-panel {
    min-width: 0;
    width: 100%;
}

.admin-edit-panel {
    background: var(--admin-white);
    border-radius: 8px;
    position: sticky;
    top: 20px;
    height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    min-width: 0;
}

.edit-panel-header {
    padding: 15px 20px;
    border-bottom: 2px solid var(--admin-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--admin-primary);
    color: var(--admin-white);
}

.edit-panel-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.edit-panel-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.edit-panel-placeholder {
    padding: 60px 20px;
    text-align: center;
    color: #999;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.edit-panel-placeholder i {
    display: block;
    margin-bottom: 15px;
}

#editFrame {
    width: 100%;
    height: 100%;
    border: none;
    flex: 1;
    min-height: 0;
}

/* Responsive Split Layout */
@media (max-width: 1400px) {
    .admin-split-layout {
        grid-template-columns: 1fr;
    }

    .admin-edit-panel {
        position: relative;
        top: 0;
        max-height: none;
    }

    .admin-edit-panel:not(.active) {
        display: none;
    }
}

@media (min-width: 1401px) {
    .admin-split-layout {
        grid-template-columns: 1.5fr 1fr;
    }
}

@media (max-width: 768px) {
    .admin-split-layout {
        gap: 15px;
    }
}

/* Filters */
.filters-container {
    background: var(--admin-white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

.filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
    background-color: #e3f2fd !important;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgb(154, 201, 255);
}

.filter-group {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    display: inline-block;
    margin-bottom: 0;
    color: var(--admin-text);
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-group input,
.filter-group select {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--admin-border);
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--admin-accent);
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-actions .btn {
    white-space: nowrap;
}

.filter-actions .reset-btn {
    min-width: 38px;
    padding: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.filter-actions .reset-btn i {
    margin: 0;
}

/* Data Table */
.data-table-container {
    background: var(--admin-white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--admin-primary);
    color: var(--admin-white);
}

.data-table th {
    padding: 15px;
    font-weight: 600;
}

[dir="rtl"] .data-table th {
    text-align: right;
}

[dir="ltr"] .data-table th {
    text-align: left;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid var(--admin-border);
}

.data-table tbody tr:hover {
    background: var(--admin-light);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.clickable-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

.clickable-row:hover {
    background: var(--admin-light) !important;
}

.clickable-row.selected {
    background: rgba(49, 130, 206, 0.1) !important;
    border-right: 3px solid var(--admin-primary);
}

[dir="rtl"] .clickable-row.selected {
    border-right: none;
    border-left: 3px solid var(--admin-primary);
}

/* Compact table rows */
.data-table.table-sm th {
    padding: 8px 12px;
}

.data-table.table-sm td {
    padding: 6px 12px;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: #718096;
    font-size: 0.9rem;
}

/* Hide details row on wide screens (every even row in tbody is the details row) */
/* Disabled - this was hiding every other row in tables without detail rows */
/* .table tbody tr:nth-child(even) {
    display: none;
} */

.actions {
    white-space: nowrap;
}

[dir="rtl"] .actions .btn {
    margin-left: 5px;
}

[dir="ltr"] .actions .btn {
    margin-right: 5px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: #c6f6d5;
    color: #22543d;
}

.badge-warning {
    background: #fefcbf;
    color: #744210;
}

.badge-danger {
    background: #fed7d7;
    color: #742a2a;
}

.badge-info {
    background: #bee3f8;
    color: #2c5282;
}

.badge-primary {
    background: #cfe2ff;
    color: #084298;
}

.badge-secondary {
    background: #e2e3e5;
    color: #41464b;
}

.badge-dark {
    background: #212529;
    color: #ffffff;
}

/* Forms - Unified, Compact, and Clear Styling */
.form-container {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

.form-container h2 {
    color: var(--admin-primary);
    margin: 0 0 20px 0;
    font-size: 1.3rem;
    font-weight: 600;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--admin-border);
}

.admin-form {
    background-color: transparent;
}

.admin-form .form-group {
    margin-bottom: 16px;
}

.admin-form label {
    display: block;
    margin-bottom: 6px;
    margin-top: 10px;
    color: var(--admin-primary);
    font-weight: 800;
    font-size: 0.85rem;
    line-height: 1;
    text-transform: none;
    letter-spacing: 0;
}

.admin-form label[for] {
    cursor: pointer;
}

.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="number"],
.admin-form input[type="date"],
.admin-form input[type="url"],
.admin-form input[type="password"],
.admin-form textarea,
.admin-form select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--admin-white);
    transition: all 0.2s ease;
    color: var(--admin-text);
    box-sizing: border-box;
}

.admin-form input[type="text"]:hover,
.admin-form input[type="email"]:hover,
.admin-form input[type="number"]:hover,
.admin-form input[type="date"]:hover,
.admin-form input[type="url"]:hover,
.admin-form input[type="password"]:hover,
.admin-form textarea:hover,
.admin-form select:hover {
    border-color: #b0b0b0;
}

.admin-form input[type="text"]:focus,
.admin-form input[type="email"]:focus,
.admin-form input[type="number"]:focus,
.admin-form input[type="date"]:focus,
.admin-form input[type="url"]:focus,
.admin-form input[type="password"]:focus,
.admin-form textarea:focus,
.admin-form select:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.1);
}

.admin-form input[type="text"]::placeholder,
.admin-form input[type="email"]::placeholder,
.admin-form input[type="number"]::placeholder,
.admin-form input[type="url"]::placeholder,
.admin-form input[type="password"]::placeholder,
.admin-form textarea::placeholder {
    color: #b0b0b0;
    opacity: 1;
}

.admin-form input:disabled,
.admin-form textarea:disabled,
.admin-form select:disabled {
    background: #f0f0f0;
    color: #999;
    cursor: not-allowed;
}

.admin-form input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: 2px solid #d0d0d0;
    border-radius: 4px;
    background: var(--admin-white);
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.admin-form input[type="checkbox"]:hover {
    border-color: var(--admin-primary);
}

.admin-form input[type="checkbox"]:checked {
    background-color: var(--admin-primary);
    border-color: var(--admin-primary);
}

.admin-form input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
}

.admin-form input[type="checkbox"]:focus {
    outline: 2px solid rgba(30, 58, 95, 0.2);
    outline-offset: 2px;
}

.admin-form input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f0f0f0;
}

[dir="rtl"] .admin-form input[type="checkbox"] {
    margin-right: 0;
    margin-left: 8px;
}

.admin-form input[type="file"] {
    width: 100%;
    font-size: 0.85rem;
}

.admin-form textarea {
    resize: vertical;
    min-height: 80px;
}

.admin-form select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
    appearance: none;
}

[dir="rtl"] .admin-form select {
    background-position: left 10px center;
    padding-right: 10px;
    padding-left: 30px;
}

.admin-form small {
    display: block;
    margin-top: 4px;
    color: #718096;
    font-size: 0.8rem;
    line-height: 1.3;
}

.admin-form .form-group[style*="grid-template-columns"] {
    display: grid;
    gap: 12px;
}

.admin-form .form-group[style*="grid-template-columns"] > div {
    display: flex;
    flex-direction: column;
}

.admin-form .form-group[style*="grid-template-columns"] label {
    margin-bottom: 6px;
}

/* Grid layout classes for form groups */
.admin-form .form-group.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.admin-form .form-group.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.admin-form .form-group.grid-2 > div,
.admin-form .form-group.grid-3 > div {
    display: flex;
    flex-direction: column;
}

.admin-form .form-group.grid-2 label,
.admin-form .form-group.grid-3 label {
    margin-bottom: 6px;
}

/* Image upload wrapper styling */
.admin-form .image-upload-wrapper {
    margin-top: 0;
}

.admin-form .image-preview {
    background: var(--admin-white);
    border: 1px solid #d0d0d0;
}

.admin-form .image-preview:hover {
    border-color: var(--admin-primary);
}

/* Required field indicator - use class or add * manually in HTML */
.admin-form label.required::after,
.admin-form .required-label::after {
    content: ' *';
    color: var(--admin-danger);
    font-weight: 600;
    margin-left: 2px;
}

/* Checkbox and radio styling */
.admin-form input[type="checkbox"] + label,
.admin-form input[type="radio"] + label {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0;
    margin-left: 6px;
    font-size: 0.9rem;
    color: var(--admin-text);
    font-weight: 400;
    cursor: pointer;
    user-select: none;
}

[dir="rtl"] .admin-form input[type="checkbox"] + label,
[dir="rtl"] .admin-form input[type="radio"] + label {
    margin-left: 0;
    margin-right: 6px;
}

/* Radio button styling */
.admin-form input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: 2px solid #d0d0d0;
    border-radius: 50%;
    background: var(--admin-white);
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.admin-form input[type="radio"]:hover {
    border-color: var(--admin-primary);
}

.admin-form input[type="radio"]:checked {
    border-color: var(--admin-primary);
}

.admin-form input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--admin-primary);
}

.admin-form input[type="radio"]:focus {
    outline: 2px solid rgba(30, 58, 95, 0.2);
    outline-offset: 2px;
}

.admin-form input[type="radio"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f0f0f0;
}

[dir="rtl"] .admin-form input[type="radio"] {
    margin-right: 0;
    margin-left: 8px;
}

.current-image img {
    border-radius: 4px;
    border: 2px solid var(--admin-border);
}

.current-file {
    background: var(--admin-light);
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--admin-border);
}

.form-actions .btn {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.form-actions .btn-primary {
    min-width: 150px;
}

.form-actions .btn-secondary {
    min-width: 100px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s;
    font-family: inherit;
}

.btn-primary {
    background: var(--admin-primary);
    color: var(--admin-white);
}

.btn-primary:hover {
    background: var(--admin-secondary);
}

.btn-secondary {
    background: #718096;
    color: var(--admin-white);
}

.btn-secondary:hover {
    background: #4a5568;
}

.btn-danger {
    background: var(--admin-danger);
    color: var(--admin-white);
}

.btn-danger:hover {
    background: #c53030;
}

.btn-info {
    background: var(--admin-primary);
    color: var(--admin-white);
}

.btn-info:hover {
    background: var(--admin-secondary);
    color: var(--admin-white);
}

.btn-success {
    background: var(--admin-success);
    color: var(--admin-white);
}

.btn-success:hover {
    background: #2f855a;
}

.btn-warning {
    background: var(--admin-warning);
    color: var(--admin-white);
}

.btn-warning:hover {
    background: #b7791f;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fed7d7;
    color: #742a2a;
    border-right: 4px solid var(--admin-danger);
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
    border-right: 4px solid var(--admin-success);
}

/* Flash Messages */
.flash-message {
    padding: 15px 20px;
    margin-bottom: 0;
    margin-left: auto;
    margin-right: auto;
    max-width: 600px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flash-success {
    background: #c6f6d5;
    color: #22543d;
    border-right: 4px solid var(--admin-success);
}

.flash-error {
    background: #fed7d7;
    color: #742a2a;
    border-right: 4px solid var(--admin-danger);
}

.flash-info {
    background: #bee3f8;
    color: #2c5282;
    border-right: 4px solid var(--admin-accent);
}

.close-flash {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
    padding: 0;
    margin-right: 10px;
}

/* Activity List */
.activity-list {
    max-height: 600px;
    overflow-y: auto;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.page-link {
    padding: 10px 15px;
    background: var(--admin-white);
    color: var(--admin-primary);
    text-decoration: none;
    border-radius: 4px;
    border: 2px solid var(--admin-border);
    transition: all 0.3s;
}

.page-link:hover {
    background: var(--admin-primary);
    color: var(--admin-white);
    border-color: var(--admin-primary);
}

.page-link.active {
    background: var(--admin-primary);
    color: var(--admin-white);
    border-color: var(--admin-primary);
}

/* No Content */
.no-content {
    text-align: center;
    padding: 40px 20px;
    color: #718096;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 70px;
        height: 100vh;
        position: fixed;
        top: 0;
        z-index: 1000;
        overflow-x: hidden;
    }

    [dir="rtl"] .admin-sidebar {
        right: 0;
    }

    [dir="ltr"] .admin-sidebar {
        left: 0;
    }
    
    [dir="rtl"] .admin-main {
        margin-right: 70px;
    }
    
    [dir="ltr"] .admin-main {
        margin-left: 70px;
    }
    
    .sidebar-nav a {
        font-size: 0;
        padding: 10px 0;
        text-align: center;
        position: relative; /* For badge positioning */
    }

    .sidebar-nav i {
        font-size: 1.4rem;
        margin: 0 !important;
        width: 100%;
        display: block;
        text-align: center;
    }
    
    .badge-flashing {
        position: absolute;
        top: 5px;
        right: 10px; /* Adjust based on design */
        font-size: 9px;
        min-width: 16px;
        height: 16px;
        padding: 2px;
    }
    
    [dir="rtl"] .badge-flashing {
        right: auto;
        left: 10px;
    }
    
    .sidebar-logo {
        margin-bottom: 10px;
    }
    
    .sidebar-logo img {
        max-width: 50px;
        width: 100%;
        height: auto;
    }
    
    .sidebar-profile {
        margin-bottom: 10px;
    }
    
    .sidebar-profile p {
        display: none;
    }
    
    .sidebar-profile-img {
        width: 40px;
        height: auto;
        max-width: 100%;
        aspect-ratio: 1 / 1;
        margin-bottom: 0;
        border-width: 2px;
    }
    
    .sidebar-header {
        padding: 15px 10px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .stat-card {
        padding: 15px;
        gap: 12px;
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        margin: 0 auto;
        border-radius: 10px;
    }
    
    .stat-info {
        width: 100%;
    }
    
    .stat-info h3 {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }
    
    .stat-number {
        font-size: 1.5rem;
        line-height: 1.2;
    }
    
    .stat-label {
        font-size: 0.75rem;
        display: block;
        margin-top: 4px;
    }
    
    .data-table-container {
        overflow-x: auto;
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    /* Show details row on mobile */
    .table tbody tr:nth-child(even) {
        display: table-row;
    }
    
    .table th,
    .table td {
        padding: 8px 6px;
        font-size: 0.8rem;
    }
    
    .table th {
        font-size: 0.75rem;
        white-space: nowrap;
    }
    
    .table.table-sm th,
    .table.table-sm td {
        padding: 6px 4px;
        font-size: 0.75rem;
    }
    
    .dashboard-section {
        padding: 15px;
    }
    
    .dashboard-section h2 {
        font-size: 1.2rem;
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    
    .activity-list {
        max-height: 400px;
    }
    
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .form-container {
        padding: 0;
    }
    
    .admin-form .form-group {
        margin-bottom: 14px;
    }
    
    .admin-form input[type="text"],
    .admin-form input[type="email"],
    .admin-form input[type="number"],
    .admin-form input[type="date"],
    .admin-form input[type="url"],
    .admin-form input[type="password"],
    .admin-form textarea,
    .admin-form select {
        padding: 7px 9px;
        font-size: 0.9rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .sidebar-logo img {
        max-width: 35px;
    }
    
    .sidebar-header {
        padding: 10px 5px;
    }
    
    .sidebar-profile-img {
        width: 35px;
        height: auto;
        aspect-ratio: 1 / 1;
        border-width: 2px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 12px;
        gap: 10px;
    }
    
    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
        border-radius: 8px;
    }
    
    .stat-info h3 {
        font-size: 0.8rem;
        margin-bottom: 5px;
    }
    
    .stat-number {
        font-size: 1.3rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    .table {
        font-size: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 6px 4px;
        font-size: 0.7rem;
    }
    
    .table th {
        font-size: 0.7rem;
    }
    
    .table.table-sm th,
    .table.table-sm td {
        padding: 4px 3px;
        font-size: 0.65rem;
    }
    
    .dashboard-section {
        padding: 12px;
    }
    
    .dashboard-section h2 {
        font-size: 1rem;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }
    
    .activity-list {
        max-height: 350px;
    }
    
    /* Hide less important columns on very small screens */
    .table th:nth-child(3),
    .table td:nth-child(3) {
        display: none;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--admin-primary);
    color: var(--admin-white);
    border-radius: 10px 10px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
}

.modal form {
    padding: 20px;
}

.modal .form-group {
    margin-bottom: 20px;
}

.modal .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.modal .form-control {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
    transition: border-color 0.3s;
}

.modal .form-control:focus {
    outline: none;
    border-color: var(--admin-primary);
}

.modal-footer {
    padding: 20px;
    border-top: 2px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f8f9fa;
    border-radius: 0 0 10px 10px;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
    line-height: 1;
}

.close:hover {
    transform: scale(1.2);
}

/* Button Styles */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Cairo', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--admin-primary);
    color: var(--admin-white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--admin-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.4);
}

.btn-secondary {
    background: #718096;
    color: var(--admin-white);
}

.btn-secondary:hover:not(:disabled) {
    background: #4a5568;
}

.btn-danger {
    background: var(--admin-danger);
    color: var(--admin-white);
}

.btn-danger:hover:not(:disabled) {
    background: #c53030;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.4);
}

.btn-success {
    background: var(--admin-success);
    color: var(--admin-white);
}

.btn-success:hover:not(:disabled) {
    background: #2f855a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 161, 105, 0.4);
}

.btn-warning {
    background: var(--admin-warning);
    color: var(--admin-white);
}

.btn-warning:hover:not(:disabled) {
    background: #b7791f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(214, 158, 46, 0.4);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.1rem;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-header h2 {
        font-size: 1.1rem;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Timeline Styles */
.timeline {
    position: relative;
    padding-left: 1rem;
    border-left: 2px solid #e9ecef;
}
.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}
.timeline-item:last-child {
    padding-bottom: 0;
}
.timeline-marker {
    position: absolute;
    left: -0.6rem;
    top: 0.2rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #e9ecef;
}

/* Hover Lift Effect */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15)!important;
}

/* Right-to-Left Support for Timeline */
[dir="rtl"] .timeline {
    padding-left: 0;
    padding-right: 1rem;
    border-left: none;
    border-right: 2px solid #e9ecef;
}
[dir="rtl"] .timeline-marker {
    left: auto;
    right: -0.6rem;
}
[dir="rtl"] .border-start {
    border-left: 0 !important;
    border-right: 4px solid #dc3545 !important;
}

/* Form Tabs */
.form-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0;
}

.tab-button {
    padding: 12px 20px;
    background: #f5f5f5;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
    position: relative;
    top: 2px;
}

.tab-button:hover {
    background: #e9e9e9;
    color: #333;
}

.tab-button.active {
    background: white;
    color: #3498db;
    border-bottom-color: #3498db;
    font-weight: 600;
}

.tab-button i {
    margin-left: 5px;
}

[dir="rtl"] .tab-button i {
    margin-left: 0;
    margin-right: 5px;
}

/* Form tabs (for users-edit.php) */
.admin-form .tab-content {
    display: none;
    padding: 20px 0;
    animation: fadeIn 0.3s;
}

.admin-form .tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Profile Photo */
.profile-photo-preview {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    border: 3px solid var(--admin-border);
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
}

.profile-photo-preview:hover {
    border-color: var(--admin-primary);
    transform: scale(1.05);
}

.profile-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-placeholder {
    width: 100%;
    height: 100%;
    background: var(--admin-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.profile-placeholder i {
    font-size: 50px;
}

.profile-photo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 4px;
}

.profile-photo-preview:hover .profile-photo-overlay {
    opacity: 1;
}

/* Status Toggle */
.status-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.status-toggle.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.status-toggle.disabled .status-toggle-slider {
    background-color: #d0d0d0 !important;
}

.status-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.status-toggle-slider {
    width: 48px;
    height: 24px;
    background-color: #d0d0d0;
    border-radius: 24px;
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
}

.status-toggle:hover:not(.disabled) .status-toggle-slider {
    border-color: rgba(30, 58, 95, 0.2);
}

.status-toggle-slider:before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    background-color: white;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.1);
}

[dir="rtl"] .status-toggle-slider:before {
    left: auto;
    right: 2px;
}

[dir="rtl"] .status-toggle input[type="checkbox"]:checked+.status-toggle-slider:before {
    transform: translateY(-50%) translateX(-24px);
}

.status-toggle input[type="checkbox"]:checked+.status-toggle-slider {
    background-color: var(--admin-success);
    border-color: var(--admin-success);
}

.status-toggle input[type="checkbox"]:checked+.status-toggle-slider:before {
    transform: translateY(-50%) translateX(24px);
    box-shadow: 0 2px 6px rgba(56, 161, 105, 0.3), 0 1px 3px rgba(56, 161, 105, 0.2);
}

.status-toggle input[type="checkbox"]:focus+.status-toggle-slider {
    outline: 2px solid rgba(30, 58, 95, 0.2);
    outline-offset: 2px;
}

.status-toggle-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--admin-text);
    min-width: 60px;
}

.status-toggle-label .status-active {
    display: none;
    color: var(--admin-success);
}

.status-toggle-label .status-inactive {
    display: inline-block;
    color: #718096;
}

.status-toggle-wrapper.status-active .status-toggle-label .status-active {
    display: inline-block;
}

.status-toggle-wrapper.status-active .status-toggle-label .status-inactive {
    display: none;
}

/* Password Clear Button */
.admin-form #password {
    padding-right: 35px;
}

/* Household Section */
.household-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.household-members-list .table {
    width: 100%;
    margin-bottom: 0;
    background-color: white;
}

/* CRITICAL: Override global rule that hides even rows */
.household-section .table tbody tr,
.household-section .table tbody tr:nth-child(even),
.household-section .table tbody tr:nth-child(odd) {
    display: table-row !important;
}

/* Invoice Edit Page Styles */
.invoice-item-row:hover {
    background: rgb(222, 226, 231) !important;
}

.invoice-item-row .item-total {
    font-weight: 600;
    color: var(--admin-primary);
    background: var(--admin-white);
}

#subtotal,
#vat_amount {
    font-size: 1.1rem;
    color: var(--admin-text);
}

#total_amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--admin-primary);
}

/* Autocomplete Styles */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--admin-border);
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.autocomplete-suggestions.show {
    display: block;
}

.autocomplete-suggestion {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
    white-space: nowrap;
    overflow: hidden;
}

.autocomplete-suggestion:hover,
.autocomplete-suggestion.highlighted {
    background-color: #f0f7ff;
}

.autocomplete-suggestion:last-child {
    border-bottom: none;
}

.suggestion-description {
    font-weight: 500;
    color: var(--admin-text);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-details {
    font-size: 0.85rem;
    color: #718096;
    display: flex;
    gap: 15px;
    flex-wrap: nowrap;
    overflow: hidden;
    white-space: nowrap;
}

.suggestion-details span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.suggestion-details i {
    font-size: 0.75rem;
}

.suggestion-details .badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .invoice-item-row .row>div {
        margin-bottom: 10px;
    }
}

/* ========================================
   Common Form Styles (for all admin forms)
   ======================================== */

/* ========================================
   Common Form Styles (for all admin forms)
   ======================================== */

/* Form Container */
.admin-form,
.standard-form,
.library-post-form,
.form-light {
    background-color: #e8e8e8;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Form Labels - Common Style */
.admin-form label,
.standard-form label,
.library-post-form label,
.form-light label,
.admin-form .form-label,
.standard-form .form-label,
.library-post-form .form-label,
.form-light .form-label {
    display: block;
    margin-bottom: 4px;
    color: #0d324d;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Form Controls */
.admin-form .form-control,
.standard-form .form-control,
.library-post-form .form-control,
.form-light .form-control {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.admin-form .form-control:focus,
.standard-form .form-control:focus,
.library-post-form .form-control:focus,
.form-light .form-control:focus {
    border-color: #0d324d;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(13, 50, 77, 0.25);
}

/* Form Select */
.admin-form .form-select,
.standard-form .form-select,
.library-post-form .form-select,
.form-light .form-select {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.admin-form .form-select:focus,
.standard-form .form-select:focus,
.library-post-form .form-select:focus,
.form-light .form-select:focus {
    border-color: #0d324d;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(13, 50, 77, 0.25);
}

/* Form Textarea */
.admin-form textarea.form-control,
.standard-form textarea.form-control,
.library-post-form textarea.form-control,
.form-light textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Required Field Indicator */
.admin-form label .text-danger,
.standard-form label .text-danger,
.library-post-form label .text-danger,
.form-light label .text-danger,
.admin-form .form-label .text-danger,
.standard-form .form-label .text-danger,
.library-post-form .form-label .text-danger,
.form-light .form-label .text-danger {
    color: #dc3545;
    margin-right: 4px;
}

/* Form Groups */
.admin-form .form-group,
.standard-form .form-group,
.library-post-form .form-group,
.form-light .form-group {
    margin-bottom: 1rem;
}

/* Form Help Text */
.admin-form .form-text,
.standard-form .form-text,
.library-post-form .form-text,
.form-light .form-text {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
}
