@import url('https://fonts.googleapis.com/css2?family=Assistant:wght@300;400;600;700&display=swap');

:root {
    --primary-color: #0056b3;
    --secondary-color: #f8f9fa;
    --text-color: #333;
    --bg-color: #f4f7f6;
    --accent-color: #17a2b8;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --card-shadow: 0 4px 6px rgba(0,0,0,0.1);
    --header-height: 60px;
}

body {
    font-family: 'Assistant', Arial, sans-serif !important;
    background-color: var(--bg-color) !important;
    background-image: none !important;
    color: var(--text-color);
    margin: 0;
    padding-top: var(--header-height); /* Space for fixed header */
    direction: rtl;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}
a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.2s;
}
a:hover {
    color: #003d82;
    text-decoration: underline;
}

/* Layout Containers */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header / Navigation */
.main-header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1000;
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    justify-content: space-between;
}

.nav-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-links a {
    color: #555;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 5px 10px;
    border-radius: 4px;
}
.nav-links a:hover {
    background-color: #e9ecef;
    color: var(--primary-color);
    text-decoration: none;
}
.user-info {
    font-size: 0.9rem;
    color: #777;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    padding: 20px;
    margin-bottom: 20px;
}

/* Tables - Modernize the old tables */
table {
    border-collapse: collapse !important; 
    /* width: 100%; often tables are width 100% but sometimes not */
    margin-bottom: 1rem;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

th, td {
    padding: 12px 15px;
    text-align: right; /* RTL default */
    border-bottom: 1px solid #e9ecef !important;
    border: none; /* override old borders */
}

th {
    background-color: #f8f9fa;
    font-weight: 700;
    color: #495057;
    border-bottom: 2px solid #dee2e6 !important;
}

tr:hover {
    background-color: #f1f3f5;
}

/* Inputs & Forms */
input[type="text"], 
input[type="password"], 
input[type="email"], 
input[type="number"], 
select, 
textarea {
    display: inline-block;
    width: auto;
    padding: 8px 12px;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent-color);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.25);
}

/* Buttons */
input[type="submit"], button, .btn {
    display: inline-block;
    font-weight: 600;
    color: #fff;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    background-color: var(--primary-color);
    border: 1px solid transparent;
    padding: 8px 16px;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 4px;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

input[type="submit"]:hover, button:hover, .btn:hover {
    background-color: #004494;
    text-decoration: none;
}

/* Utility to hide old junk */
.hidden { display: none !important; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .container { padding: 10px; }
    table { display: block; overflow-x: auto; }
    .nav-links { display: none; /* simple hide for mobile for now or stack */ }
}

/* Dashboard styles for menu.asp */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.dashboard-card {
    display: flex !important;
    gap: 10px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 120px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #eee;
    text-decoration: none !important;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    background-color: #fff;
}

.dashboard-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.welcome-box {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    text-align: center;
    margin-bottom: 30px;
}

.section-title {
    margin-top: 40px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Footer improvements */
.footer {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    margin-top: 40px;
    font-size: 0.9rem;
    border-top: 1px solid #eee;
}

/* Specific overrides for legacy classes */
.style1, .style2, .style3, .style7, .style8, .style12 {
    font-family: 'Assistant', sans-serif !important;
}

/* Page Header */
.page-header {
    margin-bottom: 25px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 15px;
    text-align: center;
}

.page-header h1 {
    margin: 0;
    font-size: 1.8rem;
    text-align: center;
    display: block;
    width: 100%;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: #004494;
    color: white;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}
.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}
.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}
.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeeba;
}

/* Action Bar for buttons below header */
.action-bar {
    text-align: right;
    margin-bottom: 20px;
    padding: 0 10px;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.filter-links a {
    margin: 0 5px;
    color: #555;
    font-size: 0.95rem;
}
.filter-links a:hover {
    color: var(--primary-color);
}

/* Data Table Specifics */
.data-table {
    width: 100%;
}
.data-table tr:nth-child(even) {
    background-color: #f9f9f9;
}
.data-table tr:hover {
    background-color: #eef2f5;
}
.row-link {
    display: block;
    color: #333;
    font-weight: 600;
}
