/*
 * Highbrook Homes Portal - Shared Components
 * Reusable UI components across all portals
 * Based on the polished styles from Build Team Portal
 */

/* ========================================
   BUTTONS
   High-quality button styles with animations
   ======================================== */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    font-family: inherit;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    line-height: 1.5;
}

/* Primary Button - Gradient with lift effect */
.btn-primary {
    background: linear-gradient(to bottom right, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(73, 14, 111, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(73, 14, 111, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Secondary Button - Solid color with hover effect */
.btn-secondary {
    background: var(--gradient-start);
    color: white;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #9F7FC7;  /* Slightly darker light purple */
}

/* Danger Button - For destructive actions like sign out */
.btn-danger {
    background: linear-gradient(to bottom right, var(--accent-coral-light) 0%, var(--accent-coral) 100%);
    color: var(--error-text);
    box-shadow: 0 4px 12px rgba(245, 160, 158, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 160, 158, 0.4);
}

.btn-danger:active {
    transform: translateY(0);
}

/* Outline Button - Transparent with border */
.btn-outline {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Button Sizes */
.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: var(--radius-sm);
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

/* Full Width Button */
.btn-block {
    width: 100%;
    display: block;
}

/* Disabled Button State */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Microsoft Button (for Staff Portal SSO) */
.btn-microsoft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0078d4;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.3s;
    cursor: pointer;
}

.btn-microsoft:hover {
    background: #106ebe;
}

.btn-microsoft svg {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

/* Sign Out Button (specific style for header) */
.btn-signout {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    border-radius: var(--radius-md);
}

.btn-signout:hover {
    background: #c53030;
}

.btn-signout:active {
    transform: scale(0.98);
}

/* ========================================
   CARDS
   Card containers with shadows and hover effects
   ======================================== */

.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
}

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

/* Welcome Card - Centered content for landing/welcome messages */
.welcome-card {
    background: var(--bg-white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    margin-bottom: 30px;
}

.welcome-card h2 {
    color: var(--primary-purple);
    margin-bottom: 20px;
    font-size: 32px;
}

.welcome-card p {
    color: #666;
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 30px;
}

/* Info Card - Information display */
.info-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.info-card h3 {
    color: var(--primary-purple);
    font-size: 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-card ul {
    list-style: none;
}

.info-card li {
    color: #666;
    margin-bottom: 12px;
    padding-left: 24px;
    position: relative;
}

.info-card li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-purple);
    font-weight: bold;
}

/* Login/Auth Container - Centered card for authentication pages */
.login-container,
.auth-container {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 450px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

/* Header Card - For dashboard headers */
.header {
    background: var(--bg-white);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
}

.header h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 28px;
}

.header .user-info {
    color: #666;
    font-size: 16px;
}

/* ========================================
   FORMS
   Form inputs, labels, and groups
   ======================================== */

.form-group {
    margin-bottom: 24px;
    text-align: left;
}

label {
    display: block;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 14px;
}

input[type="email"],
input[type="tel"],
input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid var(--border-gray);
    border-radius: var(--radius-md);
    transition: border-color 0.3s;
    font-family: inherit;
}

input[type="email"]:focus,
input[type="tel"]:focus,
input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-purple);
}

/* Pre-filled Input Styling */
input.pre-filled {
    border-color: var(--primary-purple);
    background: #f8f9ff;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    padding: 15px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-label {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    cursor: pointer;
    margin: 0;
}

.checkbox-label-secondary {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
    display: block;
    margin-top: 4px;
}

/* Help Text */
.help-text {
    color: var(--text-light);
    font-size: 13px;
    margin-top: 8px;
}

/* ========================================
   STATUS BADGES
   For displaying statuses like Active, Signed In, etc.
   ======================================== */

.status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.active,
.status-badge.signed-in,
.status-badge.status-active {
    background: var(--success-bg);
    color: var(--success-text);
}

.status-badge.inactive,
.status-badge.signed-out,
.status-badge.status-inactive {
    background: var(--error-bg);
    color: var(--error-text);
}

.status-badge.pending {
    background: var(--warning-bg);
    color: var(--warning-text);
}

/* ========================================
   ALERTS / MESSAGES
   Error, success, warning, info messages
   ======================================== */

.alert {
    padding: 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    text-align: left;
}

.alert strong {
    font-weight: 600;
}

.alert-error,
.error-message {
    background: var(--error-bg);
    border: 1px solid #fc8181;
    color: var(--error-text);
}

.alert-success,
.success-message {
    background: var(--success-bg);
    border: 1px solid #68d391;
    color: var(--success-text);
}

.alert-warning {
    background: var(--warning-bg);
    border: 1px solid #ffc107;
    color: var(--warning-text);
}

.alert-info {
    background: var(--info-bg);
    border: 1px solid #90cdf4;
    color: var(--info-text);
}

/* Security Notice Box */
.security-notice {
    background: var(--bg-light);
    border-left: 4px solid var(--primary-purple);
    padding: 15px;
    margin-bottom: 30px;
    text-align: left;
    border-radius: var(--radius-sm);
}

.security-notice h3 {
    color: var(--primary-purple);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
}

.security-notice p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

/* Info Notice Box */
.info-notice {
    background: var(--info-bg);
    border-left: 4px solid var(--primary-purple);
    padding: 15px;
    border-radius: var(--radius-sm);
    text-align: left;
    margin-top: 15px;
}

.info-notice-title {
    color: var(--primary-purple);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-notice-content {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
}

/* ========================================
   UNIFIED SPINNER - Gradient Ring
   Modern loading indicator with brand colors
   ======================================== */

.spinner {
    display: inline-block;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        var(--primary-purple, #490E6F) 90deg,
        var(--gradient-start, #B89FD9) 180deg,
        transparent 360deg
    );
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #fff calc(100% - 3px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #fff calc(100% - 3px));
    animation: spinner-rotate 0.8s linear infinite;
}

/* Size variants */
.spinner--sm {
    width: 16px;
    height: 16px;
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #fff calc(100% - 2px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #fff calc(100% - 2px));
}

.spinner--md {
    width: 24px;
    height: 24px;
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #fff calc(100% - 3px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #fff calc(100% - 3px));
}

.spinner--lg {
    width: 48px;
    height: 48px;
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #fff calc(100% - 4px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #fff calc(100% - 4px));
}

/* White variant for dark backgrounds */
.spinner--white {
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(255, 255, 255, 0.3) 90deg,
        #fff 180deg,
        transparent 360deg
    );
}

@keyframes spinner-rotate {
    to { transform: rotate(360deg); }
}

/* Legacy class - maps to new spinner for backwards compatibility */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(255, 255, 255, 0.3) 90deg,
        #fff 180deg,
        transparent 360deg
    );
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #fff calc(100% - 2px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #fff calc(100% - 2px));
    animation: spinner-rotate 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* ========================================
   TYPOGRAPHY
   Links only - headings are in base.css
   ======================================== */

/* Links */
a {
    color: var(--primary-purple);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    text-decoration: underline;
}

.back-link {
    margin-top: 30px;
    display: inline-block;
    color: var(--primary-purple);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

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

/* ========================================
   MOBILE RESPONSIVE
   Adjustments for smaller screens
   ======================================== */

@media (max-width: 768px) {
    .login-container,
    .auth-container {
        padding: 30px 20px;
    }

    h1 {
        font-size: 24px;
    }

    .welcome-card h2 {
        font-size: 26px;
    }

    .btn {
        width: 100%;
        padding: 16px;
        font-size: 18px;
    }

    .card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 40px;
    }

    input[type="email"],
    input[type="tel"],
    input[type="text"],
    input[type="password"] {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* ========================================
   PAGE UPDATE NOTIFICATION - AUTO-REFRESH
   ======================================== */
/* Appears at top when service worker detects HTML content changes */

/* Backdrop overlay */
.page-update-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 9998 !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
    pointer-events: none !important;
}

.page-update-backdrop.show {
    opacity: 1 !important;
}

.page-update-notification {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(0) !important;
    background: linear-gradient(to bottom right, #B89FD9 0%, #490E6F 100%) !important;
    color: white !important;
    padding: 32px 48px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    z-index: 9999 !important;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    border-radius: 16px !important;
    min-width: 400px !important;
    max-width: 600px !important;
}

.page-update-notification.show {
    transform: translate(-50%, -50%) scale(1) !important;
}

.update-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
    width: 100%;
}

.update-icon {
    font-size: 48px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.update-message {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
}

.refresh-btn {
    background: white;
    color: var(--primary-purple);
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.dismiss-btn {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.8);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .page-update-notification {
        padding: 24px 32px;
        min-width: 90%;
        max-width: 90%;
    }

    .update-content {
        gap: 16px;
    }

    .update-icon {
        font-size: 36px;
    }

    .update-message {
        font-size: 18px;
    }

    .refresh-btn {
        font-size: 15px;
        padding: 12px 24px;
    }

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

/* ========================================
   UPDATE SUCCESS NOTIFICATION
   ======================================== */
/* Beautiful success banner that appears top-right after updates complete */
/* Success green (#059669 dark, #10b981 bright) complements brand purple (#490E6F to #B89FD9) */

.update-success-notification {
    position: fixed;
    top: -150px;
    right: 24px;
    background: #059669;
    color: white;
    padding: 20px 28px;
    border-radius: 16px;
    box-shadow:
        0 20px 60px rgba(5, 150, 105, 0.4),
        0 8px 16px rgba(5, 150, 105, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    z-index: 10000;
    transition: top 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    min-width: 320px;
}

.update-success-notification.show {
    top: 24px;
}

.success-content {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.update-success-notification .success-icon {
    font-size: 32px;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
    line-height: 1;
}

.update-success-notification .success-message {
    font-size: 17px;
    font-weight: 600;
    color: white;
    letter-spacing: -0.02em;
    flex: 1;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

/* Install Now button styling */
.install-now-btn {
    background: white !important;
    color: #490E6F !important;
    border: 2px solid white !important;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.install-now-btn:hover {
    background: rgba(255, 255, 255, 0.9) !important;
    transform: scale(1.05);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .update-success-notification {
        right: 16px;
        left: 16px;
        min-width: auto;
        padding: 18px 24px;
    }

    .success-icon {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .success-message {
        font-size: 16px;
    }

    .install-now-btn {
        font-size: 14px;
        padding: 8px 16px;
    }
}

/* ========================================
   UPDATE LOADING OVERLAY
   ======================================== */
/* Full-screen loading overlay shown while background refresh completes */
/* Uses unified spinner - just spinner centered on purple gradient, NO text */

.update-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #490E6F 0%, #B89FD9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.update-loading-overlay.show {
    opacity: 1;
}

/* ========================================
   PAGE REFRESH TOAST (Optimistic UI)
   ======================================== */

/* Toast container - slides in from top */
.page-refresh-toast {
    position: fixed;
    top: 70px; /* Below header */
    left: 50%;
    transform: translateX(-50%) translateY(-120%);
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #1976d2;
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: 0 6px 24px rgba(25, 118, 210, 0.2);
    z-index: 10000;
    min-width: 320px;
    max-width: 600px;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.page-refresh-toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Toast content layout */
.page-refresh-toast .toast-content {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* Toast icon */
.page-refresh-toast .toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

/* Toast message */
.page-refresh-toast .toast-message {
    color: #0d47a1;
    font-size: 16px;
    font-weight: 600;
    flex: 1;
    min-width: 150px;
}

/* Toast actions */
.page-refresh-toast .toast-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Toast buttons */
.page-refresh-toast .toast-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-refresh-toast .toast-btn-primary {
    background: #1976d2;
    color: white;
}

.page-refresh-toast .toast-btn-primary:hover {
    background: #1565c0;
    transform: scale(1.05);
}

.page-refresh-toast .toast-btn-secondary {
    background: white;
    color: #1976d2;
    border: 2px solid #1976d2;
}

.page-refresh-toast .toast-btn-secondary:hover {
    background: #e3f2fd;
    transform: scale(1.05);
}

/* Success notification (after page refresh) */
.page-refresh-success {
    position: fixed;
    top: 70px;
    right: 20px;
    background: linear-gradient(135deg, #d4edda 0%, #a8d5ba 100%);
    border: 2px solid #28a745;
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: 0 6px 24px rgba(40, 167, 69, 0.2);
    z-index: 10001;
    transform: translateX(calc(100% + 40px));
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.page-refresh-success.show {
    transform: translateX(0);
}

.page-refresh-success .success-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-refresh-success .success-icon {
    font-size: 24px;
    color: #28a745;
    font-weight: bold;
}

.page-refresh-success .success-message {
    color: #155724;
    font-size: 16px;
    font-weight: 600;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .page-refresh-toast {
        top: 10px;
        left: 10px;
        right: 10px;
        transform: translateX(0) translateY(-120%);
        min-width: unset;
        max-width: unset;
        width: calc(100% - 20px);
    }

    .page-refresh-toast.show {
        transform: translateX(0) translateY(0);
    }

    .page-refresh-toast .toast-content {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .page-refresh-toast .toast-message {
        text-align: center;
    }

    .page-refresh-toast .toast-actions {
        justify-content: center;
    }

    .page-refresh-success {
        top: 10px;
        left: 10px;
        right: 10px;
        transform: translateY(-120%);
    }

    .page-refresh-success.show {
        transform: translateY(0);
    }
}

/* ========================================
   GLOBAL UPDATE SLIDER (Phase 3)
   ======================================== */

/* Slider container - slides in from top */
.global-update-slider {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: white;
    padding: 16px 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10001; /* Above page-refresh-toast */
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.global-update-slider.show {
    transform: translateY(0);
}

/* Slider content - horizontal layout */
.slider-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Icon */
.slider-icon {
    font-size: 28px;
    flex-shrink: 0;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Message */
.slider-message {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.slider-message strong {
    font-size: 16px;
    font-weight: 600;
}

.slider-subtitle {
    font-size: 13px;
    opacity: 0.9;
}

/* Actions */
.slider-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.slider-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.slider-btn-primary {
    background: white;
    color: #1976d2;
}

.slider-btn-primary:hover {
    background: #f5f5f5;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.slider-btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.slider-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.7);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .global-update-slider {
        padding: 12px 16px;
    }

    .slider-content {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .slider-icon {
        font-size: 24px;
        align-self: center;
    }

    .slider-message {
        text-align: center;
    }

    .slider-message strong {
        font-size: 15px;
    }

    .slider-subtitle {
        font-size: 12px;
    }

    .slider-actions {
        flex-direction: column;
        gap: 8px;
    }

    .slider-btn {
        width: 100%;
        padding: 12px;
    }
}

/* ========================================
   DASHBOARD CARDS SYSTEM
   Reusable card grid for all dashboards
   ======================================== */

/* Dashboard section wrapper */
.dashboard-section {
    margin-bottom: 3rem;
}

.dashboard-section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dashboard-section-icon {
    font-size: 1.5rem;
    color: var(--primary-purple);
}

.dashboard-section-text {
    flex: 1;
}

.dashboard-section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.dashboard-section-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    margin-bottom: 0;
}

/* Dashboard grid container - Refined spacing */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding-top: 0.5rem;
}

/* Dashboard card link wrapper */
.dashboard-card-link {
    text-decoration: none;
    display: block;
    height: 100%;
    transition: transform 0.3s ease;
}

.dashboard-card-link:hover {
    text-decoration: none;
    transform: translateY(-4px);
}

/* Dashboard card */
.dashboard-card {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 1.75rem;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
}

.dashboard-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -5px rgba(73, 14, 111, 0.15);
    border-color: rgba(184, 159, 217, 0.3);
}

/* Card header */
.dashboard-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.dashboard-card-icon {
    width: 54px;
    height: 54px;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 8px 16px rgba(73, 14, 111, 0.15);
    transition: transform 0.3s ease;
}

.dashboard-card:hover .dashboard-card-icon {
    transform: scale(1.1) rotate(-3deg);
}

/* Access level badges */
.dashboard-access-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-access-badge.badge-full {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.dashboard-access-badge.badge-view {
    background: rgba(59, 130, 246, 0.1);
    color: #2563EB;
}

.dashboard-access-badge.badge-edit {
    background: rgba(245, 158, 11, 0.1);
    color: #D97706;
}

.dashboard-access-badge.badge-default {
    background: var(--bg-light);
    color: var(--text-secondary);
}

/* Card body */
.dashboard-card-body {
    flex: 1;
    margin-bottom: 1rem;
}

.dashboard-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.dashboard-card-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    opacity: 0.9;
}

/* Card footer */
.dashboard-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(0,0,0,0.03);
}

.dashboard-card-action {
    font-size: 0.9rem;
    color: var(--primary-purple);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s ease;
    background: rgba(73, 14, 111, 0.05);
    padding: 8px 16px;
    border-radius: 20px;
}

.dashboard-card:hover .dashboard-card-action {
    background: rgba(73, 14, 111, 0.1);
    gap: 0.75rem;
}

.dashboard-card-action i {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.dashboard-card:hover .dashboard-card-action i {
    transform: translateX(2px);
}

/* Card color variations */
.dashboard-card.card-color-blue .dashboard-card-icon {
    background: linear-gradient(135deg, #90cdf4 0%, #3182ce 100%);
}

.dashboard-card.card-color-green .dashboard-card-icon {
    background: linear-gradient(135deg, #A7D8A3 0%, #059669 100%);
}

.dashboard-card.card-color-orange .dashboard-card-icon {
    background: linear-gradient(135deg, #F7C77D 0%, #ea580c 100%);
}

.dashboard-card.card-color-coral .dashboard-card-icon {
    background: linear-gradient(135deg, #F5A09E 0%, #dc2626 100%);
}

.dashboard-card.card-color-purple .dashboard-card-icon {
    background: linear-gradient(135deg, #9F7AEA 0%, #6B46C1 100%);
}

.dashboard-card.card-color-teal .dashboard-card-icon {
    background: linear-gradient(135deg, #5eead4 0%, #0d9488 100%);
}

.dashboard-card.card-color-pink .dashboard-card-icon {
    background: linear-gradient(135deg, #f9a8d4 0%, #ec4899 100%);
}

/* Empty state */
.dashboard-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background: var(--bg-light);
    border-radius: 12px;
    border: 2px dashed var(--border-gray);
}

.dashboard-empty-state h3 {
    color: var(--text-secondary);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.dashboard-empty-state p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Responsive design */
@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1440px) {
    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .dashboard-section {
        margin-bottom: 2rem;
    }

    .dashboard-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .dashboard-section-title {
        font-size: 1.5rem;
    }

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

    .dashboard-card {
        padding: 1.25rem;
        min-height: 140px;
    }

    .dashboard-card-icon {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }

    .dashboard-card-title {
        font-size: 1rem;
    }

    .dashboard-card-description {
        font-size: 0.8125rem;
    }
}

/* ========================================
   DASHBOARD MENU CARDS
   Clean professional cards with snazzy hover effects
   ======================================== */

/* Menu card container - Clean and professional */
.dashboard-menu-card {
    background: var(--bg-white);
    border-radius: 12px;
    border: 2px solid transparent;
    box-shadow: 0 4px 6px rgba(73, 14, 111, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    position: relative;
}

/* Clean hover effect with lift and border */
.dashboard-menu-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(73, 14, 111, 0.15);
    border-color: var(--gradient-start);
    background: linear-gradient(to bottom right,
        rgba(184, 159, 217, 0.03),
        rgba(73, 14, 111, 0.03));
}

/* Menu card header - Simple and clean */
.dashboard-menu-card-header {
    padding: 1.5rem;
    background: linear-gradient(135deg,
        rgba(184, 159, 217, 0.08) 0%,
        rgba(73, 14, 111, 0.05) 100%);
    border-bottom: 1px solid rgba(73, 14, 111, 0.1);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

/* Icon - Clean gradient without excessive effects */
.dashboard-menu-card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(73, 14, 111, 0.2);
    transition: all 0.3s ease;
}

.dashboard-menu-card:hover .dashboard-menu-card-icon {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(73, 14, 111, 0.25);
}

.dashboard-menu-card-text {
    flex: 1;
}

/* Title - Normal text, no gradients */
.dashboard-menu-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.dashboard-menu-card-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

/* Menu card body */
.dashboard-menu-card-body {
    padding: 0.5rem 0;
}

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

.dashboard-menu-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.dashboard-menu-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

/* Simple hover state */
.dashboard-menu-link:hover {
    background: rgba(73, 14, 111, 0.05);
    color: var(--primary-purple);
    text-decoration: none;
    padding-left: 1.75rem;
}

.menu-item-icon {
    width: 20px;
    margin-right: 0.75rem;
    color: var(--primary-purple);
    font-size: 0.9rem;
    text-align: center;
}

.menu-item-text {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
}

.menu-item-badge {
    background: var(--gradient-end);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    margin-right: 0.5rem;
}

.menu-item-arrow {
    color: rgba(73, 14, 111, 0.3);
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.dashboard-menu-link:hover .menu-item-arrow {
    color: var(--primary-purple);
    transform: translateX(3px);
}

/* Menu card footer - Simple and clean */
.dashboard-menu-card-footer {
    padding: 1rem 1.5rem;
    background: rgba(73, 14, 111, 0.02);
    border-top: 1px solid rgba(73, 14, 111, 0.1);
}

.dashboard-card-count {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Color variations - Simple icon colors only */
.dashboard-menu-card.card-color-blue .dashboard-menu-card-icon {
    background: linear-gradient(135deg, #90cdf4 0%, #3182ce 100%);
}

.dashboard-menu-card.card-color-green .dashboard-menu-card-icon {
    background: linear-gradient(135deg, #A7D8A3 0%, #059669 100%);
}

.dashboard-menu-card.card-color-orange .dashboard-menu-card-icon {
    background: linear-gradient(135deg, #F7C77D 0%, #ea580c 100%);
}

.dashboard-menu-card.card-color-coral .dashboard-menu-card-icon {
    background: linear-gradient(135deg, #F5A09E 0%, #dc2626 100%);
}

.dashboard-menu-card.card-color-teal .dashboard-menu-card-icon {
    background: linear-gradient(135deg, #5eead4 0%, #0d9488 100%);
}

.dashboard-menu-card.card-color-pink .dashboard-menu-card-icon {
    background: linear-gradient(135deg, #f9a8d4 0%, #ec4899 100%);
}

/* ==========================================
   COMPACT DASHBOARD MENU CARDS
   Condensed, space-efficient menu cards
   ========================================== */

.dashboard-menu-card-compact {
    background: var(--bg-white);
    border-radius: 12px;
    border: 2px solid transparent;
    box-shadow: 0 4px 6px rgba(73, 14, 111, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 1.25rem;
    position: relative;
}

.dashboard-menu-card-compact:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(73, 14, 111, 0.15);
    border-color: var(--gradient-start);
    background: linear-gradient(to bottom right,
        rgba(184, 159, 217, 0.03),
        rgba(73, 14, 111, 0.02));
}

/* Compact header - inline icon and text */
.dashboard-menu-card-compact-header {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg,
        rgba(184, 159, 217, 0.04) 0%,
        rgba(73, 14, 111, 0.02) 100%);
    border-bottom: 1px solid rgba(73, 14, 111, 0.06);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-compact-icon {
    font-size: 1.25rem;
    color: var(--gradient-end);
    flex-shrink: 0;
}

.card-compact-text {
    flex: 1;
    min-width: 0;
}

.card-compact-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.card-compact-description {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0.25rem 0 0 0;
    line-height: 1.3;
}

/* Body container */
.dashboard-menu-card-compact-body {
    padding: 0.75rem;
}

/* Grid layout for menu items */
.dashboard-menu-compact-grid {
    display: grid;
    gap: 0.5rem;
}

/* Grid layout - 2 columns for 4+ items */
.dashboard-menu-compact-grid.grid-layout {
    grid-template-columns: repeat(2, 1fr);
}

/* List layout - single column for fewer items */
.dashboard-menu-compact-grid.list-layout {
    grid-template-columns: 1fr;
}

/* Individual menu items */
.dashboard-menu-compact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s ease;
    background: var(--bg-white);
    border: 1px solid transparent;
    font-size: 0.875rem;
    position: relative;
    overflow: hidden;
}

.dashboard-menu-compact-item:hover {
    background: linear-gradient(135deg,
        rgba(184, 159, 217, 0.08) 0%,
        rgba(73, 14, 111, 0.05) 100%);
    border-color: rgba(73, 14, 111, 0.1);
    transform: translateX(2px);
}

.item-compact-icon {
    font-size: 0.875rem;
    color: var(--gradient-end);
    flex-shrink: 0;
    width: 1rem;
    text-align: center;
}

.item-compact-text {
    flex: 1;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-compact-badge {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    flex-shrink: 0;
}

/* Color variations */
.dashboard-menu-card-compact.card-color-blue {
    border-color: rgba(0, 123, 255, 0.12);
}

.dashboard-menu-card-compact.card-color-blue:hover {
    border-color: rgba(0, 123, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.1);
}

.dashboard-menu-card-compact.card-color-blue .card-compact-icon,
.dashboard-menu-card-compact.card-color-blue .item-compact-icon {
    color: #007bff;
}

.dashboard-menu-card-compact.card-color-green {
    border-color: rgba(40, 167, 69, 0.12);
}

.dashboard-menu-card-compact.card-color-green:hover {
    border-color: rgba(40, 167, 69, 0.2);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.1);
}

.dashboard-menu-card-compact.card-color-green .card-compact-icon,
.dashboard-menu-card-compact.card-color-green .item-compact-icon {
    color: #28a745;
}

.dashboard-menu-card-compact.card-color-teal {
    border-color: rgba(13, 148, 136, 0.12);
}

.dashboard-menu-card-compact.card-color-teal:hover {
    border-color: rgba(13, 148, 136, 0.2);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.1);
}

.dashboard-menu-card-compact.card-color-teal .card-compact-icon,
.dashboard-menu-card-compact.card-color-teal .item-compact-icon {
    color: #0d9488;
}

.dashboard-menu-card-compact.card-color-pink {
    border-color: rgba(236, 72, 153, 0.12);
}

.dashboard-menu-card-compact.card-color-pink:hover {
    border-color: rgba(236, 72, 153, 0.2);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.1);
}

.dashboard-menu-card-compact.card-color-pink .card-compact-icon,
.dashboard-menu-card-compact.card-color-pink .item-compact-icon {
    color: #ec4899;
}

/* Responsive design */
@media (max-width: 768px) {
    /* Compact cards on mobile */
    .dashboard-menu-compact-grid.grid-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-menu-card-compact-header {
        padding: 0.875rem 1rem;
    }

    .dashboard-menu-card-compact-body {
        padding: 0.625rem;
    }

    .dashboard-menu-compact-item {
        padding: 0.75rem;
    }

    /* Original card styles */
    .dashboard-menu-card-header {
        padding: 1.25rem;
    }

    .dashboard-menu-card-icon {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }

    .dashboard-menu-card-title {
        font-size: 1.125rem;
    }

    .dashboard-menu-link {
        padding: 0.75rem 1.25rem;
    }

    .dashboard-menu-link:hover {
        padding-left: 1.5rem;
    }

    .menu-item-text {
        font-size: 0.9rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    /* For medium screens, allow flexible columns */
    .dashboard-menu-compact-grid.grid-layout {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}

@media (min-width: 1025px) {
    /* For large screens with many items */
    .dashboard-menu-card-compact.has-many-items .dashboard-menu-compact-grid.grid-layout {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        max-width: 100%;
    }
}

/* ==========================================
   HIERARCHICAL SIDEBAR NAVIGATION
   Icon-first, compact, collapsible sections
   ========================================== */

.sidebar-hierarchical {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
    margin-bottom: 2rem;
}

/* Department Level (Top) */
.sidebar-hierarchical .department-section {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 1.25rem;
}

.sidebar-hierarchical .department-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sidebar-hierarchical .department-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.25rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary, #490E6F);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    position: relative;
}

/* Add a small accent line next to header */
.sidebar-hierarchical .department-header::before {
    content: '';
    display: block;
    width: 4px;
    height: 14px;
    background: linear-gradient(to bottom, #B89FD9, #490E6F);
    border-radius: 2px;
}

.sidebar-hierarchical .department-icon {
    font-size: 1rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Section Level (Middle) - Collapsible TOGGLE ONLY */
.sidebar-hierarchical .section {
    margin-bottom: 0.5rem;
}

.sidebar-hierarchical .section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem 0.625rem 0.5rem 1.5rem;
    background: rgba(73, 14, 111, 0.02);
    border: 1px solid rgba(73, 14, 111, 0.08);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary, #333);
    text-align: left;
}

.sidebar-hierarchical .section-toggle:hover {
    background: rgba(73, 14, 111, 0.06);
    border-color: rgba(73, 14, 111, 0.15);
    color: var(--primary, #490E6F);
}

.sidebar-hierarchical .section.expanded .section-toggle {
    background: rgba(73, 14, 111, 0.08);
    border-color: rgba(73, 14, 111, 0.15);
    color: var(--primary, #490E6F);
}

.sidebar-hierarchical .section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
}

.sidebar-hierarchical .section-icon {
    width: 1.25rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--primary-light, #B89FD9);
}

.sidebar-hierarchical .section-toggle:hover .section-icon {
    color: var(--primary, #490E6F);
}

.sidebar-hierarchical .section.expanded .section-toggle .section-icon {
    color: var(--primary, #490E6F);
}

.sidebar-hierarchical .chevron {
    font-size: 0.625rem;
    color: var(--text-secondary, #666);
    transition: transform 0.2s ease;
    margin-left: 0.25rem;
}

.sidebar-hierarchical .section-toggle:hover .chevron {
    color: var(--primary, #490E6F);
}

.sidebar-hierarchical .section.expanded .chevron {
    transform: rotate(180deg);
    color: var(--primary, #490E6F);
}

.sidebar-hierarchical .section-pages {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 2.75rem;
}

.sidebar-hierarchical .section.expanded .section-pages {
    max-height: 500px;
}

/* Page Level (Bottom) */
.sidebar-hierarchical .page-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    color: var(--text-secondary, #666);
    text-decoration: none;
    font-size: 0.8125rem;
    border-radius: 4px;
    transition: all 0.15s ease;
    margin-bottom: 0.125rem;
    border-left: 2px solid transparent;
}

.sidebar-hierarchical .page-link i {
    font-size: 0.625rem;
    color: var(--primary-lighter, #E8DFF5);
    width: 0.875rem;
    text-align: center;
}

.sidebar-hierarchical .page-link:hover {
    background: linear-gradient(to right, rgba(73, 14, 111, 0.05), transparent);
    border-left-color: var(--primary-light, #B89FD9);
    color: var(--primary, #490E6F);
    transform: translateX(2px);
}

.sidebar-hierarchical .page-link:hover i {
    color: var(--primary-light, #B89FD9);
}

.sidebar-hierarchical .page-link.active {
    background: linear-gradient(to right, rgba(73, 14, 111, 0.12), transparent);
    border-left-color: var(--primary, #490E6F);
    color: var(--primary, #490E6F);
    font-weight: 500;
}

.sidebar-hierarchical .page-link.active i {
    color: var(--primary, #490E6F);
}

/* Direct pages (no section) */
.sidebar-hierarchical .nav-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem 0.5rem 1.5rem;
    color: var(--text-secondary, #666);
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 6px;
    transition: all 0.15s ease;
    margin-bottom: 0.25rem;
}

.sidebar-hierarchical .nav-link i {
    width: 1.25rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--primary-light, #B89FD9);
}

.sidebar-hierarchical .nav-link:hover {
    background: linear-gradient(to right, rgba(73, 14, 111, 0.06), transparent);
    transform: translateX(2px);
    color: var(--primary, #490E6F);
}

.sidebar-hierarchical .nav-link:hover i {
    color: var(--primary, #490E6F);
}

.sidebar-hierarchical .nav-link.active {
    background: var(--primary, #490E6F);
    color: white;
}

.sidebar-hierarchical .nav-link.active i {
    color: white;
}

/* No navigation state */
.sidebar-hierarchical .no-navigation {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-secondary, #666);
    font-size: 0.875rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .sidebar-hierarchical {
        padding: 0.5rem;
    }

    .sidebar-hierarchical .department-header {
        font-size: 0.75rem;
        padding: 0.4rem 0.5rem;
    }

    .sidebar-hierarchical .section-toggle {
        font-size: 0.8125rem;
        padding: 0.4rem 0.5rem 0.4rem 1rem;
    }

    .sidebar-hierarchical .section-pages {
        padding-left: 2rem;
    }

    .sidebar-hierarchical .nav-link {
        font-size: 0.8125rem;
        padding: 0.4rem 0.5rem 0.4rem 1rem;
    }

    .sidebar-hierarchical .page-link {
        font-size: 0.75rem;
    }
}

/* ========================================
   LOADING ANIMATIONS
   Spinner for button loading states
   ======================================== */

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

/* ========================================
   INTERACTION TIMELINE COMPONENTS
   Timeline filter and interaction display
   ======================================== */

/* Interaction Timeline Styles */
.interaction-timeline-container {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #490E6F;
}

.timeline-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #333;
}

.timeline-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-add-interaction {
    padding: 0.5rem 1rem;
    background-color: #6B46C1;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.15s;
}

.btn-add-interaction:hover {
    background-color: #5b3aa8;
}

.btn-schedule-viewing {
    padding: 0.5rem 1rem;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.15s;
}

.btn-schedule-viewing:hover {
    background-color: #2563eb;
}

/* Desktop: Wrapped pill filters */
.timeline-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #ddd;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: #490E6F;
    background-color: #f8f5fb;
}

.filter-btn.active {
    border-color: #490E6F;
    background-color: #490E6F;
    color: white;
}

/* Mobile/Tablet: Bottom sheet modal trigger */
.filter-modal-trigger {
    display: none; /* Hidden by default (desktop) */
    width: 100%;
    padding: 0.875rem 1rem;
    background: white;
    border: 2px solid #490E6F;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #490E6F;
    transition: all 0.2s;
    margin-bottom: 1.5rem;
    align-items: center;
    justify-content: space-between;
}

.filter-modal-trigger:hover {
    background: #f8f5fb;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(73, 14, 111, 0.2);
}

.filter-modal-trigger:active {
    transform: translateY(0);
}

.filter-trigger-text {
    flex: 1;
    text-align: left;
}

.filter-trigger-icon {
    font-size: 1rem;
    transition: transform 0.2s;
}

/* Bottom Sheet Modal */
.filter-modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.filter-modal-backdrop.show {
    display: block;
    opacity: 1;
}

.filter-modal {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 24px 24px 0 0;
    z-index: 9999;
    max-height: 80vh;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
}

.filter-modal.show {
    display: flex;
    flex-direction: column;
    transform: translateY(0);
}

/* Modal handle (drag indicator) */
.modal-handle {
    display: flex;
    justify-content: center;
    padding: 0.75rem;
    cursor: grab;
}

.modal-handle-bar {
    width: 40px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
}

/* Modal header */
.filter-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.filter-modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.filter-modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0.25rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.filter-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* Modal body */
.filter-modal-body {
    padding: 1rem 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* Filter options list */
.filter-options-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.filter-option-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
    min-height: 44px; /* Touch-friendly */
    border: 2px solid transparent;
}

.filter-option-item:hover {
    background: #f8f5fb;
    border-color: #B89FD9;
}

.filter-option-item.selected {
    background: linear-gradient(135deg, #f8f5fb 0%, #eee5f5 100%);
    border-color: #490E6F;
}

.filter-option-icon {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.filter-option-text {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

.filter-option-check {
    font-size: 1.25rem;
    color: #490E6F;
    opacity: 0;
    transition: opacity 0.2s;
}

.filter-option-item.selected .filter-option-check {
    opacity: 1;
}

/* Modal footer */
.filter-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

.btn-apply-filter {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #B89FD9 0%, #490E6F 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(73, 14, 111, 0.3);
}

.btn-apply-filter:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(73, 14, 111, 0.4);
}

.btn-apply-filter:active {
    transform: translateY(0);
}

/* Timeline content */
.timeline-list {
    position: relative;
}

.timeline-item {
    position: relative;
    padding-left: 3rem;
    padding-bottom: 1.5rem;
    border-left: 2px solid #e0e0e0;
    margin-left: 1rem;
}

.timeline-item:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

.timeline-icon {
    position: absolute;
    left: -1.25rem;
    top: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: white;
    border: 3px solid #e0e0e0;
}

.timeline-icon.call { background-color: #007bff; border-color: #007bff; color: white; }
.timeline-icon.email { background-color: #17a2b8; border-color: #17a2b8; color: white; }
.timeline-icon.meeting { background-color: #28a745; border-color: #28a745; color: white; }
.timeline-icon.sms { background-color: #6f42c1; border-color: #6f42c1; color: white; }
.timeline-icon.site_visit { background-color: #fd7e14; border-color: #fd7e14; color: white; }
.timeline-icon.viewing { background-color: #20c997; border-color: #20c997; color: white; }
.timeline-icon.milestone_update { background-color: #490E6F; border-color: #490E6F; color: white; }
.timeline-icon.complaint { background-color: #dc3545; border-color: #dc3545; color: white; }
.timeline-icon.feedback { background-color: #28a745; border-color: #28a745; color: white; }
.timeline-icon.other { background-color: #6c757d; border-color: #6c757d; color: white; }

.timeline-content {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    position: relative;
}

.timeline-content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.timeline-subject {
    font-weight: 600;
    color: #333;
    font-size: 15px;
    margin: 0;
}

.timeline-meta {
    display: flex;
    gap: 1rem;
    font-size: 13px;
    color: #666;
    margin-bottom: 0.5rem;
}

.timeline-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.timeline-description {
    color: #555;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    white-space: pre-wrap;
}

.timeline-actions-menu {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #dee2e6;
}

.timeline-action-btn {
    padding: 0.25rem 0.75rem;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all 0.2s;
}

.timeline-action-btn:hover {
    background-color: #490E6F;
    border-color: #490E6F;
    color: white;
}

.follow-up-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: #ffc107;
    color: #333;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.outcome-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 0.5rem;
}

.outcome-badge.successful {
    background-color: #d4edda;
    color: #155724;
}

.outcome-badge.follow_up_needed {
    background-color: #fff3cd;
    color: #856404;
}

.outcome-badge.no_response {
    background-color: #f8d7da;
    color: #721c24;
}

.outcome-badge.issue_resolved {
    background-color: #d1ecf1;
    color: #0c5460;
}

.outcome-badge.escalated {
    background-color: #f5c6cb;
    color: #721c24;
}

.outcome-badge.other {
    background-color: #e2e3e5;
    color: #383d41;
}

.notes-truncated {
    cursor: pointer;
    color: #490E6F;
    text-decoration: underline;
    font-size: 13px;
    margin-top: 0.25rem;
    display: inline-block;
}

.notes-truncated:hover {
    color: #2d0843;
}

.icon-label {
    font-size: 14px;
    color: #333;
    font-weight: 700;
    text-transform: capitalize;
    letter-spacing: 0.3px;
    background: rgba(73, 14, 111, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
}

.timeline-details {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #dee2e6;
}

.timeline-details-toggle {
    cursor: pointer;
    color: #490E6F;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: none;
    padding: 0;
    text-decoration: underline;
}

.timeline-details-toggle:hover {
    color: #2d0843;
}

.timeline-details-content {
    display: none;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    font-size: 13px;
}

.timeline-details-content.show {
    display: block;
}

.timeline-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
}

.timeline-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.timeline-loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.timeline-load-more {
    text-align: center;
    padding: 1rem 0;
}

.btn-load-more {
    padding: 0.5rem 1.5rem;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-load-more:hover {
    background-color: #5a6268;
}

/* Responsive Breakpoints */

/* Mobile and Tablet (≤1024px): Use bottom sheet modal */
@media (max-width: 1024px) {
    .timeline-filters {
        display: none; /* Hide pill buttons */
    }

    .filter-modal-trigger {
        display: flex; /* Show modal trigger */
    }
}

/* Desktop (>1024px): Use wrapped pills */
@media (min-width: 1025px) {
    .timeline-filters {
        display: flex; /* Show pill buttons */
    }

    .filter-modal-trigger {
        display: none; /* Hide modal trigger */
    }

    /* Never show modal on desktop */
    .filter-modal-backdrop,
    .filter-modal {
        display: none !important;
    }
}

/* Mobile specific adjustments */
@media (max-width: 768px) {
    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .timeline-meta {
        flex-direction: column;
        gap: 0.25rem;
    }

    .filter-modal {
        max-height: 90vh;
    }
}

/* ========================================
   PLOT ASSIGNMENT COMPONENTS
   Assigned customer display and actions
   ======================================== */

.assigned-customer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.assigned-customer-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.customer-link {
    color: var(--primary, #490E6F);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.customer-link:hover {
    color: var(--primary-dark, #360A52);
    text-decoration: underline;
}

.customer-type-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 12px;
    letter-spacing: 0.02em;
}

.customer-type-badge.organisation {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
}

.customer-type-badge.individual {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.btn-unassign-plot {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: #fff;
    color: #dc3545;
    border: 1px solid #dc3545;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
}

.btn-unassign-plot:hover {
    background: #dc3545;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.btn-unassign-plot:active {
    transform: translateY(0);
}

.btn-unassign-plot i {
    font-size: 0.875rem;
}

/* Unassign Modal Styles */
.modal-small {
    max-width: 480px;
}

.modal-header-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-bottom: 2px solid #ffc107;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
}

.modal-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #ffc107;
    color: #856404;
    border-radius: 50%;
    font-size: 1.5rem;
}

.modal-header-warning h2 {
    flex: 1;
    color: #856404;
    margin: 0;
}

.warning-message {
    padding: 1rem 0;
}

.warning-message p {
    margin: 0 0 0.75rem 0;
    color: #666;
    line-height: 1.6;
}

.warning-message p:last-child {
    margin-bottom: 0;
}

.unassign-details {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 1rem;
    margin-top: 1rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.detail-row:not(:last-child) {
    border-bottom: 1px solid #dee2e6;
}

.detail-label {
    font-weight: 600;
    color: #495057;
}

.detail-value {
    color: #212529;
    font-weight: 500;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.btn-danger:active {
    transform: translateY(0);
}

.btn-danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .assigned-customer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .customer-type-badge {
        font-size: 0.65rem;
        padding: 0.1rem 0.4rem;
    }

    .btn-unassign-plot {
        padding: 0.5rem 0.875rem;
        font-size: 0.875rem;
    }

    .modal-header-warning {
        padding: 1rem;
    }

    .modal-header-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .unassign-details {
        padding: 0.75rem;
    }

    .btn-danger {
        width: 100%;
        justify-content: center;
    }
}
