@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-main: #060913;                 /* Deep space navy black */
    --bg-card: rgba(13, 20, 38, 0.65);  /* Transparent slate glass */
    --bg-sidebar: rgba(9, 14, 27, 0.88);
    
    /* Prestigious Brand Palette */
    --primary: #3B82F6;                 /* Sapphire Blue */
    --primary-hover: #2563EB;
    --gold: #C5A85C;                    /* Brushed Metallic Gold */
    --gold-hover: #B09247;
    
    /* Subtle Glow Borders */
    --border-card: rgba(255, 255, 255, 0.05);
    --border-gold: rgba(197, 168, 92, 0.16);
    --border-sapphire: rgba(59, 130, 246, 0.16);
    
    /* Typographic Slate Scale */
    --text-primary: #F8FAFC;            /* Slate 50 */
    --text-secondary: #94A3B8;          /* Slate 400 */
    --text-muted: #64748B;              /* Slate 500 */
    
    /* Status indicators */
    --success: #10B981;                 /* Emerald Green */
    --warning: #F59E0B;                 /* Amber */
    --danger: #EF4444;                  /* Ruby Red */
    
    --shadow-glow: 0 16px 36px -8px rgba(0, 0, 0, 0.6), 0 0 20px rgba(59, 130, 246, 0.02);
    --sidebar-w: 270px;
    --radius-lg: 16px;
    --radius-md: 10px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Custom Corporate Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
}
::-webkit-scrollbar-thumb {
    background: rgba(197, 168, 92, 0.2);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    letter-spacing: -0.1px;
}

/* Layout Shell */
.app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-card);
    padding: 2.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3.5rem;
    padding-left: 0.75rem;
}

.logo-icon {
    font-size: 1.85rem;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(197, 168, 92, 0.4);
    animation: goldPulse 3s infinite ease-in-out;
}

.logo-text {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.7px;
    background: linear-gradient(135deg, var(--text-primary), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex-grow: 1;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    position: relative;
}

.nav-item a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    padding-left: 1.25rem;
}

.nav-item.active a {
    color: #fff;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(197, 168, 92, 0.08));
    border-color: var(--border-sapphire);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.08);
}

/* Vertical Gold Accent Indicator */
.nav-item.active a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 4px;
    background: var(--gold);
    border-radius: 4px;
    box-shadow: 0 0 10px var(--gold);
}

.nav-item a i {
    font-size: 1.15rem;
    width: 20px;
    text-align: center;
}

.nav-item.active a i {
    color: var(--gold);
}

.logout-container {
    margin-top: auto;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.1rem;
    color: #EF4444;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.15);
}

/* Main Content Wrapper */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-w);
    padding: 2.75rem 3rem;
    width: calc(100% - var(--sidebar-w));
    min-height: 100vh;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.75rem;
}

.page-title {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.6px;
    background: linear-gradient(to right, #ffffff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-subtitle {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
}

/* Cards & Glassmorphism */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-glow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(197, 168, 92, 0.12), transparent);
}

.glass-card:hover {
    border-color: var(--border-gold);
    transform: translateY(-2px);
    box-shadow: 0 20px 48px -6px rgba(0, 0, 0, 0.7), 0 0 25px rgba(197, 168, 92, 0.03);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.8rem 1.4rem;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    letter-spacing: 0.2px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold), #967C3D);
    color: #070B13;
    box-shadow: 0 4px 18px rgba(197, 168, 92, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(197, 168, 92, 0.35);
    background: linear-gradient(135deg, #D5BD74, var(--gold));
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-gold);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #F87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: #EF4444;
    color: #fff;
    transform: translateY(-2px);
}

/* Dashboard Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.75rem;
    margin-bottom: 2.75rem;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 1.35rem;
    border-left: 3px solid var(--border-sapphire);
}

.metric-card:hover {
    border-left-color: var(--gold);
}

.metric-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid var(--border-sapphire);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.metric-card:hover .metric-icon {
    background: rgba(197, 168, 92, 0.08);
    border-color: var(--border-gold);
    color: var(--gold);
}

.metric-info {
    display: flex;
    flex-direction: column;
}

.metric-value {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 0.15rem;
}

/* Grids & Dashboard Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2.1fr 1fr;
    gap: 1.75rem;
}

/* Data Tables */
.table-container {
    overflow-x: auto;
}

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

th {
    padding: 1.1rem 1rem;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid var(--border-card);
}

td {
    padding: 1.1rem 1rem;
    border-bottom: 1px solid var(--border-card);
    font-size: 0.92rem;
    color: var(--text-primary);
}

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

tr:hover td {
    background: rgba(59, 130, 246, 0.02);
}

/* Badges */
.badge {
    display: inline-flex;
    padding: 0.3rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-whatsapp { background: rgba(16, 185, 129, 0.12); color: #34D399; border: 1px solid rgba(16, 185, 129, 0.25); }
.badge-messenger { background: rgba(59, 130, 246, 0.12); color: #60A5FA; border: 1px solid rgba(59, 130, 246, 0.25); }
.badge-instagram { background: rgba(197, 168, 92, 0.12); color: var(--gold); border: 1px solid rgba(197, 168, 92, 0.25); }

.badge-pending { background: rgba(245, 158, 11, 0.12); color: #FBBF24; border: 1px solid rgba(245, 158, 11, 0.25); }
.badge-approved { background: rgba(16, 185, 129, 0.12); color: #34D399; border: 1px solid rgba(16, 185, 129, 0.25); }
.badge-shipped { background: rgba(99, 102, 241, 0.12); color: #818CF8; border: 1px solid rgba(99, 102, 241, 0.25); }
.badge-cancelled { background: rgba(239, 68, 68, 0.12); color: #F87171; border: 1px solid rgba(239, 68, 68, 0.25); }

/* Live Chat Interface */
.chat-layout {
    display: grid;
    grid-template-columns: 330px 1fr;
    gap: 1.75rem;
    height: calc(100vh - 180px);
}

.chat-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.convo-item {
    padding: 1.15rem;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.convo-item:hover, .convo-item.active {
    background: rgba(59, 130, 246, 0.04);
    border-color: var(--border-sapphire);
}

.convo-item.active {
    border-left: 3px solid var(--gold);
}

.convo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.convo-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.convo-time {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.convo-preview {
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-main {
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.message {
    max-width: 65%;
    padding: 0.9rem 1.25rem;
    border-radius: 14px;
    line-height: 1.5;
    font-size: 0.92rem;
    word-wrap: break-word;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.message.received {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-bottom-left-radius: 2px;
    border: 1px solid var(--border-card);
}

.message.sent {
    align-self: flex-end;
    background: linear-gradient(135deg, #1E3A8A, #1e293b); /* Deep sapphire and slate */
    color: #fff;
    border-bottom-right-radius: 2px;
    border: 1px solid var(--border-sapphire);
}

.chat-input-area {
    display: flex;
    gap: 0.85rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-card);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.35rem;
}

.form-label {
    display: block;
    margin-bottom: 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.2px;
}

.form-control, input, select, textarea {
    width: 100%;
    padding: 0.8rem 1.1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.92rem;
    outline: none;
    transition: all 0.3s ease;
}

.form-control:focus, input:focus, select:focus, textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 12px rgba(197, 168, 92, 0.15);
    background: rgba(255, 255, 255, 0.04);
}

/* Login Page Styling */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    background: radial-gradient(circle at 15% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
                radial-gradient(circle at 85% 80%, rgba(197, 168, 92, 0.06) 0%, transparent 40%);
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 3rem;
    border-color: var(--border-gold);
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 7, 18, 0.85);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #090e1a;
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 580px;
    padding: 2.25rem;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8);
    transform: scale(0.92);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-backdrop.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.75rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--danger);
}

/* Product Catalog Grid */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.75rem;
}

.product-card {
    display: flex;
    flex-direction: column;
}

.product-image {
    width: 100%;
    height: 200px;
    border-radius: var(--radius-md);
    object-fit: cover;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-card);
    margin-bottom: 1.15rem;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image {
    transform: scale(1.03);
    border-color: var(--border-gold);
}

.product-card.clickable-product {
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.product-card.clickable-product:hover {
    transform: translateY(-4px);
    border-color: var(--border-gold) !important;
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.15) !important;
}

.product-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    letter-spacing: -0.3px;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: auto;
    padding-top: 1.15rem;
    border-top: 1px solid var(--border-card);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.08);
    transition: .3s;
    border-radius: 34px;
    border: 1px solid var(--border-card);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #94A3B8;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: rgba(197, 168, 92, 0.2);
    border-color: var(--border-gold);
}

input:checked + .slider:before {
    transform: translateX(26px);
    background-color: var(--gold);
    box-shadow: 0 0 8px var(--gold);
}

/* Animations */
@keyframes goldPulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(197,168,92,0.2)); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 12px rgba(197,168,92,0.6)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(197,168,92,0.2)); }
}
