/* Dashboard Specific Styles */
:root {
    --sidebar-width: 280px;
    --dashboard-bg: #f4f7fb;
    --card-bg: #ffffff;
}

body.dashboard-body {
    background-color: var(--dashboard-bg);
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.dashboard-sidebar {
    width: var(--sidebar-width);
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-logo {
    padding: 24px;
    font-size: 24px;
    font-weight: 900;
    color: var(--text-main);
    text-decoration: none;
    border-bottom: 1px solid var(--border-light);
}

.logo-dot {
    color: var(--primary);
}

.sidebar-nav {
    padding: 24px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.sidebar-link iconify-icon {
    font-size: 24px;
    transition: color var(--transition);
}

.sidebar-link:hover, .sidebar-link.active {
    background-color: var(--bg-color);
    color: var(--primary);
}

.sidebar-link.active {
    background-color: var(--primary);
    color: white;
}

.sidebar-link.active iconify-icon {
    color: white;
}

/* Main Content */
.dashboard-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Topbar */
.dashboard-header {
    height: 80px;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    transition: color var(--transition);
    position: relative;
}

.btn-icon:hover {
    color: var(--primary);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--accent);
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--card-bg);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

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

/* Content Area */
.dashboard-content {
    padding: 40px;
    flex: 1;
}

/* Filters */
.feed-filters {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.feed-filters .custom-select {
    width: 200px;
    background: var(--card-bg);
}

.feed-filters .search__input-wrapper {
    flex: 1;
    background: var(--card-bg);
    border-color: var(--border-light);
}

.feed-filters .search__input-wrapper:focus-within {
    border-color: var(--primary);
}

/* Order Feed Grid */
.orders-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

/* Order Card */
.order-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 32px;
    border: 1px solid var(--border-light);
    transition: box-shadow var(--transition), transform var(--transition);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.order-card:hover {
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
    transform: translateY(-2px);
}

.order-card.disabled {
    opacity: 0.7;
    filter: grayscale(0.5);
}

.client-request-card:hover, .no-hover-card:hover {
    box-shadow: none;
    transform: none;
}

.no-hover-btn:hover {
    transform: none !important;
    box-shadow: none !important;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.order-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 12px 0;
}

.order-meta {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: var(--text-muted);
}

.order-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.order-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
    text-align: right;
    white-space: nowrap;
}

.order-price.negotiable {
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 600;
}

.order-desc {
    font-size: 15px;
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.order-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.order-tag {
    background: var(--bg-color);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.order-tag.urgent {
    background: #FEF2F2;
    color: #EF4444;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
}

.status-badge.closed {
    background: var(--bg-color);
    color: var(--text-muted);
}

/* Tabs */
.dashboard-tabs {
    display: none; /* Hide for now, logic will show active tab */
}

.dashboard-tabs.active {
    display: block;
}

/* Client Dashboard Specific */
/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-light);
    transition: .3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input:checked + .toggle-slider {
    background-color: var(--primary);
}

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

.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

/* Offers Section */
.offers-section {
    margin-top: 24px;
    border-top: 1px dashed var(--border-light);
    padding-top: 24px;
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.offers-section.active {
    display: block;
}

.offers-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.offer-card {
    background: var(--bg-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.offer-contractor {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.offer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.offer-info h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: var(--text-main);
}

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

.offer-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
}

.offer-actions {
    display: flex;
    gap: 12px;
}

/* Chat Layout */
.chat-container {
    display: flex;
    height: calc(100vh - 160px);
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.chat-sidebar {
    width: 320px;
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
}

.chat-list-item {
    padding: 16px;
    display: flex;
    gap: 12px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--transition);
}

.chat-list-item:hover, .chat-list-item.active {
    background: var(--bg-color);
}

.chat-list-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-list-info {
    flex: 1;
    overflow: hidden;
}

.chat-list-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.chat-list-preview {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-color);
}

.chat-header {
    height: 70px;
    padding: 0 24px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 16px;
}

.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.message.received {
    align-self: flex-start;
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-bottom-left-radius: 4px;
}

.message.sent {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-input-area {
    padding: 16px 24px;
    background: var(--card-bg);
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 12px;
    align-items: center;
}

.chat-input-area input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    outline: none;
}

.chat-input-area input:focus {
    border-color: var(--primary);
}

/* Active Project / Milestones View */
.project-view {
    display: flex;
    gap: 32px;
}

.project-main-col {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.project-side-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.milestone-tracker {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 32px;
    border: 1px solid var(--border-light);
}

.milestone {
    display: flex;
    gap: 20px;
    position: relative;
    padding-bottom: 32px;
}

.milestone:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 32px;
    bottom: 0;
    width: 2px;
    background: var(--border-light);
}

.milestone.completed:has(+ .milestone.completed):not(:last-child)::before {
    background: var(--primary);
}

.milestone-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-muted);
    z-index: 2;
}

.milestone.completed .milestone-icon {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.milestone-content {
    flex: 1;
}

.milestone-content h4 {
    margin: 0;
    font-size: 16px;
}

.milestone-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.milestone-content p {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--text-muted);
}

.milestone-photos {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.milestone-photos img {
    width: 80px;
    height: 60px;
    border-radius: 4px;
    object-fit: cover;
    cursor: pointer;
}

/* Documents List */
.documents-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 32px;
    border: 1px solid var(--border-light);
}

.doc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.doc-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Finances / Safe Deal */
.finance-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.stat-card h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-card .value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-main);
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.transactions-table th, .transactions-table td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.transactions-table th {
    background: var(--bg-color);
    font-size: 13px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}
