/* ============================================
   LIVELIHOOD SHOP BD - Admin Panel Styles
   ============================================ */

@import 'bootstrap/dist/css/bootstrap.min.css';
@import 'bootstrap-icons/font/bootstrap-icons.css';

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1e293b;
    --sidebar-text: #cbd5e1;
    --sidebar-heading: #ffffff;
    --sidebar-hover-bg: #334155;
    --sidebar-active-bg: #3b82f6;
    --sidebar-active-text: #ffffff;
    --topbar-height: 64px;
    --topbar-bg: #ffffff;
    --content-bg: #f1f5f9;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --card-border-radius: 10px;
    --transition-speed: 0.25s;
}

/* ============================================
   Base / Reset
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', 'Noto Sans Bengali', system-ui, -apple-system, sans-serif;
    background-color: var(--content-bg);
    color: #334155;
    overflow-x: hidden;
}

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

/* ============================================
   Sidebar
   ============================================ */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-speed) ease;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #475569 transparent;
}

.admin-sidebar::-webkit-scrollbar {
    width: 5px;
}

.admin-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

/* Sidebar Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid #334155;
    flex-shrink: 0;
}

.sidebar-brand-link {
    text-decoration: none;
    color: inherit;
}

.sidebar-brand-link:hover {
    color: inherit;
}

.sidebar-brand-name {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--sidebar-heading);
    letter-spacing: 0.5px;
}

.sidebar-brand-subtitle {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 2px;
}

.sidebar-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.25rem;
    padding: 4px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s;
}

.sidebar-close-btn:hover {
    color: #ffffff;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 12px 0;
}

.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-menu-item {
    margin: 2px 8px;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.15s ease;
    position: relative;
}

.sidebar-menu-link:hover {
    background: var(--sidebar-hover-bg);
    color: #ffffff;
}

.sidebar-menu-link i:first-child {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-menu-item.active > .sidebar-menu-link {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 500;
}

/* Sidebar Badge */
.sidebar-badge {
    margin-left: auto;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    line-height: 1.4;
}

/* Submenu Arrow */
.submenu-arrow {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.submenu-arrow.rotate-180 {
    transform: rotate(180deg);
}

/* Sidebar Submenu */
.sidebar-submenu {
    list-style: none;
    margin: 0;
    padding: 4px 0 4px 16px;
}

.sidebar-submenu li {
    margin: 1px 0;
}

.sidebar-submenu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

.sidebar-submenu a i {
    font-size: 0.9rem;
    width: 18px;
    text-align: center;
}

.sidebar-submenu a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-submenu li.active a {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.1);
    font-weight: 500;
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    backdrop-filter: blur(2px);
}

/* ============================================
   Main Content Area
   ============================================ */
.admin-main {
    flex: 1;
    min-width: 0;
    transition: margin-left var(--transition-speed) ease;
    margin-left: 0;
}

.admin-main.sidebar-expanded {
    margin-left: var(--sidebar-width);
}

.admin-content {
    padding: 24px;
    min-height: calc(100vh - var(--topbar-height));
}

/* ============================================
   Top Bar
   ============================================ */
.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--topbar-height);
    padding: 0 24px;
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: #64748b;
    font-size: 1.3rem;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    line-height: 1;
    transition: all 0.15s;
}

.topbar-toggle-btn:hover {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

.topbar-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
    color: #1e293b;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Topbar Icon Button */
.topbar-icon-btn {
    position: relative;
    background: none;
    border: none;
    color: #64748b;
    font-size: 1.25rem;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.topbar-icon-btn:hover {
    background: #f1f5f9;
    color: #334155;
}

/* Notification Badge */
.topbar-notification {
    position: relative;
}

.topbar-notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 0 4px;
    border: 2px solid #ffffff;
    line-height: 1;
}

/* Topbar Profile */
.topbar-profile {
    position: relative;
}

.topbar-profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    color: #475569;
}

.topbar-profile-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.topbar-avatar {
    font-size: 1.4rem;
    color: #3b82f6;
    line-height: 1;
}

.topbar-profile-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
}

.topbar-profile-arrow {
    font-size: 0.7rem;
    color: #94a3b8;
    transition: transform 0.2s;
}

/* Topbar Dropdown */
.topbar-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--card-border-radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 220px;
    overflow: hidden;
    z-index: 1050;
}

.dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 600;
    font-size: 0.875rem;
    color: #334155;
}

.dropdown-header-link {
    font-size: 0.8rem;
    font-weight: 500;
    color: #3b82f6;
    text-decoration: none;
}

.dropdown-header-link:hover {
    text-decoration: underline;
}

.dropdown-body {
    padding: 8px;
}

.dropdown-empty-text {
    text-align: center;
    padding: 16px;
    color: #94a3b8;
    font-size: 0.85rem;
    margin: 0;
}

.topbar-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #475569;
    text-decoration: none;
    font-size: 0.875rem;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 6px;
}

.topbar-dropdown .dropdown-item:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.topbar-dropdown .dropdown-item i {
    font-size: 1rem;
    width: 18px;
    text-align: center;
}

.topbar-dropdown .dropdown-item-danger {
    color: #ef4444;
}

.topbar-dropdown .dropdown-item-danger:hover {
    background: #fef2f2;
    color: #dc2626;
}

.topbar-dropdown .dropdown-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 4px 0;
}

.notification-dropdown {
    min-width: 300px;
}

/* ============================================
   Dashboard Stat Cards
   ============================================ */
.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--card-bg);
    border-radius: var(--card-border-radius);
    padding: 20px;
    border-left: 4px solid transparent;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-card-body {
    min-width: 0;
}

.stat-card-value {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    color: #1e293b;
}

.stat-card-label {
    font-size: 0.8rem;
    color: #64748b;
    margin: 4px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Stat Card Color Variants */
.stat-card-blue {
    border-left-color: #3b82f6;
}
.stat-card-blue .stat-card-icon {
    background: #eff6ff;
    color: #3b82f6;
}

.stat-card-green {
    border-left-color: #22c55e;
}
.stat-card-green .stat-card-icon {
    background: #f0fdf4;
    color: #22c55e;
}

.stat-card-warning {
    border-left-color: #f59e0b;
}
.stat-card-warning .stat-card-icon {
    background: #fffbeb;
    color: #f59e0b;
}

.stat-card-purple {
    border-left-color: #8b5cf6;
}
.stat-card-purple .stat-card-icon {
    background: #f5f3ff;
    color: #8b5cf6;
}

.stat-card-success {
    border-left-color: #10b981;
}
.stat-card-success .stat-card-icon {
    background: #ecfdf5;
    color: #10b981;
}

.stat-card-danger {
    border-left-color: #ef4444;
}
.stat-card-danger .stat-card-icon {
    background: #fef2f2;
    color: #ef4444;
}

.stat-card-info {
    border-left-color: #06b6d4;
}
.stat-card-info .stat-card-icon {
    background: #ecfeff;
    color: #06b6d4;
}

/* ============================================
   Admin Cards (General)
   ============================================ */
.admin-card {
    border: none;
    border-radius: var(--card-border-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    border-bottom: 1px solid #f1f5f9;
    padding: 16px 20px;
}

.admin-card-header .card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

/* ============================================
   Admin Table
   ============================================ */
.admin-table {
    font-size: 0.875rem;
    width: 100%;
    margin: 0;
}

.admin-table thead th {
    background: #f8fafc;
    border-bottom: 2px solid var(--border-color);
    color: #64748b;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    white-space: nowrap;
}

.admin-table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
}

.admin-table tbody tr:hover {
    background: #f8fafc;
}

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

.admin-table .badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
}

/* ============================================
   Status Badges
   ============================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-pending { background: #fef3c7; color: #92400e; }
.status-confirmed { background: #dbeafe; color: #1e40af; }
.status-processing { background: #e0e7ff; color: #3730a3; }
.status-shipped { background: #cffafe; color: #155e75; }
.status-delivered { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.status-returned { background: #fce7f3; color: #9d174d; }

/* ============================================
   Forms
   ============================================ */
.admin-form-card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 25px;
    margin-bottom: 20px;
}

.admin-form-card h6 {
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

/* ============================================
   Image Upload Preview
   ============================================ */
.admin-img-upload {
    width: 120px;
    height: 120px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.admin-img-upload:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.admin-img-upload img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-img-upload .placeholder {
    text-align: center;
    color: #94a3b8;
    font-size: 0.8rem;
}

.admin-img-upload .placeholder i {
    font-size: 2rem;
    display: block;
    margin-bottom: 5px;
}

/* ============================================
   Action Buttons
   ============================================ */
.admin-actions {
    display: flex;
    gap: 8px;
}

.admin-actions .btn {
    padding: 5px 10px;
    font-size: 0.8125rem;
}

/* ============================================
   Admin Login Page
   ============================================ */
.admin-login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #1e40af 100%);
    padding: 20px;
}

.admin-login-wrapper {
    width: 100%;
    max-width: 420px;
}

.admin-login-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px 36px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.admin-login-brand {
    text-align: center;
    margin-bottom: 8px;
}

.admin-login-logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: 0.5px;
    margin: 0;
}

.admin-login-subtitle {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 4px 0 0;
}

.admin-login-title {
    text-align: center;
    font-size: 1.15rem;
    font-weight: 600;
    color: #475569;
    margin: 24px 0;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

/* Login Alert */
.admin-login-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.admin-login-alert i {
    margin-top: 2px;
    flex-shrink: 0;
}

.admin-login-alert p {
    margin: 0;
}

.admin-login-alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #16a34a;
}

/* Login Form */
.admin-login-form .form-group {
    margin-bottom: 20px;
}

.admin-login-form .form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
    pointer-events: none;
}

.input-icon-wrapper .form-control {
    padding-left: 42px;
    height: 46px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 0.9rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.input-icon-wrapper .form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.input-icon-wrapper .form-control.is-invalid {
    border-color: #ef4444;
}

.input-icon-wrapper .form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-check-group {
    display: flex;
    align-items: center;
}

.form-check-group .form-check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #475569;
}

.form-check-group .form-check-input {
    margin: 0;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    cursor: pointer;
}

.admin-login-btn {
    width: 100%;
    height: 46px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #3b82f6;
    border: none;
    color: #ffffff;
    transition: background 0.15s ease;
}

.admin-login-btn:hover {
    background: #2563eb;
    color: #ffffff;
}

.admin-login-btn:active {
    background: #1d4ed8;
}

.admin-login-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    margin-top: 24px;
}

/* ============================================
   Toast Container
   ============================================ */
#admin-toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============================================
   Responsive: Mobile
   ============================================ */
@media (max-width: 991.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.sidebar-active {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0 !important;
    }

    .admin-content {
        padding: 16px;
    }

    .admin-topbar {
        padding: 0 16px;
    }

    .stat-card {
        padding: 14px;
        gap: 12px;
    }

    .stat-card-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        border-radius: 10px;
    }

    .stat-card-value {
        font-size: 1.1rem;
    }

    .admin-login-card {
        padding: 30px 24px;
    }
}

@media (max-width: 575.98px) {
    .topbar-title {
        font-size: 1rem;
    }

    .stat-card-value {
        font-size: 1rem;
    }

    .stat-card-label {
        font-size: 0.72rem;
    }

    .admin-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .admin-form-card {
        padding: 15px;
    }
}

/* ============================================
   Print
   ============================================ */
@media print {
    .admin-sidebar,
    .admin-topbar,
    .admin-actions,
    .sidebar-overlay {
        display: none !important;
    }

    .admin-main {
        margin-left: 0 !important;
    }
}
