/* Hyper Theme - Detached Layout CSS */

:root {
    --bs-blue: #727cf5;
    --bs-indigo: #6610f2;
    --bs-purple: #6b5eae;
    --bs-pink: #ff679b;
    --bs-red: #fa5c7c;
    --bs-orange: #fd7e14;
    --bs-yellow: #ffbc00;
    --bs-green: #0acf97;
    --bs-teal: #02a8b5;
    --bs-cyan: #39afd1;
    --bs-white: #fff;
    --bs-gray: #98a6ad;
    --bs-gray-dark: #343a40;
    --bs-gray-100: #f1f3fa;
    --bs-gray-200: #eef2f7;
    --bs-gray-300: #dee2e6;
    --bs-gray-400: #ced4da;
    --bs-gray-500: #adb5bd;
    --bs-gray-600: #98a6ad;
    --bs-gray-700: #6c757d;
    --bs-gray-800: #343a40;
    --bs-gray-900: #313a46;
    --bs-primary: #727cf5;
    --bs-secondary: #6c757d;
    --bs-success: #0acf97;
    --bs-info: #39afd1;
    --bs-warning: #ffbc00;
    --bs-danger: #fa5c7c;
    --bs-light: #eef2f7;
    --bs-dark: #313a46;
    --bs-primary-rgb: 114, 124, 245;
    --bs-secondary-rgb: 108, 117, 125;
    --bs-success-rgb: 10, 207, 151;
    --bs-info-rgb: 57, 175, 209;
    --bs-warning-rgb: 255, 188, 0;
    --bs-danger-rgb: 250, 92, 124;
    --bs-light-rgb: 238, 242, 247;
    --bs-dark-rgb: 49, 58, 70;
}

body {
    margin: 0;
    font-family: "Nunito", "Cairo", sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.5;
    color: #6c757d;
    background-color: #f5f6f8;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* ========== TOPBAR ========== */
.topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1030;
    background-color: #fff;
    box-shadow: 0 0 15px rgba(49, 58, 70, 0.1);
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 24px;
}

.topbar-logo {
    display: flex;
    align-items: center;
    margin-right: 24px;
}

.topbar-logout {
    display: flex;
    align-items: center;
    margin-right: 16px;
}

.topbar-logo img {
    height: 24px;
}

.topbar-menu {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.topbar-menu-item {
    padding: 0 16px;
    color: #6c757d;
    font-weight: 600;
    text-decoration: none;
    position: relative;
    height: 70px;
    display: flex;
    align-items: center;
}

.topbar-menu-item:hover {
    color: #727cf5;
    text-decoration: none;
}

.topbar-menu-item.active {
    color: #727cf5;
}

.topbar-menu-item.active:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #727cf5;
}

.topbar-right {
    display: flex;
    align-items: center;
}

.logout-container {
    margin-right: 10px;
}

.logout-btn-fancy {
    display: flex;
    align-items: center;
    background: linear-gradient(45deg, #ff5252, #ff3547);
    color: white;
    border-radius: 30px;
    padding: 6px 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(255, 82, 82, 0.3);
    font-weight: 500;
    font-size: 0.85rem;
    border: none;
    position: relative;
    overflow: hidden;
    height: 32px;
}

.logout-btn-fancy:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #ff3547, #ff5252);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 30px;
}

.logout-btn-fancy:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 82, 82, 0.5);
    color: white;
    background: linear-gradient(45deg, #ff3547, #ff5252);
}

.logout-btn-fancy:hover:before {
    opacity: 1;
}

.logout-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    position: relative;
    z-index: 2;
}

.logout-text {
    position: relative;
    z-index: 2;
}

.topbar-user {
    display: flex;
    align-items: center;
}

.topbar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #727cf5;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

.topbar-user-info {
    line-height: 1.2;
}

.topbar-user-name {
    font-weight: 600;
    color: #313a46;
}

.topbar-user-role {
    font-size: 12px;
    color: #98a6ad;
}

/* ========== SIDEBAR ========== */
.sidebar {
    position: fixed;
    top: 70px;
    right: 0;
    bottom: 0;
    width: 260px;
    background-color: #fff;
    box-shadow: 0 0 15px rgba(49, 58, 70, 0.1);
    z-index: 1020;
    transition: all 0.2s;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #eef2f7;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    font-weight: 700;
    margin-top: 10px;
    margin-bottom: 5px;
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #313a46;
    text-decoration: none;
}

.sidebar-brand:hover {
    color: #727cf5;
}

.sidebar-menu {
    padding: 0;
    list-style: none;
    margin: 0;
}

.sidebar-item {
    position: relative;
}

.sidebar-link {
    display: block;
    padding: 12px 20px;
    color: #6c757d;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    color: #727cf5;
    background-color: rgba(114, 124, 245, 0.1);
}

.sidebar-link.active {
    color: #727cf5;
    background-color: rgba(114, 124, 245, 0.1);
    border-left: 3px solid #727cf5;
}

.sidebar-link i {
    width: 20px;
    margin-left: 10px;
    font-size: 1rem;
    text-align: center;
}

.sidebar-dropdown .sidebar-link:after {
    content: "\f107";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 20px;
    top: 12px;
}

.sidebar-dropdown.show .sidebar-link:after {
    content: "\f106";
}

.sidebar-dropdown-menu {
    padding-right: 35px;
    list-style: none;
    display: none;
}

.sidebar-dropdown.show .sidebar-dropdown-menu {
    display: block;
}

.sidebar-dropdown-item {
    position: relative;
}

.sidebar-dropdown-link {
    display: block;
    padding: 8px 20px;
    color: #6c757d;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-dropdown-link:hover {
    color: #727cf5;
}

.sidebar-dropdown-link.active {
    color: #727cf5;
}

.sidebar-dropdown-link i {
    width: 20px;
    margin-left: 10px;
    font-size: 0.9rem;
    text-align: center;
}

/* ========== CONTENT PAGE ========== */
.content-page {
    margin-top: 70px;
    margin-right: 260px;
    padding: 24px;
    min-height: calc(100vh - 70px);
    transition: all 0.2s;
}

.content-page.sidebar-collapsed {
    margin-right: 70px;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: fixed;
    bottom: 20px;
    right: 280px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #727cf5;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1030;
    box-shadow: 0 0 15px rgba(49, 58, 70, 0.2);
    transition: all 0.2s;
}

.sidebar-toggle:hover {
    background-color: #5a66f3;
}

.sidebar-toggle.collapsed {
    right: 90px;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .sidebar-item span {
    display: none;
}

.sidebar.collapsed .sidebar-link {
    justify-content: center;
    padding: 0.75rem 0;
    position: relative;
}

.sidebar.collapsed .sidebar-item i {
    margin-right: 0;
    font-size: 1.25rem;
}

/* Tooltip for collapsed sidebar */
.sidebar.collapsed .sidebar-link:hover:after {
    content: attr(data-title);
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #313a46;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sidebar.collapsed .sidebar-header,
.sidebar.collapsed .sidebar-dropdown-menu {
    display: none;
}

.page-title-box {
    padding: 24px 0;
}

.page-title {
    font-size: 1.75rem;
    margin: 0;
    color: #313a46;
    font-weight: 700;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.page-title:after {
    content: '';
    position: absolute;
    width: 50px;
    height: 3px;
    background: #727cf5;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

/* ========== CARDS ========== */
.card {
    margin-bottom: 24px;
    box-shadow: 0 0 15px rgba(49, 58, 70, 0.1);
    border: none;
    border-radius: 0.25rem;
}

.card-header {
    padding: 1rem 1.5rem;
    margin-bottom: 0;
    background-color: #fff;
    border-bottom: 1px solid #eef2f7;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header:first-child {
    border-radius: calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0;
}

.card-title {
    margin: 0;
    color: #313a46;
    font-size: 1rem;
    font-weight: 700;
}

.card-body {
    flex: 1 1 auto;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

/* كروت ملونة وجذابة */
.card-body.bg-primary-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.card-body.bg-success-gradient {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.card-body.bg-warning-gradient {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.card-body.bg-info-gradient {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.card-body.bg-danger-gradient {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.card-body.bg-purple-gradient {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
}

.card-body.bg-orange-gradient {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #333;
}

.card-body.bg-teal-gradient {
    background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
    color: #333;
}

/* تأثيرات إضافية للكروت الملونة */
.card-body[class*="gradient"] {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.card-body[class*="gradient"]:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

/* أيقونات الكروت الملونة */
.card-body[class*="gradient"] .card-icon {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
}

/* نصوص الكروت الملونة */
.card-body[class*="gradient"] .card-title {
    color: inherit;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.card-body[class*="gradient"] .card-text {
    color: rgba(255,255,255,0.9);
}

.card-body[class*="gradient"] .text-muted {
    color: rgba(255,255,255,0.7) !important;
}

.card-footer {
    padding: 1rem 1.5rem;
    background-color: #fff;
    border-top: 1px solid #eef2f7;
}

.card-footer:last-child {
    border-radius: 0 0 calc(0.25rem - 1px) calc(0.25rem - 1px);
}

/* ========== STATS WIDGETS ========== */
.widget-flat {
    position: relative;
    overflow: hidden;
}

.widget-icon {
    color: #727cf5;
    font-size: 20px;
    background-color: rgba(114, 124, 245, 0.25);
    height: 40px;
    width: 40px;
    text-align: center;
    line-height: 40px;
    border-radius: 3px;
    display: inline-block;
}

.widget-icon.widget-icon-success {
    color: #0acf97;
    background-color: rgba(10, 207, 151, 0.25);
}

.widget-icon.widget-icon-warning {
    color: #ffbc00;
    background-color: rgba(255, 188, 0, 0.25);
}

.widget-icon.widget-icon-danger {
    color: #fa5c7c;
    background-color: rgba(250, 92, 124, 0.25);
}

.widget-icon.widget-icon-info {
    color: #39afd1;
    background-color: rgba(57, 175, 209, 0.25);
}

.widget-detail-1 {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background-color: #fff;
    border-top: 1px solid #eef2f7;
}

.widget-detail-2 {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(49, 58, 70, 0.5);
    padding: 1rem;
    color: #fff;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-block;
    font-weight: 600;
    line-height: 1.5;
    color: #6c757d;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.45rem 0.9rem;
    font-size: 0.9rem;
    border-radius: 0.15rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn-primary {
    color: #fff;
    background-color: #727cf5;
    border-color: #727cf5;
}

.btn-primary:hover {
    color: #fff;
    background-color: #6169d0;
    border-color: #5b63c4;
}

.btn-success {
    color: #fff;
    background-color: #0acf97;
    border-color: #0acf97;
}

.btn-success:hover {
    color: #fff;
    background-color: #09b080;
    border-color: #08a578;
}

.btn-info {
    color: #fff;
    background-color: #39afd1;
    border-color: #39afd1;
}

.btn-info:hover {
    color: #fff;
    background-color: #3095b2;
    border-color: #2d8ca7;
}

.btn-warning {
    color: #fff;
    background-color: #ffbc00;
    border-color: #ffbc00;
}

.btn-warning:hover {
    color: #fff;
    background-color: #d9a000;
    border-color: #cc9700;
}

.btn-danger {
    color: #fff;
    background-color: #fa5c7c;
    border-color: #fa5c7c;
}

.btn-danger:hover {
    color: #fff;
    background-color: #d54e69;
    border-color: #c94963;
}

.btn-light {
    color: #313a46;
    background-color: #eef2f7;
    border-color: #eef2f7;
}

.btn-light:hover {
    color: #313a46;
    background-color: #caced2;
    border-color: #bfc2c6;
}

.btn-dark {
    color: #fff;
    background-color: #313a46;
    border-color: #313a46;
}

.btn-dark:hover {
    color: #fff;
    background-color: #29313c;
    border-color: #262e38;
}

.btn-outline-primary {
    color: #727cf5;
    border-color: #727cf5;
}

.btn-outline-primary:hover {
    color: #fff;
    background-color: #727cf5;
    border-color: #727cf5;
}

.btn-sm {
    padding: 0.28rem 0.8rem;
    font-size: 0.75rem;
    border-radius: 0.15rem;
}

.btn-lg {
    padding: 0.5rem 1rem;
    font-size: 1.2rem;
    border-radius: 0.15rem;
}

/* ========== TABLES ========== */
.table {
    width: 100%;
    margin-bottom: 0;
    color: #6c757d;
    vertical-align: top;
    border-color: #eef2f7;
}

.table > :not(:last-child) > :last-child > * {
    border-bottom-color: #eef2f7;
}

.table > :not(caption) > * > * {
    padding: 0.75rem;
    border-bottom-width: 1px;
}

.table > thead {
    vertical-align: bottom;
}

.table > tbody {
    vertical-align: inherit;
}

.table-centered td, .table-centered th {
    vertical-align: middle !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(238, 242, 247, 0.5);
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(238, 242, 247, 0.7);
}

/* ========== FORMS ========== */
.form-control {
    display: block;
    width: 100%;
    padding: 0.45rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.5;
    color: #6c757d;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #dee2e6;
    appearance: none;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: #6c757d;
    background-color: #fff;
    border-color: #c3c6fa;
    outline: 0;
    box-shadow: 0 0 0 0.15rem rgba(114, 124, 245, 0.25);
}

.form-label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #6c757d;
}

.form-select {
    display: block;
    width: 100%;
    padding: 0.45rem 2.25rem 0.45rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.5;
    color: #6c757d;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    background-size: 16px 12px;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    appearance: none;
}

.form-select:focus {
    border-color: #c3c6fa;
    outline: 0;
    box-shadow: 0 0 0 0.15rem rgba(114, 124, 245, 0.25);
}

/* ========== ALERTS ========== */
.alert {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-primary {
    color: #3b4184;
    background-color: #e0e1fc;
    border-color: #d4d5fa;
}

.alert-success {
    color: #056c4f;
    background-color: #cef5ea;
    border-color: #baf1e2;
}

.alert-info {
    color: #1e5b6d;
    background-color: #d7eef6;
    border-color: #c7e8f2;
}

.alert-warning {
    color: #856200;
    background-color: #fff2cc;
    border-color: #ffecb8;
}

.alert-danger {
    color: #823040;
    background-color: #fedbe2;
    border-color: #fecdd6;
}

/* ========== BADGES ========== */
.badge {
    display: inline-block;
    padding: 0.25em 0.5em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-primary {
    background-color: #727cf5;
}

.badge-success {
    background-color: #0acf97;
}

.badge-info {
    background-color: #39afd1;
}

.badge-warning {
    background-color: #ffbc00;
}

.badge-danger {
    background-color: #fa5c7c;
}

.badge-light {
    color: #313a46;
    background-color: #eef2f7;
}

.badge-dark {
    background-color: #313a46;
}

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
}

.page-link {
    position: relative;
    display: block;
    color: #727cf5;
    text-decoration: none;
    background-color: #fff;
    border: 1px solid #dee2e6;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    padding: 0.5rem 0.75rem;
    margin-left: -1px;
}

.page-link:hover {
    z-index: 2;
    color: #5a66f3;
    background-color: #eef2f7;
    border-color: #dee2e6;
}

.page-link:focus {
    z-index: 3;
    color: #5a66f3;
    background-color: #eef2f7;
    outline: 0;
    box-shadow: 0 0 0 0.15rem rgba(114, 124, 245, 0.25);
}

.page-item:first-child .page-link {
    margin-left: 0;
    border-top-left-radius: 0.25rem;
    border-bottom-left-radius: 0.25rem;
}

.page-item:last-child .page-link {
    border-top-right-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
}

.page-item.active .page-link {
    z-index: 3;
    color: #fff;
    background-color: #727cf5;
    border-color: #727cf5;
}

.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #fff;
    border-color: #dee2e6;
}

/* ========== DROPDOWN ========== */
.dropdown-menu {
    position: absolute;
    z-index: 1000;
    display: none;
    min-width: 10rem;
    padding: 0.5rem 0;
    margin: 0;
    font-size: 0.9rem;
    color: #6c757d;
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.25rem;
    box-shadow: 0 0.25rem 0.75rem rgba(49, 58, 70, 0.15);
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.375rem 1.5rem;
    clear: both;
    font-weight: 400;
    color: #6c757d;
    text-align: inherit;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
}

.dropdown-item:hover, .dropdown-item:focus {
    color: #5f666d;
    background-color: #f8f9fa;
    text-decoration: none;
}

.dropdown-item.active, .dropdown-item:active {
    color: #fff;
    text-decoration: none;
    background-color: #727cf5;
}

.dropdown-item.disabled, .dropdown-item:disabled {
    color: #adb5bd;
    pointer-events: none;
    background-color: transparent;
}

.dropdown-divider {
    height: 0;
    margin: 0.5rem 0;
    overflow: hidden;
    border-top: 1px solid #eef2f7;
}

/* ========== FOOTER ========== */
.footer {
    padding: 1.5rem 0;
    color: #98a6ad;
    background-color: #fff;
    border-top: 1px solid #eef2f7;
    font-size: 0.9rem;
}

.copyright-text {
    font-weight: 500;
    color: #6c757d;
}

.footer-links {
    margin-top: 0.5rem;
}

.footer-links a {
    color: #98a6ad;
    margin-left: 1.5rem;
    transition: all 0.4s;
    text-decoration: none;
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.footer-links a:hover {
    color: #727cf5;
    text-decoration: none;
    background-color: rgba(114, 124, 245, 0.1);
}

/* ========== CHARTS ========== */
.chart-container {
    position: relative;
    margin: auto;
    height: 300px;
    width: 100%;
}

/* ========== UTILITIES ========== */
.text-primary {
    color: #727cf5 !important;
}

.text-success {
    color: #0acf97 !important;
}

.text-info {
    color: #39afd1 !important;
}

.text-warning {
    color: #ffbc00 !important;
}

.text-danger {
    color: #fa5c7c !important;
}

.text-muted {
    color: #98a6ad !important;
}

.bg-primary {
    background-color: #727cf5 !important;
}

.bg-success {
    background-color: #0acf97 !important;
}

.bg-info {
    background-color: #39afd1 !important;
}

.bg-warning {
    background-color: #ffbc00 !important;
}

.bg-danger {
    background-color: #fa5c7c !important;
}

.bg-light {
    background-color: #eef2f7 !important;
}

.bg-dark {
    background-color: #313a46 !important;
}

/* ========== RTL SUPPORT ========== */
html[dir="rtl"] .topbar-logo {
    margin-right: 0;
    margin-left: 24px;
}

html[dir="rtl"] .logout-container {
    margin-right: 0;
    margin-left: 10px;
}

html[dir="rtl"] .logout-icon {
    margin-right: 0;
    margin-left: 8px;
}

html[dir="rtl"] .topbar-user-avatar {
    margin-right: 0;
    margin-left: 8px;
}

html[dir="rtl"] .topbar-user {
    margin-right: 0;
}

html[dir="rtl"] .footer-links a {
    margin-left: 0;
    margin-right: 1.5rem;
}

html[dir="rtl"] .sidebar {
    right: 0;
    left: auto;
}

html[dir="rtl"] .content-page {
    margin-right: 260px;
    margin-left: 0;
}

html[dir="rtl"] .content-page.sidebar-collapsed {
    margin-right: 70px;
    margin-left: 0;
}

html[dir="rtl"] .sidebar-toggle {
    right: 280px;
    left: auto;
}

html[dir="rtl"] .sidebar-toggle.collapsed {
    right: 90px;
    left: auto;
}

html[dir="rtl"] .sidebar.collapsed .sidebar-link:hover:after {
    right: 70px;
    left: auto;
}

html[dir="rtl"] .dropdown-menu {
    text-align: right;
}

html[dir="rtl"] .table {
    text-align: right;
}

html[dir="rtl"] .form-select {
    padding: 0.45rem 0.9rem 0.45rem 2.25rem;
    background-position: left 0.9rem center;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 767.98px) {
    .topbar {
        padding: 0 16px;
    }
    
    .topbar-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background-color: #fff;
        box-shadow: 0 0 15px rgba(49, 58, 70, 0.1);
        display: none;
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
        z-index: 1030;
    }
    
    .topbar-menu.show {
        display: flex;
    }
    
    .topbar-menu-item {
        height: auto;
        padding: 8px 0;
        width: 100%;
    }
    
    .topbar-menu-item.active:after {
        display: none;
    }
    
    .sidebar {
        transform: translateX(260px);
        z-index: 1040;
    }
    
    .sidebar.mobile-show {
        transform: translateX(0);
    }
    
    .content-page {
        margin-right: 0;
        padding: 16px;
    }
    
    .page-title-box {
        padding: 16px 0;
    }
    
    .sidebar-toggle {
        right: 20px;
    }
    
    .footer {
        text-align: center;
    }
    
    .footer-links {
        margin-top: 10px;
        text-align: center !important;
    }
    
    .topbar-right {
        display: none;
    }
}

/* ========== CUSTOM STYLES FOR REAL ESTATE SYSTEM ========== */
.property-card {
    transition: transform 0.3s;
}

.property-card:hover {
    transform: translateY(-5px);
}

.property-image {
    height: 200px;
    object-fit: cover;
    width: 100%;
    border-top-left-radius: 0.25rem;
    border-top-right-radius: 0.25rem;
}

.status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
}

.status-available {
    background-color: #0acf97;
    color: #fff;
}

.status-sold {
    background-color: #fa5c7c;
    color: #fff;
}

.status-pending {
    background-color: #ffbc00;
    color: #fff;
}

/* Timeline */
.timeline {
    margin-top: 20px;
    position: relative;
}

.timeline-item {
    position: relative;
    padding-left: 40px;
    margin-bottom: 20px;
}

.timeline-item:before {
    content: "";
    position: absolute;
    left: 9px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #eef2f7;
}

.timeline-icon {
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    text-align: center;
    background-color: #727cf5;
    color: #fff;
    font-size: 12px;
    line-height: 20px;
}

.timeline-date {
    display: block;
    color: #98a6ad;
    font-size: 12px;
    margin-bottom: 5px;
}

.timeline-content {
    background-color: #fff;
    padding: 15px;
    border-radius: 0.25rem;
    box-shadow: 0 0 15px rgba(49, 58, 70, 0.1);
}

/* RTL Timeline */
html[dir="rtl"] .timeline-item {
    padding-left: 0;
    padding-right: 40px;
}

html[dir="rtl"] .timeline-item:before {
    left: auto;
    right: 9px;
}

html[dir="rtl"] .timeline-icon {
    left: auto;
    right: 0;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #6c757d;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 767.98px) {
    .mobile-menu-toggle {
        display: block;
    }
}

/* Hyper-Inspired Admin Theme - RTL Support */

/* Reset & Variables */
:root {
    --primary-color: #6c5ce7;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-color: #74b9ff;
    --success-color: #00b894;
    --warning-color: #fdcb6e;
    --danger-color: #e17055;
    --info-color: #74b9ff;
    
    --dark-color: #2d3436;
    --light-color: #ddd;
    --white: #ffffff;
    --gray-50: #f8f9fa;
    --gray-100: #e9ecef;
    --gray-200: #dee2e6;
    --gray-300: #ced4da;
    --gray-400: #adb5bd;
    --gray-500: #6c757d;
    --gray-600: #495057;
    --gray-700: #343a40;
    --gray-800: #212529;
    
    --sidebar-width: 260px;
    --topbar-height: 70px;
    
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    
    --border-radius: 0.375rem;
    --border-radius-lg: 0.5rem;
    --border-radius-xl: 0.75rem;
    
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    direction: rtl;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    z-index: 1000;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.sidebar-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.sidebar-logo i {
    font-size: 2rem;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-menu-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 1rem;
}

.sidebar-item {
    margin: 0.25rem 0.75rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    transform: translateX(-4px);
}

.sidebar-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    box-shadow: var(--shadow);
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 1.125rem;
}

/* Topbar Styles */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: var(--sidebar-width);
    height: var(--topbar-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 999;
    box-shadow: var(--shadow-sm);
}

.topbar-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

/* Role-based avatar colors */
.user-avatar.admin {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

.user-avatar.sales {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
}

.user-avatar.cashier {
    background: linear-gradient(135deg, #fed766 0%, #ffa726 100%);
}

.user-avatar.viewer {
    background: linear-gradient(135deg, #a8edea 0%, #6c5ce7 100%);
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-left: 0.75rem;
    line-height: 1.2;
}

.user-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
    transition: var(--transition);
}

.user-role {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
    padding: 0.125rem 0.375rem;
    background-color: var(--gray-100);
    border-radius: 0.25rem;
    transition: var(--transition);
}

/* Role-based role badge colors */
.user-role.admin {
    background-color: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

.user-role.sales {
    background-color: rgba(78, 205, 196, 0.1);
    color: #4ecdc4;
}

.user-role.cashier {
    background-color: rgba(254, 215, 102, 0.1);
    color: #fed766;
}

.user-role.viewer {
    background-color: rgba(168, 237, 234, 0.1);
    color: #6c5ce7;
}

.topbar-user:hover .user-name {
    color: var(--primary-color);
}

.topbar-user:hover .user-role {
    transform: scale(1.02);
}

.logout-btn {
    background: var(--danger-color);
    color: var(--white);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logout-btn:hover {
    background: #d63031;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
    color: var(--white);
}

/* Main Content Area */
.main-content {
    margin-right: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 2rem;
    min-height: calc(100vh - var(--topbar-height));
}

/* Page Title */
.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--gray-600);
    font-size: 1rem;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    margin-bottom: 2rem;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
}

.stat-card.primary::before { background: var(--primary-color); }
.stat-card.success::before { background: var(--success-color); }
.stat-card.warning::before { background: var(--warning-color); }
.stat-card.info::before { background: var(--info-color); }
.stat-card.danger::before { background: var(--danger-color); }

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--white);
}

.stat-card.primary .stat-icon { background: var(--primary-color); }
.stat-card.success .stat-icon { background: var(--success-color); }
.stat-card.warning .stat-icon { background: var(--warning-color); }
.stat-card.info .stat-icon { background: var(--info-color); }
.stat-card.danger .stat-icon { background: var(--danger-color); }

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: var(--border-radius);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1.5;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: #5a4fcf;
    transform: translateY(-1px);
    color: var(--white);
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

.btn-success:hover {
    background: #00a085;
    transform: translateY(-1px);
    color: var(--white);
}

.btn-warning {
    background: var(--warning-color);
    color: var(--white);
}

.btn-warning:hover {
    background: #e17055;
    transform: translateY(-1px);
    color: var(--white);
}

.btn-info {
    background: var(--info-color);
    color: var(--white);
}

.btn-info:hover {
    background: #0984e3;
    transform: translateY(-1px);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* Tables */
.table-container {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: var(--gray-50);
    padding: 1rem;
    text-align: right;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
}

.table td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid var(--gray-100);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(0, 184, 148, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(0, 184, 148, 0.2);
}

.alert-warning {
    background: rgba(253, 203, 110, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(253, 203, 110, 0.2);
}

.alert-danger {
    background: rgba(225, 112, 85, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(225, 112, 85, 0.2);
}

.alert-info {
    background: rgba(116, 185, 255, 0.1);
    color: var(--info-color);
    border: 1px solid rgba(116, 185, 255, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .topbar {
        right: 0;
    }
    
    .main-content {
        margin-right: 0;
        padding: 1rem;
    }
    
    .topbar-title {
        display: none;
    }
    
    .user-info {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile menu toggle */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-600);
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }

.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

.flex-wrap { flex-wrap: wrap; }
