/* 
  JAKALELANA B2B Package Builder - Premium Design System 
*/

:root {
    /* Color Palette - Vibrant Dark/Sleek Theme */
    --bg-primary: #0f172a; /* Slate 900 */
    --bg-secondary: #1e293b; /* Slate 800 */
    --accent-primary: #3b82f6; /* Blue 500 */
    --accent-hover: #2563eb; /* Blue 600 */
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Glassmorphism */
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    /* Layout */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.ph {
    color: inherit;
}

/* Background effects */
body::before {
    content: '';
    position: fixed;
    top: -20%;
    left: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    z-index: -1;
}

body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    right: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
    z-index: -1;
}

/* Utilities */
.hidden { display: none !important; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1.5rem; }
.text-right { text-align: right; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* Typography */
h1, h2, h3, h4, h5, h6 { font-weight: 600; line-height: 1.2; }
a { text-decoration: none; color: inherit; }

/* Glass Panel Base */
.glass-panel, .glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* Buttons */
button {
    cursor: pointer;
    border: none;
    outline: none;
    font-size: 1rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
}
.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
}

.btn-icon {
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: 50%;
}
.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Forms & Inputs */
input, select, textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
}
textarea {
    resize: vertical;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(0, 0, 0, 0.4);
}
select option { background: var(--bg-secondary); color: white; }

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

/* Notification Dropdown */
.notif-dropdown {
    position: absolute;
    top: 120%;
    right: 0; /* Align to the right edge of the .actions container */
    width: 300px;
    padding: 1rem;
    border-radius: 12px;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform-origin: top right;
}

/* Login Page Specifics */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
}

.logo-area {
    text-align: center;
    margin-bottom: 2rem;
}
.logo-icon {
    font-size: 3rem;
    background: var(--accent-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
}

.input-group { margin-bottom: 1.5rem; }
.input-wrapper {
    position: relative;
}
.input-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.input-wrapper input {
    padding-left: 2.75rem;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(239, 68, 68, 0.3);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.login-form button { width: 100%; }

.login-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 280px;
    border-right: 1px solid var(--glass-border);
    border-top: none;
    border-bottom: none;
    border-left: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--glass-border);
}
.sidebar-header h2 { font-size: 1.25rem; letter-spacing: 1px; }

.sidebar-nav {
    padding: 1.5rem 1rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    transition: var(--transition);
}
.nav-item:hover, .nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-primary);
}
.nav-item.active {
    border-left: 3px solid var(--accent-primary);
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, transparent 100%);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.user-name { display: block; font-weight: 500; font-size: 0.9rem; }
.user-role { display: block; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    position: relative;
    z-index: 50;
}

.content-area {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

/* Cards & Grid */
.card {
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}
.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--glass-border);
}
.card-body {
    padding: 1.25rem;
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
}
.form-group.full-width { grid-column: 1 / -1; }
.section-title h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-primary);
    border-bottom: 1px dashed rgba(255,255,255,0.1);
    padding-bottom: 0.5rem;
}

/* Data Tables */
.table-responsive {
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th, .data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}
.data-table th {
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}
.data-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Calculation Result */
.calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}
.calc-box {
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
}
.calc-box.highlight {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}
.calc-box .label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.calc-box .value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
}
.value.success { color: var(--success); }

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
}
.tab-btn {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    white-space: nowrap;
}
.tab-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-content {
    width: 100%;
    max-width: 600px;
    border-radius: var(--radius-md);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}
.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Loading State */
.loading-state {
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.loading-state i { font-size: 2rem; color: var(--accent-primary); }

/* Animations */
.slide-up {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Vendor Theme tweaks */
.vendor-theme .sidebar-header { color: #a855f7; }
.vendor-theme .nav-item.active { border-left-color: #a855f7; background: linear-gradient(90deg, rgba(168, 85, 247, 0.1) 0%, transparent 100%); }
.vendor-theme .btn-primary { background: linear-gradient(135deg, #a855f7 0%, #d946ef 100%); }

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    background: rgba(0,0,0,0.15);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.checkbox-item:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
}

/* Custom Premium Checkbox Styling */
.checkbox-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 4px;
    border: 1.5px solid var(--text-muted);
    background: rgba(0,0,0,0.2);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
    display: grid;
    place-content: center;
}

.checkbox-item input[type="checkbox"]::before {
    content: "";
    width: 0.65rem;
    height: 0.65rem;
    transform: scale(0);
    transition: 0.2s transform ease-in-out;
    box-shadow: inset 1em 1em var(--bg-primary);
    transform-origin: center;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.checkbox-item input[type="checkbox"]:checked {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.checkbox-item input[type="checkbox"]:checked::before {
    transform: scale(1);
}

/* Checked State for Label */
.checkbox-item:has(input[type="checkbox"]:checked) {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--accent-primary);
    color: #fff;
}



/* --- Modals --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-content {
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

/* --- Mobile Responsiveness (Media Queries) --- */
.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
    z-index: 998;
}

@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
    }
    
    .mobile-menu-btn {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        height: 100vh;
        width: 280px;
        background: var(--bg-secondary);
        z-index: 999;
        transition: left 0.3s ease;
        box-shadow: 4px 0 15px rgba(0,0,0,0.5);
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .topbar {
        padding: 0.75rem 1rem;
        justify-content: flex-start;
    }
    
    .topbar h1 {
        font-size: 1.15rem;
        line-height: 1.2;
        margin: 0;
    }
    
    .topbar .actions {
        margin-left: auto;
    }

    .notif-dropdown {
        position: fixed;
        top: 70px;
        right: 1rem;
        left: 1rem;
        width: auto;
        transform-origin: top;
    }

    .content-area {
        padding: 0.75rem;
    }

    .card-header h4 {
        font-size: 1rem;
        margin: 0;
    }
    
    .card-header.flex-between {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
    }
    
    .tabs::-webkit-scrollbar {
        display: none;
    }

    .grid-form {
        grid-template-columns: 1fr;
    }

    .calc-grid {
        grid-template-columns: 1fr;
    }

    .checkbox-group {
        max-height: 300px;
        grid-template-columns: 1fr;
        padding: 0.5rem;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table th, .data-table td {
        padding: 0.5rem;
    }
    
    .data-table th {
        font-size: 0.65rem;
    }
    
    .data-table td {
        font-size: 0.85rem;
    }
    
    .data-table {
        min-width: 800px; /* Force scroll */
    }
}

