/* CargoSphere International - Admin Panel Stylesheet */

/* ===== Admin Layout ===== */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.admin-sidebar {
    width: 260px;
    background: var(--dark-blue);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: var(--transition);
}
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-header img { width: 36px; height: 36px; border-radius: 6px; }
.sidebar-header .brand { font-weight: 700; font-size: 0.95rem; }
.sidebar-header .brand span { color: var(--accent); font-size: 0.75rem; display: block; font-weight: 400; }

.sidebar-nav { padding: 16px 0; }
.sidebar-nav .nav-section {
    padding: 8px 20px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.4);
    margin-top: 8px;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: rgba(255,255,255,0.7);
    font-size: 0.88rem;
    transition: var(--transition);
    border-left: 3px solid transparent;
}
.sidebar-nav a:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}
.sidebar-nav a.active {
    color: #fff;
    background: rgba(255,255,255,0.08);
    border-left-color: var(--accent);
}
.sidebar-nav a .icon { font-size: 1.1rem; width: 24px; text-align: center; }
.sidebar-nav a .badge-count {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
}

/* ===== Main Content ===== */
.admin-main {
    flex: 1;
    margin-left: 260px;
    background: var(--bg-light);
    min-height: 100vh;
}
.admin-topbar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}
.admin-topbar h1 { font-size: 1.3rem; font-weight: 700; }
.admin-topbar-actions { display: flex; align-items: center; gap: 12px; }

.admin-content { padding: 32px; }

/* ===== Dashboard Cards ===== */
.dash-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}
.dash-stat-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
}
.dash-stat-card .label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.dash-stat-card .value { font-size: 2rem; font-weight: 800; color: var(--text-primary); margin: 8px 0 4px; }
.dash-stat-card .change { font-size: 0.8rem; }
.dash-stat-card .change.up { color: var(--success); }
.dash-stat-card .change.down { color: var(--danger); }

/* ===== Admin Tables ===== */
.admin-table-wrapper {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.admin-table-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}
.admin-table-header h2 { font-size: 1.1rem; }
.admin-table-filters {
    display: flex;
    gap: 12px;
    align-items: center;
}
.admin-table-filters select,
.admin-table-filters input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: var(--font-family);
}

/* ===== Detail Views ===== */
.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}
.detail-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
}
.detail-card h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
}
.detail-row:last-child { border-bottom: none; }
.detail-row .label { color: var(--text-muted); }
.detail-row .value { font-weight: 600; }

/* ===== Status Actions ===== */
.status-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.status-btn {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-white);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}
.status-btn:hover { background: var(--bg-light); }
.status-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== Line Items Editor ===== */
.line-items-table th { font-size: 0.8rem; }
.line-items-table td { padding: 8px 12px; }
.line-items-table input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: var(--font-family);
}
.line-items-total {
    text-align: right;
    padding: 16px 24px;
    border-top: 2px solid var(--border);
}
.line-items-total .row {
    display: flex;
    justify-content: flex-end;
    gap: 32px;
    padding: 4px 0;
    font-size: 0.9rem;
}
.line-items-total .row.total { font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--dark-blue) 0%, var(--primary) 100%);
}
.login-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 48px;
    width: 420px;
    max-width: 90%;
    box-shadow: var(--shadow-lg);
}
.login-card .logo { text-align: center; margin-bottom: 32px; }
.login-card .logo img { width: 64px; height: 64px; border-radius: 12px; }
.login-card .logo h2 { margin-top: 12px; font-size: 1.2rem; }
.login-card .logo p { color: var(--text-muted); font-size: 0.85rem; }

/* ===== PDF Print Styles ===== */
@media print {
    .admin-sidebar, .admin-topbar, .no-print { display: none !important; }
    .admin-main { margin-left: 0; }
    .admin-content { padding: 0; }
}

/* ===== Responsive Admin ===== */
@media (max-width: 1024px) {
    .dash-stats { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .admin-topbar { padding: 12px 16px; }
    .admin-content { padding: 16px; }
    .dash-stats { grid-template-columns: 1fr; }
}
