/* Reset and base styles */
:root {
    --bg-app: #080b11;
    --bg-sidebar: #0e1320;
    --bg-card: rgba(20, 27, 45, 0.6);
    --bg-card-hover: rgba(30, 41, 69, 0.8);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 255, 255, 0.15);
    
    /* Neon Glow Accent Colors */
    --color-violet: #a855f7;
    --color-violet-glow: rgba(168, 85, 247, 0.15);
    --color-blue: #06b6d4;
    --color-blue-glow: rgba(6, 182, 212, 0.15);
    --color-emerald: #10b981;
    --color-emerald-glow: rgba(16, 185, 129, 0.15);
    --color-amber: #f59e0b;
    --color-amber-glow: rgba(245, 158, 11, 0.15);
    --color-danger: #ef4444;
    
    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Font Families */
    --font-primary: 'Inter', 'Bai Jamjuree', sans-serif;
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: var(--font-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(168, 85, 247, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 40%);
    background-attachment: fixed;
}

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

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    flex-shrink: 0;
    z-index: 10;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--color-violet), var(--color-blue));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
}

.logo-icon i {
    width: 22px;
    height: 22px;
    color: #fff;
}

.logo-text h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.menu-item i {
    width: 20px;
    height: 20px;
}

.menu-item:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
}

.menu-item.active {
    color: var(--text-primary);
    background: linear-gradient(to right, rgba(168, 85, 247, 0.15), rgba(6, 182, 212, 0.05));
    border-color: rgba(168, 85, 247, 0.3);
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.05);
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-violet), #8b5cf6);
    color: #fff;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
    color: var(--text-primary);
}

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

.btn-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fff;
}

.w-full { width: 100%; }
.mt-2 { margin-top: 0.5rem; }
.mt-6 { margin-top: 1.5rem; }

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 2.5rem;
    max-width: 1600px;
    margin: 0 auto;
    width: calc(100% - 280px);
}

/* Header */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    gap: 2rem;
}

.header-title h1 {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.35rem;
    background: linear-gradient(135deg, #fff 60%, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Glassmorphism Panel */
.glass-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    padding: 1.5rem;
    transition: var(--transition-normal);
}

.glass-panel:hover {
    border-color: var(--border-color-hover);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* KPI Cards Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: transparent;
}

.kpi-card#kpi-steng::before { background: var(--color-violet); }
.kpi-card#kpi-project-val::before { background: var(--color-blue); }
.kpi-card#kpi-revenue::before { background: var(--color-emerald); }
.kpi-card#kpi-contract::before { background: var(--color-amber); }

.kpi-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-color-hover);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    background-color: var(--bg-card-hover);
}

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

.bg-violet-glow { background-color: var(--color-violet-glow); }
.bg-blue-glow { background-color: var(--color-blue-glow); }
.bg-emerald-glow { background-color: var(--color-emerald-glow); }
.bg-amber-glow { background-color: var(--color-amber-glow); }

.kpi-icon-wrapper i {
    width: 24px;
    height: 24px;
}

.text-violet { color: var(--color-violet); }
.text-blue { color: var(--color-blue); }
.text-emerald { color: var(--color-emerald); }
.text-amber { color: var(--color-amber); }

.kpi-info {
    flex-grow: 1;
}

.kpi-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.kpi-value {
    font-size: 1.45rem;
    font-weight: 700;
    margin: 0.2rem 0;
    letter-spacing: -0.5px;
    font-family: 'Inter', sans-serif;
}

.kpi-change {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
}

.trend-up {
    color: var(--color-emerald);
    font-weight: 600;
    background-color: rgba(16, 185, 129, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.trend-label {
    color: var(--text-muted);
}

/* Charts Container */
.charts-container {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

.chart-header {
    margin-bottom: 1.5rem;
}

.chart-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.chart-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.chart-body {
    flex-grow: 1;
    position: relative;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Table Section & Toolbar */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.table-toolbar h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.table-summary-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

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

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

.search-box input {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.6rem 1rem 0.6rem 2.25rem;
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--color-violet);
    background-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.filter-box {
    position: relative;
    display: flex;
    align-items: center;
}

.filter-box i {
    position: absolute;
    left: 0.85rem;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.filter-box select {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.6rem 2rem 0.6rem 2.25rem;
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
    appearance: none;
    outline: none;
}

.filter-box select:focus {
    border-color: var(--color-violet);
    background-color: rgba(255, 255, 255, 0.08);
}

/* Beautiful Table */
.table-responsive {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: rgba(10, 15, 30, 0.2);
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.report-table th, 
.report-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.report-table th {
    background-color: rgba(15, 23, 42, 0.8);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 2;
}

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

.report-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

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

/* Numbers Formatting */
.num-steng { color: #d8b4fe; font-weight: 500; font-family: 'Inter', sans-serif; }
.num-value { color: #7dd3fc; font-weight: 500; font-family: 'Inter', sans-serif; }
.num-revenue { color: #6ee7b7; font-weight: 500; font-family: 'Inter', sans-serif; }
.num-contract { color: #fde047; font-weight: 500; font-family: 'Inter', sans-serif; }
.num-empty { color: var(--text-muted); text-align: center; }

/* Totals Row */
.table-totals-row {
    background-color: rgba(15, 23, 42, 0.9);
}

.table-totals-row td {
    border-top: 2px solid rgba(255, 255, 255, 0.15);
    font-size: 0.95rem;
    color: #fff;
}

#foot-total-steng { color: var(--color-violet); text-shadow: 0 0 10px rgba(168, 85, 247, 0.2); }
#foot-total-project { color: var(--color-blue); text-shadow: 0 0 10px rgba(6, 182, 212, 0.2); }
#foot-total-revenue { color: var(--color-emerald); text-shadow: 0 0 10px rgba(16, 185, 129, 0.2); }
#foot-total-contract { color: var(--color-amber); text-shadow: 0 0 10px rgba(245, 158, 11, 0.2); }

/* Row Actions */
.row-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-icon i {
    width: 15px;
    height: 15px;
}

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

.btn-icon.btn-edit:hover {
    border-color: var(--color-violet);
    color: var(--color-violet);
    background-color: rgba(168, 85, 247, 0.05);
}

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

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(5, 7, 12, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

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

.modal-container {
    width: 100%;
    max-width: 580px;
    border-color: rgba(255, 255, 255, 0.12);
    background-color: #0d121f;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform var(--transition-normal);
}

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

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

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.modal-body form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

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

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

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

.form-group textarea,
.form-group input {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.form-group textarea:focus,
.form-group input:focus {
    outline: none;
    border-color: var(--color-violet);
    background-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.form-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 200;
}

.toast {
    background-color: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 280px;
    max-width: 400px;
    animation: slideInRight 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background-color: var(--color-violet);
    animation: toastProgress 3s linear forwards;
}

.toast-success::after { background-color: var(--color-emerald); }
.toast-danger::after { background-color: var(--color-danger); }
.toast-info::after { background-color: var(--color-blue); }

.toast i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-success i { color: var(--color-emerald); }
.toast-danger i { color: var(--color-danger); }
.toast-info i { color: var(--color-blue); }

.toast-content {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

.animate-scale {
    animation: animateScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes animateScale {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Project Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

.status-contract {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--color-amber);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-project {
    background-color: rgba(6, 182, 212, 0.1);
    color: var(--color-blue);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.status-steng {
    background-color: rgba(168, 85, 247, 0.1);
    color: var(--color-violet);
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.status-pending {
    background-color: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .charts-container {
        grid-template-columns: 1fr;
    }
    .main-content {
        width: 100%;
        padding: 1.5rem;
    }
}

@media (max-width: 900px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1.25rem;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .sidebar-header {
        margin-bottom: 0;
    }
    .sidebar-menu {
        flex-direction: row;
        gap: 0.25rem;
        flex-grow: 0;
    }
    .menu-item span {
        display: none;
    }
    .sidebar-footer {
        display: none;
    }
    .main-content {
        padding: 1.25rem;
    }
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

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

/* Bidding & Contracts Table Additional CSS */
.bidding-table-responsive {
    overflow-x: auto;
    position: relative;
    max-height: 650px;
}

.bidding-table {
    min-width: 1800px; /* Force wide layout to fit 18 columns */
}

.bidding-table th {
    white-space: nowrap;
    text-align: left;
    font-size: 0.78rem;
    padding: 0.85rem 1rem;
}

.table-group-header th {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.5rem 1rem !important;
    text-transform: uppercase;
}

/* Sticky Column logic for Bidding Table - Freeze Name column */
.bidding-table th:nth-child(2),
.bidding-table td:nth-child(2) {
    position: sticky;
    left: 0;
    background-color: #0c111d !important; /* Solid dark background to prevent bleed */
    z-index: 4;
    box-shadow: 3px 0 6px rgba(0, 0, 0, 0.4);
    min-width: 250px;
    max-width: 350px;
}

.bidding-table th:nth-child(2) {
    z-index: 5; /* Header must stay above body cells */
    background-color: #111827 !important;
}

/* Hover style helper for sticky column */
.bidding-table tbody tr:hover td:nth-child(2) {
    background-color: #1a2235 !important;
}

/* Form Section Title in Modal */
.form-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-top: 1.25rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    letter-spacing: 0.5px;
}

.readonly-input {
    background-color: rgba(255, 255, 255, 0.01) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-secondary) !important;
    cursor: not-allowed;
}

/* Project-specific styles from the image */
.text-red-glow {
    color: #f87171 !important; /* Soft light red */
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.val-crossed-out {
    text-decoration: line-through;
    text-decoration-color: #ef4444;
    text-decoration-thickness: 1.5px;
    color: #fca5a5 !important;
}

/* Checkbox alignment */
.checkbox-group {
    display: flex;
    flex-direction: row !important;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-group input {
    width: 18px !important;
    height: 18px !important;
    cursor: pointer;
}

.checkbox-group label {
    margin-bottom: 0;
    cursor: pointer;
}

/* Sticky Actions (จัดการ) Column for Bidding Table */
.bidding-table th:last-child,
.bidding-table td:last-child {
    position: sticky;
    right: 0;
    background-color: #0c111d !important;
    z-index: 4;
    box-shadow: -3px 0 6px rgba(0, 0, 0, 0.4);
}

.bidding-table th:last-child {
    z-index: 5;
    background-color: #111827 !important;
}

/* Hover style helper for sticky actions column */
.bidding-table tbody tr:hover td:last-child {
    background-color: #1a2235 !important;
}

/* Double click hint */
.double-click-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
    font-weight: 500;
}

/* === File Attachment === */
.text-violet { color: #a78bfa; }
.mt-4 { margin-top: 1.25rem !important; }

.file-drop-zone {
    border: 2px dashed rgba(167, 139, 250, 0.4);
    border-radius: 12px;
    background: rgba(167, 139, 250, 0.04);
    transition: border-color 0.25s, background 0.25s;
    cursor: pointer;
}
.file-drop-zone.dragover {
    border-color: #a78bfa;
    background: rgba(167, 139, 250, 0.12);
}
.file-drop-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    gap: 0.25rem;
}
.file-drop-icon {
    width: 2.5rem;
    height: 2.5rem;
    color: #a78bfa;
    margin-bottom: 0.5rem;
}
.file-drop-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}
.file-drop-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    text-align: center;
}

/* Attached files list */
.attached-files-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    transition: background 0.2s;
    animation: fadeInUp 0.2s ease;
}
.file-item:hover { background: rgba(255,255,255,0.08); }
.file-icon-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 7px;
    font-weight: 700;
    font-size: 0.65rem;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}
.file-icon-badge.pdf  { background: rgba(239,68,68,0.2);  color: #f87171; }
.file-icon-badge.word { background: rgba(59,130,246,0.2);  color: #60a5fa; }
.file-icon-badge.excel{ background: rgba(34,197,94,0.2);   color: #4ade80; }
.file-icon-badge.other{ background: rgba(148,163,184,0.2); color: #94a3b8; }
.file-info { flex: 1; min-width: 0; }
.file-name {
    font-size: 0.82rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}
.file-size {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}
.file-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-shrink: 0;
}
.btn-file-action {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    color: var(--text-muted);
}
.btn-file-action:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.btn-file-action.remove:hover { background: rgba(239,68,68,0.2); color: #f87171; }

/* Attachments badge in the detail page */
.attachment-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    background: rgba(167,139,250,0.1);
    border: 1px solid rgba(167,139,250,0.25);
    font-size: 0.75rem;
    color: #c4b5fd;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}
.attachment-chip:hover { background: rgba(167,139,250,0.2); }
.attachment-chip svg { width: 0.9rem; height: 0.9rem; }

/* -------------------------------------
   LOGIN PAGE STYLES (NEW DESIGN)
   ------------------------------------- */
.login-page.poly-bg {
    background-image: url('login_poly_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    color: #fff;
    margin: 0;
    padding: 0;
}

.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 800px;
    gap: 4rem;
    padding: 2rem;
    animation: fadeIn 0.8s ease-out;
}

.login-left {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
}

.login-logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon-poly {
    width: 48px;
    height: 48px;
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px;
    border-radius: 8px;
}

.logo-text-poly {
    display: flex;
    flex-direction: column;
}

.logo-text-poly h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0;
    line-height: 1.1;
}

.logo-text-poly span {
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 1px;
    opacity: 0.8;
}

.login-divider {
    width: 1px;
    height: 250px;
    background: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.login-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 300px;
}

.users-icon {
    margin-bottom: 2rem;
}

.users-icon i {
    width: 64px;
    height: 64px;
    color: #fff;
    stroke-width: 1.5;
}

.login-form-poly {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-input-poly {
    position: relative;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    height: 42px;
}

.login-input-poly i {
    color: #555;
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
}

.login-input-poly input {
    background: transparent;
    border: none;
    color: #333;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    width: 100%;
    height: 100%;
    outline: none;
}

.login-input-poly input::placeholder {
    color: #999;
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    margin-bottom: 1rem;
    width: 100%;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    opacity: 0.9;
}

.remember-me input {
    margin: 0;
    cursor: pointer;
}

.forgot-pwd {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #fff;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.forgot-pwd:hover {
    opacity: 1;
    text-decoration: underline;
}

.forgot-pwd i {
    width: 14px;
    height: 14px;
}

.btn-login-poly {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 1px;
}

.btn-login-poly:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.login-error {
    color: #fca5a5;
    font-size: 0.8rem;
    margin-top: -1rem;
    margin-bottom: 0.5rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
}

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

@media (max-width: 768px) {
    .login-wrapper {
        flex-direction: column;
        gap: 2rem;
    }
    .login-left {
        justify-content: center;
    }
    .login-divider {
        width: 100%;
        height: 1px;
    }
    .login-right {
        margin: 0 auto;
    }
}
