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

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
    border-right: 1px solid var(--border);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    transition: width 0.3s ease;
}

.sidebar-logo {
    margin-bottom: 40px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo .material-symbols-outlined {
    font-size: 28px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    align-items: center;
}

.sidebar-menu li {
    width: 100%;
    display: flex;
    justify-content: center;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius);
    color: var(--text-muted);
    transition: all 0.2s;
    position: relative;
}

.sidebar-menu a:hover {
    color: var(--primary);
    background-color: var(--bg-main);
}

.sidebar-menu a.active {
    color: var(--primary);
    background-color: var(--primary-light);
}

/* Left border indicator for active state */
.sidebar-menu a.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    height: 24px;
    width: 3px;
    background-color: var(--primary);
    border-radius: 0 4px 4px 0;
}

/* Main Workspace */
.workspace {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

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

.header-title h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-search .search-bar {
    width: 400px;
    background-color: var(--bg-main);
    border: none;
}

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

.icon-btn {
    color: var(--text-muted);
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

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

.user-name {
    font-size: 14px;
    font-weight: 600;
}

/* Content Area Layout */
.content-area {
    padding: 32px 40px;
    display: flex;
    gap: 24px;
}

.main-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0; /* Prevent overflow */
}

.side-panel {
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Summary Cards (Top 4) */
.summary-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.summary-card {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.summary-card-left {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-blue { background-color: #E0F2FE; color: #0284C7; }
.icon-green { background-color: #DCFCE7; color: #16A34A; }
.icon-orange { background-color: #FFEDD5; color: #EA580C; }

.summary-value-group {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.summary-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
}

.summary-trend {
    font-size: 13px;
    font-weight: 600;
}

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }

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

.summary-card-right {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Main Table Card */
.main-table-card {
    flex: 1;
}

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

.card-title h2 {
    font-size: 18px;
    margin-bottom: 4px;
}

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

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

.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.tabs {
    display: flex;
    gap: 24px;
}

.tab {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    padding-bottom: 12px;
    position: relative;
    cursor: pointer;
}

.tab.active {
    color: var(--primary);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -13px; /* Align with border-bottom of container */
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary);
}

.table-controls .search-bar {
    width: 250px;
    padding: 6px 12px;
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

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

.td-checkbox {
    width: 40px;
}

.td-avatar {
    width: 50px;
}

.table-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.td-name {
    font-weight: 600;
    color: var(--text-main);
    width: 150px;
}

.td-progress {
    width: 200px;
}

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

.progress-track {
    flex: 1;
    height: 6px;
    background-color: var(--bg-main);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary);
    border-radius: 3px;
}

.progress-text {
    font-size: 13px;
    font-weight: 600;
    width: 40px;
}

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

.td-status {
    width: 150px;
}

.status-dot {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}

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

.dot-success { background-color: var(--success); }
.dot-warning { background-color: var(--warning); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }

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

.action-icon {
    color: var(--text-light);
    margin-left: 8px;
    transition: color 0.2s;
}

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

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-muted);
}

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

/* Right Panel (Side Panel) */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 0 4px;
}

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

.panel-badge {
    font-size: 12px;
    color: var(--success);
    font-weight: 500;
}

.bundle-card {
    padding: 20px;
}

.bundle-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.bundle-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.4;
}

.bundle-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.bundle-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bundle-item-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--border-radius);
    background-color: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.bundle-item-text {
    display: flex;
    flex-direction: column;
}

.bundle-item-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
}

.bundle-item-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.bundle-action {
    width: 100%;
    margin-top: 8px;
}

/* Sidebar Expanded State */
body.sidebar-expanded .sidebar {
    width: 240px;
    align-items: stretch;
}

body.sidebar-expanded .workspace {
    margin-left: 240px;
}

body.sidebar-expanded .sidebar-logo {
    width: 100%;
    justify-content: flex-start;
    padding-left: 28px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    display: none;
    white-space: nowrap;
}

body.sidebar-expanded .logo-text {
    display: block;
}

.menu-text {
    margin-left: 16px;
    font-weight: 500;
    font-size: 14px;
    display: none;
    white-space: nowrap;
}

body.sidebar-expanded .sidebar-menu {
    align-items: stretch;
    padding: 0 16px;
}

body.sidebar-expanded .sidebar-menu li {
    justify-content: flex-start;
}

body.sidebar-expanded .sidebar-menu a {
    width: 100%;
    justify-content: flex-start;
    padding: 0 12px;
}

body.sidebar-expanded .menu-text {
    display: block;
}

.sidebar-toggle-wrapper {
    margin-top: auto;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 16px 0;
    border-top: 1px solid var(--border);
}

body.sidebar-expanded .sidebar-toggle-wrapper {
    justify-content: flex-end;
    padding-right: 16px;
}

.sidebar-toggle {
    width: 32px;
    height: 32px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.2s;
}

.sidebar-toggle:hover {
    background-color: var(--bg-main);
    color: var(--text-main);
}
