/* =========================================================
 * Jet Life Sciences - Admin Panel Stylesheet
 * ========================================================= */

:root {
    --sidebar-width: 240px;
    --admin-header: 60px;
}

* { box-sizing: border-box; }

body.admin-body {
    background: #f1f5f9;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: #1e293b;
    margin: 0;
    padding: 0;
}

a { color: #1a5ca8; text-decoration: none; }
a:hover { color: #0d3d79; }

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

.admin-sidebar {
    width: var(--sidebar-width);
    background: #1a1f35;
    color: #cbd5e1;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
    flex-shrink: 0;
}
.admin-sidebar::-webkit-scrollbar { width: 6px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

.admin-brand {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #334155;
    color: #fff;
    font-size: 1.125rem;
    font-weight: 700;
}
.admin-brand .logo-mark {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #1a5ca8, #00a99d);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800;
}

.admin-nav { padding: 12px 0; }
.admin-nav-section { padding: 12px 20px 6px; font-size: 0.75rem; text-transform: uppercase; color: #64748b; letter-spacing: 0.5px; }
.admin-nav ul { list-style: none; margin: 0; padding: 0; }
.admin-nav li { margin: 1px 8px; }
.admin-nav li a {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; color: #cbd5e1;
    border-radius: 6px; font-size: 0.92rem;
    transition: all 0.15s;
}
.admin-nav li a .icon { width: 18px; text-align: center; opacity: 0.85; }
.admin-nav li a:hover { background: #334155; color: #fff; }
.admin-nav li.active a { background: #1a5ca8; color: #fff; }
.admin-nav .has-sub > a::after { content: '▸'; margin-left: auto; font-size: 0.7rem; opacity: 0.6; transition: transform 0.2s; }
.admin-nav .has-sub.open > a::after { transform: rotate(90deg); }
.admin-nav .submenu { padding-left: 20px; max-height: 0; overflow: hidden; transition: max-height 0.3s; }
.admin-nav .has-sub.open .submenu { max-height: 500px; }

.admin-main { flex: 1; margin-left: var(--sidebar-width); min-width: 0; }

.admin-header {
    height: var(--admin-header);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}
.admin-header h1 { margin: 0; font-size: 1.25rem; color: #1a1f35; }
.admin-header-right { display: flex; align-items: center; gap: 16px; }

.user-dropdown { position: relative; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 12px; border-radius: 6px; }
.user-dropdown:hover { background: #f1f5f9; }
.avatar { width: 32px; height: 32px; background: linear-gradient(135deg, #1a5ca8, #00a99d); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 0.85rem; }
.user-name { font-weight: 500; font-size: 0.9rem; }
.user-menu {
    position: absolute; top: 100%; right: 0; min-width: 180px;
    background: #fff; box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 8px; margin-top: 4px;
    opacity: 0; visibility: hidden; transform: translateY(6px);
    transition: all 0.2s;
    list-style: none; z-index: 100;
}
.user-dropdown:hover .user-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.user-menu li a { display: block; padding: 8px 12px; color: #334155; border-radius: 4px; font-size: 0.9rem; }
.user-menu li a:hover { background: #f1f5f9; color: #1a5ca8; }

.admin-content { padding: 24px; }

/* ---------------- Cards ---------------- */
.card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h3 { margin: 0; font-size: 1rem; font-weight: 600; color: #1a1f35; }
.card-body { padding: 20px; }
.card-footer { padding: 16px 20px; background: #f8fafc; border-top: 1px solid #e2e8f0; }

/* ---------------- Stat Cards ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 24px; }
.stat-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 24px; position: relative; overflow: hidden;
}
.stat-card .stat-icon {
    position: absolute; right: 20px; top: 20px;
    width: 48px; height: 48px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: #fff;
}
.stat-card.blue .stat-icon { background: #1a5ca8; }
.stat-card.green .stat-icon { background: #00a99d; }
.stat-card.orange .stat-icon { background: #f59e0b; }
.stat-card.purple .stat-icon { background: #7c3aed; }
.stat-label { color: #64748b; font-size: 0.85rem; margin-bottom: 8px; }
.stat-value { font-size: 2rem; font-weight: 700; color: #1a1f35; line-height: 1; }
.stat-change { margin-top: 12px; font-size: 0.85rem; color: #10b981; }

/* ---------------- Tables ---------------- */
.table {
    width: 100%; border-collapse: collapse;
    background: #fff;
}
.table thead th {
    background: #f8fafc;
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.85rem;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}
.table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    color: #334155;
    vertical-align: middle;
}
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: none; }

.table .product-name { font-weight: 500; color: #1a1f35; }
.table .product-name small { display: block; color: #94a3b8; font-weight: normal; font-size: 0.8rem; margin-top: 2px; }

.badge {
    display: inline-block; padding: 4px 10px; font-size: 0.8rem; font-weight: 500;
    border-radius: 999px;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-primary { background: #e8f1fb; color: #0d3d79; }

.btn-action {
    padding: 4px 10px; font-size: 0.8rem; border-radius: 4px;
    border: 1px solid #e2e8f0; background: #fff; color: #475569; cursor: pointer;
    margin-right: 4px;
    transition: all 0.15s;
}
.btn-action:hover { border-color: #1a5ca8; color: #1a5ca8; background: #e8f1fb; }
.btn-action.edit { color: #1a5ca8; border-color: #cbd5e1; }
.btn-action.delete { color: #991b1b; border-color: #cbd5e1; }
.btn-action.delete:hover { background: #fee2e2; border-color: #991b1b; color: #991b1b; }

/* ---------------- Buttons ---------------- */
.admin-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 18px; font-size: 0.9rem; font-weight: 500;
    border: 1px solid transparent; border-radius: 6px;
    cursor: pointer; transition: all 0.15s; background: #fff; color: #334155;
    text-decoration: none; line-height: 1.4;
}
.admin-btn-primary { background: #1a5ca8; color: #fff; border-color: #1a5ca8; }
.admin-btn-primary:hover { background: #0d3d79; border-color: #0d3d79; color: #fff; box-shadow: 0 4px 10px rgba(26, 92, 168, 0.2); }
.admin-btn-success { background: #10b981; color: #fff; border-color: #10b981; }
.admin-btn-success:hover { background: #0d9670; border-color: #0d9670; color: #fff; }
.admin-btn-danger { background: #ef4444; color: #fff; border-color: #ef4444; }
.admin-btn-danger:hover { background: #dc2626; border-color: #dc2626; color: #fff; }
.admin-btn-default { background: #fff; color: #334155; border-color: #e2e8f0; }
.admin-btn-default:hover { background: #f8fafc; color: #1a5ca8; border-color: #cbd5e1; }
.admin-btn-outline { background: transparent; color: #1a5ca8; border-color: #1a5ca8; }
.admin-btn-outline:hover { background: #1a5ca8; color: #fff; }
.admin-btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.admin-btn-lg { padding: 10px 24px; font-size: 1rem; }
.admin-btn-block { display: flex; width: 100%; }

/* ---------------- Forms ---------------- */
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 20px; }
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 0.9rem; color: #334155; }
.form-label .required { color: #ef4444; }
.form-control, .form-input, .form-select, .form-textarea {
    width: 100%; padding: 9px 14px; font-size: 0.9rem; border: 1px solid #e2e8f0;
    border-radius: 6px; background: #fff; transition: all 0.15s;
    font-family: inherit; color: #1e293b;
}
.form-control:focus, .form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none; border-color: #1a5ca8;
    box-shadow: 0 0 0 3px rgba(26, 92, 168, 0.1);
}
.form-textarea { min-height: 120px; resize: vertical; }
.form-help { margin-top: 6px; font-size: 0.8rem; color: #64748b; }
.form-check { display: flex; align-items: center; gap: 8px; }
.form-check input[type="checkbox"], .form-check input[type="radio"] { width: 16px; height: 16px; }

/* ---------------- Filters ---------------- */
.filter-bar {
    background: #fff; border: 1px solid #e2e8f0;
    border-radius: 8px; padding: 16px 20px; margin-bottom: 20px;
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.filter-bar .form-group { margin-bottom: 0; flex: 1; min-width: 200px; }

/* ---------------- Pagination ---------------- */
.pagination-wrap {
    margin-top: 24px;
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 0;
}
.pagination-info { color: #64748b; font-size: 0.9rem; }
.pagination { display: flex; list-style: none; gap: 4px; }
.pagination li a {
    display: block; padding: 8px 14px;
    background: #fff; border: 1px solid #e2e8f0;
    border-radius: 6px; color: #475569; font-size: 0.9rem;
    transition: all 0.15s;
}
.pagination li a:hover { border-color: #1a5ca8; color: #1a5ca8; }
.pagination li.active a { background: #1a5ca8; color: #fff; border-color: #1a5ca8; }
.pagination li.disabled a { opacity: 0.5; cursor: not-allowed; }
.pagination li.disabled a:hover { border-color: #e2e8f0; color: #475569; }

/* ---------------- Page Header ---------------- */
.page-header { margin-bottom: 24px; }
.page-title { font-size: 1.5rem; font-weight: 700; color: #1a1f35; margin: 0 0 8px; }
.page-subtitle { color: #64748b; font-size: 0.95rem; margin: 0; }
.breadcrumbs-admin { margin-bottom: 16px; color: #64748b; font-size: 0.85rem; }
.breadcrumbs-admin a { color: #64748b; }
.breadcrumbs-admin a:hover { color: #1a5ca8; }

/* ---------------- Tabs ---------------- */
.nav-tabs {
    display: flex; border-bottom: 1px solid #e2e8f0;
    list-style: none; margin: 0; padding: 0;
    margin-bottom: 20px;
}
.nav-tabs li { margin-right: 4px; }
.nav-tabs li a {
    display: block; padding: 10px 20px; color: #64748b; font-weight: 500;
    border: 1px solid transparent; border-bottom: none;
    border-radius: 6px 6px 0 0; font-size: 0.92rem;
}
.nav-tabs li a:hover { color: #1a5ca8; background: #f8fafc; }
.nav-tabs li.active a { color: #1a5ca8; border-color: #e2e8f0; background: #fff; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ---------------- Alerts ---------------- */
.alert-box {
    padding: 14px 18px; border-radius: 6px; margin-bottom: 20px;
    border: 1px solid transparent; font-size: 0.95rem;
}
.alert-success { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.alert-info { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }

/* ---------------- Login Page ---------------- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d3d79 0%, #1a5ca8 50%, #00a99d 100%);
    padding: 20px;
}
.login-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo .logo-mark {
    width: 60px; height: 60px; margin: 0 auto 12px;
    background: linear-gradient(135deg, #1a5ca8, #00a99d);
    border-radius: 12px; display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 1.5rem;
}
.login-title { font-size: 1.5rem; font-weight: 700; color: #1a1f35; margin: 0 0 8px; text-align: center; }
.login-subtitle { text-align: center; color: #64748b; margin-bottom: 28px; font-size: 0.95rem; }

/* ---------------- Image Upload ---------------- */
.image-upload {
    border: 2px dashed #e2e8f0;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    background: #f8fafc;
    transition: all 0.2s;
}
.image-upload:hover { border-color: #1a5ca8; background: #e8f1fb; }
.image-upload-icon { font-size: 2rem; color: #94a3b8; margin-bottom: 8px; }
.image-upload-text { color: #64748b; font-size: 0.9rem; }

/* ---------------- List / Recent Activity ---------------- */
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list li { padding: 12px 0; border-bottom: 1px solid #f1f5f9; display: flex; gap: 12px; }
.activity-list li:last-child { border-bottom: none; }
.activity-time { color: #94a3b8; font-size: 0.8rem; white-space: nowrap; }
.activity-desc { color: #334155; font-size: 0.9rem; }

/* ---------------- Quick Actions ---------------- */
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.quick-action-item {
    padding: 20px; background: #f8fafc;
    border-radius: 8px; text-align: center; text-decoration: none;
    color: #334155; transition: all 0.2s;
}
.quick-action-item:hover { background: #e8f1fb; color: #1a5ca8; transform: translateY(-2px); }
.quick-action-icon { font-size: 1.75rem; color: #1a5ca8; margin-bottom: 8px; }
.quick-action-label { font-size: 0.9rem; font-weight: 500; }

/* ---------------- Responsive Admin ---------------- */
@media (max-width: 1200px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .admin-sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .admin-sidebar.show { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .form-row { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr; }
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
