/* ===============================================
   ADMIN PANEL STYLES - WebTopup
   Modern dark admin panel matching website theme
   =============================================== */

:root {
    --admin-sidebar-width: 260px;
    --admin-primary: #0C951E;
    --admin-primary-hover: #0a7a19;
    --admin-dark-bg: #ffffff;
    --admin-card-bg: #ffffff;
    --admin-border: #e5e5e5;
    --admin-text-primary: #1a1a1a;
    --admin-text-secondary: #6b7280;
    --admin-success: #0C951E;
    --admin-danger: #ef4444;
    --admin-warning: #f59e0b;
    --admin-info: #3b82f6;
    --admin-bg-light: #f9fafb;
    --admin-hover-bg: #f3f4f6;
}

.admin-layout {
    background: var(--admin-bg-light);
    color: var(--admin-text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
}

/* ===============================================
   ADMIN CONTAINER & LAYOUT
   =============================================== */

.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-main {
    flex: 1;
    margin-left: var(--admin-sidebar-width);
    background: var(--admin-bg-light);
    min-height: 100vh;
}

/* ===============================================
   SIDEBAR
   =============================================== */

.admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--admin-sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
    border-right: 1px solid #2a2a2a;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--admin-border);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
    color: var(--admin-text-primary);
    transition: all 0.3s ease;
}

.sidebar-logo:hover {
    opacity: 0.8;
}

.logo-img {
    width: 180px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(12, 149, 30, 0.3));
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--admin-primary) 0%, #06d62b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===============================================
   SIDEBAR NAVIGATION
   =============================================== */

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1.5rem;
    color: #b0b0b0;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(12, 149, 30, 0.1);
    color: #ffffff;
    border-left-color: var(--admin-primary);
}

.nav-item.active {
    background: rgba(12, 149, 30, 0.08);
    color: var(--admin-primary);
    border-left-color: var(--admin-primary);
    font-weight: 600;
}

.nav-item svg {
    flex-shrink: 0;
}

.nav-divider {
    height: 1px;
    background: #2a2a2a;
    margin: 1rem 1.5rem;
}

/* ===============================================
   SIDEBAR FOOTER
   =============================================== */

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #2a2a2a;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--admin-primary) 0%, #06d62b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: #b0b0b0;
}

/* ===============================================
   ADMIN HEADER
   =============================================== */

.admin-header {
    background: var(--admin-card-bg);
    border-bottom: 1px solid var(--admin-border);
    padding: 1.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--admin-text-primary);
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.sidebar-toggle:hover {
    background: var(--admin-hover-bg);
}

.sidebar-toggle svg {
    width: 24px;
    height: 24px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--admin-text-primary);
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ===============================================
   ADMIN CONTENT
   =============================================== */

.admin-content {
    padding: 2rem;
}

/* ===============================================
   ALERTS
   =============================================== */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.alert svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.alert ul {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}

.alert-success {
    background: rgba(12, 149, 30, 0.1);
    border: 1px solid rgba(12, 149, 30, 0.3);
    color: #06d62b;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* ===============================================
   CARDS
   =============================================== */

.card {
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--admin-border);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--admin-text-primary);
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

/* ===============================================
   DASHBOARD GRID
   =============================================== */

.dashboard-grid {
    display: grid;
    gap: 1.5rem;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: rgba(12, 149, 30, 0.3);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    color: white;
}

.stat-details {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--admin-text-primary);
    margin: 0 0 0.25rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--admin-text-secondary);
    margin: 0;
}

/* ===============================================
   QUICK LINKS
   =============================================== */

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.quick-link-card {
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    padding: 1.5rem;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.quick-link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: rgba(12, 149, 30, 0.5);
}

.quick-link-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: rgba(12, 149, 30, 0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-link-icon svg {
    color: var(--admin-primary);
}

.quick-link-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--admin-text-primary);
    margin: 0 0 0.5rem;
}

.quick-link-card p {
    font-size: 0.875rem;
    color: var(--admin-text-secondary);
    margin: 0;
}

/* ===============================================
   TABLES
   =============================================== */

.table-responsive {
    overflow-x: auto;
    margin: -1.5rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--admin-bg-light);
}

.data-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--admin-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--admin-border);
}

.data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--admin-border);
    color: var(--admin-text-primary);
}

.data-table tbody tr {
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background: var(--admin-hover-bg);
}

.table-img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

/* ===============================================
   BADGES
   =============================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: rgba(12, 149, 30, 0.15);
    color: #06d62b;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.badge-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--admin-text-secondary);
}

/* ===============================================
   BUTTONS
   =============================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--admin-primary) 0%, #06d62b 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(12, 149, 30, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--admin-text-primary);
    border: 1px solid var(--admin-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(12, 149, 30, 0.5);
}

.btn-danger {
    background: var(--admin-danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-info {
    background: var(--admin-info);
    color: white;
}

.btn-info:hover {
    background: #2563eb;
}

.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1.05rem;
}

/* ===============================================
   ACTION BUTTONS
   =============================================== */

.action-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-buttons .btn {
    padding: 0.5rem;
}

/* ===============================================
   FORMS
   =============================================== */

.form-grid {
    display: grid;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--admin-text-primary);
}

.form-label.required::after {
    content: " *";
    color: var(--admin-danger);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    color: var(--admin-text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(12, 149, 30, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-file {
    display: none;
}

.file-upload-area {
    border: 2px dashed var(--admin-border);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload-area:hover {
    border-color: var(--admin-primary);
    background: rgba(12, 149, 30, 0.03);
}

.file-upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: var(--admin-text-secondary);
}

.file-upload-text {
    font-size: 0.95rem;
    color: var(--admin-text-primary);
    margin-bottom: 0.5rem;
}

.file-upload-hint {
    font-size: 0.875rem;
    color: var(--admin-text-secondary);
}

.file-preview {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-preview-img {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    object-fit: cover;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--admin-primary);
    cursor: pointer;
}

.checkbox-label {
    font-size: 0.95rem;
    color: var(--admin-text-primary);
    cursor: pointer;
    user-select: none;
}

/* ===============================================
   EMPTY STATE
   =============================================== */

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--admin-text-secondary);
}

.empty-state svg {
    margin: 0 auto 1.5rem;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--admin-text-primary);
    margin: 0 0 0.5rem;
}

.empty-state p {
    margin: 0 0 1.5rem;
}

/* ===============================================
   FORM ACTIONS
   =============================================== */

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--admin-border);
    margin-top: 1.5rem;
}

/* ===============================================
   IMAGE PREVIEW
   =============================================== */

.current-image {
    margin-top: 1rem;
}

.current-image-label {
    display: block;
    font-size: 0.875rem;
    color: var(--admin-text-secondary);
    margin-bottom: 0.5rem;
}

.current-image-wrapper {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--admin-border);
}

.current-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===============================================
   RESPONSIVE
   =============================================== */

@media (max-width: 1024px) {
    :root {
        --admin-sidebar-width: 220px;
    }
}

@media (max-width: 768px) {
    .admin-main {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    }

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

    .header-content {
        display: flex;
        align-items: center;
    }

    .admin-content {
        padding: 1.5rem 1rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    .quick-links-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}
