/* Modern Dashboard Design - White & Gold Theme (RTL) */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');

:root {
    --primary-color: #0f172a;
    /* Deep Blue */
    --secondary-color: #f8fafc;
    /* Light Grey for cards */
    --accent-color: #d4af37;
    /* Gold */
    --accent-hover: #fcd34d;
    /* Lighter Gold */
    --olive-primary: #2e3b22;
    /* Dark Olive Green */
    --olive-dark: #1f2916;
    /* Deep Olive */
    --text-primary: #1e293b;
    /* Dark Slate for text */
    --text-secondary: #475569;
    /* Greyish text */
    --bg-gradient: #ffffff;
    /* White Background */
    --card-bg: rgba(255, 255, 255, 0.9);
    --glass-border: 1px solid rgba(0, 0, 0, 0.05);
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-glow: 0 0 15px rgba(212, 175, 55, 0.2);
    --radius-md: 12px;
    --radius-lg: 16px;
    --font-heading: 'Cairo', sans-serif;
    --font-body: 'Cairo', sans-serif;
}

body {
    font-family: var(--font-body);
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
}

/* Typography Overrides */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--primary-color);
}

/* Navbar Customization */
.navbar-inverse .navbar-inner {
    background: linear-gradient(135deg, var(--olive-primary), var(--olive-dark)) !important;
    backdrop-filter: blur(10px);
    border: none;
    border-bottom: 2px solid var(--accent-color);
    background-image: none !important;
    box-shadow: var(--shadow-soft);
    padding: 10px 0;
}

.navbar .brand {
    font-family: var(--font-heading);
    color: #ffffff !important;
    font-weight: 700;
    font-size: 24px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar .nav>li>a {
    color: rgba(255, 255, 255, 0.9) !important;
    font-family: var(--font-body);
    font-weight: 600;
    transition: all 0.3s ease;
    text-shadow: none;
}

.navbar .nav>li>a:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

.navbar .nav>li.dropdown.open>.dropdown-toggle,
.navbar .nav>li.dropdown.active>.dropdown-toggle,
.navbar .nav>li.dropdown.open.active>.dropdown-toggle {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}

.dropdown-menu {
    background: #ffffff !important;
    border: var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.dropdown-menu>li>a {
    color: var(--text-primary) !important;
    padding: 10px 20px;
    transition: all 0.2s;
    text-align: right;
}

.dropdown-menu>li>a:hover {
    background: rgba(74, 103, 65, 0.1) !important;
    color: var(--olive-primary) !important;
    border-radius: 4px;
}

/* Sidebar Customization (Right Side) */
#sidebar {
    float: right !important;
    /* Force Right Align */
    margin-left: 20px;
    margin-right: 0;
}

#sidebar ul.nav-list {
    background: linear-gradient(145deg, var(--olive-primary), var(--olive-dark));
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 15px;
    box-shadow: 0 4px 20px rgba(74, 103, 65, 0.3);
}

#sidebar .nav-list>li>a {
    color: rgba(255, 255, 255, 0.85);
    /* White text for Olive BG */
    font-family: var(--font-heading);
    font-size: 16px;
    padding: 12px 15px;
    margin-bottom: 5px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    border: 1px solid transparent;
}

#sidebar .nav-list>li>a i {
    margin-left: 10px;
    margin-right: 0 !important;
    /* RTL Fix */
    font-size: 18px;
    width: 25px;
    text-align: center;
    transition: transform 0.3s ease;
    color: #d4af37;
    /* Gold icons stand out nicely on Olive */
}

#sidebar .nav-list>li>a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    text-decoration: none;
    transform: translateX(-5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#sidebar .nav-list>li>a:hover i {
    transform: scale(1.1);
    color: #fff;
}

/* Dashboard Cards */
.block {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    margin-bottom: 25px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.block:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.block-header {
    background: linear-gradient(135deg, var(--primary-color), #2c3e50) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 15px 20px;
    color: #fff;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.block-header .muted {
    color: #fff !important;
    font-size: 16px;
    font-family: var(--font-heading);
}

.block-content {
    background: transparent !important;
    padding: 20px;
}

/* Modern Card Layout for Dashboard Stats */
.dashboard-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(212, 175, 55, 0.1), transparent);
    transform: translateX(-100%);
    transition: 0.5s;
}

.dashboard-card:hover::before {
    transform: translateX(100%);
}

.dashboard-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.15);
    transform: translateY(-5px);
}

/* Replaced img with .card-icon for Font Icons */
.dashboard-card .card-icon {
    font-size: 36px;
    line-height: 80px;
    /* Vertically center */
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--accent-color);
    margin-bottom: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    background: var(--olive-primary);
    color: #ffffff;
    display: inline-block;
    text-align: center;
}

.dashboard-card:hover .card-icon {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.5);
    background: #ffffff;
    color: var(--olive-primary);
    border-color: var(--olive-primary);
}

.chart-bottom-heading {
    color: var(--text-primary);
    font-size: 18px;
    margin-top: 15px;
}

.chart-bottom-heading b {
    color: var(--accent-color);
    font-weight: 700;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.span3 {
    animation: fadeIn 0.6s ease-out forwards;
}

.span3:nth-child(1) {
    animation-delay: 0.1s;
}

.span3:nth-child(2) {
    animation-delay: 0.2s;
}

.span3:nth-child(3) {
    animation-delay: 0.3s;
}

.span3:nth-child(4) {
    animation-delay: 0.4s;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    body {
        padding: 0 10px;
    }

    .navbar .brand {
        font-size: 20px;
    }

    #sidebar {
        float: none !important;
        margin: 0;
    }
}

/* Modern Tables */
.dashboard-table-container {
    background: #ffffff;
    backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 20px;
    margin-top: 20px;
}

.dashboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
    color: var(--text-primary);
}

.dashboard-table thead th {
    background: var(--primary-color) !important;
    color: var(--accent-color) !important;
    padding: 15px;
    font-family: var(--font-heading);
    font-weight: 700;
    border-bottom: 2px solid var(--accent-color);
    text-align: center !important;
}

.dashboard-table tbody td {
    padding: 12px 15px;
    vertical-align: middle;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background 0.2s;
    text-align: center;
}

.dashboard-table tbody tr:hover td {
    background: rgba(212, 175, 55, 0.05);
}

.dashboard-table tbody tr:last-child td {
    border-bottom: none;
}

.btn-modern {
    background: linear-gradient(135deg, var(--accent-color), #b8860b);
    color: #fff !important;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
    text-decoration: none;
}

.btn-modern-icon {
    margin-left: 8px;
}

/* Charts */
.dashboard-chart-container {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0, 0, 0, 0.05);
    height: 400px;
    position: relative;
}

.dashboard-chart-header {
    margin-bottom: 20px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-chart-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--primary-color);
}

.dashboard-filter-form {
    background: #ffffff;
    padding: 15px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

margin-bottom: 0 !important;
height: 40px !important;
}

/* --- Added Modern Styles for Tables & Mobile --- */

/* Glassmorphic Tables */
.table {
    width: 100%;
    margin-bottom: 20px;
    background-color: transparent !important;
    border-collapse: separate;
    border-spacing: 0;
    border: none;
}

.table thead th {
    background: linear-gradient(135deg, var(--olive-primary), var(--olive-dark)) !important;
    color: #ffffff !important;
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 15px !important;
    border-bottom: 2px solid var(--accent-color) !important;
    vertical-align: middle !important;
    text-align: center !important;
}

.table tbody td {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(5px);
    color: var(--text-primary);
    padding: 12px 15px !important;
    vertical-align: middle !important;
    border-top: 1px solid rgba(0, 0, 0, 0.05) !important;
    transition: all 0.2s ease;
    text-align: center !important;
}

.table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.95) !important;
    transform: scale(1.01);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.table-bordered {
    border: none !important;
}

.table-bordered th,
.table-bordered td {
    border-left: none !important;
}

/* Rounded Corners for Table */
.table thead tr:first-child th:first-child {
    border-top-right-radius: 10px;
}

.table thead tr:first-child th:last-child {
    border-top-left-radius: 10px;
}

.table tbody tr:last-child td:first-child {
    border-bottom-right-radius: 10px;
}

.table tbody tr:last-child td:last-child {
    border-bottom-left-radius: 10px;
}

/* Action Buttons in Tables */
.btn-success,
.btn-danger,
.btn-info,
.btn-primary,
.btn-warning {
    border: none;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn i {
    margin: 0;
}

/* Modern Inputs */
input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e2e8f0;
    border-radius: 8px !important;
    padding: 10px 15px !important;
    height: auto !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    font-family: var(--font-body);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
    outline: none;
}

/* Mobile Responsive Adjustments */
@media (max-width: 979px) {
    body {
        padding-top: 0 !important;
    }

    .navbar-fixed-top {
        position: static !important;
        margin-bottom: 20px;
    }

    #sidebar {
        width: 100%;
        margin: 0 0 20px 0 !important;
        float: none !important;
    }

    .span9 {
        width: 100%;
        margin: 0 !important;
    }

    .dashboard-card {
        margin-bottom: 20px;
    }

    /* Responsive Table Wrapper */
    .block-content {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 600px;
    }

    /* Force scroll on small screens */

    /* Adjust Fonts */
    h1 {
        font-size: 24px;
    }

    h3 {
        font-size: 18px;
    }
}

@media (max-width: 767px) {

    .row-fluid .span3,
    .row-fluid .span6,
    .row-fluid .span9,
    .row-fluid .span12 {
        width: 100%;
        margin-left: 0;
        box-sizing: border-box;
        display: block;
        float: none;
    }

    /* Adjust Card Grid */
    .dashboard-card {
        display: flex;
        flex-direction: row;
        /* Horizontal cards on mobile */
        align-items: center;
        text-align: right;
        padding: 15px;
        min-height: auto;
    }

    .dashboard-card .card-icon {
        margin-bottom: 0;
        margin-left: 15px;
        width: 60px;
        height: 60px;
        line-height: 60px;
        font-size: 24px;
    }

    .dashboard-card h1 {
        font-size: 20px;
        margin: 0;
    }

    .chart-bottom-heading {
        font-size: 14px;
        margin-top: 5px;
    }
}