/* AMD Construction Pro CSS Styles */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f5f5f5;
    overflow: hidden;
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden !important;
    margin: 0;
    padding: 0;
}

.app-container {
    height: 100%;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.header {
    background: #2c5aa0; /* Dark blue from image */
    height: 60px; /* Adjusted height */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    color: white;
    position: relative; /* For search results positioning */
    border-bottom: 1px solid #1e3c72; /* Slightly darker border */
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px; /* Increased gap */
    font-size: 18px; /* Larger font */
    font-weight: 600;
}

.logo-icon {
    width: 32px; /* Larger icon */
    height: 32px;
}

.search-box {
    flex-grow: 1;
    max-width: 500px; /* Max width for search */
    margin: 0 20px; /* Margin around search */
    position: relative; /* For search results */
}

.search-input {
    width: 100%;
    padding: 10px 15px; /* More padding */
    border: 1px solid #5a7faa; /* Lighter border for input */
    border-radius: 20px; /* Rounded corners */
    font-size: 14px;
    outline: none;
    background-color: #4a6e9c; /* Darker background for input */
    color: white;
}

.search-input::placeholder {
    color: #a9c2e1; /* Lighter placeholder text */
}

.search-results-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none; /* Hidden by default */
    color: #333; /* Text color for results */
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px; /* Increased gap */
    font-size: 14px;
    position: relative;
}

.user-menu {
    position: relative;
}

.user-menu-button {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.16);
    color: white;
    cursor: pointer;
    font-size: 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.user-menu-button:hover,
.user-menu-button:focus {
    background: rgba(255,255,255,0.24);
    outline: none;
}

.user-menu:hover .user-menu-button {
    opacity: 0.8;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 170px;
    background: white;
    border: 1px solid #d7dee8;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
    display: none;
    padding: 6px;
    z-index: 1200;
}

.user-menu.open .user-menu-dropdown {
    display: block;
}

.user-menu-item {
    width: 100%;
    border: 0;
    background: transparent;
    color: #1f2937;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 4px;
    font-size: 14px;
    text-align: left;
}

.user-menu-item:hover,
.user-menu-item:focus {
    background: #eef4fb;
    outline: none;
}


.ribbon {
    background: #1e3c72; /* Darker blue from image's ribbon */
    color: white;
    padding: 0 16px; /* No vertical padding, tabs will define height */
    border-bottom: 1px solid #1a252f;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Align tabs to the left */
    min-height: 50px; /* Min height for ribbon */
    position: sticky;
    top: 0; /* Stick to top if header scrolls (though app-container is fixed) */
    z-index: 999; /* Below header search results */
}

.ribbon-tabs {
    display: flex;
    gap: 1px; /* Small gap between tabs */
}

.ribbon-tab {
    background: transparent; /* Match image - tabs are part of the ribbon */
    border: none;
    border-bottom: 3px solid transparent; /* For active state */
    color: #b0c4de; /* Lighter blue for inactive tabs */
    padding: 15px 20px; /* Padding for tab size */
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.ribbon-tab:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.ribbon-tab.active {
    color: white; /* Active tab text color */
    border-bottom: 3px solid #66a3ff; /* Light blue underline for active tab */
    font-weight: 600;
}

/* Main Content Wrapper for Sidebar and Primary Content */
.main-content-wrapper {
    flex: 1 1 auto; /* Takes remaining space */
    display: flex;
    overflow: hidden; /* Prevent app scroll, internal areas will scroll */
    background-color: #eef2f7; /* Light grey background for content area */
    flex-direction: column;
}

/* Left Sidebar (Quick Stats, Upcoming Tasks) */
.left-sidebar {
    width: 280px;
    background: #ffffff; /* White background for sidebar */
    padding: 20px;
    overflow-y: auto;
    border-right: 1px solid #d8dfe5; /* Light border */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.quick-stats-panel h3 {
    font-size: 16px;
    color: #334e68; /* Dark blue grey for titles */
    margin-bottom: 15px;
    border-bottom: 1px solid #e0e6ed;
    padding-bottom: 10px;
}

.quick-stats-panel .stat-item {
    background-color: #f8f9fa; /* Light background for stat items */
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #495057;
    border: 1px solid #e9ecef;
}
.quick-stats-panel .stat-item i {
    font-size: 18px;
    color: #007bff; /* Default icon color */
}

/* Specific icon colors from image */
#active-projects-stat i { color: #6f42c1; } /* Purple */
#upcoming-deadlines-stat i { color: #dc3545; } /* Red */
#overdue-tasks-stat i { color: #17a2b8; } /* Teal */
#financial-forecast-stat i { color: #28a745; } /* Green */


.upcoming-tasks-panel button {
    display: inline-block;
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    margin-right: 10px;
    margin-bottom: 10px;
}
.upcoming-tasks-panel button:hover {
    background-color: #0056b3;
}
.upcoming-tasks-panel #all-tasks-btn {
    background-color: #6c757d;
}
.upcoming-tasks-panel #all-tasks-btn:hover {
    background-color: #545b62;
}

.upcoming-tasks-panel ul {
    list-style: none;
    padding: 0;
}
.upcoming-tasks-panel li {
    padding: 8px 0;
    border-bottom: 1px dashed #e0e6ed;
    font-size: 13px;
}
.upcoming-tasks-panel li:last-child {
    border-bottom: none;
}


/* Primary Content Area (for tabs) */
.primary-content-area {
    flex: 1; /* Takes remaining width */
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Tab Content Display Logic */
.primary-content-area .tab-content {
    display: none; /* Hide all tabs by default */
    width: 100%;
    height: 100%; /* Ensure tab content can fill the area if needed */
    animation: fadeIn 0.3s ease-in-out;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: auto;
}

.primary-content-area .tab-content.active {
    display: block; /* Show only the active tab */
}

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


/* Modal Container - for dynamically loaded modals */
#modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1040; /* Ensure it's below specific modals like #add-task-modal if they have higher z-index */
    pointer-events: none; /* Allows clicks through if no modal is visible */
}

/* General Modal Styling (if modalManager.js doesn't handle all of it) */
.modal-overlay { /* This class might be added by modalManager.js */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto; /* Enable pointer events when overlay is active */
}

.modal-content-wrapper { /* This class might be added by modalManager.js */
    background: white;
    border-radius: 8px;
    padding: 20px;
    max-width: 600px; /* Default max width */
    width: 90%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    max-height: 90vh;
    overflow-y: auto;
}

/* Fallback for .main-content if old JS still references it directly for tabs */
/* This is less ideal than tabs loading into .primary-content-area */
.main-content > .tab-content {
    display: none !important;
}
.main-content > .tab-content.active {
    display: block !important;
    padding: 20px; /* Add padding if loaded directly into .main-content */
    background-color: #fff; /* Ensure white background if not in primary-content-area */
}


::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.flex-1 { flex: 1; }
/* ... any other utilities you need ... */

/* Ensure app container takes full viewport and handles flex layout correctly */
/* This is mostly a repeat but reinforces the overall structure */
/* html, body, .app-container {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
} */

/* Ensure header and ribbon don't shrink */
.header, .ribbon {
    flex-shrink: 0;
}

