/* site.css */

:root {
    --primary-color: #4361ee;
    --primary-hover: #3a56d4;
    --secondary-color: #3f37c9;
    --success-color: #4cc9f0;
    --danger-color: #f72585;
    --warning-color: #f8961e;
    
    --bg-color: #f8f9fa;
    --surface-color: #ffffff;
    --text-primary: #2b2d42;
    --text-secondary: #8d99ae;
    --border-color: #e9ecef;
    --sidebar-bg: #ffffff;
    --sidebar-text: #2b2d42;
    --sidebar-hover: #f1f3f5;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --sidebar-bg: #1e293b;
    --sidebar-text: #f8fafc;
    --sidebar-hover: #334155;
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
}

* {
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    transition: var(--transition);
    overflow-x: hidden;
}

/* Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-left: 1px solid var(--border-color); /* RTL */
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: fixed;
    height: 100vh;
    z-index: 1000;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h3 {
    margin: 0;
    font-weight: 800;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.sidebar-menu {
    padding: 16px;
    list-style: none;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 8px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition);
    font-weight: 600;
}

.sidebar-menu a i {
    margin-left: 12px; /* RTL */
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.3);
    transform: translateX(-5px); /* RTL */
}

/* Main Content */
.main-content {
    flex: 1;
    margin-right: 260px; /* RTL */
    padding: 24px 32px;
    transition: var(--transition);
    min-height: 100vh;
}

/* Topbar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 16px 24px;
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.topbar-title h2 {
    margin: 0;
    font-weight: 700;
    color: var(--text-primary);
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle:hover {
    transform: scale(1.1);
    color: var(--primary-color);
}

/* Cards */
.card-custom {
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 24px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    margin-bottom: 24px;
}

.card-custom:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Buttons */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.3);
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(67, 97, 238, 0.4);
    color: white;
}

/* Tables */
.table-custom {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    color: var(--text-primary);
}

.table-custom th {
    background-color: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
}

.table-custom tbody tr {
    background-color: var(--surface-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.table-custom tbody tr:hover {
    transform: scale(1.01);
    box-shadow: var(--shadow-md);
    z-index: 2;
    position: relative;
}

.table-custom td {
    padding: 16px;
    vertical-align: middle;
    color: var(--text-primary);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.table-custom td:first-child {
    border-right: 1px solid var(--border-color);
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.table-custom td:last-child {
    border-left: 1px solid var(--border-color);
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

/* Inputs */
.form-control-custom {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    transition: var(--transition);
}

.form-control-custom:focus {
    background-color: var(--surface-color);
    border-color: var(--primary-color);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
    outline: none;
}

/* Select */
.form-select.form-control-custom {
    background-color: var(--bg-color);
    color: var(--text-primary);
}

/* Modal override */
.modal-content {
    background-color: var(--surface-color);
    color: var(--text-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}
.modal-header, .modal-footer {
    border-color: var(--border-color);
}
.text-danger { color: var(--danger-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }