/* 公司資產管理系統 - 核心樣式表 v3.0 (穩定版) */
:root {
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --bg-dark: #0f172a;
    --bg-surface: #1e293b;
    --bg-surface-elevated: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #8b5cf6;
    --danger: #ef4444;
    --success: #22c55e;
    --border-color: rgba(255, 255, 255, 0.1);
    --sidebar-width: 250px;
}

.hidden {
    display: none !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Noto Sans TC', sans-serif;
}

body {
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* 佈局架構 */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* 側邊欄 */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    transition: 0.3s;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--accent);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    list-style: none;
    flex-grow: 1;
}

.nav-links li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.2rem;
    color: var(--text-secondary);
    border-radius: 12px;
    cursor: pointer;
    transition: 0.3s;
    margin-bottom: 0.5rem;
}

.nav-links li i {
    width: 20px;
    height: 20px;
}

.nav-links li:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-links li.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}

/* 主內容區 */
.main-content {
    flex-grow: 1;
    padding: 2rem 3rem;
    overflow-y: auto;
    max-width: calc(100vw - var(--sidebar-width));
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 2.2rem;
    font-weight: 700;
}

.header-left p {
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

.avatar {
    background: var(--primary-gradient);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.8rem;
}

/* 通用組件 */
.card {
    background: var(--bg-surface);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
}

.card h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

/* 資產網格 */
.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.asset-card {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: 22px;
    border: 1px solid var(--border-color);
    position: relative;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
}

.asset-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}

.asset-card.selected {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.asset-badge {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    padding: 0.3rem 0.8rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-pc {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.badge-nb {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.badge-n {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.asset-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: 1rem;
    margin-bottom: 1.2rem;
    height: 3.2rem;
    overflow: hidden;
}

/* 表單樣式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    color: white;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 1rem;
    transition: 0.3s;
}

.form-group input:focus {
    border-color: var(--accent);
    outline: none;
    background: rgba(0, 0, 0, 0.35);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* 動作按鈕 */
.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: 0.3s;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.card-footer-actions {
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding-top: 1rem;
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-action.edit-btn {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
}

.btn-action.delete-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

/* 資料表格樣式 */
.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.data-table tr {
    transition: 0.2s;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.data-table td {
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* 登入遮罩 */
.login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(25px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: #1e293b;
    padding: 3rem;
    border-radius: 28px;
    width: 95%;
    max-width: 420px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}

/* 響應式調整 */
.mobile-header {
    display: none;
    background: var(--bg-surface);
    padding: 1rem;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: -250px;
        height: 100vh;
        z-index: 1001;
    }

    .sidebar.active-sidebar {
        left: 0;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    }

    .mobile-header {
        display: flex;
    }

    .main-content {
        padding: 1.5rem;
        max-width: 100vw;
    }

    .header-left h1 {
        font-size: 1.6rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}