/* ================================================================
   好去处 - 管理后台  |  Modern UI 2026
   配色体系: 暖橙 #FF6B35 + 深靛 #1E1B4B + 浅灰 #F8FAFC
   设计风格: Glassmorphism + Soft Shadows + Micro-interactions
   ================================================================ */

/* ==================== CSS Variables ==================== */
:root {
    --primary: #FF6B35;
    --primary-light: #FF8F5E;
    --primary-dark: #E55A28;
    --primary-alpha: rgba(255, 107, 53, 0.08);
    --primary-glow: rgba(255, 107, 53, 0.25);

    --sidebar-bg: #0F0A1F;
    --sidebar-hover: rgba(255, 255, 255, 0.06);
    --sidebar-active: rgba(255, 107, 53, 0.12);

    --bg: #F1F5F9;
    --bg-elevated: #FFFFFF;
    --bg-card: #FFFFFF;

    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-inverse: #FFFFFF;

    --border: #E2E8F0;
    --border-light: #F1F5F9;

    --success: #10B981;
    --success-bg: #ECFDF5;
    --success-border: #A7F3D0;
    --danger: #EF4444;
    --danger-bg: #FEF2F2;
    --danger-border: #FECACA;
    --warning: #F59E0B;
    --warning-bg: #FFFBEB;
    --warning-border: #FDE68A;
    --info: #6366F1;
    --info-bg: #EEF2FF;
    --info-border: #C7D2FE;
    --processing: #F97316;
    --processing-bg: #FFF7ED;
    --processing-border: #FED7AA;

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.07), 0 4px 6px -2px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.03);
    --shadow-glow: 0 0 20px var(--primary-glow);

    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== Global Reset ==================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

input, select, textarea, button {
    font-family: inherit;
}

::selection {
    background: var(--primary-alpha);
    color: var(--primary-dark);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* ==================== Login Page ==================== */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0F0A1F 0%, #1E1B4B 40%, #312E81 100%);
    position: relative;
    overflow: hidden;
}

/* Animated background blobs */
.login-wrapper::before,
.login-wrapper::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 8s ease-in-out infinite;
}
.login-wrapper::before {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}
.login-wrapper::after {
    width: 300px;
    height: 300px;
    background: #8B5CF6;
    bottom: -80px;
    left: -80px;
    animation-delay: -4s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

.login-box {
    width: 420px;
    padding: 48px 40px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    animation: loginSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-box .login-logo {
    text-align: center;
    margin-bottom: 8px;
}

.login-box .login-logo .logo-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), #F97316);
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px var(--primary-glow);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 6px;
    color: #FFFFFF;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.login-box .subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 36px;
    font-size: 14px;
    letter-spacing: 0.02em;
}

.login-box .form-group {
    margin-bottom: 20px;
    position: relative;
}

.login-box .form-group label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.login-box .form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    font-size: 15px;
    outline: none;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.06);
    color: #FFFFFF;
}

.login-box .form-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.login-box .form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(255, 255, 255, 0.1);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), #F97316);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px var(--primary-glow);
}

.login-btn:active {
    transform: translateY(0) scale(0.98);
}

.login-error {
    color: #FCA5A5;
    font-size: 13px;
    text-align: center;
    margin-bottom: 16px;
    display: none;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
}

/* ==================== Admin Layout ==================== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ==================== Sidebar ==================== */
.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid rgba(255,255,255,0.04);
}

.sidebar-logo {
    height: 68px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.sidebar-logo .logo-mark {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), #F97316);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.sidebar-logo .logo-text {
    font-size: 17px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.01em;
}

.sidebar-logo .logo-badge {
    font-size: 10px;
    background: rgba(255, 107, 53, 0.2);
    color: var(--primary-light);
    padding: 2px 6px;
    border-radius: var(--radius-full);
    font-weight: 600;
    margin-left: -4px;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
}

.sidebar-menu .menu-group {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 16px 14px 8px;
}

.sidebar-menu .menu-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: var(--transition);
    font-size: 13.5px;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    position: relative;
    font-weight: 450;
}

.sidebar-menu .menu-item:hover {
    background: var(--sidebar-hover);
    color: rgba(255, 255, 255, 0.9);
}

.sidebar-menu .menu-item.active {
    background: var(--sidebar-active);
    color: var(--primary-light);
    font-weight: 500;
}

.sidebar-menu .menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.sidebar-menu .menu-item .icon {
    margin-right: 10px;
    font-size: 17px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-menu .menu-item .menu-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
}

/* ==================== Main Area ==================== */
.main-area {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg);
}

/* ==================== Top Header ==================== */
.top-header {
    height: 68px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 99;
}

.top-header .breadcrumb {
    font-size: 17px;
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.top-header .header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-header .admin-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-header .admin-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary), #F97316);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.top-header .admin-name {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.logout-btn {
    padding: 7px 16px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

.logout-btn:hover {
    color: var(--danger);
    border-color: var(--danger-border);
    background: var(--danger-bg);
}

/* ==================== Content Area ==================== */
.content-area {
    flex: 1;
    padding: 24px 28px;
}

/* ==================== Page Sections ==================== */
.page-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== Dashboard Stats ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 18px;
    transition: var(--transition);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.08;
    transition: opacity 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.stat-card:hover::after {
    opacity: 0.15;
}

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    flex-shrink: 0;
    position: relative;
}

.stat-card .stat-icon.blue {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}
.stat-card .stat-icon.orange {
    background: linear-gradient(135deg, var(--primary), #F97316);
    box-shadow: 0 4px 14px rgba(255, 107, 53, 0.3);
}
.stat-card .stat-icon.green {
    background: linear-gradient(135deg, #10B981, #34D399);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}
.stat-card .stat-icon.purple {
    background: linear-gradient(135deg, #EC4899, #F472B6);
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.3);
}

.stat-card .stat-icon.blue + .stat-info ~ ::after { background: #6366F1; }
.stat-card .stat-icon.orange + .stat-info ~ ::after { background: var(--primary); }
.stat-card .stat-icon.green + .stat-info ~ ::after { background: #10B981; }
.stat-card .stat-icon.purple + .stat-info ~ ::after { background: #EC4899; }

.stat-card.blue-card::after { background: #6366F1; }
.stat-card.orange-card::after { background: var(--primary); }
.stat-card.green-card::after { background: #10B981; }
.stat-card.purple-card::after { background: #EC4899; }

.stat-card .stat-info h3 {
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 2px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.stat-card .stat-info p {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 450;
}

/* ==================== Table Card ==================== */
.table-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
}

.table-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 14px;
}

.table-card .card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* ==================== Toolbar ==================== */
.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.search-input {
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 13px;
    outline: none;
    transition: var(--transition);
    min-width: 220px;
    background: var(--bg);
    color: var(--text-primary);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
    background: white;
}

.filter-select {
    padding: 9px 32px 9px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 13px;
    outline: none;
    background: var(--bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.filter-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border: none;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    gap: 5px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #F97316);
    color: #fff;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #DC2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25);
}

.btn-warning {
    background: var(--warning);
    color: #fff;
}

.btn-warning:hover {
    background: #D97706;
    transform: translateY(-1px);
}

.btn-info {
    background: var(--info);
    color: #fff;
}

.btn-info:hover {
    background: #4F46E5;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-default {
    background: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-default:hover {
    background: var(--border);
    color: var(--text-primary);
}

/* ==================== Data Table ==================== */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.data-table thead th {
    background: var(--bg);
    padding: 11px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table thead th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

.data-table thead th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

.data-table tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    vertical-align: middle;
    transition: background 0.15s;
}

.data-table tbody tr {
    transition: background 0.15s;
}

.data-table tbody tr:hover {
    background: var(--primary-alpha);
}

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

.data-table .text-center {
    text-align: center;
}

.data-table .actions {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

/* ==================== Pagination ==================== */
.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination .page-btn {
    min-width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    padding: 0 10px;
}

.pagination .page-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-alpha);
}

.pagination .page-btn.active {
    background: linear-gradient(135deg, var(--primary), #F97316);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.pagination .page-btn.disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    border-color: var(--border-light);
    background: var(--bg);
    opacity: 0.5;
}

.pagination .page-info {
    font-size: 13px;
    color: var(--text-muted);
    margin-right: 8px;
}

/* ==================== Modal ==================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 10, 31, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: overlayIn 0.2s ease;
}

@keyframes overlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    width: 540px;
    max-width: 92vw;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl), 0 0 60px rgba(0,0,0,0.15);
    animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255,255,255,0.1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px 16px;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    font-size: 17px;
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--bg);
    cursor: pointer;
    font-size: 18px;
    color: var(--text-muted);
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.modal-body {
    padding: 24px 28px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 28px 20px;
    border-top: 1px solid var(--border-light);
}

/* ==================== Forms ==================== */
.form-row {
    margin-bottom: 18px;
}

.form-row label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-row label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
    transition: var(--transition);
    color: var(--text-primary);
    background: var(--bg);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
    background: white;
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    min-height: 88px;
    resize: vertical;
    line-height: 1.5;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.form-row-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ==================== Image Upload ==================== */
.image-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    background: var(--bg-elevated);
    transition: var(--transition);
}

.image-upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-alpha);
}

.image-upload-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.image-upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.image-upload-btn .upload-icon {
    font-size: 32px;
    line-height: 1;
}

.image-upload-btn .upload-text {
    font-size: 13px;
    font-weight: 500;
}

.image-preview-container {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.image-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--border);
    background: var(--bg-elevated);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: var(--transition);
    opacity: 0.9;
}

.image-delete-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: var(--shadow-sm);
}

/* ==================== Tags / Status ==================== */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    gap: 4px;
}

.tag-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.tag-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.tag-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}

.tag-info {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid var(--info-border);
}

.tag-default {
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.tag-processing {
    background: var(--processing-bg);
    color: var(--processing);
    border: 1px solid var(--processing-border);
}

/* Tag dot indicator */
.tag::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.6;
}

/* ==================== Avatar ==================== */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--border-light);
}

.avatar-sm {
    width: 30px;
    height: 30px;
}

/* ==================== Empty State ==================== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

/* ==================== Loading ==================== */
.loading-mask {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 48px;
    color: var(--text-muted);
}

.spinner {
    width: 28px;
    height: 28px;
    border: 2.5px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== Toast Notifications ==================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 22px;
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 380px;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(10px);
}

.toast::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.8);
    flex-shrink: 0;
}

.toast-success { background: rgba(16, 185, 129, 0.95); }
.toast-error { background: rgba(239, 68, 68, 0.95); }
.toast-warning { background: rgba(245, 158, 11, 0.95); color: #fff; }
.toast-info { background: rgba(99, 102, 241, 0.95); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

/* ==================== Config Table ==================== */
.config-table {
    width: 100%;
    border-collapse: collapse;
}

.config-table tr {
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s;
}

.config-table tr:hover {
    background: var(--primary-alpha);
}

.config-table td {
    padding: 14px 16px;
    vertical-align: middle;
}

.config-table .config-key {
    font-weight: 600;
    color: var(--text-primary);
    width: 200px;
    white-space: nowrap;
    font-size: 13px;
}

.config-table .config-remark {
    color: var(--text-muted);
    font-size: 12px;
    width: 180px;
}

.config-table .config-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
    transition: var(--transition);
    background: var(--bg);
}

.config-table .config-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
    background: white;
}

/* ==================== Text Ellipsis ==================== */
.text-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
    display: inline-block;
    vertical-align: middle;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-area {
        margin-left: 0;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .table-card .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .toolbar {
        width: 100%;
    }
    .search-input {
        min-width: 100%;
    }
    .form-row-inline {
        grid-template-columns: 1fr;
    }
    .mobile-menu-btn {
        display: flex !important;
    }
    .content-area {
        padding: 16px;
    }
    .top-header {
        padding: 0 16px;
    }
}

.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 18px;
    cursor: pointer;
    padding: 6px 10px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.mobile-menu-btn:hover {
    background: var(--bg);
    color: var(--text-primary);
}

/* ==================== Additional Utilities ==================== */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), #F97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Subtle pulse animation for active sidebar items */
.sidebar-menu .menu-item.active .icon {
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Table row enter animation */
.data-table tbody tr {
    animation: rowIn 0.25s ease backwards;
}

/* ==================== Place-Task Binding Layout ==================== */
.ptb-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    min-height: 500px;
}

.ptb-places-panel,
.ptb-tasks-panel {
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ptb-panel-header {
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.ptb-places-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.ptb-place-item {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
    border: 1px solid transparent;
}

.ptb-place-item:hover {
    background: var(--primary-alpha);
}

.ptb-place-item.active {
    background: var(--primary-alpha);
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary-glow);
}

.ptb-place-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.ptb-place-id {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    flex-shrink: 0;
}

.ptb-place-name {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ptb-place-city {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.ptb-tasks-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.ptb-empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
    font-size: 13px;
}

.ptb-task-item {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    transition: var(--transition);
}

.ptb-task-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--border);
}

.ptb-task-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.ptb-task-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ptb-task-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.ptb-task-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ptb-task-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.ptb-task-time {
    font-size: 11px;
    color: var(--text-muted);
}

/* Bind option item inside modal */
.ptb-bind-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.ptb-bind-option:hover {
    background: var(--primary-alpha);
    border-color: var(--primary);
}

.ptb-bind-option-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ptb-bind-option-info .ptb-task-title {
    font-size: 13px;
}

/* Responsive for PTB layout */
@media (max-width: 900px) {
    .ptb-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .ptb-places-list {
        max-height: 240px;
    }
    .ptb-tasks-list {
        max-height: 400px;
    }
}

@keyframes rowIn {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Stagger table rows */
.data-table tbody tr:nth-child(1) { animation-delay: 0s; }
.data-table tbody tr:nth-child(2) { animation-delay: 0.03s; }
.data-table tbody tr:nth-child(3) { animation-delay: 0.06s; }
.data-table tbody tr:nth-child(4) { animation-delay: 0.09s; }
.data-table tbody tr:nth-child(5) { animation-delay: 0.12s; }
.data-table tbody tr:nth-child(6) { animation-delay: 0.15s; }
.data-table tbody tr:nth-child(7) { animation-delay: 0.18s; }
.data-table tbody tr:nth-child(8) { animation-delay: 0.21s; }
.data-table tbody tr:nth-child(9) { animation-delay: 0.24s; }
.data-table tbody tr:nth-child(10) { animation-delay: 0.27s; }
