/* [KM-UI-NORDIC-NEW-L1A1] Logic: 北歐主題 佈局與導覽樣式規格 */

/* Header V2 [KM-REQ-UI-UX-20260329] */
header {
    grid-area: header;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 100;
}

.module-toolbar {
    grid-area: module-toolbar;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 2rem;
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid var(--glass-border);
    z-index: 90;
    min-width: 0;
}

.hamburger-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: #fff;
    color: var(--accent-color);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hamburger-btn:hover {
    background: rgba(188, 108, 37, 0.08);
}

.module-toolbar-main {
    min-width: 0;
}

.module-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
}

.module-context {
    font-size: 0.76rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    height: 44px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(188, 108, 37, 0.1);
}

.header-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.header-context {
    background: rgba(188, 108, 37, 0.03);
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-context .label { color: var(--text-muted); }
.header-context .value { color: var(--accent-color); font-weight: 600; }

.header-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Sidebar V2 [KM-UI-NORDIC-MOD-S2C3] */
#sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: #f8f5f2; /* Nordic Wood Neutral */
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    overflow-y: auto;
    z-index: 220;
    box-shadow: 16px 0 40px rgba(45, 52, 54, 0.16);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
}

#sidebar.open {
    transform: translateX(0);
}

.sidebar-backdrop {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100vw;
    height: calc(100vh - var(--header-height));
    background: rgba(45, 52, 54, 0.22);
    z-index: 210;
}

.nav-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    margin-top: 2rem;
}

.nav-title:first-child {
    margin-top: 0;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 1rem;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: transparent;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
    font: inherit;
    text-align: left;
}

.nav-item:hover:not(:disabled) {
    background: rgba(188, 108, 37, 0.05);
    color: var(--accent-color);
}

.nav-item:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.nav-item.active {
    background: #fff;
    color: var(--accent-color);
    border-color: var(--glass-border);
    box-shadow: 0 4px 12px rgba(188, 108, 37, 0.05);
}

.nav-item.locked {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(1);
}

.nav-item:disabled {
    cursor: not-allowed;
}

.nav-item i {
    width: 20px;
    font-size: 1.1rem;
    text-align: center;
}

.nav-label {
    font-size: 1.15rem;
    font-weight: 500;
}

/* Main Content Structure */
#main-content {
    grid-area: main;
    display: flex;
    flex-direction: column;
    padding: 2.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    background: radial-gradient(circle at top right, rgba(212, 163, 115, 0.05), transparent 45%);
}

/* Project Selection Styles [KM-UI-NORDIC-MOD-A3B4] */
.project-row {
    cursor: pointer;
    transition: background 0.2s;
}

.project-row:hover {
    background: rgba(188, 108, 37, 0.03);
}

.project-row.active {
    background: rgba(188, 108, 37, 0.08);
    border-color: rgba(188, 108, 37, 0.3);
}

/* Action Button Capsule [DSD-UI-NORDIC-§4.1] */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1;
}

.action-btn.open {
    color: var(--accent-color);
    background: rgba(188, 108, 37, 0.05);
    border-color: rgba(188, 108, 37, 0.1);
}

.action-btn.open:hover {
    background: rgba(188, 108, 37, 0.15);
    transform: translateY(-1px);
}

.action-btn.delete {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.1);
}

.action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
    transform: translateY(-1px);
}
