/* LifeTastic Admin Panel - Custom Theme */
/* Main accent color: #9c895e */

:root {
    --lt-primary:       #9c895e;
    --lt-primary-dark:  #7a6b49;
    --lt-primary-light: #b8a882;
    --lt-primary-xs:    #f5f1ea;
    --lt-sidebar-bg:    #1e1e2e;
    --lt-sidebar-text:  #c8c8d8;
    --lt-sidebar-hover: #2d2d42;
    --lt-sidebar-active:#9c895e;
    --lt-topbar-bg:     #ffffff;
    --lt-body-bg:       #f4f6fb;
    --lt-card-shadow:   0 2px 12px rgba(0,0,0,0.07);
    --lt-border-radius: 10px;
}

/* ─── Body ─────────────────────────────────────────────────── */
body {
    background-color: var(--lt-body-bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 0.9rem;
}

/* ─── Buttons ──────────────────────────────────────────────── */
.btn-primary,
.btn-lt {
    background-color: var(--lt-primary) !important;
    border-color:     var(--lt-primary) !important;
    color: #fff !important;
}
.btn-primary:hover,
.btn-lt:hover {
    background-color: var(--lt-primary-dark) !important;
    border-color:     var(--lt-primary-dark) !important;
}
.btn-primary:focus,
.btn-lt:focus {
    box-shadow: 0 0 0 0.2rem rgba(156, 137, 94, 0.4) !important;
}
.btn-outline-primary {
    color:        var(--lt-primary) !important;
    border-color: var(--lt-primary) !important;
}
.btn-outline-primary:hover {
    background-color: var(--lt-primary) !important;
    color: #fff !important;
}

/* ─── Sidebar ──────────────────────────────────────────────── */
#sidebar {
    width: 260px;
    min-height: 100vh;
    background: var(--lt-sidebar-bg);
    transition: all 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
#sidebar.collapsed {
    width: 70px;
}
#sidebar.collapsed .sidebar-label,
#sidebar.collapsed .sidebar-section-title {
    display: none;
}
#sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem;
}
#sidebar.collapsed .nav-link i {
    margin-right: 0 !important;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.sidebar-brand img,
.sidebar-brand .brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--lt-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.sidebar-brand .brand-name {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
}
.sidebar-brand .brand-sub {
    color: rgba(255,255,255,0.4);
    font-size: 0.7rem;
}

.sidebar-nav {
    padding: 1rem 0;
    flex: 1;
}
.sidebar-section-title {
    color: rgba(255,255,255,0.3);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 1rem 1.5rem 0.4rem;
}
.sidebar-nav .nav-link {
    color: var(--lt-sidebar-text);
    padding: 0.6rem 1.5rem;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    transition: all 0.2s;
    text-decoration: none;
    position: relative;
}
.sidebar-nav .nav-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}
.sidebar-nav .nav-link:hover {
    background: var(--lt-sidebar-hover);
    color: #fff;
}
.sidebar-nav .nav-link.active {
    background: rgba(156, 137, 94, 0.15);
    color: var(--lt-primary-light);
    border-left: 3px solid var(--lt-primary);
}
.sidebar-nav .nav-link.active i {
    color: var(--lt-primary);
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-footer .staff-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--lt-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}
.sidebar-footer .staff-name {
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
}
.sidebar-footer .staff-role {
    color: rgba(255,255,255,0.4);
    font-size: 0.7rem;
}

/* ─── Main Content ─────────────────────────────────────────── */
#main-content {
    margin-left: 260px;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
#main-content.expanded {
    margin-left: 70px;
}

/* ─── Topbar ───────────────────────────────────────────────── */
.topbar {
    background: var(--lt-topbar-bg);
    border-bottom: 1px solid #e8ecf0;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.topbar .toggle-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
}
.topbar .toggle-btn:hover {
    background: var(--lt-primary-xs);
    color: var(--lt-primary);
}
.topbar .page-title {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
    flex: 1;
}
.topbar .topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ─── Page Content ─────────────────────────────────────────── */
.page-content {
    padding: 1.5rem;
    flex: 1;
}

/* ─── Cards ────────────────────────────────────────────────── */
.card {
    border: none;
    border-radius: var(--lt-border-radius);
    box-shadow: var(--lt-card-shadow);
}
.card-header {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    border-radius: var(--lt-border-radius) var(--lt-border-radius) 0 0 !important;
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header .card-title-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--lt-primary-xs);
    color: var(--lt-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

/* ─── Stats Cards ──────────────────────────────────────────── */
.stat-card {
    border-radius: var(--lt-border-radius);
    padding: 1.25rem;
    border: none;
    box-shadow: var(--lt-card-shadow);
    background: #fff;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.stat-card .stat-icon.bg-lt-primary { background: rgba(156,137,94,0.12); color: var(--lt-primary); }
.stat-card .stat-icon.bg-lt-blue    { background: rgba(66,133,244,0.12); color: #4285f4; }
.stat-card .stat-icon.bg-lt-green   { background: rgba(52,168,83,0.12);  color: #34a853; }
.stat-card .stat-icon.bg-lt-orange  { background: rgba(251,188,5,0.12);  color: #fbbc05; }
.stat-card .stat-icon.bg-lt-red     { background: rgba(234,67,53,0.12);  color: #ea4335; }
.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1;
}
.stat-card .stat-label {
    font-size: 0.78rem;
    color: #888;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.2rem;
}

/* ─── Tables / DataTables ──────────────────────────────────── */
.table {
    font-size: 0.85rem;
}
.table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #e8ecf0;
    font-weight: 600;
    color: #555;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.table tbody tr {
    transition: background 0.15s;
}
.table tbody tr:hover {
    background: var(--lt-primary-xs);
}
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--lt-primary);
    box-shadow: 0 0 0 0.15rem rgba(156,137,94,0.2);
    outline: none;
}
.dataTables_wrapper .dataTables_length select {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
}
.page-item.active .page-link {
    background-color: var(--lt-primary) !important;
    border-color:     var(--lt-primary) !important;
}
.page-link {
    color: var(--lt-primary) !important;
}

/* ─── Badges ───────────────────────────────────────────────── */
.badge-lt-primary { background: var(--lt-primary); color: #fff; }
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.status-badge.active      { background: #d4edda; color: #155724; }
.status-badge.inactive    { background: #f8d7da; color: #721c24; }
.status-badge.pending     { background: #fff3cd; color: #856404; }
.status-badge.processing  { background: #cce5ff; color: #004085; }
.status-badge.shipped     { background: #d1ecf1; color: #0c5460; }
.status-badge.completed   { background: #d4edda; color: #155724; }
.status-badge.suspended   { background: #f8d7da; color: #721c24; }
.status-badge.expired     { background: #e2e3e5; color: #383d41; }

/* ─── Forms ────────────────────────────────────────────────── */
.form-control:focus,
.form-select:focus {
    border-color: var(--lt-primary);
    box-shadow: 0 0 0 0.15rem rgba(156,137,94,0.25);
}
.form-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 0.3rem;
}
.form-section-title {
    font-weight: 600;
    color: var(--lt-primary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--lt-primary-xs);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* ─── Action Buttons ───────────────────────────────────────── */
.btn-action {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-action.edit   { background: #e3f2fd; color: #1976d2; }
.btn-action.delete { background: #fce4ec; color: #c62828; }
.btn-action.view   { background: #e8f5e9; color: #2e7d32; }
.btn-action.suspend{ background: #fff8e1; color: #f57f17; }
.btn-action:hover  { opacity: 0.8; transform: scale(1.05); }

/* ─── Login Page ───────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e1e2e 0%, #2d2d42 50%, #1a1a2e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--lt-primary), var(--lt-primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    margin: 0 auto 1rem;
}
.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    text-align: center;
}
.login-subtitle {
    color: #888;
    text-align: center;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

/* ─── Alerts ───────────────────────────────────────────────── */
.alert-lt {
    border-radius: 8px;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
}

/* ─── Breadcrumb ───────────────────────────────────────────── */
.breadcrumb {
    font-size: 0.8rem;
    background: none;
    padding: 0;
    margin-bottom: 0.5rem;
}
.breadcrumb-item.active { color: #888; }
.breadcrumb-item a { color: var(--lt-primary); text-decoration: none; }

/* ─── Progress Bars ────────────────────────────────────────── */
.progress-bar { background-color: var(--lt-primary); }

/* ─── Modals ───────────────────────────────────────────────── */
.modal-header {
    background: var(--lt-primary-xs);
    border-bottom: 1px solid var(--lt-primary-light);
}
.modal-title {
    color: var(--lt-primary-dark);
    font-weight: 600;
}

/* ─── Input Groups ─────────────────────────────────────────── */
.input-group-text {
    background: #f8f9fa;
    border-color: #ddd;
    color: #666;
}

/* ─── Nav Tabs ─────────────────────────────────────────────── */
.nav-tabs .nav-link.active {
    color: var(--lt-primary) !important;
    border-color: var(--lt-primary) var(--lt-primary) #fff;
    font-weight: 600;
}
.nav-tabs .nav-link {
    color: #666;
}

/* ─── Responsive ───────────────────────────────────────────── */
@media (max-width: 991.98px) {
    #sidebar {
        transform: translateX(-100%);
        width: 260px !important;
    }
    #sidebar.mobile-open {
        transform: translateX(0);
    }
    #main-content {
        margin-left: 0 !important;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    .sidebar-overlay.active {
        display: block;
    }
}

/* ─── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--lt-primary-light); }

/* ─── Misc ─────────────────────────────────────────────────── */
.text-lt-primary { color: var(--lt-primary) !important; }
.bg-lt-primary   { background-color: var(--lt-primary) !important; }
.border-lt       { border-color: var(--lt-primary) !important; }

.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--lt-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
}

.product-img-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #aaa;
}
.empty-state i { font-size: 3rem; margin-bottom: 1rem; display: block; }

/* ─── JSON Products Editor ─────────────────────────────────── */
.product-line-item {
    background: #f8f9fa;
    border: 1px solid #e8ecf0;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

/* ─── Tooltip overrides ────────────────────────────────────── */
.tooltip-inner {
    background: var(--lt-primary-dark);
    font-size: 0.75rem;
}

/* ═══════════════════════════════════════════════════════════════
   最新消息 (Latest News) Section
   ═══════════════════════════════════════════════════════════════ */
.latest-news-section {
    background: #f9f7f2;
    border-radius: var(--lt-border-radius);
    padding: 32px 28px 28px;
    box-shadow: var(--lt-card-shadow);
}

/* ─── Section Header ───────────────────────────────────────── */
.news-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.news-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.news-icon-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
}

.news-title {
    font-family: 'Noto Sans TC', 'Inter', system-ui, sans-serif;
    font-size: 36px;
    font-weight: 700;
    color: #aa9662;
    letter-spacing: 2px;
    line-height: 1.2;
    white-space: nowrap;
    margin: 0;
}

.news-header-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, #d4c99a, transparent);
    min-width: 30px;
}

.news-more-link {
    font-size: 16px;
    font-weight: 700;
    color: #888;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
    transition: color 0.2s;
}

.news-more-link:hover {
    color: #aa9662;
}

/* ─── News Cards Scroll ────────────────────────────────────── */
.news-cards-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    margin: 0 -10px;
    padding: 0 10px 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #d4c99a transparent;
}

.news-cards-scroll::-webkit-scrollbar {
    height: 5px;
}

.news-cards-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.news-cards-scroll::-webkit-scrollbar-thumb {
    background: #d4c99a;
    border-radius: 3px;
}

.news-cards-track {
    display: flex;
    gap: 24px;
}

/* ─── Individual News Card ─────────────────────────────────── */
.news-card-item {
    flex: 0 0 320px;
    min-width: 280px;
    background: #fff;
    border: 1.5px solid #d4cc8e;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.news-card-item:hover {
    box-shadow: 0 6px 24px rgba(156, 137, 94, 0.18);
    transform: translateY(-2px);
}

/* Card Image */
.news-card-img {
    width: 100%;
    height: 240px;
    overflow: hidden;
    flex-shrink: 0;
}

.news-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.news-card-item:hover .news-card-img img {
    transform: scale(1.05);
}

/* Card Body */
.news-card-body {
    padding: 18px 20px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.news-card-heading {
    font-family: 'Noto Sans TC', 'Inter', system-ui, sans-serif;
    font-size: 19px;
    font-weight: 700;
    color: #4a3c28;
    line-height: 1.35;
    margin: 0 0 12px 0;
    letter-spacing: 0.3px;
}

.news-card-text {
    font-size: 13px;
    line-height: 1.7;
    color: #777;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 12px 0;
}

.news-card-date {
    font-size: 14px;
    font-weight: 600;
    color: #e07c4a;
    letter-spacing: 0.5px;
}

/* ─── News Section Responsive ──────────────────────────────── */
@media (max-width: 991.98px) {
    .latest-news-section {
        padding: 24px 18px 20px;
    }

    .news-title {
        font-size: 28px;
    }

    .news-icon-img {
        width: 38px;
        height: 38px;
    }

    .news-card-item {
        flex: 0 0 280px;
        min-width: 260px;
    }

    .news-card-img {
        height: 200px;
    }

    .news-card-heading {
        font-size: 17px;
    }
}

@media (max-width: 575.98px) {
    .latest-news-section {
        padding: 18px 14px 16px;
    }

    .news-header {
        gap: 10px;
        margin-bottom: 16px;
    }

    .news-title {
        font-size: 22px;
    }

    .news-icon-img {
        width: 32px;
        height: 32px;
    }

    .news-more-link {
        font-size: 14px;
    }

    .news-card-item {
        flex: 0 0 250px;
        min-width: 240px;
    }

    .news-card-img {
        height: 170px;
    }

    .news-card-body {
        padding: 14px 16px 14px;
    }

    .news-card-heading {
        font-size: 16px;
    }

    .news-card-text {
        -webkit-line-clamp: 3;
    }
}
