
/* Reset & Base Variables */
:root {
    --primary-bg: #f9fafb;
    --card-bg: rgba(255, 255, 255, 0.95);
    --primary-color: #10b981;
    --primary-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --secondary-color: #3b82f6;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-color: rgba(229, 231, 235, 0.6);
    --danger-color: #ef4444;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-glass: 0 20px 40px -10px rgba(0,0,0,0.05);
    --radius-md: 12px;
    --radius-lg: 24px;
    --font-inter: 'Inter', sans-serif;

    /* Kanban Tracking Colors */
    --k-pending: #94A3B8;
    --k-design: #8B5CF6;
    --k-approval: #F59E0B;
    --k-qc-pra: #0EA5E9;
    --k-produksi: #3B82F6;
    --k-qc-pasca: #F43F5E;
    --k-finishing: #EC4899;
    --k-packing: #14B8A6;
    --k-delivery: #6366F1;
    --k-completed: #10B981;
    --k-repair: #F59E0B;
    --k-verifikasi: #0EA5E9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-inter);
}

body {
    background-color: var(--primary-bg);
    color: var(--text-main);
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 0) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 0.05) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 0.05) 0, transparent 50%);
    min-height: 100vh;
}

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

.sidebar {
    width: 250px;
    background: #ffffff;
    padding: 24px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 10;
}

.sidebar .logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-group {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 16px;
    margin-bottom: 4px;
    padding: 0 16px;
    letter-spacing: 0.05em;
}

.sidebar nav a {
    text-decoration: none;
    color: var(--text-muted);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary-color);
}
.sidebar nav a { 
    margin-bottom: 4px;
}
.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 16px 0;
}

.upgrade-pro {
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    padding: 20px;
    color: white;
    text-align: center;
    margin-top: auto;
}

.upgrade-pro i {
    font-size: 24px;
    margin-bottom: 8px;
    color: #fbbf24;
}

.upgrade-pro p {
    font-weight: 600;
    margin-bottom: 4px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: transparent;
}

/* Topbar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 40px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    position: sticky;
    top: 0;
    z-index: 5;
}

.topbar h1 {
    font-size: 22px;
    font-weight: 600;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

/* Content Area */
.content-wrapper {
    padding: 32px 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Cards & Glassmorphism */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    padding: 28px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.glass-panel:hover {
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.1);
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
}

.section-title i {
    color: var(--primary-color);
}

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

.section-header .section-title {
    margin-bottom: 0;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

input[type="text"],
input[type="number"],
input[type="date"],
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-main);
    background: white;
    transition: all 0.3s ease;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon input {
    padding-right: 40px;
    font-size: 20px;
    font-weight: 600;
    height: 50px;
}

.input-with-icon .percent-icon {
    position: absolute;
    right: 16px;
    font-weight: 600;
    color: var(--text-muted);
}

/* Logo Upload */
.logo-upload-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.logo-preview-box {
    width: 100px;
    height: 100px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 12px;
    gap: 8px;
    overflow: hidden;
    background: #f9fafb;
}

.logo-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px 0 rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: #fee2e2;
    color: var(--danger-color);
}

.btn-danger:hover {
    background: #fecaca;
}

.btn-full {
    width: 100%;
}

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

.btn-white:hover {
    background: #f9fafb;
    box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.1);
}

.btn-outline-white {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

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

/* Dynamic Product Cards */
.product-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.product-header-left {
    display: flex;
    gap: 16px;
    flex: 1;
}

/* Tables */
.modern-table {
    width: 100%;
    border-collapse: collapse;
}

.modern-table th {
    text-align: left;
    padding: 12px 16px;
    background: #f3f4f6;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modern-table th:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.modern-table th:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.modern-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

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

.modern-table input {
    margin-bottom: 0;
}

/* Summary Section */
.layout-summary {
    align-items: stretch;
}

.margin-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.helper-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 12px;
}

.primary-gradient {
    background: var(--primary-gradient);
    border: none;
    box-shadow: 0 20px 40px -10px rgba(79, 70, 229, 0.5);
}

.success-gradient {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    background-color: #10b981 !important;
    border: none !important;
    box-shadow: 0 20px 40px -10px rgba(16, 185, 129, 0.5) !important;
    color: white !important;
}

section.success-gradient {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    background-color: #10b981 !important;
}

.text-white {
    color: white !important;
}

.text-white i {
    color: #a5b4fc !important;
}

.summary-list {
    color: white;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 15px;
    opacity: 0.9;
}

.summary-item.total-prod {
    opacity: 1;
    font-weight: 600;
    font-size: 16px;
}

.summary-item.highlight {
    color: #fbbf24;
    font-weight: 600;
}

.summary-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 4px 0;
}

.summary-divider.thick {
    height: 2px;
}

.summary-item.grand-total {
    font-size: 20px;
    font-weight: 700;
    opacity: 1;
    margin-top: 4px;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Utility */
.text-right {
    text-align: right;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* Responsive */
@media (max-width: 992px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 16px;
    }

    .sidebar .logo {
        margin-bottom: 16px;
        width: 100%;
    }

    .sidebar nav {
        flex-direction: row;
        overflow-x: auto;
        width: 100%;
    }

    .upgrade-pro {
        display: none;
    }

    .content-wrapper {
        padding: 16px;
    }

    .glass-panel {
        padding: 20px;
    }
}

/* ========================================= */
/* MERGED CUANOTA CSS                        */
/* ========================================= */






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

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
}

.sidebar-header p {
    font-size: 0.85rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

.nav-links {
    list-style: none;
    margin-top: 1.5rem;
}

.nav-links li {
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0.7;
}

.nav-links li:hover,
.nav-links li.active {
    background-color: var(--sidebar-active);
    opacity: 1;
    border-right: 4px solid var(--primary);
}

.nav-links li i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    position: relative;
}

.view-section {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.view-section.active {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.header-action h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #111827;
}

.form-actions-top {
    display: flex;
    gap: 1rem;
}

.date-display {
    background: var(--card-bg);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Glassmorphism */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

/* Dashboard Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-content h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

/* Invoice Builder Layout */
.invoice-header-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.header-section {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Typography & Display boxes */
.vendor-display {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    min-height: 100px;
}

.vendor-display h4 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.vendor-display p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.empty-state-small {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    cursor: pointer;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
}

.empty-state-small:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.empty-state-small i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Forms */
.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.pt-4 {
    padding-top: 1.5rem;
}

.border-top {
    border-top: 1px solid var(--border-color);
}

label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #374151;
}

input,
textarea,
select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: white;
    width: 100%;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

input[readonly] {
    background-color: #f9fafb;
    color: var(--text-muted);
    cursor: not-allowed;
}

.relative {
    position: relative;
}

.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-height: 150px;
    overflow-y: auto;
    z-index: 100;
    list-style: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.suggestions-list.hidden {
    display: none;
}

.suggestions-list li {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}

.suggestions-list li:hover {
    background-color: var(--primary-light);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

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

.btn-primary {
    background-color: var(--secondary);
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
}

.btn-success {
    background-color: #10b981 !important;
    color: white !important;
}

.btn-success:hover {
    background-color: #059669 !important;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #f3f4f6;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

.btn-icon {
    padding: 0.5rem;
    border-radius: 6px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.btn-icon:hover {
    color: var(--primary);
}

.btn-icon.delete:hover {
    color: var(--danger);
}

/* Table */
.table-container {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

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

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #4b5563;
    font-size: 0.85rem;
}

.items-table input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid transparent;
    background: transparent;
}

.items-table input:hover,
.items-table input:focus {
    border: 1px solid var(--border-color);
    background: white;
}

.items-table td {
    padding: 0.5rem 1rem;
    vertical-align: middle;
}

.item-total {
    font-weight: 600;
}

/* Calculator Section */
.calculator-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.5);
    padding: 1.5rem;
    border-radius: 12px;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 400px;
    padding: 0.5rem 0;
    font-size: 1.1rem;
}

.calc-row span:last-child {
    font-weight: 600;
}

.dp-row {
    border-top: 1px dashed var(--border-color);
    border-bottom: 1px dashed var(--border-color);
    padding: 1rem 0;
}

.grand-total {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.sisa-tagihan {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--danger);
}

.price-input {
    text-align: right;
    width: 150px;
    font-weight: 600;
    color: var(--primary-dark);
}

/* Bank Cards */
.bank-card {
    background: white;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--secondary);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.bank-card strong {
    font-size: 1.1rem;
    color: var(--text-color);
}

.bank-card span {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.hidden {
    display: none !important;
}

/* Data Table */
.data-table th {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* --- DASHBOARD STYLES --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glass);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-primary .stat-icon { background: rgba(79, 70, 229, 0.1); color: var(--primary-color); }
.stat-success .stat-icon { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.stat-info .stat-icon { background: rgba(14, 165, 233, 0.1); color: #0ea5e9; }
.stat-warning .stat-icon { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

.stat-content h3 {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

.charts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.chart-card {
    padding: 24px;
}

@media (max-width: 1024px) {
    .charts-container {
        grid-template-columns: 1fr;
    }
}


.sph-id-badge {
    display: inline-block;
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary-color);
    font-family: monospace;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-lunas {
    background: #d1fae5;
    color: #065f46;
}

.badge-belum {
    background: #fee2e2;
    color: #991b1b;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border-radius: 20px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-dialog {
    width: 100%;
    max-width: 600px;
    margin: 1.5rem;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 100%;
}

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

.modal-

.modal-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* ---- PRINT STYLES FOR PROFESSIONAL INVOICE ---- */
.print-only {
    display: none;
}

@media print {
    body 

    .hidden-print {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    #print-area,
    #print-area 

    

    #print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        display: block;
    }

    @page {
        size: auto;
        margin: 10mm;
    }

    .invoice-box {
        max-width: 800px;
        margin: auto;
        padding: 30px;
        border: 1px solid #eee;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
        font-size: 14px;
        line-height: 24px;
        font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;
        color: #555;
    }

    .invoice-box table {
        width: 100%;
        line-height: inherit;
        text-align: left;
    }

    .invoice-box table td {
        padding: 5px;
        vertical-align: top;
    }

    .invoice-box table tr.top table td {
        padding-bottom: 20px;
    }

    .invoice-box table tr.top table td.title {
        font-size: 28px;
        line-height: 35px;
        color: #333;
    }

    .p-company-name {
        font-size: 24px;
        font-weight: bold;
        color: var(--primary-dark);
    }

    .invoice-box table tr.information table td {
        padding-bottom: 40px;
    }

    .invoice-box table.p-items tr.heading td {
        background: #eee;
        border-bottom: 1px solid #ddd;
        font-weight: bold;
    }

    .invoice-box table.p-items tr.item td {
        border-bottom: 1px solid #eee;
    }

    .invoice-box table.p-items tr.item.last td {
        border-bottom: none;
    }

    .p-summary-box {
        width: 40%;
        float: right;
        margin-top: 20px;
    }

    .p-summary-box table td {
        padding: 5px 10px;
        border-bottom: 1px solid #eee;
    }

    .p-summary-box .p-val {
        text-align: right;
        font-weight: bold;
    }

    .p-grand-total td {
        font-size: 18px;
        color: #333;
        border-top: 2px solid #333;
    }

    .p-sisa td {
        color: var(--danger);
    }

    .p-footer {
        clear: both;
        margin-top: 50px;
        font-size: 12px;
    }

    .p-bank {
        padding: 15px;
        background: #f9f9f9;
        border-left: 4px solid var(--primary);
    }

    .p-thanks {
        text-align: center;
        margin-top: 40px;
        font-weight: bold;
        font-style: italic;
    }
}

/* Modal specific print-like preview */
#modal-invoice-preview .invoice-box {
    box-shadow: none;
    border: none;
    padding: 0;
    margin: 0;
    width: 100%;
    font-size: 12px;
    line-height: 20px;
    color: #333;
}

#modal-invoice-preview .p-company-name {
    font-size: 18px;
}

#modal-invoice-preview .p-summary-box {
    width: 50%;
}

/* ========================================= */
/* MERGED ORDERARC CSS                       */
/* ========================================= */
/* Variables & Modern Reset */






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

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-surface);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.sidebar-header {
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.nav-item i {
    font-size: 20px;
}

.nav-item:hover {
    background-color: var(--soft-blue);
    color: var(--primary);
}

.nav-item.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(47, 133, 90, 0.25);
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

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

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Important for flex layout with datatables */
}

/* Header */
.top-header {
    height: 80px;
    background-color: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-search {
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--bg-main);
    padding: 0 16px;
    border-radius: 30px;
    width: 350px;
    height: 44px;
    transition: var(--transition);
}

.header-search:focus-within {
    box-shadow: 0 0 0 2px var(--primary-hover);
    background-color: white;
}

.header-search i {
    color: var(--text-muted);
    font-size: 18px;
}

.header-search input {
    border: none;
    background: transparent;
    padding: 0 12px;
    width: 100%;
    outline: none;
    font-size: 14px;
    color: var(--text-main);
}

.search-results-container {
    position: absolute;
    top: 55px;
    left: 0;
    width: 100%;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.search-results-container.active {
    display: flex;
}

.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: var(--transition);
}

.search-result-item:hover {
    background-color: var(--soft-blue);
}

.search-result-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 2px;
}

.search-result-desc {
    font-size: 12px;
    color: var(--text-muted);
}

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

.btn-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.btn-icon:hover {
    background-color: var(--bg-main);
    color: var(--primary);
}

.badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background-color: var(--accent);
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(47, 133, 90, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(39, 103, 73, 0.3);
}

.btn-secondary {
    background-color: var(--bg-main);
    color: var(--text-main);
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-outline:hover {
    background-color: var(--soft-blue);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

/* Views Container */
.views-container {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    position: relative;
}

.view {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.view.active {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

/* Cards & Global Elements */
.card {
    background-color: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

/* Dashboard Specifics */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.metric-card {
    background-color: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.metric-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.metric-card.soft-blue .metric-icon {
    background: var(--soft-blue);
    color: var(--primary);
}

.metric-card.soft-yellow .metric-icon {
    background: var(--soft-yellow);
    color: var(--warning);
}

.metric-card.soft-red .metric-icon {
    background: var(--soft-red);
    color: var(--danger);
}

.metric-card.soft-green .metric-icon {
    background: var(--soft-green);
    color: var(--success);
}

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

.metric-label {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.recent-activity h3 {
    margin-bottom: 16px;
    font-size: 18px;
}

.activity-list {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--soft-blue);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-details {
    flex: 1;
}

.activity-text {
    font-size: 14px;
    color: var(--text-main);
}

.activity-text strong {
    color: var(--primary);
}

.activity-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* SPK Table */
.table-container {
    overflow-x: auto;
}

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

.data-table th,
.data-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.data-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    font-size: 14px;
    font-weight: 500;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background-color: #FAFCFF;
}

.tag {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.tag-draft {
    background-color: #F1F5F9;
    color: var(--status-draft);
}

.tag-process {
    background-color: var(--soft-blue);
    color: var(--status-process);
}

.tag-completed {
    background-color: var(--soft-green);
    color: var(--status-completed);
}

.action-btns {
    display: flex;
    gap: 8px;
}

/* Kanban Board Layout */
.pipeline-filters input {
    width: 300px;
    padding: 10px 16px;
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-md);
    outline: none;
    transition: var(--transition);
}

.pipeline-filters input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(47, 133, 90, 0.2);
}

.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    min-height: calc(100vh - 200px);
    align-items: flex-start;
}

/* Custom Scrollbar for Kanban */
.kanban-board::-webkit-scrollbar {
    height: 8px;
}

.kanban-board::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.kanban-board::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.kanban-board::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.kanban-column {
    background-color: #F8FAFC;
    border-radius: var(--radius-lg);
    min-width: 300px;
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 220px);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.column-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid transparent;
}

.col-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.color-completed { background-color: var(--k-completed); }

.kanban-column[data-status="Job Pending"] .column-header { border-bottom-color: var(--k-pending); background-color: var(--k-pending-bg); }
.kanban-column[data-status="Design"] .column-header { border-bottom-color: var(--k-design); background-color: var(--k-design-bg); }
.kanban-column[data-status="Approval"] .column-header { border-bottom-color: var(--k-approval); background-color: var(--k-approval-bg); }
.kanban-column[data-status="QC Pra-Produksi"] .column-header { border-bottom-color: var(--k-qc-pra); background-color: var(--k-qc-bg); }
.kanban-column[data-status="Produksi"] .column-header { border-bottom-color: var(--k-produksi); background-color: var(--k-produksi-bg); }
.kanban-column[data-status="QC Pasca-Produksi"] .column-header { border-bottom-color: var(--k-qc-pasca); background-color: rgba(244, 63, 94, 0.1); }
.kanban-column[data-status="Repair"] .column-header { border-bottom-color: var(--k-repair); background-color: rgba(245, 158, 11, 0.1); }
.kanban-column[data-status="Verifikasi"] .column-header { border-bottom-color: var(--k-verifikasi); background-color: rgba(14, 165, 233, 0.1); }
.kanban-column[data-status="Finishing"] .column-header { border-bottom-color: var(--k-finishing); background-color: rgba(236, 72, 153, 0.1); }
.kanban-column[data-status="Packing"] .column-header { border-bottom-color: var(--k-packing); background-color: rgba(20, 184, 166, 0.1); }
.kanban-column[data-status="Delivery"] .column-header { border-bottom-color: var(--k-delivery); background-color: rgba(99, 102, 241, 0.1); }
.kanban-column[data-status="Completed"] .column-header { border-bottom-color: var(--k-completed); background-color: var(--k-completed-bg); }

.color-repair { background-color: var(--k-repair); }
.color-verifikasi { background-color: var(--k-verifikasi); }

.column-header {
    padding: 12px 16px;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}

.job-card {
    background: white;
    margin: 12px;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.job-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}
.kanban-column:nth-child(1) .column-header {
    border-bottom-color: var(--k-pending);
}

.kanban-column:nth-child(2) .column-header {
    border-bottom-color: var(--k-design);
}

.kanban-column:nth-child(3) .column-header {
    border-bottom-color: var(--k-approval);
}

.kanban-column:nth-child(4) .column-header {
    border-bottom-color: var(--k-qc-pra);
}

.kanban-column:nth-child(5) .column-header {
    border-bottom-color: var(--k-produksi);
}

.kanban-column:nth-child(6) .column-header {
    border-bottom-color: var(--k-qc-pasca);
}

.kanban-column:nth-child(7) .column-header {
    border-bottom-color: var(--k-finishing);
}

.kanban-column:nth-child(8) .column-header {
    border-bottom-color: var(--k-packing);
}

.kanban-column:nth-child(9) .column-header {
    border-bottom-color: var(--k-delivery);
}

.kanban-column:nth-child(10) .column-header {
    border-bottom-color: var(--k-completed);
}

.column-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.col-count {
    background-color: #E2E8F0;
    color: var(--text-main);
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.column-body.drag-over {
    background-color: rgba(79, 70, 229, 0.05);
    border: 2px dashed var(--primary-color);
    border-radius: var(--radius-md);
}

/* Job Cards */
.job-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    cursor: grab;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.job-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.job-card:active {
    cursor: grabbing;
}

.card-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.indicator-safe {
    background-color: var(--success);
}

.indicator-warn {
    background-color: var(--warning);
}

.indicator-danger {
    background-color: var(--danger);
}

.card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.card-spk {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}

.card-project {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
    color: var(--text-main);
}

.card-product {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #F1F5F9;
    padding-top: 12px;
}

.card-qty {
    font-size: 12px;
    font-weight: 600;
    background-color: #F8FAFC;
    padding: 4px 8px;
    border-radius: 4px;
}

.card-deadline {
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-deadline i {
    font-size: 14px;
}

.highlight-card {
    border: 2px solid var(--accent) !important;
    animation: pulseHighlight 1.5s infinite;
}

@keyframes pulseHighlight {
    0% {
        box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(72, 187, 120, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(72, 187, 120, 0);
    }
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-overlay .modal {
    background-color: var(--bg-surface);
    width: 90%;
    max-width: 800px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    transform: translateY(20px) scale(0.95);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 20px;
}

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

.btn-close:hover {
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-

.modal-footer {
    padding: 24px 32px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-row {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.required {
    color: var(--danger);
}

.input-text {
    padding: 12px 16px;
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-md);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    background-color: #F8FAFC;
}

.input-text:focus {
    border-color: var(--primary);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(47, 133, 90, 0.1);
}

.input-textarea {
    padding: 12px 16px;
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-md);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    background-color: #F8FAFC;
    resize: vertical;
}

.input-textarea:focus {
    border-color: var(--primary);
    background-color: white;
}

.file-upload-box {
    border: 2px dashed #E2E8F0;
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    background-color: #F8FAFC;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.file-upload-box:hover {
    border-color: var(--primary);
    background-color: rgba(47, 133, 90, 0.04);
}

.file-upload-box i {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 8px;
}

.file-upload-box p {
    font-size: 14px;
    color: var(--text-muted);
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.submit-actions {
    display: flex;
    gap: 12px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background-color: white;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    border-left: 4px solid var(--primary);
    animation: slideInRight 0.3s ease forwards;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.success i {
    color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.error i {
    color: var(--danger);
}

.toast.info {
    border-left-color: var(--primary);
}

.toast.info i {
    color: var(--primary);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-muted);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Enhancements */
.mt-2 {
    margin-top: 12px;
}

.product-row {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    align-items: center;
}

.product-row .spk-product-name {
    flex: 2;
}

.product-row .spk-product-qty {
    flex: 1;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.detail-value {
    font-size: 15px;
    color: var(--text-main);
    font-weight: 500;
}

.detail-full {
    grid-column: 1 / -1;
}

.product-badge {
    display: inline-flex;
    justify-content: space-between;
    background: #F8FAFC;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 6px;
    font-size: 14px;
}

.action-buttons-flex {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

/* --- AUTH MODAL (SAAS STYLE) --- */
.auth-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(240, 253, 244, 0.85); /* Light green tint */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    background: white;
    box-shadow: 0 20px 60px rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: 24px;
    text-align: center;
}
.auth-logo {
    color: var(--primary-color);
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}
.auth-card h2 { margin-bottom: 8px; color: var(--text-main); }
.auth-card p { color: var(--text-muted); font-size: 14px; margin-bottom: 30px; }
.auth-card .form-group { text-align: left; margin-bottom: 16px; }

#profileDropdownBtn:hover #profileDropdown {
    display: block !important;
}
/* --- MODAL SYSTEM --- */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 20000;
    display: none; /* Changed from flex to none */
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-content {
    width: 100%;
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-header { padding: 20px; border-bottom: 1px solid #f3f4f6; display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--text-main); }
.modal-body { padding: 20px; }

/* Improve Profile Dropdown */
#profileDropdown {
    z-index: 10005 !important;
}
#profileDropdown button:hover {
    background: #f8fafc !important;
    color: var(--primary-color) !important;
}

/* --- INTERNAL TEAM CHAT --- */
#chat-float-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
    z-index: 10000;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
#chat-float-btn:hover { transform: scale(1.1) rotate(5deg); }

#chat-window-panel {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 500px;
    max-height: 80vh;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUpFade 0.3s ease-out;
}

.chat-header {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.status-dot { width: 8px; height: 8px; background: #10b981; border-radius: 50%; margin-right: 10px; }
.header-info { display: flex; align-items: center; }
.header-info h3 { font-size: 15px; margin: 0; font-weight: 700; color: var(--text-main); }
.header-info p { font-size: 11px; margin: 0; color: var(--text-muted); }

#chat-messages-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Chat Bubbles */
.message { max-width: 80%; padding: 10px 14px; border-radius: 16px; font-size: 14px; position: relative; }
.message.sent { align-self: flex-end; background: var(--primary-color); color: white; border-bottom-right-radius: 4px; }
.message.received { align-self: flex-start; background: #f3f4f6; color: var(--text-main); border-bottom-left-radius: 4px; }
.message-meta { font-size: 10px; margin-top: 4px; opacity: 0.7; }
.sent .message-meta { text-align: right; }

.chat-footer {
    padding: 16px;
    background: white;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid #f3f4f6;
}
#chat-input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 25px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: 0.2s;
}
#chat-input:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1); }

#emoji-picker {
    position: absolute;
    bottom: 80px;
    left: 16px;
    right: 16px;
    background: white;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 10002;
    border: 1px solid #eee;
}
.emoji-list { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.emoji-list span { font-size: 20px; cursor: pointer; text-align: center; transition: 0.2s; }
.emoji-list span:hover { transform: scale(1.3); }

.btn-icon-sm { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; padding: 4px; transition: 0.2s; }
.btn-icon-sm:hover { color: var(--primary-color); }
.btn-primary-sm { background: var(--primary-color); color: white; border: none; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; transition: 0.2s; }
.btn-primary-sm:hover { transform: scale(1.1); background: var(--primary-dark); }

/* --- AUTOCOMPLETE STYLES --- */
.autocomplete-items {
    position: absolute;
    border: 1px solid var(--border-color);
    border-top: none;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 12px 12px;
    box-shadow: var(--shadow-lg);
    max-height: 200px;
    overflow-y: auto;
}

.autocomplete-items div {
    padding: 12px 16px;
    cursor: pointer;
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
    font-size: 14px;
}

.autocomplete-items div:hover {
    background-color: var(--bg-main);
    color: var(--primary-color);
}

.autocomplete-active {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
}

/* --- CUSTOMER DATABASE TABLE --- */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    background: var(--bg-main);
    padding: 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

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

.data-table tr:hover td {
    background: rgba(79, 70, 229, 0.02);
}

.badge-count {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}
