/* ============================================
   GROWCYCLE SERVICE HUB - MASTER STYLESHEET
   Complete, Responsive Design System
   ============================================ */

/* ============================================
   CSS VARIABLES (Design Tokens)
   ============================================ */
:root {
    /* Colors */
    --header-bg: #2c3e50;
    --sidebar-bg: #ffffff;
    --accent-yellow: #f5a623;
    --accent-green: #4CAF50;
    --accent-blue: #2196F3;
    --accent-purple: #7C3AED;
    --accent-red: #f44336;
    --text-dark: #333333;
    --text-muted: #6c757d;
    --border-color: #e0e6ed;
    --bg-light: #ffffff;
    --white: #ffffff;

    /* Status Colors */
    --status-success: #388e3c;
    --status-success-bg: #e8f5e9;
    --status-warning: #f57c00;
    --status-warning-bg: #fff3e0;
    --status-danger: #c62828;
    --status-danger-bg: #ffebee;
    --status-info: #1976d2;
    --status-info-bg: #e3f2fd;

    /* Spacing */
    --sidebar-width: 250px;
    --header-height: 60px;
    --content-padding: 25px;
    --card-radius: 10px;
    --btn-radius: 6px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.2);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: var(--accent-green);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   SIDEBAR NAVIGATION
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    border-right: 1px solid var(--border-color);
    z-index: 1001;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--transition-normal);
    display: flex;
    flex-direction: column;
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

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

.sidebar::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* Sidebar Logo */
.sidebar-logo {
    padding: 24px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    background: #fafbfc;
    flex-shrink: 0;
}

.sidebar-logo h1 {
    font-size: 24px;
    color: #2c3e50;
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sidebar-logo h1::before {
    content: '';
    width: 32px;
    height: 32px;
    background: #4CAF50;
    border-radius: 8px;
    display: inline-block;
}

.sidebar-logo small {
    color: #6c757d;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: block;
    margin-top: 4px;
}

.sidebar-logo a {
    display: block;
    text-decoration: none;
}

.sidebar-logo .auth-logo img {
    max-width: 160px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.sidebar-logo-img {
    max-width: 180px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Navigation Sections */
.nav-section {
    padding: 12px 0 8px;
}

.nav-section:first-of-type {
    padding-top: 16px;
}

.nav-section-title {
    padding: 8px 20px 10px;
    font-size: 10px;
    text-transform: uppercase;
    color: #9ca3af;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Navigation Items */
.nav-item {
    display: flex;
    align-items: center;
    padding: 11px 20px;
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    gap: 12px;
    margin: 0 8px;
    border-radius: 0 6px 6px 0;
    position: relative;
}

.nav-item:hover {
    background: #f3f4f6;
    color: #1f2937;
    text-decoration: none;
    border-left-color: #e5e7eb;
}

.nav-item.active {
    background: #fef3c7;
    border-left-color: var(--border-color);
    color: #92400e;
    font-weight: 600;
}

.nav-item.active:hover {
    background: #fde68a;
}

/* Navigation Icons */
.nav-item svg {
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.nav-item:hover svg {
    opacity: 0.8;
}

.nav-item.active svg {
    opacity: 1;
    stroke: #92400e;
}

/* Navigation Item Text */
.nav-item-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Navigation Badges */
.nav-badge,
.badge {
    background: #f59e0b;
    color: #fff;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
    margin-left: auto;
    line-height: 1;
    min-width: 20px;
    text-align: center;
}

.nav-badge.purple {
    background: #43a047;
}

.nav-badge.green {
    background: #43a047;
}

.nav-badge.blue {
    background: #3b82f6;
}

.nav-badge.red {
    background: #ef4444;
}

/* Sparkle/New Icon for special items */
.nav-item .sparkle-icon {
    width: 14px;
    height: 14px;
    margin-left: 6px;
    color: var(--accent-yellow);
    vertical-align: middle;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding: 15px 20px;
    position: relative;
    border-top: 1px solid var(--border-color);
    background: #f9fafb;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background 0.15s ease;
    cursor: pointer;
}

.sidebar-user:hover {
    background: #f3f4f6;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    background: #f59e0b;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 11px;
    color: #6b7280;
}

/* Collapsed Sidebar State (Desktop) */
.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .sidebar-logo {
    padding: 15px 10px;
    justify-content: center;
}

.sidebar.collapsed .sidebar-logo .auth-logo img {
    max-width: 40px;
}

.sidebar.collapsed .sidebar-logo h1 {
    font-size: 0;
}

.sidebar.collapsed .sidebar-logo h1::before {
    width: 36px;
    height: 36px;
}

.sidebar.collapsed .sidebar-logo small {
    display: none;
}

.sidebar.collapsed .nav-section-title {
    font-size: 0;
    height: 10px;
    margin: 10px 0 5px;
    text-align: center;
}

.sidebar.collapsed .nav-section-title::after {
    content: '';
    display: block;
    width: 30px;
    height: 1px;
    background: #e0e6ed;
    margin: 0 auto;
}

.sidebar.collapsed {
    overflow: visible;
}

.sidebar.collapsed .sidebar-nav {
    overflow-y: auto;
    overflow-x: visible;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px;
    margin: 4px 8px;
    border-radius: 8px;
    border-left: none;
    position: relative;
}

.sidebar.collapsed .nav-item svg {
    margin-right: 0;
}

.sidebar.collapsed .nav-item span:not(.nav-badge) {
    display: none;
}

.sidebar.collapsed .nav-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    padding: 2px 5px;
    font-size: 9px;
}

/* Tooltip on hover for collapsed sidebar */
.sidebar.collapsed .nav-item:hover::after {
    content: attr(data-title);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 12px;
    background: #1f2937;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 6px;
    z-index: 99999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.sidebar.collapsed .nav-item:hover::before {
    content: '';
    position: absolute;
    left: calc(100% + 4px);
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #1f2937;
    z-index: 99999;
    pointer-events: none;
}

/* Collapsed sidebar footer */
.sidebar.collapsed .sidebar-footer {
    padding: 10px;
}

.sidebar.collapsed .sidebar-user {
    justify-content: center;
    padding: 10px;
}

.sidebar.collapsed .sidebar-user-info {
    display: none;
}

/* Adjust main content when sidebar is collapsed */
body.sidebar-collapsed .main-header {
    left: 70px;
}

body.sidebar-collapsed .main-content {
    margin-left: 70px;
}

/* Sidebar Nav Wrapper */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 10px;
}

/* Disabled Nav Items (Coming Soon) */
.nav-item.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-item.disabled:hover {
    background: transparent;
    border-left-color: transparent;
}

/* Navigation Sub Items */
.nav-sub-item {
    padding-left: 48px !important;
    font-size: 13px;
}

.nav-sub-item svg {
    width: 16px;
    height: 16px;
}

.sidebar.collapsed .nav-sub-item {
    display: none;
}

/* ============================================
   HEADER
   ============================================ */
.main-header {
    background: var(--header-bg);
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 25px;
}

.main-header .header-search {
    flex: 1;
    max-width: 500px;
}

.header-search {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--btn-radius);
    padding: 0;
    flex: 0 1 350px;
}

.header-search input {
    background: transparent;
    border: none;
    padding: 10px 15px;
    color: var(--white);
    width: 100%;
    font-size: 14px;
    outline: none;
}

.header-search input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.main-header .header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
}

/* Sidebar Toggle Button in Header */
.main-header .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: #f5a623;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #fff;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(245, 166, 35, 0.3);
}

.main-header .sidebar-toggle:hover {
    background: #e6951a;
}

.main-header .sidebar-toggle:active {
    background: #d4880f;
    transform: scale(0.95);
}

.main-header .header-actions>a,
.main-header .header-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: color var(--transition-fast);
}

.main-header .header-actions>a:hover,
.main-header .header-link:hover {
    color: var(--white);
    text-decoration: none;
}

.main-header .header-icon {
    position: relative;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.main-header .header-icon:hover {
    color: var(--white);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-red);
    color: var(--white);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

.main-header .user-avatar {
    width: 38px !important;
    height: 38px !important;
    background: #f5a623 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: transform 0.2s ease !important;
}

.main-header .user-avatar:hover {
    transform: scale(1.05) !important;
}

/* ============================================
   LOCATION SELECTOR (Header Dropdown)
   ============================================ */
.dropdown {
    position: relative;
}

.main-header .location-selector {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: var(--btn-radius) !important;
    padding: 8px 14px !important;
    color: var(--white) !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-family: inherit !important;
    transition: all var(--transition-fast) !important;
    line-height: 1.4 !important;
    height: auto !important;
    min-height: unset !important;
    max-height: unset !important;
    box-sizing: border-box !important;
}

.main-header .location-selector:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.main-header .location-selector span {
    color: var(--white) !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
}

.main-header .location-dot {
    width: 10px !important;
    height: 10px !important;
    min-width: 10px !important;
    min-height: 10px !important;
    background: var(--accent-green) !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
}

.main-header .location-dot.all {
    background: #4CAF50 !important;
}

.main-header .location-dropdown {
    display: none !important;
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    background: var(--white) !important;
    border-radius: 8px !important;
    box-shadow: var(--shadow-md) !important;
    min-width: 280px !important;
    margin-top: 5px !important;
    z-index: 9999 !important;
    overflow: hidden !important;
}

.main-header .location-dropdown.show {
    display: block !important;
}

.main-header .location-dropdown-header {
    padding: 12px 18px !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    color: var(--text-muted) !important;
    font-weight: 600 !important;
    background: #f8f9fa !important;
    border-bottom: 1px solid #eee !important;
}

.main-header .location-option {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 12px 18px !important;
    color: var(--text-dark) !important;
    text-decoration: none !important;
    font-size: 14px !important;
    border-bottom: 1px solid #f0f0f0 !important;
    transition: background var(--transition-fast) !important;
}

.main-header .location-option:hover {
    background: #f8f9fa !important;
    text-decoration: none !important;
}

.main-header .location-option.active {
    background: #fff8e6 !important;
    font-weight: 500 !important;
}

.main-header .location-option:last-child {
    border-bottom: none !important;
}

.main-header .location-divider {
    height: 1px !important;
    background: #eee !important;
    margin: 0 !important;
}

.main-header .location-manage {
    color: var(--accent-blue) !important;
    font-weight: 500 !important;
    display: block !important;
    padding: 12px 18px !important;
    text-decoration: none !important;
    font-size: 14px !important;
}

.main-header .location-manage:hover {
    background: #e3f2fd !important;
}

.location-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--status-success-bg);
    color: #2e7d32;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 15px;
}

.location-indicator .dot {
    width: 6px;
    height: 6px;
    background: var(--accent-green);
    border-radius: 50%;
    display: inline-block;
}

/* ============================================
   DROPDOWN MENUS (General)
   ============================================ */
.dropdown-menu,
.dropdown-menu-custom {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1050;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.dropdown-menu.show,
.dropdown-menu-custom.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-header {
    padding: 15px 18px;
    border-bottom: 1px solid #eee;
}

.dropdown-header strong {
    font-size: 14px;
    color: var(--text-dark);
    display: block;
}

.dropdown-header small {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

.dropdown-item,
.dropdown-item-custom {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 14px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-item:last-child,
.dropdown-item-custom:last-child {
    border-bottom: none;
}

.dropdown-item:hover,
.dropdown-item-custom:hover {
    background: #f8f9fa;
    text-decoration: none;
}

.dropdown-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 5px 0;
}

.dropdown-footer {
    padding: 12px 18px;
    border-top: 1px solid #eee;
    text-align: center;
}

.dropdown-footer a {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.text-danger {
    color: var(--status-danger) !important;
}

/* User Dropdown */
.user-dropdown {
    min-width: 200px;
    position: absolute !important;
    top: calc(100% + 12px) !important;
    right: 0 !important;
    left: auto !important;
    z-index: 1100;
}

/* Arrow pointer for user dropdown */
.user-dropdown::before {
    content: '';
    position: absolute;
    top: -7px;
    right: 12px;
    width: 14px;
    height: 14px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-right: none;
    border-bottom: none;
    transform: rotate(45deg);
    z-index: 1;
}

/* Ensure dropdown parent has relative positioning */
.header-actions .dropdown {
    position: relative;
}

/* Notification Dropdown */
.notification-dropdown {
    width: 360px;
    max-width: calc(100vw - 40px);
    position: absolute !important;
    top: calc(100% + 12px) !important;
    right: 0 !important;
    left: auto !important;
    z-index: 1100;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* Arrow pointer */
.notification-dropdown::before {
    content: '';
    position: absolute;
    top: -7px;
    right: 18px;
    width: 14px;
    height: 14px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-right: none;
    border-bottom: none;
    transform: rotate(45deg);
    z-index: 1;
}

.notification-dropdown .dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}

.notification-dropdown .dropdown-header span {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
}

.notification-dropdown .mark-all-read {
    font-size: 12px;
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
}

.notification-dropdown .mark-all-read:hover {
    text-decoration: underline;
}

.notification-list {
    max-height: 320px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
    transition: background var(--transition-fast);
    align-items: flex-start;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item.unread {
    background: #f0f7ff;
    border-left: 3px solid var(--accent-blue);
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    background: #e5e7eb;
}

.notification-icon.info {
    background: #1d4ed8;
    color: #fff;
}

.notification-icon.success,
.notification-icon.quote_accepted,
.notification-icon.job_complete,
.notification-icon.payment {
    background: #059669;
    color: #fff;
}

.notification-icon.warning,
.notification-icon.job_scheduled {
    background: #d97706;
    color: #fff;
}

.notification-icon.error,
.notification-icon.overdue {
    background: #dc2626;
    color: #fff;
}

.notification-icon.new_lead {
    background: #3b82f6;
    color: #fff;
}

.notification-icon.daily_summary {
    background: #43a047;
    color: #fff;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-content p {
    margin: 0 0 4px 0;
    font-size: 13px;
    color: var(--text-dark);
    line-height: 1.4;
}

.notification-content small {
    font-size: 11px;
    color: var(--text-muted);
}

.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.notification-empty::before {
    content: '🔔';
    display: block;
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.notification-dropdown .dropdown-footer {
    padding: 12px 16px;
    border-top: 1px solid #eee;
    text-align: center;
    background: #fafafa;
}

.notification-dropdown .dropdown-footer a {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.notification-dropdown .dropdown-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

.content {
    padding: var(--content-padding);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-title {
    font-size: 26px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.header-buttons,
.quick-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.top-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.top-actions-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn,
.btn-action {
    padding: 10px 20px;
    border-radius: var(--btn-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
    font-family: inherit;
    line-height: 1.4;
}

.btn-secondary {
    background: var(--white);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #f8f9fa;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-yellow);
    color: var(--white);
}

.btn-primary:hover {
    background: #e09a1e;
    color: var(--white);
    text-decoration: none;
}

.btn-success {
    background: var(--accent-green);
    color: var(--white);
}

.btn-success:hover {
    background: #45a049;
    color: var(--white);
    text-decoration: none;
}

.btn-danger {
    background: var(--accent-red);
    color: var(--white);
}

.btn-danger:hover {
    background: #d32f2f;
    color: var(--white);
    text-decoration: none;
}

.btn-info {
    background: var(--accent-blue);
    color: var(--white);
}

.btn-info:hover {
    background: #1976d2;
}

.btn-green {
    background: #43a047;
    color: var(--white);
}

.btn-green:hover {
    background: #059669;
    color: var(--white);
    text-decoration: none;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

.btn-filter {
    padding: 10px 22px;
    background: var(--accent-green);
    color: var(--white);
    border: none;
    border-radius: var(--btn-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.btn-filter:hover {
    background: #45a049;
}

/* ============================================
   CARDS & PANELS
   ============================================ */
.card {
    background: var(--white);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: visible;
}

.card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.card-header h3,
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.card-body {
    padding: 22px;
    overflow: visible;
}

.card-footer {
    padding: 15px 22px;
    border-top: 1px solid var(--border-color);
    background: #f8f9fa;
}

/* ============================================
   STATS CARDS / GRID
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.stats-grid.cols-5 {
    grid-template-columns: repeat(5, 1fr);
}

.stats-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.stats-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.stat-card {
    background: var(--white);
    border-radius: var(--card-radius);
    padding: 22px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

/* Colored variants removed - all cards use uniform border now */
.stat-card.highlight,
.stat-card.green,
.stat-card.blue,
.stat-card.red {
    border: 1px solid var(--border-color);
}

.stat-number,
.stat-value {
    font-size: 34px;
    font-weight: 700;
    color: #1E3A5F;
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
}

.stat-change {
    font-size: 13px;
    margin-top: 10px;
}

.stat-change.positive {
    color: var(--accent-green);
}

.stat-change.negative {
    color: var(--accent-red);
}

.stat-card .number {
    font-size: 34px;
    font-weight: 700;
    color: #1E3A5F;
    line-height: 1;
}

.stat-card .label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Stats Bar (Alternative) */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.stats-row.cols-5 {
    grid-template-columns: repeat(5, 1fr);
}

.stats-row.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* ============================================
   VIEW TABS
   ============================================ */
.view-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.view-tab {
    padding: 12px 28px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    transition: all var(--transition-fast);
    font-family: inherit;
}

.view-tab:hover {
    border-color: var(--accent-yellow);
}

.view-tab.active {
    background: var(--accent-yellow);
    border-color: var(--accent-yellow);
    color: var(--white);
}

.view-panel {
    display: none;
}

.view-panel.active {
    display: block;
}

/* Page Tabs (Alternative Style) */
.page-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.page-tab {
    padding: 14px 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    position: relative;
    margin-bottom: -2px;
    border-bottom: 2px solid transparent;
    font-family: inherit;
    transition: color var(--transition-fast);
}

.page-tab:hover {
    color: var(--text-dark);
    text-decoration: none;
}

.page-tab.active {
    color: var(--accent-green);
    border-bottom-color: var(--accent-green);
}

/* Detail Tabs */
.detail-tabs {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 25px;
}

.detail-tab {
    padding: 14px 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    position: relative;
    margin-bottom: -2px;
    font-family: inherit;
}

.detail-tab:hover {
    color: var(--text-dark);
}

.detail-tab.active {
    color: var(--accent-yellow);
    border-bottom: 2px solid var(--accent-yellow);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================
   FILTERS BAR
   ============================================ */
.filters-bar {
    background: var(--white);
    padding: 20px 24px;
    border-radius: var(--card-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
    overflow: visible !important;
    position: relative;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    overflow: visible;
}

.filter-group label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.filter-group select,
.filter-group input[type="date"],
.filter-group input[type="text"] {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--btn-radius);
    font-size: 13px;
    min-width: 150px;
    font-family: inherit;
    background: #fff;
    color: var(--text-dark);
    height: 42px;
}

.filter-group select {
    padding-right: 36px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--accent-yellow);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);
}

.filter-group input::placeholder {
    color: #9ca3af;
}

.filter-row {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    overflow: visible !important;
}

.filter-group.filter-search {
    flex: 1;
    min-width: 180px;
    max-width: 250px;
}

.filter-group.filter-search input {
    width: 100%;
}

/* ============================================
   DATE RANGE PICKER
   ============================================ */
.filter-group.filter-date-range {
    position: relative !important;
    overflow: visible !important;
}

.date-range-picker {
    position: relative !important;
    display: inline-block;
}

.date-range-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--btn-radius);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 160px;
    height: 42px;
}

.date-range-trigger:hover {
    border-color: var(--accent-yellow);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);
}

.date-range-trigger svg {
    color: var(--accent-yellow);
    flex-shrink: 0;
}

.date-range-trigger .chevron {
    margin-left: auto;
    color: #9ca3af;
    transition: transform 0.2s ease;
}

.date-range-picker.open .date-range-trigger {
    border-color: var(--accent-yellow);
    box-shadow: 0 2px 8px rgba(245, 166, 35, 0.15);
}

.date-range-picker.open .chevron {
    transform: rotate(180deg);
}

.date-range-dropdown {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 9999 !important;
    display: none;
    min-width: 280px;
    overflow: hidden;
}

.date-range-picker.open .date-range-dropdown {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.date-range-presets {
    padding: 8px;
    border-bottom: 1px solid #f3f4f6;
    max-height: 300px;
    overflow-y: auto;
}

.preset-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.preset-btn:hover {
    background: #fef9f0;
}

.preset-btn.active {
    background: #fef3cd;
    color: #b45309;
    font-weight: 500;
}

.preset-btn .preset-date {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 400;
}

.preset-btn.active .preset-date {
    color: #d97706;
}

.date-range-custom {
    padding: 12px;
    background: #f9fafb;
}

.custom-range-header {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.custom-range-inputs {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.date-input-group {
    flex: 1;
}

.date-input-group label {
    display: block;
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 4px;
}

.date-input-group input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-dark);
    background: #fff;
}

.date-input-group input:focus {
    outline: none;
    border-color: var(--accent-yellow);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);
}

.apply-custom-btn {
    width: 100%;
    padding: 10px;
    background: var(--accent-yellow);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.apply-custom-btn:hover {
    background: #e09a1e;
}

/* ============================================
   DATA TABLES
   ============================================ */
.list-wrapper {
    background: var(--white);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-sm);
    overflow: visible;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f8f9fa;
    padding: 14px 18px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 16px 18px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    vertical-align: middle;
}

.data-table tr:hover {
    background: #fafbfc;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table .text-muted {
    color: var(--text-muted);
    font-size: 13px;
}

.data-table .text-right {
    text-align: right;
}

/* Line Items Table */
.line-items-table {
    width: 100%;
    border-collapse: collapse;
}

.line-items-table th {
    text-align: left;
    padding: 12px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    background: #f8f9fa;
}

.line-items-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.line-items-table .text-right {
    text-align: right;
}

/* ============================================
   STATUS BADGES
   ============================================ */
.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
    white-space: nowrap;
}

.status-active,
.status-completed,
.status-paid {
    background: var(--status-success-bg);
    color: var(--status-success);
}

.status-scheduled,
.status-sent {
    background: var(--status-info-bg);
    color: var(--status-info);
}

.status-inprogress,
.status-in-progress,
.status-partial {
    background: var(--status-warning-bg);
    color: var(--status-warning);
}

.status-pending,
.status-overdue,
.status-declined {
    background: var(--status-danger-bg);
    color: var(--status-danger);
}

.status-draft,
.status-inactive {
    background: #f5f5f5;
    color: #757575;
}

.status-accepted {
    background: var(--status-success-bg);
    color: var(--status-success);
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* Confidence Badges */
.confidence-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.confidence-high {
    background: var(--status-success-bg);
    color: var(--status-success);
}

.confidence-medium {
    background: var(--status-warning-bg);
    color: var(--status-warning);
}

.confidence-low {
    background: #fce4ec;
    color: #c2185b;
}

/* Stage Badge */
.stage-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: var(--status-info-bg);
    color: var(--status-info);
}

/* Source Badge */
.source-badge {
    background: #f3e5f5;
    color: #7b1fa2;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
}

/* Crew Badge */
.crew-badge {
    background: var(--status-success-bg);
    color: var(--accent-green);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

/* Type Badge */
.type-badge {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

.type-service {
    background: var(--status-info-bg);
    color: var(--status-info);
}

.type-product {
    background: var(--status-success-bg);
    color: var(--status-success);
}

.type-material {
    background: var(--status-warning-bg);
    color: var(--status-warning);
}

/* ============================================
   ACTION LINKS
   ============================================ */
.action-link {
    color: var(--accent-green);
    text-decoration: none;
    font-weight: 500;
}

.action-link:hover {
    text-decoration: underline;
}

.view-all {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.view-all:hover {
    text-decoration: underline;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--btn-radius);
    font-size: 14px;
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-yellow);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);
}

.form-control.is-invalid {
    border-color: var(--accent-red);
}

.invalid-feedback {
    color: var(--accent-red);
    font-size: 13px;
    margin-top: 6px;
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .input-group-text {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: var(--btn-radius) 0 0 var(--btn-radius);
}

.input-group .form-control {
    border-radius: 0 var(--btn-radius) var(--btn-radius) 0;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-row.cols-3,
.form-row.three-col {
    grid-template-columns: repeat(3, 1fr);
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.required {
    color: var(--accent-red);
}

/* Toggle Switch */
.toggle-switch,
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input,
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider,
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: var(--transition-normal);
    border-radius: 26px;
}

.toggle-slider:before,
.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition-normal);
    border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider,
.switch input:checked+.slider,
input:checked+.slider {
    background-color: var(--accent-green);
}

.toggle-switch input:checked+.toggle-slider:before,
.switch input:checked+.slider:before,
input:checked+.slider:before {
    transform: translateX(24px);
}

/* Toggle Switch Small Variant */
.toggle-switch.toggle-sm,
.toggle-switch-sm {
    width: 36px;
    height: 20px;
}

.toggle-switch.toggle-sm .toggle-slider,
.toggle-slider-sm {
    border-radius: 20px;
}

.toggle-switch.toggle-sm .toggle-slider:before,
.toggle-slider-sm:before {
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
}

.toggle-switch.toggle-sm input:checked+.toggle-slider:before,
.toggle-switch-sm input:checked+.toggle-slider-sm:before {
    transform: translateX(16px);
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--text-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-dark);
    background: #f0f0f0;
}

.modal-body {
    padding: 25px 25px 0;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 20px 25px 45px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f8f9fa;
    flex-shrink: 0;
}

/* ============================================
   DASHBOARD SPECIFIC
   ============================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
}

/* Job List */
.job-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.job-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.job-info h4 {
    font-size: 14px;
    color: var(--text-dark);
    margin: 0 0 5px 0;
    font-weight: 500;
}

.job-info p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.job-time {
    font-size: 13px;
    color: var(--text-muted);
    text-align: right;
}

.job-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 5px;
}

/* Activity List */
.activity-list,
.activity-feed {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-item {
    display: flex;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    background: #f0f0f0;
}

.activity-icon.lead {
    background: var(--status-info-bg);
    color: var(--status-info);
}

.activity-icon.payment {
    background: var(--status-success-bg);
    color: var(--status-success);
}

.activity-icon.job {
    background: var(--status-warning-bg);
    color: var(--status-warning);
}

.activity-icon.invoice {
    background: #fce4ec;
    color: #c2185b;
}

.activity-text {
    font-size: 14px;
    color: var(--text-dark);
    margin: 0 0 4px 0;
}

.activity-time {
    font-size: 12px;
    color: var(--text-muted);
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 500;
    margin-bottom: 4px;
}

.activity-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-yellow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

/* Chart Placeholder */
.chart-placeholder {
    height: 200px;
    background: #f5f7fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ============================================
   LOCATIONS PAGE
   ============================================ */
.locations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.location-card {
    background: var(--white);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition-fast);
}

/* Hover effect removed */

.location-card.primary {
    border: 2px solid var(--accent-green);
}

.location-card-header {
    padding: 20px;
    background: #2c3e50;
    color: var(--white);
    position: relative;
}

.location-card.primary .location-card-header {
    background: #4CAF50;
}

.location-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 600;
}

.location-badge.primary {
    background: var(--white);
    color: var(--accent-green);
}

.location-card-header h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 5px 0;
}

.location-card-header p {
    font-size: 0.85rem;
    opacity: 0.9;
    margin: 0;
}

.location-card-body {
    padding: 20px;
}

.location-info-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
}

.location-info-row:last-child {
    margin-bottom: 0;
}

.location-info-icon {
    width: 32px;
    height: 32px;
    background: var(--bg-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.location-info-content {
    flex: 1;
}

.location-info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 3px;
}

.location-info-value {
    font-size: 0.9rem;
    color: var(--text-dark);
}

.location-info-value a {
    color: var(--accent-blue);
    text-decoration: none;
}

.location-info-value a:hover {
    text-decoration: underline;
}

.location-card-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.location-stats {
    display: flex;
    gap: 20px;
}

.location-stat {
    text-align: center;
}

.location-stat .value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--header-bg);
}

.location-stat .label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.location-actions {
    display: flex;
    gap: 8px;
}

/* ============================================
   SETTINGS PAGE
   ============================================ */
.settings-nav {
    background: var(--white);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.settings-nav-item {
    display: block;
    padding: 15px 20px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
    border-bottom: 1px solid #f0f0f0;
}

.settings-nav-item:hover {
    background: #f8f9fa;
    text-decoration: none;
}

.settings-nav-item.active {
    background: #fff8e6;
    border-left-color: var(--accent-yellow);
    font-weight: 500;
}

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

.settings-section {
    margin-bottom: 30px;
}

.settings-section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

/* Integration Cards */
.integration-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.integration-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.integration-icon {
    width: 48px;
    height: 48px;
    background: #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.integration-name {
    font-weight: 600;
    color: var(--text-dark);
}

.integration-desc {
    font-size: 13px;
    color: var(--text-muted);
}

.connected {
    color: var(--accent-green);
    font-size: 13px;
    font-weight: 500;
}

/* ============================================
   CALENDAR
   ============================================ */
.calendar-wrapper {
    background: var(--white);
    border-radius: var(--card-radius);
    padding: 25px;
    box-shadow: var(--shadow-sm);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.calendar-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.calendar-nav button {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: var(--white);
    border-radius: var(--btn-radius);
    cursor: pointer;
    font-family: inherit;
}

.calendar-nav button:hover {
    background: #f8f9fa;
}

.calendar-title {
    font-size: 20px;
    font-weight: 600;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.calendar-day-header {
    background: #f8f9fa;
    padding: 12px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.calendar-day {
    background: var(--white);
    min-height: 100px;
    padding: 8px;
}

.calendar-day-number {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
}

.calendar-event {
    background: var(--accent-green);
    color: var(--white);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-event.orange {
    background: var(--accent-yellow);
}

.calendar-event.blue {
    background: var(--accent-blue);
}

/* ============================================
   MAP PLACEHOLDER
   ============================================ */
.map-wrapper {
    background: var(--white);
    border-radius: var(--card-radius);
    padding: 25px;
    box-shadow: var(--shadow-sm);
}

.map-placeholder {
    height: 550px;
    background: #e9ecef;
    border-radius: var(--card-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.map-legend {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.high {
    background: var(--status-success);
}

.legend-dot.medium {
    background: var(--status-warning);
}

.legend-dot.low {
    background: #c2185b;
}

/* ============================================
   DETAIL PAGES
   ============================================ */
.detail-header {
    background: var(--white);
    border-radius: var(--card-radius);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);
}

.detail-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 15px;
}

.detail-meta {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.detail-meta-item {
    font-size: 14px;
}

.detail-meta-item .label {
    color: var(--text-muted);
    margin-right: 8px;
}

/* ============================================
   NOTES & COMMENTS
   ============================================ */
.note-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.note-author {
    font-weight: 500;
}

.note-date {
    font-size: 12px;
    color: var(--text-muted);
}

.note-content {
    font-size: 14px;
    line-height: 1.6;
}

/* ============================================
   SUMMARY CARDS (Quote/Invoice Totals)
   ============================================ */
.summary-card {
    background: var(--white);
    border-radius: var(--card-radius);
    padding: 25px;
    box-shadow: var(--shadow-sm);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.total {
    font-weight: 600;
    font-size: 16px;
    border-top: 2px solid var(--border-color);
    margin-top: 10px;
    padding-top: 15px;
}

.totals-section {
    margin-top: 20px;
    border-top: 2px solid var(--border-color);
    padding-top: 20px;
}

.totals-row {
    display: flex;
    justify-content: flex-end;
    gap: 50px;
    padding: 8px 0;
    font-size: 14px;
}

.totals-row.grand-total {
    font-size: 18px;
    font-weight: 600;
    border-top: 2px solid var(--border-color);
    margin-top: 10px;
    padding-top: 15px;
}

.totals-label {
    color: var(--text-muted);
    min-width: 120px;
    text-align: right;
}

.totals-value {
    min-width: 100px;
    text-align: right;
}

/* ============================================
   BATCH ACTIONS
   ============================================ */
.batch-actions {
    background: #fff3cd;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.batch-actions.show {
    display: flex;
}

.batch-count {
    font-weight: 600;
    color: var(--text-dark);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 14px;
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.breadcrumb a {
    color: var(--text-muted);
}

.breadcrumb a:hover {
    color: var(--accent-green);
}

/* ============================================
   REPORTS PAGE
   ============================================ */
.report-card {
    background: var(--white);
    border-radius: var(--card-radius);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.report-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.report-card-title {
    font-size: 16px;
    font-weight: 600;
}

/* ============================================
   SCHEDULER PAGE
   ============================================ */
.scheduler-sidebar {
    width: 300px;
    background: var(--white);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    height: fit-content;
}

.unscheduled-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.unscheduled-item {
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: grab;
    background: var(--white);
    transition: all var(--transition-fast);
}

.unscheduled-item:hover {
    border-color: var(--accent-yellow);
    box-shadow: var(--shadow-sm);
}

.unscheduled-item-title {
    font-weight: 500;
    margin-bottom: 5px;
}

.unscheduled-item-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   PRODUCTS/SERVICES PAGE
   ============================================ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--white);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition-fast);
}

/* Hover effect removed */

.product-card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.product-card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 5px 0;
}

.product-card-body {
    padding: 20px;
}

.product-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-green);
}

.product-price small {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
}

/* ============================================
   LAYOUT HELPERS
   ============================================ */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.three-column {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.sidebar-column {
    width: 350px;
    flex-shrink: 0;
}

.main-column {
    flex: 1;
    min-width: 0;
}

.content-with-sidebar {
    display: flex;
    gap: 25px;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-muted {
    color: var(--text-muted) !important;
}

.text-success {
    color: var(--status-success) !important;
}

.text-danger {
    color: var(--status-danger) !important;
}

.text-warning {
    color: var(--status-warning) !important;
}

.text-right {
    text-align: right !important;
}

.text-center {
    text-align: center !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-10 {
    margin-bottom: 10px !important;
}

.mb-20 {
    margin-bottom: 20px !important;
}

.mt-10 {
    margin-top: 10px !important;
}

.mt-20 {
    margin-top: 20px !important;
}

.p-20 {
    padding: 20px !important;
}

.d-flex {
    display: flex !important;
}

.align-center {
    align-items: center !important;
}

.justify-between {
    justify-content: space-between !important;
}

.gap-10 {
    gap: 10px !important;
}

.gap-20 {
    gap: 20px !important;
}

.flex-1 {
    flex: 1 !important;
}

.flex-wrap {
    flex-wrap: wrap !important;
}

.hidden {
    display: none !important;
}

/* ============================================
   AUTH / LOGIN PAGES
   ============================================ */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--status-success-bg);
}

.auth-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo img {
    max-width: 200px;
    height: auto;
    display: inline-block;
}

.auth-logo-icon {
    width: 60px;
    height: 60px;
    background: var(--accent-green);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.auth-logo-icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

.auth-logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.auth-logo p {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

.auth-links {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.auth-links a {
    color: var(--accent-green);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.auth-links a:hover {
    text-decoration: underline;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-green);
}

.form-check-label {
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer {
    text-align: center;
    margin-top: 30px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ============================================
   PULSE ANIMATION (for status indicators)
   ============================================ */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Extra Large Screens (1400px and below) */
@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .stats-grid.cols-5 {
        grid-template-columns: repeat(3, 1fr);
    }

    .stats-grid.cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Large Screens (1200px and below) */
@media (max-width: 1200px) {

    .two-column,
    .three-column {
        grid-template-columns: 1fr;
    }

    .content-with-sidebar {
        flex-direction: column;
    }

    .sidebar-column {
        width: 100%;
    }

    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .locations-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* Medium Screens / Tablets (992px and below) */
@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid.cols-5,
    .stats-grid.cols-4,
    .stats-grid.cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row,
    .form-row.cols-3 {
        grid-template-columns: 1fr;
    }

    .detail-meta {
        flex-direction: column;
        gap: 10px;
    }

    .header-search {
        flex: 0 1 250px;
    }

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

    .calendar-day {
        min-height: 80px;
        padding: 4px;
    }

    .calendar-event {
        font-size: 10px;
        padding: 2px 4px;
    }

    /* Enhanced tablet-specific styles */
    .page-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        padding-bottom: 5px;
    }

    .page-tab {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .modal {
        max-width: min(600px, calc(100vw - 40px));
        margin: 20px;
    }

    .card {
        margin-bottom: 16px;
    }

    .card-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .filters-bar {
        flex-wrap: wrap;
        gap: 12px;
    }

    .filter-group {
        flex: 1 1 150px;
        min-width: 150px;
    }

    .data-table {
        font-size: 13px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }

    .action-link,
    .action-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-card {
        padding: 16px;
    }

    .tab-buttons {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1 1 auto;
        min-width: 100px;
    }
}

/* Sidebar Close Button - Hidden on Desktop */
.sidebar-close-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.sidebar-close-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Small Screens / Mobile (768px and below) */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar-logo {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        gap: 10px;
    }

    .sidebar-logo .auth-logo {
        display: flex;
        align-items: center;
    }

    .sidebar-logo .auth-logo img {
        max-width: 130px;
        height: auto;
        margin: 0;
    }

    .sidebar-close-btn {
        display: flex;
        position: static !important;
        transform: none !important;
        flex-shrink: 0;
        width: 32px;
        height: 32px;
    }

    .nav-section:first-of-type {
        padding-top: 8px;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        z-index: 9999;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Reset collapsed state on mobile */
    .sidebar.collapsed {
        width: 280px;
    }

    body.sidebar-collapsed .main-header,
    body.sidebar-collapsed .main-content {
        margin-left: 0;
        left: 0;
    }

    .main-header {
        left: 0;
        padding: 0 15px;
        gap: 10px;
    }

    .main-content {
        margin-left: 0;
    }

    .content {
        padding: 15px;
    }

    .stats-grid,
    .stats-grid.cols-5,
    .stats-grid.cols-4,
    .stats-grid.cols-3 {
        grid-template-columns: 1fr;
    }

    .stats-bar {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-title {
        font-size: 22px;
    }

    .header-buttons,
    .quick-actions {
        width: 100%;
        flex-direction: column;
    }

    .header-buttons .btn,
    .quick-actions .btn {
        width: 100%;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group select,
    .filter-group input {
        min-width: auto;
        width: 100%;
    }

    /* Date range picker full width on mobile */
    .filter-group.filter-date-range {
        width: 100%;
    }

    .filter-group.filter-date-range .date-range-picker {
        width: 100%;
    }

    .filter-group.filter-date-range .date-range-trigger {
        width: 100%;
        min-width: auto;
    }

    .header-search {
        display: none;
    }

    .header-actions {
        gap: 15px;
    }

    .location-selector span:not(.location-dot) {
        display: none;
    }

    .view-tabs {
        flex-direction: column;
    }

    .view-tab {
        width: 100%;
        text-align: center;
    }

    .page-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .page-tab {
        flex-shrink: 0;
        padding: 12px 16px;
    }

    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal {
        max-width: 100%;
        margin: 10px;
        border-radius: 8px;
    }

    .modal-body {
        padding: 15px;
    }

    .modal-header,
    .modal-footer {
        padding: 15px;
    }

    .job-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .job-time {
        text-align: left;
    }

    .location-card-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .location-stats {
        width: 100%;
        justify-content: space-between;
    }

    .integration-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .calendar-wrapper {
        padding: 15px;
    }

    .calendar-grid {
        display: none;
    }

    .auth-card {
        padding: 25px;
    }

    .totals-row {
        gap: 20px;
        font-size: 13px;
    }

    .totals-row.grand-total {
        font-size: 16px;
    }
}

/* Extra Small Screens (480px and below) */
@media (max-width: 480px) {
    .stat-card {
        padding: 15px;
    }

    .stat-number,
    .stat-value,
    .stat-card .number {
        font-size: 28px;
    }

    .card-body {
        padding: 15px;
    }

    .card-header {
        padding: 15px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .locations-grid {
        grid-template-columns: 1fr;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .detail-header-top {
        flex-direction: column;
    }
}

/* ============================================
   CUSTOMER LIST SPECIFIC
   ============================================ */
.customer-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.customer-avatar {
    width: 40px;
    height: 40px;
    background: var(--accent-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.customer-avatar.orange {
    background: var(--accent-yellow);
}

.customer-avatar.blue {
    background: var(--accent-blue);
}

/* ============================================
   SERVICE TAGS
   ============================================ */
.service-tag {
    display: inline-block;
    background: #f0f4f8;
    color: #4a5568;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-right: 4px;
    margin-bottom: 2px;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
    margin-top: 20px;
    padding: 15px;
}

.pagination button,
.pagination a,
.paginate_button {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    background: var(--white);
    border-radius: var(--btn-radius);
    cursor: pointer;
    font-size: 14px;
    color: var(--text-dark);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.pagination button:hover,
.pagination a:hover,
.paginate_button:hover {
    background: #f8f9fa;
    text-decoration: none;
}

.pagination button.active,
.pagination a.active,
.paginate_button.current {
    background: var(--accent-yellow);
    color: var(--white);
    border-color: var(--accent-yellow);
}

.pagination button:disabled,
.paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   DATATABLES COMPLETE OVERRIDE
   ============================================ */
/* Reset DataTables default styles */
table.dataTable {
    width: 100% !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    margin: 0 !important;
}

table.dataTable thead th,
table.dataTable thead td {
    background: #f8f9fa !important;
    padding: 14px 18px !important;
    text-align: left !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    color: #6c757d !important;
    font-weight: 600 !important;
    border-bottom: 2px solid #e0e6ed !important;
    border-top: none !important;
}

table.dataTable tbody td {
    padding: 16px 18px !important;
    border-bottom: 1px solid #f0f0f0 !important;
    font-size: 14px !important;
    vertical-align: middle !important;
    border-top: none !important;
}

table.dataTable tbody tr:hover {
    background: #fafbfc !important;
}

table.dataTable tbody tr:last-child td {
    border-bottom: none !important;
}

/* DataTables wrapper */
.dataTables_wrapper {
    padding: 0 !important;
}

/* Hide DataTables default filter (we use our own) */
.dataTables_wrapper .dataTables_filter {
    display: none !important;
}

/* DataTables info */
.dataTables_wrapper .dataTables_info {
    padding: 15px 20px !important;
    font-size: 14px !important;
    color: #6c757d !important;
    border-top: none !important;
    flex: 1 !important;
}

/* DataTables length selector */
.dataTables_wrapper .dataTables_length {
    padding: 15px 20px !important;
    font-size: 14px !important;
    color: #6c757d !important;
}

.dataTables_wrapper .dataTables_length label {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
}

.dataTables_wrapper .dataTables_length select {
    padding: 8px 12px !important;
    border: 1px solid #e0e6ed !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    background: #fff !important;
    cursor: pointer !important;
}

/* DataTables pagination */
.dataTables_wrapper .dataTables_paginate {
    padding: 15px 20px !important;
    text-align: right !important;
    border-top: none !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 6px !important;
}

/* Reset paginate_button when it's a wrapper li element */
.dataTables_wrapper .dataTables_paginate .paginate_button.page-item,
div.dataTables_wrapper div.dataTables_paginate ul.pagination li.paginate_button {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    min-width: auto !important;
    height: auto !important;
}

/* Style the actual clickable elements */
.dataTables_wrapper .dataTables_paginate .paginate_button:not(.page-item),
.dataTables_wrapper .dataTables_paginate a.paginate_button,
div.dataTables_wrapper div.dataTables_paginate ul.pagination li a.page-link,
div.dataTables_wrapper div.dataTables_paginate ul.pagination li span.page-link {
    padding: 10px 16px !important;
    margin: 0 !important;
    border: 1px solid #e0e6ed !important;
    background: #fff !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #374151 !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    min-width: 42px !important;
    height: 42px !important;
    transition: all 0.2s ease !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

/* Hover states */
.dataTables_wrapper .dataTables_paginate .paginate_button:not(.page-item):hover,
.dataTables_wrapper .dataTables_paginate a.paginate_button:hover,
div.dataTables_wrapper div.dataTables_paginate ul.pagination li a.page-link:hover {
    background: #f8f9fa !important;
    border-color: #d1d5db !important;
    color: #1f2937 !important;
}

/* Active/Current page */
.dataTables_wrapper .dataTables_paginate .paginate_button.current:not(.page-item),
.dataTables_wrapper .dataTables_paginate .paginate_button.current:not(.page-item):hover,
div.dataTables_wrapper div.dataTables_paginate ul.pagination li.active a.page-link,
div.dataTables_wrapper div.dataTables_paginate ul.pagination li.active span.page-link {
    background: #f5a623 !important;
    color: #fff !important;
    border-color: #f5a623 !important;
    font-weight: 600 !important;
}

/* Disabled states */
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:not(.page-item),
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:not(.page-item):hover,
.dataTables_wrapper .dataTables_paginate a.paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate a.paginate_button.disabled:hover,
div.dataTables_wrapper div.dataTables_paginate ul.pagination li.disabled a.page-link,
div.dataTables_wrapper div.dataTables_paginate ul.pagination li.disabled span.page-link {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    background: #f9fafb !important;
    color: #9ca3af !important;
    border-color: #e5e7eb !important;
}

/* Reset hover on disabled wrapper li */
.dataTables_wrapper .dataTables_paginate .paginate_button.page-item.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.page-item.disabled:hover {
    background: transparent !important;
    border: none !important;
}

/* Ellipsis styling */
.dataTables_wrapper .dataTables_paginate .ellipsis {
    padding: 10px 8px !important;
    color: #6b7280 !important;
}

/* Bootstrap 5 DataTables pagination override */
div.dataTables_wrapper div.dataTables_paginate ul.pagination {
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    gap: 6px !important;
    list-style: none !important;
    border: none !important;
    background: none !important;
}

div.dataTables_wrapper div.dataTables_paginate ul.pagination li {
    margin: 0 !important;
    border: none !important;
    background: none !important;
}

div.dataTables_wrapper div.dataTables_paginate ul.pagination li a.page-link:focus,
div.dataTables_wrapper div.dataTables_paginate ul.pagination li span.page-link:focus {
    box-shadow: none !important;
    outline: 2px solid #f5a623 !important;
    outline-offset: 2px !important;
}

/* Remove any double borders or boxes */
.dataTables_wrapper .dataTables_paginate span {
    display: inline-flex !important;
    gap: 6px !important;
    border: none !important;
    background: none !important;
}

.dataTables_wrapper .dataTables_paginate span .paginate_button {
    border: 1px solid #e0e6ed !important;
}

/* Fix for paginate wrapper spans */
.dataTables_paginate>span,
.dataTables_paginate>.paginate_button {
    border: none !important;
    box-shadow: none !important;
}

/* Ensure no nested borders */
.paginate_button span,
.page-link span {
    border: none !important;
    background: none !important;
    padding: 0 !important;
}

/* Bottom section layout */
.dataTables_wrapper .bottom,
.dataTables_wrapper .table-footer {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
    padding: 15px 20px !important;
    border-top: 1px solid #f0f0f0 !important;
    background: #fafbfc !important;
}

/* Table footer layout - info left, pagination right */
.table-footer {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 15px 20px !important;
    border-top: 1px solid #f0f0f0 !important;
    background: #fafbfc !important;
}

.table-footer .dataTables_info {
    padding: 0 !important;
    border: none !important;
}

.table-footer .dataTables_paginate {
    padding: 0 !important;
    border: none !important;
}

/* Sorting icons */
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc {
    background-image: none !important;
    cursor: pointer !important;
}

table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:after {
    content: '' !important;
    display: none !important;
}

/* Processing indicator */
.dataTables_wrapper .dataTables_processing {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid #e0e6ed !important;
    border-radius: 8px !important;
    padding: 20px 40px !important;
    font-size: 14px !important;
    color: #333 !important;
}

/* Empty table message */
.dataTables_wrapper .dataTables_empty {
    padding: 40px !important;
    text-align: center !important;
    color: #6c757d !important;
    font-size: 14px !important;
}

/* ============================================
   TABS SPECIFIC (Detail Pages)
   ============================================ */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 20px;
    border: none;
    background: none;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.tab-btn:hover {
    color: var(--text-dark);
}

.tab-btn.active {
    color: var(--accent-green);
    border-bottom-color: var(--accent-green);
    font-weight: 500;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {

    .sidebar,
    .main-header,
    .btn,
    .actions-dropdown,
    .header-buttons,
    .quick-actions,
    .filters-bar,
    .batch-actions {
        display: none !important;
    }

    .main-content {
        margin: 0;
        padding: 20px;
    }

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

    .data-table {
        font-size: 12px;
    }

    a {
        text-decoration: none;
        color: inherit;
    }

    .status-badge,
    .confidence-badge,
    .stage-badge {
        border: 1px solid currentColor;
    }
}

/* ============================================
   MOBILE SIDEBAR TOGGLE (JavaScript Required)
   ============================================ */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

@media (max-width: 768px) {
    .sidebar-toggle {
        display: block;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
    }

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

/* ============================================
   FLASH MESSAGES / ALERTS (MISSING COMPONENT)
   ============================================ */
.flash-message,
.alert {
    padding: 14px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid transparent;
}

.flash-message svg,
.alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.flash-message-content,
.alert-content {
    flex: 1;
}

.flash-message strong,
.alert strong {
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

.flash-message.success,
.alert-success {
    background: #D1FAE5;
    color: #059669;
    border-color: #43a047;
}

.flash-message.error,
.alert-error,
.alert-danger {
    background: #FEE2E2;
    color: #DC2626;
    border-color: #EF4444;
}

.flash-message.warning,
.alert-warning {
    background: #FEF3C7;
    color: #D97706;
    border-color: #F59E0B;
}

.flash-message.info,
.alert-info {
    background: #DBEAFE;
    color: #2563EB;
    border-color: #3B82F6;
}

.flash-message-close,
.alert-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.flash-message-close:hover,
.alert-close:hover {
    opacity: 1;
}

/* ============================================
   EMPTY STATE COMPONENT
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    background: var(--bg-light);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.empty-state-icon svg {
    width: 40px;
    height: 40px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-weight: 600;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ============================================
   PAGINATION COMPONENT
   ============================================ */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.pagination-info {
    font-size: 13px;
    color: var(--text-muted);
}

.pagination-buttons {
    display: flex;
    gap: 8px;
}

.pagination-btn {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-dark);
}

.pagination-btn:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #ccc;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: var(--accent-green);
    color: #fff;
    border-color: var(--accent-green);
}

/* ============================================
   BREADCRUMB COMPONENT
   ============================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--accent-green);
}

.breadcrumb-separator {
    color: var(--border-color);
}

/* ============================================
   TABS COMPONENT
   ============================================ */
.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 24px;
}

.tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--text-dark);
}

.tab.active {
    color: var(--accent-green);
    border-bottom-color: var(--accent-green);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================
   VIEW TABS (Alternate tab style)
   ============================================ */
.view-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: #fff;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.view-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.view-tab:hover {
    background: #f8f9fa;
    color: var(--text-dark);
}

.view-tab.active {
    background: var(--accent-green);
    color: #fff;
}

.tab-count {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.view-tab.active .tab-count {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   DROPDOWN MENU COMPONENT
   ============================================ */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.dropdown-toggle:hover {
    border-color: #ccc;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    margin-top: 4px;
    z-index: 1000;
    display: none;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    padding: 10px 16px;
    color: var(--text-dark);
    text-decoration: none;
    display: block;
    font-size: 14px;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

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

.dropdown-item:hover {
    background: #f8f9fa;
    text-decoration: none;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* ============================================
   TOOLTIP COMPONENT
   ============================================ */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-text {
    visibility: hidden;
    background: #333;
    color: #fff;
    text-align: center;
    padding: 6px 12px;
    border-radius: 6px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--accent-green);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.show,
.loading-overlay.active {
    display: flex;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-green);
    transition: width 0.3s ease;
}

.progress-bar.sm {
    height: 4px;
}

.progress-bar.lg {
    height: 12px;
}

/* ============================================
   AVATAR COMPONENT
   ============================================ */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 12px;
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 20px;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* ============================================
   FILTERS BAR
   ============================================ */
.filters-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}

/* ============================================
   LIST WRAPPER (for tables/lists)
   ============================================ */
.list-wrapper {
    background: #fff;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    overflow: visible;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-success {
    color: var(--status-success) !important;
}

.text-danger {
    color: var(--status-danger) !important;
}

.text-warning {
    color: var(--status-warning) !important;
}

.text-info {
    color: var(--status-info) !important;
}

.text-blue {
    color: #2563EB !important;
}

.font-bold {
    font-weight: 600;
}

.font-normal {
    font-weight: 400;
}

.mt-0 {
    margin-top: 0 !important;
}

.mt-1 {
    margin-top: 8px !important;
}

.mt-2 {
    margin-top: 16px !important;
}

.mt-3 {
    margin-top: 24px !important;
}

.mt-4 {
    margin-top: 32px !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-1 {
    margin-bottom: 8px !important;
}

.mb-2 {
    margin-bottom: 16px !important;
}

.mb-3 {
    margin-bottom: 24px !important;
}

.mb-4 {
    margin-bottom: 32px !important;
}

.p-0 {
    padding: 0 !important;
}

.p-1 {
    padding: 8px !important;
}

.p-2 {
    padding: 16px !important;
}

.p-3 {
    padding: 24px !important;
}

.p-4 {
    padding: 32px !important;
}

.py-1 {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

.py-2 {
    padding-top: 16px !important;
    padding-bottom: 16px !important;
}

.py-3 {
    padding-top: 24px !important;
    padding-bottom: 24px !important;
}

.py-4 {
    padding-top: 32px !important;
    padding-bottom: 32px !important;
}

.py-5 {
    padding-top: 40px !important;
    padding-bottom: 40px !important;
}

.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-inline {
    display: inline !important;
}

.d-inline-block {
    display: inline-block !important;
}

.d-flex {
    display: flex !important;
}

.flex-wrap {
    flex-wrap: wrap !important;
}

.flex-nowrap {
    flex-wrap: nowrap !important;
}

.justify-center {
    justify-content: center !important;
}

.justify-between {
    justify-content: space-between !important;
}

.align-center {
    align-items: center !important;
}

.gap-1 {
    gap: 8px !important;
}

.gap-2 {
    gap: 16px !important;
}

.gap-3 {
    gap: 24px !important;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

/* Responsive display utilities */
.d-sm-none {
    display: none;
}

.d-md-none {
    display: none;
}

.d-lg-none {
    display: none;
}

@media (max-width: 576px) {
    .d-sm-none {
        display: none !important;
    }

    .d-sm-block {
        display: block !important;
    }

    .d-sm-flex {
        display: flex !important;
    }
}

@media (max-width: 768px) {
    .d-md-none {
        display: none !important;
    }

    .d-md-block {
        display: block !important;
    }

    .d-md-flex {
        display: flex !important;
    }

    .text-md-center {
        text-align: center !important;
    }

    .w-md-100 {
        width: 100% !important;
    }
}

@media (max-width: 992px) {
    .d-lg-none {
        display: none !important;
    }

    .d-lg-block {
        display: block !important;
    }

    .d-lg-flex {
        display: flex !important;
    }

    .w-lg-100 {
        width: 100% !important;
    }
}

/* ============================================
   RESPONSIVE MODAL SIZES
   ============================================ */

/* Modal size variants */
.modal.modal-sm {
    max-width: min(400px, calc(100vw - 20px));
}

.modal.modal-md {
    max-width: min(550px, calc(100vw - 20px));
}

.modal.modal-lg {
    max-width: min(700px, calc(100vw - 20px));
}

.modal.modal-xl {
    max-width: min(900px, calc(100vw - 20px));
}

.modal.modal-full {
    max-width: calc(100vw - 20px);
}

/* Override inline styles for modals with responsive max-width */
.modal[style*="max-width: 500px"],
.modal[style*="max-width: 550px"],
.modal[style*="max-width: 600px"] {
    max-width: min(550px, calc(100vw - 20px)) !important;
}

.modal[style*="max-width: 700px"],
.modal[style*="max-width: 800px"] {
    max-width: min(700px, calc(100vw - 20px)) !important;
}

/* ============================================
   RESPONSIVE TYPOGRAPHY
   ============================================ */
.text-responsive-sm {
    font-size: clamp(12px, 2vw, 14px);
}

.text-responsive-md {
    font-size: clamp(14px, 2.5vw, 16px);
}

.text-responsive-lg {
    font-size: clamp(18px, 3vw, 24px);
}

.text-responsive-xl {
    font-size: clamp(24px, 4vw, 36px);
}

/* ============================================
   RESPONSIVE FLEX UTILITIES
   ============================================ */
.flex-column-mobile {
    display: flex;
    flex-direction: row;
}

@media (max-width: 768px) {
    .flex-column-mobile {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .flex-column-xs {
        flex-direction: column !important;
    }

    .gap-xs-1 {
        gap: 8px !important;
    }

    .gap-xs-2 {
        gap: 12px !important;
    }
}

/* ============================================
   RESPONSIVE SPACING
   ============================================ */
@media (max-width: 768px) {
    .p-md-0 {
        padding: 0 !important;
    }

    .p-md-1 {
        padding: 8px !important;
    }

    .p-md-2 {
        padding: 12px !important;
    }

    .m-md-0 {
        margin: 0 !important;
    }

    .m-md-1 {
        margin: 8px !important;
    }

    .m-md-2 {
        margin: 12px !important;
    }
}

@media (max-width: 576px) {
    .p-xs-0 {
        padding: 0 !important;
    }

    .p-xs-1 {
        padding: 6px !important;
    }

    .p-xs-2 {
        padding: 10px !important;
    }
}

/* ============================================
   TOUCH-FRIENDLY UTILITIES
   ============================================ */
@media (max-width: 768px) {

    /* Larger touch targets for mobile */
    .btn,
    .action-btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* Better tap targets for table actions */
    .data-table .action-link,
    .data-table .action-btn {
        padding: 8px 12px;
    }

    /* Improve checkbox/radio touch targets */
    input[type="checkbox"],
    input[type="radio"] {
        width: 20px;
        height: 20px;
        cursor: pointer;
    }
}

/* ============================================
   OVERFLOW HANDLING
   ============================================ */
.overflow-x-auto {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.overflow-y-auto {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   RESPONSIVE GRID ADDITIONS
   ============================================ */
.grid-responsive {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

@media (max-width: 576px) {
    .grid-responsive {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* ============================================
   DATATABLE ACTION MENU (Three-Dot Menu)
   ============================================ */
.dt-action-menu {
    position: relative;
    display: inline-block;
}

.dt-action-menu.open {
    z-index: 1060;
}

.dt-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.15s ease;
}

.dt-action-btn:hover {
    background: #f0f0f0;
    color: #384454;
}

.dt-action-btn i {
    font-size: 16px;
}

.dt-action-dropdown {
    position: fixed;
    z-index: 99999;
    min-width: 100px;
    padding: 4px 0;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e9ecef;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.dt-action-menu.open .dt-action-dropdown {
    /* Original dropdown stays hidden - we use portal instead */
    opacity: 0;
    visibility: hidden;
}

/* Portal dropdown (appended to body) */
#dt-action-dropdown-portal {
    position: fixed !important;
    z-index: 999999 !important;
    min-width: 100px;
    padding: 4px 0;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e9ecef;
}

#dt-action-dropdown-portal .dt-action-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 14px;
    background: none;
    border: none;
    color: #384454;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

#dt-action-dropdown-portal .dt-action-item:hover {
    background: #f8f9fa;
    text-decoration: none;
    color: #384454;
}

#dt-action-dropdown-portal a.dt-action-item {
    text-decoration: none;
    color: #384454;
}

#dt-action-dropdown-portal .dt-action-item.view-action:hover {
    background: #e3f2fd;
}

#dt-action-dropdown-portal .dt-action-item.edit-action:hover {
    background: #e8f5e9;
}

#dt-action-dropdown-portal .dt-action-item.delete-action:hover {
    background: #ffebee;
}

#dt-action-dropdown-portal .dt-action-divider {
    height: 1px;
    margin: 6px 0;
    background: #e9ecef;
}

.dt-action-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 14px;
    background: none;
    border: none;
    color: #384454;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.dt-action-item:hover {
    background: #f8f9fa;
    text-decoration: none;
    color: #384454;
}

.dt-action-item i {
    width: 16px;
    text-align: center;
    color: #6c757d;
    font-size: 14px;
}

.dt-action-item:hover i {
    color: #384454;
}

.dt-action-item.view-action i {
    color: #2196F3;
}

.dt-action-item.edit-action i {
    color: #4CAF50;
}

.dt-action-item.delete-action i {
    color: #dc3545;
}

.dt-action-item.view-action:hover {
    background: #e3f2fd;
}

.dt-action-item.edit-action:hover {
    background: #e8f5e9;
}

.dt-action-item.delete-action:hover {
    background: #ffebee;
}

.dt-action-divider {
    height: 1px;
    margin: 6px 0;
    background: #e9ecef;
}

/* DataTable Clickable Row Styling */
table.dataTable tbody tr.clickable-row {
    cursor: pointer;
    transition: background 0.15s ease;
}

table.dataTable tbody tr.clickable-row:hover {
    background: #f8f9fa !important;
}

/* Prevent row click on action column */
table.dataTable tbody td.dt-action-cell {
    cursor: default;
    overflow: visible;
    position: relative;
}

/* User Menu Dropdown */
.sidebar-user-menu {
    position: absolute;
    bottom: 100%;
    left: 20px;
    right: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    z-index: 1000;
    overflow: hidden;
    animation: slideUpFade 0.2s ease;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sidebar-user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-user-menu-item:last-child {
    border-bottom: none;
}

.sidebar-user-menu-item:hover {
    background: #f8f9fa;
}

.sidebar-user-menu-item i {
    width: 18px;
    font-size: 14px;
    color: #6b7280;
}

.sidebar-user-menu-item span {
    flex: 1;
}

.sidebar-user-menu-item-danger {
    color: #dc3545;
}

.sidebar-user-menu-item-danger:hover {
    background: #fff5f5;
}

.sidebar-user-menu-item-danger i {
    color: #dc3545;
}

.sidebar-user-menu-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 4px 0;
}

.sidebar-user-menu-badge {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    margin-left: auto;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {

    0%,
    100% {
        box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    }

    50% {
        box-shadow: 0 2px 12px rgba(239, 68, 68, 0.5);
    }
}

.sidebar-user-chevron {
    transition: transform 0.2s ease;
}

.sidebar-user.active .sidebar-user-chevron {
    transform: rotate(180deg);
}

.sidebar-user-menu-header {
    padding: 14px 16px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.sidebar-user-menu-header strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.sidebar-user-menu-header small {
    display: block;
    font-size: 12px;
    color: #6b7280;
}