/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Top Navigation Bar */
.navbar {
    z-index: 1030;
    height: 60px;
    padding: 0.5rem 1rem;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.25rem;
    color: #fff !important;
    text-decoration: none;
}

.navbar-brand:hover {
    color: #f8f9fa !important;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    width: 280px;
    height: calc(100vh - 60px);
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.3s ease;
    z-index: 1020;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-content {
    padding: 1rem 0;
}

/* Sidebar Sections */
.sidebar-section {
    margin-bottom: 0.5rem;
}

.sidebar-heading {
    width: 100%;
    padding: 0.75rem 1.5rem;
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #bdc3c7;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    background: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.sidebar-heading:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ecf0f1;
}

.sidebar-heading i:first-child {
    margin-right: 0.75rem;
    width: 1.25rem;
    text-align: center;
}

.sidebar-chevron {
    transition: transform 0.2s ease;
    font-size: 0.75rem;
    margin-left: auto;
}

.sidebar-chevron.rotated {
    transform: rotate(-180deg);
}

.sidebar.collapsed .sidebar-heading {
    padding: 0.75rem;
    justify-content: center;
}

.sidebar.collapsed .sidebar-text {
    display: none;
}

.sidebar.collapsed .sidebar-chevron {
    display: none;
}

/* Sidebar Navigation */
.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.sidebar-nav.collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-left-color: #3498db;
    text-decoration: none;
}

.sidebar-link.active {
    background-color: rgba(52, 152, 219, 0.2);
    border-left-color: #3498db;
    color: #fff;
}

.sidebar-link i {
    margin-right: 0.75rem;
    width: 1.25rem;
    text-align: center;
    font-size: 0.875rem;
}

.sidebar.collapsed .sidebar-link {
    padding: 0.75rem;
    justify-content: center;
}

/* Sidebar Sub-items */
.sidebar-sub {
    padding-left: 3rem;
    font-size: 0.875rem;
}

.sidebar.collapsed .sidebar-sub {
    padding-left: 0.75rem;
}

/* Sidebar Dividers */
.sidebar-divider {
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.sidebar.collapsed .sidebar-divider {
    display: none;
}

/* Main Content Area */
.main-content {
    margin-left: 280px;
    margin-top: 60px;
    padding: 2rem;
    background-color: #f8f9fa;
    min-height: calc(100vh - 60px);
    transition: all 0.3s ease;
    width: calc(100% - 280px);
}

.main-content.sidebar-collapsed {
    margin-left: 70px;
    width: calc(100% - 70px);
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 1.5rem;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    border-radius: 0.75rem 0.75rem 0 0 !important;
    padding: 1rem 1.25rem;
}

/* Button Styles */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Quick Action Buttons */
.btn.w-100 {
    height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.btn.w-100 i {
    margin-bottom: 0.5rem;
}

.btn.w-100 span {
    font-size: 0.875rem;
    line-height: 1.2;
}

/* Utility Classes */
.opacity-75 {
    opacity: 0.75;
}

.text-decoration-none {
    text-decoration: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
    }

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

    .sidebar.collapsed {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .main-content.sidebar-collapsed {
        margin-left: 0;
        width: 100%;
    }
}

/* Login Wrapper for Unauthenticated Users */
.login-wrapper {
    min-height: 100vh;
    background-color: #f8f9fa;
    padding: 2rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: #2c3e50;
    font-weight: 600;
}

/* Form Styles */
form {
    margin-top: 1rem;
}

/* Link Styles */
a {
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

/* Legacy Flash Message Support */
.flashes {
    list-style-type: none;
    padding: 0;
    margin-bottom: 1.5rem;
}

.flashes .error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid #f5c6cb;
}

.flashes .success {
    background-color: #d4edda;
    color: #155724;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid #c3e6cb;
}

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

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Active Page Highlighting */
.sidebar-link.active,
.sidebar-link[href*="{{ request.endpoint }}"] {
    background-color: rgba(52, 152, 219, 0.2);
    border-left-color: #3498db;
    color: #fff;
}

.link-button {
    background: none;
    border: none;
    color: blue;
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
}
.link-button:disabled {
    color: grey;
    cursor: default;
    text-decoration: none;
}

.tooltip-icon {
    position: relative;
    margin-right: 5px;
}

.tooltip-icon:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 0;
    bottom: 100%;
    background: #000;
    color: #fff;
    padding: 5px;
    border-radius: 5px;
    white-space: nowrap;
    transform: translateY(-5px);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
}

.tooltip-icon:hover::after {
    opacity: 1;
    transform: translateY(0);
}

/* The Modal (background) - Custom modal styles */
.custom-modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

/* Bootstrap Modal Override - Ensure Bootstrap modals have proper z-index */
.modal {
    z-index: 1050 !important;
}

.modal-backdrop {
    z-index: 1040 !important;
}

.modal-dialog {
    z-index: 1060 !important;
    position: relative;
}

/* Ensure modal is clickable and interactive */
.modal.show {
    display: block !important;
}

.modal-body input,
.modal-body textarea,
.modal-body button {
    pointer-events: auto !important;
    z-index: 1070 !important;
    position: relative;
}

/* Custom Modal Content/Box */
.custom-modal-content {
    background-color: #fefefe;
    margin: 15% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
}

/* Bootstrap Modal Content Override */
.modal-content {
    z-index: 1060 !important;
    position: relative;
}

/* The Close Button */
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

a.tooltip-icon {
    text-decoration: none;
}

.input-wide {
    width: 300px;
}


/* Login form */

.login-container {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
    padding: 20px;
    width: 300px;
    text-align: center;
}

.login-container h1 {
    color: #333;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.login-form input[type="submit"] {
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    cursor: pointer;
}

.login-body {
    background-color: #f0f0f0;
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

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

/* Font Awesome Icon Rules */
.view-icon {
    /* color: #4CAF50; /* Green color for view icon */
    font-size: 16px;
}

.edit-icon {
    /* color: #FFC107; /* Yellow color for edit icon */
    font-size: 16px;
}

.delete-icon {
    /* color: #F44336; /* Red color for delete icon */
    font-size: 16px;
}

.td-icons {
    display: flex;
    align-items: center;
    justify-content: space-between;  /* or 'space-around' depending on your preference */
}

/* Table Rules */

th, td {
    padding: 5px 5px; /* Adjusted padding for more space */
    text-align: left;
}

tr:hover {
    background-color: #e0e0e0; /* Light grey background on hover */
}

/* General page styling */
.container {
    max-width: 1200px; /* Adjust the max-width as needed */
}

/* Accordion and card styling */
.accordion .card {
    margin-bottom: 1rem; /* Spacing between cards */
}

.accordion .card-header {
    background-color: #f8f9fa; /* Light grey background for headers */
    border-bottom: 1px solid #e3e6e8; /* Light border for separation */
}

.accordion .btn-link {
    text-decoration: none; /* Remove underline from links */
    color: #007bff; /* Bootstrap primary color for link */
    font-weight: bold; /* Make the title bold */
}

.accordion .btn-link:hover,
.accordion .btn-link:focus {
    text-decoration: none; /* Remove underline on hover/focus */
    color: #0056b3; /* Darker shade for hover/focus state */
}

.accordion .card-body {
    background-color: #ffffff; /* White background for content */
    color: #212529; /* Dark text for readability */
}

/* Button styling */
.btn-secondary {
    color: #ffffff; /* White text on buttons */
    background-color: #6c757d; /* Bootstrap secondary color */
    border-color: #6c757d;
}

.btn-secondary:hover {
    color: #ffffff;
    background-color: #5a6268; /* Slightly darker on hover */
    border-color: #545b62;
}

/* Add padding to the content inside card-body for better spacing */
.card-body p {
    padding: 0.5rem 0; /* Add padding to top and bottom of paragraph */
}

/* Make the back button stand out */
.btn-back {
    color: #fff;
    background-color: #17a2b8; /* Use a different color to distinguish it */
    border-color: #17a2b8;
}

.btn-back:hover {
    color: #fff;
    background-color: #138496; /* Darker on hover */
    border-color: #117a8b;
}

/* ===== WORKFLOW ACTIONS STYLES ===== */

/* Connected Horizontal Workflow Progress */
.workflow-progress-connected {
    margin-bottom: 1.5rem;
}

.workflow-steps-horizontal {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
}

.workflow-step-horizontal {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-width: 80px;
}

.step-circle-horizontal {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
    z-index: 2;
    position: relative;
}

.step-circle-horizontal.completed {
    background-color: #28a745;
    color: white;
    border: 3px solid #28a745;
}

.step-circle-horizontal.pending {
    background-color: white;
    color: #6c757d;
    border: 3px solid #dee2e6;
}

.step-label-horizontal {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    color: #495057;
    line-height: 1.2;
}

.workflow-step-horizontal.completed .step-label-horizontal {
    color: #28a745;
    font-weight: 600;
}

.step-connector-horizontal {
    height: 3px;
    flex: 1;
    min-width: 30px;
    margin: 0 -5px;
    margin-top: -20px;
    z-index: 1;
    position: relative;
}

.step-connector-horizontal.completed {
    background-color: #28a745;
}

.step-connector-horizontal.pending {
    background-color: #dee2e6;
}

/* Compact Action Buttons */
.workflow-actions-compact {
    margin-top: 1rem;
}

.action-button-group {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.75rem;
    background-color: #fff;
    transition: all 0.3s ease;
    height: 100%;
}

.action-button-group:hover {
    border-color: #007bff;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 123, 255, 0.075);
}

.action-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.action-button-group .btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

.action-button-group .badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .workflow-steps-horizontal {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .step-connector-horizontal {
        display: none;
    }

    .workflow-step-horizontal {
        min-width: 60px;
    }

    .step-circle-horizontal {
        width: 35px;
        height: 35px;
        font-size: 0.8rem;
    }

    .workflow-actions-compact .col-lg-3 {
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 576px) {
    .action-button-group {
        padding: 0.5rem;
    }

    .action-label {
        font-size: 0.8rem;
        margin-bottom: 0.375rem;
    }

    .action-button-group .btn {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }

    .step-label-horizontal {
        font-size: 0.7rem;
    }
}

/* ===== QBO STATUS PAGE STYLES ===== */

/* Clean Page Header - Consistent with App Theme */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items-center;
    margin-bottom: 2rem;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-icon {
    color: #0d6efd;
    font-size: 1.5rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
    color: #212529;
}

.page-subtitle {
    font-size: 1rem;
    margin: 0;
    color: #6c757d;
    font-weight: 400;
}



/* Clean Status Cards - Consistent with App Theme */
.status-overview-card {
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 2rem;
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.2s ease-in-out;
    position: relative;
}

.status-overview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.status-overview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #6c757d;
    border-radius: 0.75rem 0.75rem 0 0;
}

.status-overview-card.success::before {
    background: #28a745;
}
.status-overview-card.warning::before {
    background: #ffc107;
}
.status-overview-card.danger::before {
    background: #dc3545;
}

/* Clean Status Indicators - Consistent with App Theme */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.status-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.status-icon.success {
    background: #28a745;
    color: white;
}
.status-icon.warning {
    background: #ffc107;
    color: white;
}
.status-icon.danger {
    background: #dc3545;
    color: white;
}

.status-text h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
}

.status-text p {
    margin: 0;
    color: #6c757d;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Clean Metrics Grid - Consistent with App Theme */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.metric-card {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.375rem;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.metric-card:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.metric-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: block;
    color: #212529;
}

.metric-number.success {
    color: #28a745;
}
.metric-number.warning {
    color: #ffc107;
}
.metric-number.danger {
    color: #dc3545;
}
.metric-number.info {
    color: #17a2b8;
}

.metric-label {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Clean Action Sections - Consistent with App Theme */
.action-section {
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 2rem;
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.2s ease-in-out;
}

.action-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.action-section h5 {
    margin-bottom: 1.5rem;
    font-weight: 600;
    color: #212529;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-section h5 i {
    color: #0d6efd;
}

.btn-action {
    width: 100%;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-size: 0.875rem;
}

.btn-action:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

/* Clean Info Panels - Consistent with App Theme */
.info-panel {
    background: #f8f9fa;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-top: 1rem;
    border: 1px solid #e9ecef;
}

.info-panel h6 {
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #212529;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

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

.info-label {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

.info-value {
    font-weight: 600;
    color: #212529;
    font-size: 0.875rem;
}

/* Loading Spinner Enhancement */
.loading-spinner {
    display: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Animation for page load */
.status-overview-card,
.action-section {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Stagger animation delays */
.status-overview-card:nth-child(1) { animation-delay: 0.1s; }
.status-overview-card:nth-child(2) { animation-delay: 0.2s; }
.action-section:nth-child(1) { animation-delay: 0.3s; }
.action-section:nth-child(2) { animation-delay: 0.4s; }
.action-section:nth-child(3) { animation-delay: 0.5s; }
