/* ==========================================================================
   GROWNEXT - PREMIUM ADMIN PANEL CSS
   ========================================================================== */

:root {
    --bg-dark: #08080a;
    --panel-dark: rgba(18, 18, 22, 0.75);
    --panel-border: rgba(255, 255, 255, 0.08);
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-glow: rgba(37, 99, 235, 0.35);
    --text-white: #ffffff;
    --text-muted: #9ca3af;
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
}

body.admin-body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* ==========================================
   LOGIN SCREEN
   ========================================== */
.admin-login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #111827 0%, #030712 100%);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.admin-login-overlay.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-card {
    background: rgba(17, 24, 39, 0.85);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 90%;
    max-width: 420px;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 40px var(--accent-glow);
    text-align: center;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.login-card:hover {
    transform: translateY(-5px);
}

.login-logo {
    width: 70px;
    height: 70px;
    margin-bottom: 20px;
}

.login-card h2 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-card p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 30px;
}

.input-container {
    position: relative;
    margin-bottom: 24px;
}

.input-container i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}

.input-container input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    color: var(--text-white);
    font-size: 15px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.input-container input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
    background: rgba(0, 0, 0, 0.5);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent) 0%, #3b82f6 100%);
    border: none;
    border-radius: 12px;
    color: var(--text-white);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.login-btn:hover {
    box-shadow: 0 6px 20px var(--accent-glow);
    transform: translateY(-2px);
}

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

.login-error {
    color: var(--danger);
    font-size: 13px;
    margin-top: 15px;
    min-height: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-error.show {
    opacity: 1;
}

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

/* Sidebar styling */
.admin-sidebar {
    width: 260px;
    background: var(--panel-dark);
    border-right: 1px solid var(--panel-border);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 30px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--panel-border);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
}

.sidebar-header h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    padding: 24px 16px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    background: rgba(37, 99, 235, 0.15);
    border-left: 4px solid var(--accent);
    color: var(--text-white);
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--panel-border);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--danger);
    background: transparent;
    border: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    width: 100%;
    transition: background 0.3s ease;
}

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

/* Main Content Area */
.admin-main {
    flex-grow: 1;
    margin-left: 260px;
    padding: 40px;
    transition: all 0.3s ease;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
}

.header-title h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.header-title p {
    color: var(--text-muted);
    font-size: 14px;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn-primary {
    background: var(--accent);
    color: var(--text-white);
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
    border: 1px solid var(--panel-border);
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================
   DASHBOARD WIDGETS
   ========================================== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 35px;
}

.metric-card {
    background: var(--panel-dark);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.metric-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
}

.metric-icon.blue {
    background: rgba(37, 99, 235, 0.15);
    color: #3b82f6;
}

.metric-icon.green {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.metric-icon.purple {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.metric-icon.orange {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.metric-info h3 {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-info .value {
    font-size: 26px;
    font-weight: 700;
}

/* ==========================================
   TAB PANELS
   ========================================== */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

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

/* ==========================================
   DATATABLE & PANELS
   ========================================== */
.table-panel {
    background: var(--panel-dark);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin-bottom: 30px;
}

.table-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 15px;
    flex-wrap: wrap;
}

.table-title {
    font-size: 18px;
    font-weight: 600;
}

.table-filters {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

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

.search-input-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input-wrapper input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--panel-border);
    padding: 10px 14px 10px 40px;
    border-radius: 10px;
    color: var(--text-white);
    font-size: 14px;
    width: 240px;
    transition: all 0.3s ease;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--accent);
    width: 280px;
}

.filter-select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--panel-border);
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--text-white);
    font-size: 14px;
    outline: none;
    cursor: pointer;
}

.table-container {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th {
    padding: 16px 20px;
    border-bottom: 1px solid var(--panel-border);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
}

.admin-table td {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 14px;
    vertical-align: middle;
}

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

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Badges */
.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
    text-transform: capitalize;
}

.badge.new {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.badge.in_progress {
    background: var(--warning-bg);
    color: var(--warning);
}

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

.badge.awaiting_payment {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge.paid {
    background: var(--success-bg);
    color: var(--success);
}

.badge.active {
    background: var(--success-bg);
    color: var(--success);
}

.badge.completed {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

/* Actions Row */
.actions-row {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-icon:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.08);
}

.btn-icon.edit:hover {
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.1);
}

.btn-icon.delete:hover {
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
    background: var(--danger-bg);
}

.btn-icon.whatsapp:hover {
    color: #25d366;
    border-color: rgba(37, 211, 102, 0.3);
    background: rgba(37, 211, 102, 0.1);
}

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

.empty-state i {
    font-size: 40px;
    margin-bottom: 15px;
}

.empty-state p {
    font-size: 15px;
}

/* ==========================================
   MODAL PANEL
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: #111115;
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    width: 90%;
    max-width: 650px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.modal-overlay.show .modal-card {
    transform: scale(1);
}

.modal-header {
    padding: 24px 30px;
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.btn-close-modal:hover {
    color: var(--text-white);
}

.modal-body {
    padding: 30px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

@media (max-width: 600px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

.detail-item label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.detail-item .val {
    font-size: 14px;
    font-weight: 500;
}

.detail-item.full-width {
    grid-column: span 2;
}

@media (max-width: 600px) {
    .detail-item.full-width {
        grid-column: span 1;
    }
}

.detail-item textarea, .detail-item select, .detail-item input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-white);
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
}

.detail-item textarea:focus, .detail-item select:focus, .detail-item input:focus {
    outline: none;
    border-color: var(--accent);
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--panel-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ==========================================
   CONFIG & PORTFOLIO MANAGERS
   ========================================== */
.editor-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.editor-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
}

.editor-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.03);
}

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

.editor-card-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: #3b82f6;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .form-grid-3, .form-grid-2 {
        grid-template-columns: 1fr;
    }
}

.features-editor-wrapper {
    margin-top: 15px;
}

.features-editor-wrapper label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.feature-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.feature-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.feature-tag i {
    cursor: pointer;
    color: var(--danger);
}

.feature-tag i:hover {
    color: #ef4444;
}

.feature-input-row {
    display: flex;
    gap: 10px;
}

.feature-input-row input {
    flex-grow: 1;
}

/* SVGs and Charts */
.trend-svg {
    width: 100%;
    height: 140px;
    stroke-dasharray: 1000;
    stroke-dashoffset: 0;
    animation: drawLine 2s ease forwards;
}

@keyframes drawLine {
    from { stroke-dashoffset: 1000; }
    to { stroke-dashoffset: 0; }
}

/* Premium Custom File Uploader */
.file-upload-wrapper {
    margin-top: 8px;
}

.file-upload-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--panel-bg, #0f172a);
    border: 1px dashed var(--panel-border, rgba(255, 255, 255, 0.15));
    border-radius: 8px;
    color: var(--text-color, #e2e8f0);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload-label:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.03);
}

.file-upload-label i {
    font-size: 16px;
    color: #3b82f6;
}

.file-name {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.3s ease;
}

/* ==========================================
   MOBILE RESPONSIVENESS
   ========================================== */
@media (max-width: 992px) {
    .admin-sidebar {
        width: 70px;
    }
    
    .sidebar-header h1, .sidebar-nav span, .sidebar-footer button span {
        display: none;
    }
    
    .sidebar-header {
        padding: 24px 15px;
        justify-content: center;
    }
    
    .nav-item {
        justify-content: center;
        padding: 12px;
    }
    
    .admin-main {
        margin-left: 70px;
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}
