/* ============================================================
   CRM CABINET GECS - Custom Styles
   ============================================================ */

/* --- Root Variables --- */
:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #4a90d9;
    --secondary: #6c757d;
    --success: #28a745;
    --success-dark: #1e7e34;
    --danger: #dc3545;
    --danger-dark: #bd2130;
    --warning: #ffc107;
    --warning-dark: #d39e00;
    --info: #17a2b8;
    --info-dark: #117a8b;
    --dark: #1e293b;
    --darker: #0f172a;
    --dark-card: #1e293b;
    --light: #f8f9fa;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --navbar-height: 60px;
    --footer-height: 50px;
    --transition-speed: 0.3s;
    --border-radius: 10px;
    --border-radius-sm: 6px;
    --box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --box-shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* --- Base Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--gray-100);
    color: var(--gray-800);
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    text-decoration: none;
    transition: color var(--transition-speed);
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* --- Wrapper --- */
.wrapper {
    display: flex;
    min-height: 100vh;
    padding-top: var(--navbar-height);
}

/* --- Navbar --- */
.top-navbar {
    background: linear-gradient(135deg, var(--dark) 0%, var(--darker) 100%);
    height: var(--navbar-height);
    padding: 0 1rem;
    z-index: 1040;
    box-shadow: 0 2px 15px rgba(0,0,0,0.15);
}

.top-navbar .navbar-brand {
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.nav-icon-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--transition-speed);
    color: rgba(255,255,255,0.85);
    font-size: 1.1rem;
}

.nav-icon-btn:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.3);
}

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    background: linear-gradient(180deg, var(--dark) 0%, var(--gray-900) 100%);
    z-index: 1030;
    transition: width var(--transition-speed) ease;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 2px 0 15px rgba(0,0,0,0.1);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .submenu-arrow,
.sidebar.collapsed .submenu,
.sidebar.collapsed .sidebar-footer span {
    display: none;
}

.sidebar.collapsed .nav-icon {
    margin: 0;
    font-size: 1.3rem;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px 0;
}

.sidebar-header {
    padding: 1rem;
    display: flex;
    align-items: center;
    min-height: 65px;
}

.sidebar-brand-text {
    font-weight: 700;
    font-size: 1.15rem;
    white-space: nowrap;
    transition: opacity var(--transition-speed);
}

.sidebar-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gray-600), transparent);
    margin: 0 1rem;
}

.sidebar-body {
    padding: 0.5rem 0;
    flex: 1;
}

.sidebar .nav-item {
    position: relative;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--gray-400);
    transition: all var(--transition-speed);
    border-left: 3px solid transparent;
    gap: 10px;
    white-space: nowrap;
    font-size: 0.9rem;
}

.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
    border-left-color: var(--primary);
}

.sidebar .nav-link.active {
    color: #fff;
    background: rgba(26,115,232,0.2);
    border-left-color: var(--primary);
}

.sidebar .nav-link .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar .nav-link .nav-text {
    flex: 1;
}

.sidebar .nav-link .submenu-arrow {
    font-size: 0.7rem;
    transition: transform var(--transition-speed);
}

.sidebar .nav-item.submenu-open .submenu-arrow {
    transform: rotate(180deg);
}

/* Submenu */
.submenu {
    background: rgba(0,0,0,0.15);
    padding: 0;
}

.submenu .nav-link {
    padding: 8px 20px 8px 50px;
    font-size: 0.85rem;
    border-left: none;
    color: var(--gray-500);
}

.submenu .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.submenu .nav-link.active {
    color: var(--primary-light);
    background: transparent;
}

.submenu-bullet {
    font-size: 0.4rem !important;
    color: var(--gray-600);
}

.submenu .nav-link.active .submenu-bullet {
    color: var(--primary-light);
}

.sidebar-footer {
    border-top: 1px solid var(--gray-700);
    padding: 0.5rem;
    text-align: center;
}

.sidebar-collapse-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-speed);
    cursor: pointer;
}

.sidebar.collapsed .sidebar-collapse-btn i {
    transform: rotate(180deg);
}

/* --- Scrollbar --- */
.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--gray-600);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 1.5rem;
    min-height: calc(100vh - var(--navbar-height) - var(--footer-height));
    transition: margin-left var(--transition-speed);
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* --- Footer --- */
.app-footer {
    background: #fff;
    border-top: 1px solid var(--gray-200);
    padding: 0.75rem 1.5rem;
    margin-left: var(--sidebar-width);
    font-size: 0.85rem;
    color: var(--gray-600);
    transition: margin-left var(--transition-speed);
}

.sidebar.collapsed ~ .app-footer {
    margin-left: var(--sidebar-collapsed-width);
}

/* --- Cards --- */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: box-shadow var(--transition-speed), transform var(--transition-speed);
    margin-bottom: 1.25rem;
}

.card:hover {
    box-shadow: var(--box-shadow-lg);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 1.25rem;
    font-weight: 600;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: #fff;
    border-top: 1px solid var(--gray-200);
    padding: 0.75rem 1.25rem;
    border-radius: 0 0 var(--border-radius) var(--border-radius) !important;
}

/* --- Dashboard Widgets --- */
.widget-card {
    border-radius: var(--border-radius);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

.widget-card .widget-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.widget-card .widget-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.widget-card .widget-label {
    font-size: 0.85rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.widget-card .widget-progress {
    height: 4px;
    border-radius: 2px;
    margin-top: 0.75rem;
}

.widget-card .widget-change {
    font-size: 0.8rem;
    font-weight: 600;
}

.widget-card .widget-change.up {
    color: var(--success);
}

.widget-card .widget-change.down {
    color: var(--danger);
}

.widget-card .widget-overlay {
    position: absolute;
    right: -20px;
    bottom: -20px;
    font-size: 5rem;
    opacity: 0.06;
}

/* --- Tables --- */
.table-container {
    overflow-x: auto;
}

.table {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.table thead th {
    background: var(--gray-100);
    border-bottom: 2px solid var(--gray-200);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
    color: var(--gray-600);
    white-space: nowrap;
}

.table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-color: var(--gray-200);
}

.table-striped tbody tr:nth-of-type(odd) {
    background: var(--gray-100);
}

.table-hover tbody tr:hover {
    background: rgba(26,115,232,0.05);
    cursor: pointer;
}

.table-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* --- Forms --- */
.form-control, .form-select {
    border: 1.5px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,115,232,0.15);
}

.form-control.is-invalid, .form-select.is-invalid {
    border-color: var(--danger);
}

.form-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--gray-700);
    margin-bottom: 0.35rem;
}

.input-group-text {
    background: var(--gray-100);
    border: 1.5px solid var(--gray-300);
    color: var(--gray-600);
}

/* --- Buttons --- */
.btn {
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    transition: all var(--transition-speed);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(26,115,232,0.35);
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
}

.btn-success:hover {
    background: var(--success-dark);
    border-color: var(--success-dark);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger-dark);
    border-color: var(--danger-dark);
    transform: translateY(-1px);
}

.btn-warning {
    color: #212529;
}

.btn-warning:hover {
    background: var(--warning-dark);
    border-color: var(--warning-dark);
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-rounded {
    border-radius: 50px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* --- Badges --- */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    font-size: 0.75rem;
    border-radius: 50px;
}

.badge-success {
    background: rgba(40,167,69,0.15);
    color: var(--success);
}

.badge-danger {
    background: rgba(220,53,69,0.15);
    color: var(--danger);
}

.badge-warning {
    background: rgba(255,193,7,0.15);
    color: #d39e00;
}

.badge-info {
    background: rgba(23,162,184,0.15);
    color: var(--info);
}

.badge-primary {
    background: rgba(26,115,232,0.15);
    color: var(--primary);
}

.badge-secondary {
    background: rgba(108,117,125,0.15);
    color: var(--secondary);
}

/* --- Notifications Dropdown --- */
.notification-dropdown {
    width: 350px;
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
}

.notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    transition: background var(--transition-speed);
}

.notification-item:hover {
    background: var(--gray-100);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.unread {
    background: rgba(26,115,232,0.05);
    border-left: 3px solid var(--primary);
}

.notification-count {
    font-size: 0.6rem;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Modals --- */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 1.25rem;
}

.modal-header .modal-title {
    font-weight: 600;
}

.modal-header .btn-close {
    transition: transform var(--transition-speed);
}

.modal-header .btn-close:hover {
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    border-top: 1px solid var(--gray-200);
    padding: 0.75rem 1.25rem;
}

.modal-backdrop {
    background: rgba(0,0,0,0.5);
}

/* --- Loading Spinner --- */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.spinner-container {
    text-align: center;
}

.spinner-container .spinner-text {
    margin-top: 1rem;
    color: var(--gray-600);
    font-size: 0.9rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

/* --- Login Page --- */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-container {
    width: 100%;
    max-width: 430px;
}

.login-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.98);
}

.login-card .card-body {
    padding: 2.5rem;
}

.login-form .form-control {
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
    border-radius: 8px;
}

.login-form .input-group-text {
    border-radius: 8px 0 0 8px;
}

.login-form .input-group .form-control {
    border-radius: 0 8px 8px 0;
}

.login-lang-switcher .btn-group .btn {
    border-radius: 20px;
    padding: 0.25rem 0.85rem;
    font-size: 0.8rem;
}

.toggle-password {
    border-radius: 0 8px 8px 0 !important;
    border-color: var(--gray-300);
}

/* --- Animations --- */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes ripple {
    0% { box-shadow: 0 0 0 0 rgba(26,115,232,0.4); }
    100% { box-shadow: 0 0 0 15px rgba(26,115,232,0); }
}

.fade-in {
    animation: fadeIn 0.4s ease;
}

.slide-in-up {
    animation: slideInUp 0.4s ease;
}

/* --- Calendar / Agenda --- */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.calendar-header h4 {
    font-weight: 600;
    margin: 0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--gray-500);
    padding: 0.75rem 0;
    text-transform: uppercase;
}

.calendar-day {
    min-height: 90px;
    border: 1px solid var(--gray-200);
    padding: 0.5rem;
    transition: background var(--transition-speed);
    cursor: pointer;
}

.calendar-day:hover {
    background: var(--gray-100);
}

.calendar-day.today {
    background: rgba(26,115,232,0.08);
    border-color: var(--primary);
}

.calendar-day.other-month {
    background: var(--gray-100);
    color: var(--gray-400);
}

.calendar-day .day-number {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.calendar-day .day-event {
    font-size: 0.7rem;
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.calendar-day .day-event.event-primary {
    background: rgba(26,115,232,0.15);
    color: var(--primary);
}

.calendar-day .day-event.event-success {
    background: rgba(40,167,69,0.15);
    color: var(--success);
}

.calendar-day .day-event.event-danger {
    background: rgba(220,53,69,0.15);
    color: var(--danger);
}

.calendar-day .day-event.event-warning {
    background: rgba(255,193,7,0.15);
    color: #d39e00;
}

/* --- Global Search Modal --- */
.search-modal .modal-dialog {
    max-width: 600px;
    margin-top: 80px;
}

.search-modal .modal-content {
    border-radius: 12px;
}

.search-modal .search-input {
    border: none;
    font-size: 1.1rem;
    padding: 0.75rem 0;
    outline: none;
    box-shadow: none;
}

.search-modal .search-input:focus {
    box-shadow: none;
}

.search-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    transition: background var(--transition-speed);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-result-item:hover {
    background: var(--gray-100);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* --- Alerts Flash --- */
.alert-floating {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    max-width: 450px;
    box-shadow: var(--box-shadow-lg);
    border: none;
    border-radius: var(--border-radius-sm);
    animation: slideInRight 0.3s ease;
}

.alert-dismissible .btn-close {
    padding: 0.75rem;
}

/* --- Page Header --- */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h3 {
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}

.page-header .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
}

.page-header .breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-size: 1.1rem;
    line-height: 1;
}

/* --- RTL Support --- */
[dir="rtl"] .sidebar {
    left: auto;
    right: 0;
}

[dir="rtl"] .sidebar .nav-link {
    border-left: none;
    border-right: 3px solid transparent;
}

[dir="rtl"] .sidebar .nav-link:hover,
[dir="rtl"] .sidebar .nav-link.active {
    border-left-color: transparent;
    border-right-color: var(--primary);
}

[dir="rtl"] .main-content {
    margin-left: 0;
    margin-right: var(--sidebar-width);
}

[dir="rtl"] .sidebar.collapsed ~ .main-content {
    margin-left: 0;
    margin-right: var(--sidebar-collapsed-width);
}

[dir="rtl"] .app-footer {
    margin-left: 0;
    margin-right: var(--sidebar-width);
}

[dir="rtl"] .sidebar.collapsed ~ .app-footer {
    margin-left: 0;
    margin-right: var(--sidebar-collapsed-width);
}

[dir="rtl"] .submenu .nav-link {
    padding: 8px 50px 8px 20px;
}

[dir="rtl"] .sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

[dir="rtl"] .sidebar.collapsed .nav-link {
    justify-content: center;
}

[dir="rtl"] .sidebar .nav-link .submenu-arrow {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .notification-item.unread {
    border-left: none;
    border-right: 3px solid var(--primary);
}

[dir="rtl"] .ms-auto {
    margin-left: 0 !important;
    margin-right: auto !important;
}

[dir="rtl"] .me-auto {
    margin-right: 0 !important;
    margin-left: auto !important;
}

[dir="rtl"] .me-1, [dir="rtl"] .me-2, [dir="rtl"] .me-3 {
    margin-right: 0 !important;
}

[dir="rtl"] .ms-1, [dir="rtl"] .ms-2, [dir="rtl"] .ms-3 {
    margin-left: 0 !important;
}

[dir="rtl"] .text-start {
    text-align: right !important;
}

[dir="rtl"] .text-end {
    text-align: left !important;
}

[dir="rtl"] .input-group .form-control {
    border-radius: 8px 0 0 8px !important;
}

[dir="rtl"] .input-group-text {
    border-radius: 0 8px 8px 0 !important;
}

[dir="rtl"] .toggle-password {
    border-radius: 8px 0 0 8px !important;
}

[dir="rtl"] .widget-overlay {
    right: auto;
    left: -20px;
}

/* --- Responsive --- */
@media (max-width: 1199.98px) {
    .sidebar {
        width: var(--sidebar-collapsed-width);
    }

    .sidebar .sidebar-brand-text,
    .sidebar .nav-text,
    .sidebar .submenu-arrow,
    .sidebar .submenu,
    .sidebar-footer span {
        display: none;
    }

    .sidebar .nav-icon {
        margin: 0;
        font-size: 1.3rem;
    }

    .sidebar .nav-link {
        justify-content: center;
        padding: 12px 0;
    }

    .main-content {
        margin-left: var(--sidebar-collapsed-width);
    }

    .app-footer {
        margin-left: var(--sidebar-collapsed-width);
    }

    [dir="rtl"] .main-content {
        margin-left: 0;
        margin-right: var(--sidebar-collapsed-width);
    }

    [dir="rtl"] .app-footer {
        margin-left: 0;
        margin-right: var(--sidebar-collapsed-width);
    }
}

@media (max-width: 991.98px) {
    .top-navbar .navbar-brand span {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .sidebar {
        left: -100%;
        width: 260px !important;
        z-index: 1050;
        transition: left var(--transition-speed);
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .sidebar .sidebar-brand-text,
    .sidebar .nav-text,
    .sidebar .submenu-arrow,
    .sidebar .submenu {
        display: block;
    }

    .sidebar .nav-link {
        justify-content: flex-start;
        padding: 10px 20px;
    }

    .sidebar .nav-icon {
        margin: 0;
        font-size: 1.1rem;
    }

    .sidebar-footer span {
        display: block;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1049;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 1rem;
    }

    .app-footer {
        margin-left: 0 !important;
    }

    [dir="rtl"] .sidebar {
        left: auto;
        right: -100%;
    }

    [dir="rtl"] .sidebar.mobile-open {
        left: auto;
        right: 0;
    }

    [dir="rtl"] .main-content,
    [dir="rtl"] .app-footer {
        margin-right: 0 !important;
    }

    .login-card .card-body {
        padding: 1.5rem;
    }

    .notification-dropdown {
        width: 300px;
    }
}

@media (max-width: 575.98px) {
    .main-content {
        padding: 0.75rem;
    }

    .page-header h3 {
        font-size: 1.25rem;
    }

    .card-body {
        padding: 1rem;
    }

    .widget-card .widget-value {
        font-size: 1.35rem;
    }

    .table {
        font-size: 0.8rem;
    }

    .table thead th,
    .table tbody td {
        padding: 0.5rem 0.6rem;
    }
}

/* --- Print Styles --- */
@media print {
    .sidebar,
    .top-navbar,
    .app-footer,
    .btn,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    body {
        background: #fff;
        font-size: 11pt;
    }

    .table thead th {
        background: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    @page {
        margin: 1.5cm;
    }
}
