/* Safari Layout - Custom Theme with Safari Color Palette */

/* ===== COLOR PALETTE VARIABLES ===== */
:root {
    /* Main Color Palette */
    --safari-primary: #8D6748;
    --safari-secondary: #DCC7A6;
    --safari-accent1: #E6723B;
    --safari-accent2: #758E4F;
    --safari-background: #F5F2ED;
    --safari-surface: #FAFAF9;
    --safari-text-primary: #333333;
    --safari-text-light: #777777;
    --safari-danger: #B64D3D;
    --safari-success: #A2B29F;
    
    /* Opacity Variations */
    --safari-secondary-30: rgba(220, 199, 166, 0.3);
    --safari-secondary-20: rgba(220, 199, 166, 0.2);
    --safari-accent1-20: rgba(231, 114, 59, 0.2);
    --safari-accent2-20: rgba(117, 142, 79, 0.2);
    --safari-success-20: rgba(162, 178, 159, 0.2);
    --safari-danger-20: rgba(182, 77, 61, 0.2);
    --safari-primary-20: rgba(141, 103, 72, 0.2);
}

/* ===== GLOBAL THEME OVERRIDES ===== */

/* Page Background */
body,
.layout-main-section,
.layout-main-section-wrapper {
    background-color: var(--safari-background) !important;
}

/* Header Styling */
.navbar,
.desk-header,
.top-bar {
    background-color: var(--safari-surface) !important;
    border-bottom: 1px solid var(--safari-secondary-30) !important;
}

/* Main Content Area */
.layout-main-section {
    background-color: var(--safari-background) !important;
}

/* Card and Surface Elements */
.card,
.widget,
.dashboard-card,
.form-section,
.section-body,
.frappe-card {
    background-color: var(--safari-surface) !important;
    border: 1px solid var(--safari-secondary-20) !important;
    border-radius: 8px !important;
}

.layout-side-section {
    border: 0px !important;
    border-radius: 0px !important;
}

#left-sidebar .layout-side-section-content:has(.desk-sidebar) {
    padding-right: 0px !important;
}    

/* Text Color Overrides */
.text-muted,
.text-medium,
.small {
    color: var(--safari-text-light) !important;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.text-dark {
    color: var(--safari-text-primary) !important;
}

/* ===== SIDEBAR STYLING ===== */

/* Sidebar Background and Structure */
.left-sidebar,
.desk-sidebar {
    background-color: var(--safari-secondary) !important;
    border-right: 1px solid var(--safari-secondary-30) !important;
    padding-top: 0px !important;
    margin-top: 0px !important;
}

/* Sidebar Header */
.sidebar-header {
    background-color: var(--safari-secondary) !important;
    border-bottom: 1px solid var(--safari-secondary-30) !important;
}

/* Logo behavior in collapsed sidebar */

.left-sidebar.collapsed .sidebar-header .app-logo {
    max-height: 50px;
    max-width: 50px;
    transition: all 0.3s ease;
}

.left-sidebar.collapsed .sidebar-header {
    padding: 4px !important;
    display: flex;
    justify-content: center;
    align-items: center;
}

.left-sidebar.collapsed .sidebar-header .navbar-brand {
    margin: 0;
    width: 100%;
    justify-content: center;
}

/* Show condensed menu instead of hiding completely */
.left-sidebar.collapsed .sidebar-content .layout-side-section {
    display: block;
    opacity: 1;
    visibility: visible;
}

/* Hide section labels and text in collapsed state */
.left-sidebar.collapsed .standard-sidebar-label,
.left-sidebar.collapsed .sidebar-item-label {
    display: none;
}

/* Style menu items for collapsed state */
.left-sidebar.collapsed {
    padding: 8px 0;
    margin: 4px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 40px;
}

.left-sidebar.collapsed .sidebar-item-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.left-sidebar.collapsed .sidebar-item-icon:hover {
    background-color: var(--safari-surface) !important;
}

/* Style the actual icons */
.left-sidebar.collapsed .sidebar-item-icon svg,
.left-sidebar.collapsed .sidebar-item-icon .indicator {
    width: 20px;
    height: 20px;
}

/* Hide nested/child items in collapsed state */
.left-sidebar.collapsed .sidebar-child-item,
.left-sidebar.collapsed .nested-container {
    display: none;
}

/* Hide sidebar controls in collapsed state */
.left-sidebar.collapsed .sidebar-item-control {
    display: none;
}

/* Adjust standard sidebar sections */
.left-sidebar.collapsed .standard-sidebar-section {
    margin-bottom: 8px;
}

/* Sidebar Menu Items */


.desk-sidebar-item:hover,
.sidebar-item-container:hover {
    background-color: var(--safari-surface) !important;
    border-radius: 8px !important;
}

.desk-sidebar-item.active,
.sidebar-item-container.active {
    background-color: var(--safari-primary) !important;
    color: var(--safari-surface) !important;
}

.desk-sidebar-item.active .sidebar-item-label,
.sidebar-item-container.active .sidebar-item-label {
    color: var(--safari-surface) !important;
}

/* Sidebar Section Labels */
.standard-sidebar-label {
    color: var(--safari-text-primary) !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    font-size: 11px !important;
    letter-spacing: 0.5px !important;
    margin: 12px 8px 4px 8px !important;
}

/* ===== BUTTONS AND CONTROLS ===== */

/* Primary Buttons */
.btn-primary,
.btn.btn-primary {
    background-color: var(--safari-primary) !important;
    border-color: var(--safari-primary) !important;
    color: var(--safari-surface) !important;
}

.btn-primary:hover,
.btn.btn-primary:hover {
    background-color: var(--safari-text-primary) !important;
    border-color: var(--safari-text-primary) !important;
}

/* Secondary Buttons */
.btn-secondary,
.btn.btn-secondary {
    background-color: var(--safari-secondary) !important;
    border-color: var(--safari-secondary) !important;
    color: var(--safari-text-primary) !important;
}

.btn-secondary:hover,
.btn.btn-secondary:hover {
    background-color: var(--safari-primary) !important;
    border-color: var(--safari-primary) !important;
    color: var(--safari-surface) !important;
}

/* Success Buttons */
.btn-success {
    background-color: var(--safari-accent2) !important;
    border-color: var(--safari-accent2) !important;
}

/* Danger Buttons */
.btn-danger {
    background-color: var(--safari-danger) !important;
    border-color: var(--safari-danger) !important;
}

/* Warning Buttons */
.btn-warning {
    background-color: var(--safari-accent1) !important;
    border-color: var(--safari-accent1) !important;
    color: var(--safari-surface) !important;
}

/* ===== STATUS BADGES AND INDICATORS ===== */

/* Status Badges */
.indicator.green,
.badge.badge-success,
.label.label-success {
    background-color: var(--safari-accent2-20) !important;
    color: var(--safari-accent2) !important;
}

.indicator.orange,
.badge.badge-warning,
.label.label-warning {
    background-color: var(--safari-accent1-20) !important;
    color: var(--safari-accent1) !important;
}

.indicator.red,
.badge.badge-danger,
.label.label-danger {
    background-color: var(--safari-danger-20) !important;
    color: var(--safari-danger) !important;
}

.indicator.blue,
.badge.badge-info,
.label.label-info {
    background-color: var(--safari-primary-20) !important;
    color: var(--safari-primary) !important;
}

/* ===== FORM ELEMENTS ===== */

/* Form Controls */
.form-control,
.input-group .form-control {
    border: 1px solid var(--safari-secondary-30) !important;
    background-color: var(--safari-surface) !important;
    color: var(--safari-text-primary) !important;
}

.form-control:focus,
.input-group .form-control:focus {
    border-color: var(--safari-primary) !important;
    box-shadow: 0 0 0 0.2rem var(--safari-primary-20) !important;
}

/* Form Labels */
.control-label,
.form-label {
    color: var(--safari-text-primary) !important;
    font-weight: 500 !important;
}

/* ===== TOOLTIPS ===== */

/* Tooltip support for collapsed sidebar */
.left-sidebar.collapsed .sidebar-item-icon {
    position: relative;
}

.left-sidebar.collapsed .sidebar-tooltip {
    position: absolute;
    left: 55px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--safari-text-primary);
    color: var(--safari-surface);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    z-index: 1000;
    pointer-events: none;
}

.left-sidebar.collapsed .sidebar-item-icon:hover .sidebar-tooltip {
    opacity: 1;
    visibility: visible;
}

/* ===== TABLES ===== */

/* Table Styling */
.table {
    background-color: var(--safari-surface) !important;
}

.table th {
    background-color: var(--safari-secondary) !important;
    color: var(--safari-text-primary) !important;
    border-bottom: 2px solid var(--safari-secondary-30) !important;
}

.table td {
    border-top: 1px solid var(--safari-secondary-20) !important;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--safari-background) !important;
}

/* ===== DASHBOARD WIDGETS ===== */

.shortcut-widget-box .widget-head {
    border-bottom: none !important;
}

/* Dashboard Cards */
.widget-head {
    background-color: transparent !important;
    /* background-color: var(--safari-secondary) !important; */
    color: var(--safari-text-primary) !important;
     border-bottom: 1px solid var(--safari-secondary-30) !important; 
}

.widget-body {
    background-color: var(--safari-surface) !important;
}

/* Number Cards */
.number-card-head {
    color: var(--safari-text-light) !important;
}

.number-card-number {
    color: var(--safari-primary) !important;
}

/* ===== TABS ===== */

/* Tab Navigation */
.nav-tabs .nav-link {
    color: var(--safari-text-light) !important;
    border: 1px solid transparent !important;
}

.nav-tabs .nav-link:hover {
    color: var(--safari-primary) !important;
    border-color: var(--safari-secondary-30) !important;
}

.nav-tabs .nav-link.active {
    color: var(--safari-primary) !important;
    background-color: var(--safari-surface) !important;
    border-color: var(--safari-secondary-30) !important;
    border-bottom-color: var(--safari-surface) !important;
}

/* ===== ICONS ===== */

/* Icon styling */
.icon,
.es-icon {
    margin-left: 2px;
    margin-right: 2px;
}

/* Icon colors based on context */
.sidebar-item-icon svg {
    color: var(--safari-text-primary) !important;
}

.left-sidebar .sidebar-item-container.active .sidebar-item-icon svg {
    color: var(--safari-surface) !important;
}

/* ===== NOTIFICATIONS ===== */

/* Notification Dot */
.notification-dot {
    background-color: var(--safari-accent1) !important;
}

/* Alert Messages */
.alert-info {
    background-color: var(--safari-primary-20) !important;
    border-color: var(--safari-primary) !important;
    color: var(--safari-text-primary) !important;
}

.alert-success {
    background-color: var(--safari-success-20) !important;
    border-color: var(--safari-success) !important;
    color: var(--safari-text-primary) !important;
}

.alert-warning {
    background-color: var(--safari-accent1-20) !important;
    border-color: var(--safari-accent1) !important;
    color: var(--safari-text-primary) !important;
}

.alert-danger {
    background-color: var(--safari-danger-20) !important;
    border-color: var(--safari-danger) !important;
    color: var(--safari-text-primary) !important;
}

/* ===== USER AVATAR ===== */

/* User Avatar Styling */
.avatar,
.user-avatar {
    /* background-color: var(--safari-primary) !important; */
    color: var(--safari-surface) !important;
    padding-right: 5px !important;
}

/* ===== SCROLLBARS ===== */

/* Custom Scrollbar for Safari Theme */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--safari-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--safari-primary);
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */

/* Mobile and small screen adjustments */
@media (max-width: 768px) {
    .left-sidebar {
        background-color: var(--safari-secondary) !important;
    }
    
    .sidebar-overlay {
        background-color: rgba(51, 51, 51, 0.5) !important;
    }
}

.sidebar-item-icon {
    padding-right: -2px !important; 
}

body {
    background-color: var(--safari-background) !important;
  }

  .page-head {
    background-color: var(--safari-background) !important;
}

 .page-container {
    background-color: var(--safari-background) !important;
 }
  