/* =====================================
   1. General & Global Styles
   ==================================== */
:root {
    /* Main brand colors (Facebook inspired) */
    --primary-color: #1877F2;   /* Facebook Blue */
    --secondary-color: #42B72A; /* Facebook Green (for success/accents) */
    --accent-color: #F0F2F5;    /* Light gray for subtle backgrounds */

    /* Neutrals for backgrounds and text */
    --background-light: #F0F2F5; /* Very light gray, typical Facebook background */
    --background-mid: #E4E6EB;   /* Slightly darker gray for subtle separation */
    --background-dark: #3A3B3C;  /* Dark gray for text on dark elements */
    --text-dark: #050505;        /* Near black for main text */
    --text-light: #FFFFFF;       /* Pure white for text on dark backgrounds */
    --border-color: #CED0D4;     /* Light gray for borders */

    /* Feedback colors (standard, but integrated) */
    --success-color: #42B72A;    /* Facebook Green */
    --error-color: #FA383E;      /* Clear red for errors */
    --warning-color: #F8B300;    /* Standard yellow/orange for warnings */

    /* Shadows (Subtle, flat design approach) */
    --shadow-light: 0 1px 2px rgba(0, 0, 0, 0.08); /* Very subtle */
    --shadow-medium: 0 2px 4px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06); /* Standard card shadow */
    --shadow-heavy: 0 4px 8px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.08); /* Slightly more pronounced */
    --shadow-inset: none; /* Removed inset shadow for flatter look */

    /* Logo Specific */
    --header-logo-height: 40px; /* Height for logo in header */
    --sidebar-logo-height: 60px; /* Height for logo in sidebar */
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif; /* Facebook-like font stack */
    margin: 0;
    padding: 0;
    background: var(--background-light); /* Solid light background */
    color: var(--text-dark);
    line-height: 1.34; /* Facebook's typical line-height for text */
    min-height: 100vh;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Dashboard Layout Specifics */
.dashboard-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "sidebar header"
        "sidebar main"
        "sidebar footer";
    min-height: 100vh;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
    background-color: transparent;
}

/* Base container styles for content within main area */
.container {
    max-width: 980px; /* Slightly wider for more content space */
    width: 95%;
    margin: 40px auto; /* More vertical padding */
    padding: 30px; /* Increased padding for a tighter look */
    background-color: var(--text-light); /* White background for content cards */
    border-radius: 10px; /* Standard rounded corners */
    box-shadow: var(--shadow-medium); /* Subtle shadow for content cards */
    overflow: hidden;
    position: relative;
    z-index: 1;
    border: none; /* Removed subtle container border */
}

/* =====================================
   2. Typography
   ===================================== */
h1, h2, h3, h4 {
    color: var(--text-dark);
    font-weight: 700;
    margin-bottom: 25px; /* Increased margin */
    text-align: center;
    line-height: 1.2;
}

h1 {
    font-size: 2.6em; /* Slightly smaller for Facebook's less aggressive titles */
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color); /* Thinner, neutral underline */
    padding-bottom: 18px; /* Increased padding */
    margin-top: 0;
    text-transform: none; /* No uppercase for a softer look */
    letter-spacing: normal; /* Normal letter spacing */
    text-shadow: none; /* Removed text shadow */
}

h2 {
    font-size: 2.1em; /* Slightly smaller */
    margin-top: 35px; /* Increased space */
    color: var(--text-dark);
    position: relative;
    padding-bottom: 12px; /* Increased padding */
    text-shadow: none; /* Removed text shadow */
}
h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 50px; /* Shorter underline */
    height: 2px; /* Thinner underline */
    background-color: var(--border-color); /* Neutral underline */
    border-radius: 1px;
}

h3 {
    font-size: 1.6em; /* Slightly smaller */
    color: var(--text-dark); /* Dark text for headings */
    text-align: left;
    margin-bottom: 18px; /* Increased margin */
}

p {
    margin-bottom: 18px; /* Increased margin */
    font-size: 1.05em; /* Standard paragraph text size */
    color: var(--text-dark);
}

ul {
    list-style: none;
    padding: 0;
    margin: 25px 0; /* Increased margin */
}

ul li {
    margin-bottom: 12px; /* Increased margin */
    font-size: 1.05em; /* Slightly larger */
    color: var(--text-dark);
    position: relative;
    padding-left: 30px; /* Increased padding */
}
ul li::before {
    content: '•';
    color: var(--primary-color); /* Primary color bullet */
    position: absolute;
    left: 0;
    font-size: 1.2em; /* Slightly larger */
    line-height: 1;
    top: 2px;
}

/* =====================================
   3. Forms & Inputs
   ===================================== */
form {
    display: flex;
    flex-direction: column;
    gap: 18px; /* Increased space in forms */
    padding: 25px; /* Increased padding */
    border: 1px solid var(--border-color);
    border-radius: 10px; /* Standard rounded corners */
    background: var(--text-light); /* Solid white background for forms */
    box-shadow: var(--shadow-light); /* Subtle shadow for forms */
}

label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px; /* Increased space below labels */
    display: block;
    font-size: 1em; /* Slightly larger */
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 12px 15px; /* Increased padding */
    border: 1px solid var(--border-color);
    border-radius: 8px; /* Standard rounded inputs */
    box-sizing: border-box;
    font-size: 1.05em; /* Slightly larger */
    color: var(--text-dark);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: var(--text-light); /* Solid white background */
    box-shadow: none; /* Removed inset shadow for flatter look */
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.2); /* Subtle focus ring */
    outline: none;
    background-color: var(--text-light); /* Keep white background on focus */
}

button[type="submit"],
.btn {
    background: var(--primary-color); /* Solid primary color for buttons */
    color: var(--text-light);
    padding: 14px 25px; /* Increased padding */
    border: none;
    border-radius: 8px; /* Standard rounded button corners */
    cursor: pointer;
    font-size: 1.05em; /* Slightly larger */
    font-weight: bold;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.1s ease;
    align-self: flex-start;
    box-shadow: var(--shadow-light); /* Subtle button shadow */
    position: relative;
    top: 0;
    min-width: 140px; /* Adjusted min-width */
    height: 45px; /* Adjusted min-height */
    display: flex;
    justify-content: center;
    align-items: center;
}

button[type="submit"]:hover,
.btn:hover {
    background-color: #166FE5; /* Slightly darker blue on hover */
    transform: translateY(-1px); /* Very subtle lift */
    box-shadow: var(--shadow-medium); /* Slightly stronger shadow on hover */
}

button[type="submit"]:active,
.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-light); /* No inset, just subtle shadow */
    background: #166FE5; /* Solid color when pressed */
}


.form-error, .form-success {
    padding: 15px 25px; /* Increased padding */
    border-radius: 8px; /* Standard rounded */
    margin-bottom: 25px; /* Increased margin */
    font-size: 1em; /* Slightly larger */
    box-shadow: var(--shadow-light);
}

.form-error {
    background-color: #FEEAEA;
    color: var(--error-color);
    border: 1px solid #FECACA;
}

.form-success {
    background-color: #E8FCEF;
    color: var(--success-color);
    border: 1px solid #A7F3D0;
}

/* =====================================
   4. Navigation & Layout (Dashboard Specific)
   ===================================== */
.dashboard-header {
    grid-area: header;
    background: var(--text-light); /* White header background */
    color: var(--text-dark);
    padding: 18px 30px; /* Increased padding */
    box-shadow: var(--shadow-light); /* Very subtle shadow */
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    border-bottom: 1px solid var(--border-color); /* Subtle bottom border */
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Hide text title when logo is present */
.app-title span {
    display: none;
}
.app-title img { /* Style for logo in header */
    max-height: var(--header-logo-height);
    width: auto;
    display: block; /* Remove extra space below image */
}

.user-info {
    font-size: 0.95em; /* Slightly larger user info */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px; /* Increased space */
    color: #65676B; /* Facebook's typical secondary text color */
}

.user-info strong {
    color: var(--text-dark); /* User email in dark text */
    font-weight: 600;
}

.datetime {
    font-size: 0.85em; /* Slightly larger datetime */
    opacity: 1; /* Fully opaque */
}

.language-switcher {
    display: flex;
    gap: 10px;
    margin-left: 20px; /* Space from user info */
}

.language-switcher a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.language-switcher a:hover {
    background-color: var(--accent-color);
    color: var(--text-dark);
}

.language-switcher a.active-lang {
    background-color: var(--primary-color);
    color: var(--text-light);
}


.dashboard-sidebar {
    grid-area: sidebar;
    background: var(--text-light); /* White sidebar background */
    color: var(--text-dark);
    padding: 25px 0; /* Increased padding */
    box-shadow: var(--shadow-light); /* Subtle shadow */
    display: flex;
    flex-direction: column;
    align-items: center;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 9;
    border-right: 1px solid var(--border-color); /* Subtle right border */
}

/* Hide text logo when image is present */
.sidebar-logo span {
    display: none;
}
.sidebar-logo img { /* Style for logo in sidebar */
    max-height: var(--sidebar-logo-height);
    width: auto;
    margin-bottom: 35px; /* Increased space below logo image */
    display: block; /* Remove extra space below image */
}


.sidebar-nav {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.sidebar-nav .nav-item {
    color: var(--text-dark); /* Dark text for nav items */
    text-decoration: none;
    padding: 15px 22px; /* Increased padding */
    font-weight: 500; /* Lighter font weight */
    font-size: 1.05em; /* Slightly larger */
    transition: background-color 0.2s ease, color 0.2s ease;
    border-left: none; /* Removed left border */
    border-radius: 0; /* No individual link backgrounds */
    position: relative;
    top: 0;
    min-height: 45px; /* Adjusted touch target */
    display: flex;
    align-items: center;
    box-shadow: none; /* Removed shadow */
}

/* Icon styling for nav items */
.sidebar-nav .nav-item i {
    margin-right: 12px; /* Increased space */
    font-size: 1.15em; /* Slightly larger icon */
    color: #65676B; /* Secondary text color for icons */
    transition: color 0.2s ease;
}


.sidebar-nav .nav-item:hover {
    background-color: var(--accent-color); /* Light gray background on hover */
    color: var(--text-dark); /* Keep dark text on hover */
    border-left-color: transparent;
    transform: none; /* Removed transform */
}
/* Icon color change on hover */
.sidebar-nav .nav-item:hover i {
    color: var(--primary-color); /* Primary color for icon on hover */
}

.sidebar-nav .nav-item.active {
    background-color: var(--accent-color); /* Light gray background for active */
    color: var(--primary-color); /* Primary color for active text */
    border-left: 3px solid var(--primary-color); /* Subtle left border highlight */
    font-weight: 600;
    box-shadow: none; /* Removed shadow */
}
/* Icon color for active state */
.sidebar-nav .nav-item.active i {
    color: var(--primary-color); /* Primary color for icon when active */
}


.sidebar-nav .nav-item.logout {
    margin-top: auto;
    border-top: 1px solid var(--border-color); /* Neutral border */
    text-align: center;
    padding: 18px 0; /* Increased padding */
    color: var(--error-color);
}
.sidebar-nav .nav-item.logout:hover {
    background-color: #FEEAEA; /* Light red background on hover */
    border-left-color: transparent;
    color: var(--error-color);
}
.sidebar-nav .nav-item.logout i {
    color: var(--error-color); /* Error color for logout icon */
}


.dashboard-main-content {
    grid-area: main;
    padding: 25px; /* Increased padding */
    background-color: var(--background-light);
    overflow-y: auto;
}

.dashboard-footer {
    grid-area: footer;
    background: var(--text-light); /* White footer background */
    color: #65676B; /* Facebook's typical secondary text color */
    text-align: center;
    padding: 15px 25px; /* Increased padding */
    font-size: 0.9em; /* Slightly larger footer text */
    box-shadow: var(--shadow-light); /* Subtle shadow */
    z-index: 10;
    border-top: 1px solid var(--border-color); /* Subtle top border */

    /* Flexbox for footer content */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow content to wrap on smaller screens */
    gap: 10px; /* Space between items */
}

.dashboard-footer p {
    margin: 0; /* Remove default paragraph margin */
    flex-grow: 1; /* Allow paragraph to take available space */
    text-align: left; /* Align text to left */
}

.qr-code-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-left: 20px; /* Space from copyright text */
    flex-shrink: 0; /* Prevent shrinking */
}

.qr-code-container .qr-text {
    font-size: 0.75em; /* Smaller text for QR code label */
    color: #65676B;
    margin: 0;
}

.qr-code-img {
    width: 60px; /* Fixed size for QR code */
    height: 60px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
}


/* Chart Specific Styles */
.chart-card {
    background-color: var(--text-light);
    border-radius: 10px;
    box-shadow: var(--shadow-medium);
    padding: 20px;
    margin-top: 30px;
    height: 400px; /* Fixed height for consistent chart display */
    display: flex;
    justify-content: center;
    align-items: center;
}
canvas {
    max-width: 100%;
    max-height: 100%;
}

/* Dashboard Grid for Charts/Notice Board */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr; /* Default to single column */
    gap: 30px; /* Space between grid items */
    margin-top: 30px;
}

.grid-item {
    background-color: var(--text-light);
    border-radius: 10px;
    box-shadow: var(--shadow-medium);
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.notice-board-card h2 {
    text-align: left; /* Align notice board title left */
    margin-top: 0; /* Remove extra top margin */
    margin-bottom: 15px;
    position: relative; /* For ::after pseudo-element */
    padding-bottom: 10px;
}
.notice-board-card h2::after {
    left: 0; /* Align underline to left */
    transform: none; /* Remove transform */
}

.notice-content {
    font-size: 0.95em;
    line-height: 1.5;
    color: #333;
}
.notice-content p {
    margin-bottom: 10px;
}
.notice-content strong {
    color: var(--primary-color);
}
.notice-content em {
    display: block;
    margin-top: 15px;
    font-size: 0.85em;
    color: #65676B;
    text-align: right; /* Align date to right */
}


/* =====================================
   5. Tables & Reports
   ===================================== */
.report-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 30px; /* Increased margin */
    border: 1px solid var(--border-color);
    border-radius: 10px; /* Standard rounded */
    overflow: hidden;
    box-shadow: var(--shadow-medium); /* Standard shadow */
}

.report-table th, .report-table td {
    padding: 18px 20px; /* Increased padding */
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.report-table th {
    background-color: var(--background-light); /* Light header background */
    font-weight: 600; /* Lighter font weight */
    color: #65676B; /* Secondary text color for headers */
    text-transform: none; /* No uppercase */
    font-size: 0.95em; /* Slightly larger */
    letter-spacing: normal;
}

.report-table tbody tr:last-child td {
    border-bottom: none;
}

.report-table tbody tr:nth-child(even) {
    background-color: var(--text-light); /* White background */
}

.report-table tbody tr:hover {
    background-color: var(--background-light); /* Lighter background on hover */
    cursor: pointer;
}

.status-pending {
    color: var(--warning-color);
    font-weight: 600;
    background-color: #FFFBEA;
    padding: 5px 10px; /* Increased padding */
    border-radius: 5px;
}

.status-completed {
    color: var(--success-color);
    font-weight: 600;
    background-color: #E6FCEB;
    padding: 5px 10px;
    border-radius: 5px;
}

.status-in_progress {
    color: var(--primary-color);
    font-weight: 600;
    background-color: #E0F2EF; /* Light primary background */
    padding: 5px 10px;
    border-radius: 5px;
}

/* =====================================
   6. Buttons (General)
   ===================================== */
.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: #166FE5;
}

.btn-delete {
    background-color: var(--error-color);
    color: var(--text-light);
    border: none;
    padding: 12px 18px; /* Increased padding */
    border-radius: 8px; /* Standard rounded */
    cursor: pointer;
    font-size: 0.95em; /* Slightly larger */
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: var(--shadow-light);
    position: relative;
    top: 0;
}

.btn-delete:hover {
    background-color: #D62929;
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}
.btn-delete:active {
    transform: translateY(0);
    box-shadow: var(--shadow-light);
}


/* =====================================
   7. Specific Components (Audit Form Builder, Question Blocks)
   ===================================== */
.question-builder {
    border: 1px solid var(--border-color);
    padding: 30px; /* Increased padding */
    border-radius: 10px; /* Standard rounded */
    margin-bottom: 30px; /* Increased margin */
    background-color: var(--text-light);
    box-shadow: var(--shadow-medium);
}

.question-builder-item {
    display: flex;
    flex-wrap: wrap;
    gap: 15px; /* Increased space */
    align-items: center;
    margin-bottom: 20px; /* Increased margin */
    padding: 15px; /* Increased padding */
    border: 1px solid var(--border-color); /* Solid border */
    border-radius: 8px; /* Standard rounded */
    background-color: var(--background-light); /* Lighter background */
    box-shadow: none; /* Removed shadow */
}

.question-builder-item input[type="text"],
.question-builder-item select {
    flex: 1 1 280px; /* Adjusted min-width */
}

.question-block {
    margin-bottom: 25px; /* Increased margin */
    padding: 25px; /* Increased padding */
    border: 1px solid var(--border-color);
    background: var(--text-light); /* Solid white background */
    border-radius: 10px; /* Standard rounded */
    box-shadow: var(--shadow-medium);
}

.question-text {
    font-weight: 600;
    color: var(--text-dark); /* Dark text for question text */
    margin-bottom: 10px; /* Increased margin */
    font-size: 1.15em; /* Slightly larger */
}

.response-text {
    padding-left: 18px; /* Increased padding */
    border-left: 3px solid var(--border-color); /* Neutral border */
    font-size: 1.05em; /* Slightly larger */
    color: var(--text-dark);
}

.file-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.file-link:hover {
    color: #166FE5;
    text-decoration: underline;
}

/* =====================================
   8. Responsive Adjustments
   ===================================== */
@media (min-width: 769px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr; /* Two columns on larger screens */
    }
}

@media (max-width: 1024px) {
    .container {
        margin: 30px auto;
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr auto;
        grid-template-areas:
            "header"
            "sidebar"
            "main"
            "footer";
    }

    .dashboard-sidebar {
        position: relative;
        height: auto;
        box-shadow: var(--shadow-medium); /* Adjusted shadow */
        border-radius: 0;
        padding: 10px 0;
    }

    .sidebar-logo {
        margin-bottom: 10px;
        font-size: 1.5em; /* Adjusted font size for text fallback */
    }
    .sidebar-logo img { /* Ensure image scales down on mobile */
        max-height: 40px; /* Smaller height for mobile sidebar logo */
        margin-bottom: 10px;
    }


    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px; /* Increased gap */
    }

    .sidebar-nav .nav-item {
        padding: 10px 15px; /* Increased padding */
        font-size: 0.95em; /* Slightly larger */
        border-bottom: 2px solid transparent; /* Thinner border */
    }
    .sidebar-nav .nav-item:hover {
        border-bottom-color: var(--primary-color); /* Primary color for hover */
    }
    .sidebar-nav .nav-item.active {
        border-bottom-color: var(--primary-color); /* Primary color for active */
    }
    .sidebar-nav .nav-item.logout {
        border-bottom: 2px solid var(--error-color); /* Error color for logout */
    }
    .sidebar-nav .nav-item.logout:hover {
        border-bottom-color: var(--error-color);
    }

    .dashboard-header {
        padding: 15px 20px; /* Increased padding */
        flex-direction: column;
        text-align: center;
    }

    .app-title {
        font-size: 1.5em; /* Slightly larger */
        margin-bottom: 10px; /* Increased margin */
    }
    .app-title img { /* Ensure image scales down on mobile */
        max-height: 35px; /* Slightly larger height for mobile header logo */
    }


    .user-info {
        align-items: center;
        font-size: 0.9em; /* Slightly larger font size */
    }

    .container {
        margin: 20px auto; /* Increased margin */
        padding: 20px; /* Increased padding */
        width: 95%;
    }

    h1 {
        font-size: 2.1em; /* Slightly larger */
        padding-bottom: 15px; /* Increased padding */
    }

    h2 {
        font-size: 1.7em; /* Slightly larger */
        margin-top: 30px; /* Increased margin */
    }
    h2::after {
        width: 40px; /* Longer underline */
        height: 2px;
    }

    h3 {
        font-size: 1.4em; /* Slightly larger */
    }

    form {
        padding: 15px; /* Increased padding */
        gap: 15px; /* Increased gap */
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    textarea,
    select,
    button[type="submit"],
    .btn {
        padding: 12px 15px; /* Increased padding */
        font-size: 1em; /* Slightly larger */
    }

    button[type="submit"],
    .btn {
        height: 40px; /* Slightly larger height */
    }

    .question-builder-item {
        padding: 12px; /* Increased padding */
        gap: 10px; /* Increased gap */
    }

    .report-table th, .report-table td {
        padding: 12px; /* Increased padding */
        font-size: 0.85em; /* Slightly larger */
    }

    ul li {
        font-size: 1em; /* Slightly larger */
        padding-left: 25px; /* Increased padding */
    }

    .dashboard-footer .footer-content {
        flex-direction: column; /* Stack items vertically */
        text-align: center;
    }
    .dashboard-footer p {
        text-align: center; /* Center text */
    }
    .qr-code-container {
        margin-left: 0; /* Remove left margin */
        margin-top: 10px; /* Add top margin */
    }
}

@media (max-width: 480px) {
    .container {
        margin: 15px auto; /* Increased margin */
        padding: 15px; /* Increased padding */
    }

    h1 {
        font-size: 1.8em; /* Slightly larger */
    }

    h2 {
        font-size: 1.5em; /* Slightly larger */
    }
}


/* RTL Styles */
html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] h3,
html[dir="rtl"] .dashboard-footer p {
    text-align: right;
}

html[dir="rtl"] ul li {
    padding-left: 0;
    padding-right: 30px; /* Adjust padding for RTL */
}

html[dir="rtl"] ul li::before {
    left: auto;
    right: 0; /* Position bullet on the right for RTL */
}

html[dir="rtl"] .dashboard-layout {
    grid-template-areas:
        "header sidebar" /* Flip sidebar and header */
        "main sidebar"
        "footer sidebar";
}

html[dir="rtl"] .dashboard-sidebar {
    border-right: none;
    border-left: 1px solid var(--border-color); /* Border on left for RTL */
    box-shadow: var(--shadow-light); /* Still subtle shadow */
}

html[dir="rtl"] .sidebar-nav .nav-item {
    border-left: none;
    border-right: 5px solid transparent; /* Highlight border on right for RTL */
}

html[dir="rtl"] .sidebar-nav .nav-item:hover {
    border-left-color: transparent;
    border-right-color: var(--secondary-color); /* Hover border on right */
    transform: translateX(-5px); /* Slide effect to the left */
}

html[dir="rtl"] .sidebar-nav .nav-item.active {
    border-left-color: transparent;
    border-right-color: var(--primary-color); /* Active border on right */
    transform: translateX(-5px); /* Keep active slide effect */
}

html[dir="rtl"] .sidebar-nav .nav-item i {
    margin-right: 0;
    margin-left: 12px; /* Space between icon and text for RTL */
}

html[dir="rtl"] .dashboard-header .user-info {
    align-items: flex-start; /* Align user info to start for RTL */
}

html[dir="rtl"] .dashboard-header .language-switcher {
    margin-left: 0;
    margin-right: 20px; /* Space from user info for RTL */
}

html[dir="rtl"] .dashboard-footer .footer-content p {
    text-align: right; /* Align copyright text right for RTL */
}

html[dir="rtl"] .qr-code-container {
    margin-left: 0;
    margin-right: 20px; /* Space from copyright text for RTL */
}

html[dir="rtl"] .notice-board-card h2 {
    text-align: right; /* Align notice board title right for RTL */
}
html[dir="rtl"] .notice-board-card h2::after {
    left: auto;
    right: 0; /* Align underline to right for RTL */
    transform: none; /* Remove transform */
}
html[dir="rtl"] .notice-content em {
    text-align: left; /* Align date to left for RTL */
}

/* RTL for media queries */
@media (max-width: 768px) {
    html[dir="rtl"] .dashboard-layout {
        grid-template-areas:
            "header"
            "sidebar"
            "main"
            "footer"; /* Stacking order remains the same */
    }
    html[dir="rtl"] .sidebar-nav .nav-item {
        border-bottom: 2px solid transparent; /* No left/right border on mobile */
    }
    html[dir="rtl"] .sidebar-nav .nav-item:hover,
    html[dir="rtl"] .sidebar-nav .nav-item.active,
    html[dir="rtl"] .sidebar-nav .nav-item.logout:hover {
        border-left-color: transparent;
        border-right-color: transparent; /* Remove side borders on mobile */
    }
}
