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

:root {
    --bg-main: #edf2f9; /* Cool light blue-gray background */
    --bg-card: rgba(255, 255, 255, 0.55); /* Frosted Glassmorphism card */
    --bg-sidebar: rgba(255, 255, 255, 0.75); /* Frosted Glassmorphism sidebar */
    --border-color: rgba(255, 255, 255, 0.6); /* Soft white borders for glass */
    --border-inner: rgba(0, 0, 0, 0.05);
    --border-glow: rgba(37, 99, 235, 0.2);
    
    --color-primary: #2563eb; /* Electric Blue */
    --color-primary-hover: #1d4ed8;
    --color-secondary: #06b6d4; /* Vibrant Teal/Cyan */
    --color-success: #10b981;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
    --color-info: #06b6d4;
    
    --text-main: #1e293b; /* Dark slate */
    --text-muted: #64748b; /* Cool gray */
    --text-inverse: #ffffff; /* White text on elements */
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 8px 32px 0 rgba(31, 38, 135, 0.06), 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 20px 40px -5px rgba(31, 38, 135, 0.1), 0 10px 20px -5px rgba(0, 0, 0, 0.03);
    
    --radius-sm: 10px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    
    --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;
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.18);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(37, 99, 235, 0.35);
}

body {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Floating Glass Background Blobs with Keyframe Floating Animations */
@keyframes floatBlob1 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, -40px) scale(1.15); }
    100% { transform: translate(0, 0) scale(1); }
}

@keyframes floatBlob2 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-40px, 50px) scale(0.85); }
    100% { transform: translate(0, 0) scale(1); }
}

.glass-bg-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(110px);
    z-index: -1;
    opacity: 0.42;
    pointer-events: none;
}
.blob-1 {
    top: -10%;
    right: -10%;
    width: 480px;
    height: 480px;
    background: rgba(37, 99, 235, 0.42);
    animation: floatBlob1 18s ease-in-out infinite;
}
.blob-2 {
    bottom: -10%;
    left: -10%;
    width: 420px;
    height: 420px;
    background: rgba(6, 182, 212, 0.36);
    animation: floatBlob2 22s ease-in-out infinite;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: #0f172a; /* Slate 900 */
    letter-spacing: -0.02em;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--color-primary-hover);
}

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

/* Sidebar Styling - Glassmorphic */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition-normal);
    box-shadow: 4px 0 24px rgba(31, 38, 135, 0.04);
}

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

.sidebar-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px var(--border-glow);
}

.sidebar-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
}

.sidebar-menu {
    list-style: none;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-family: var(--font-heading);
    transition: var(--transition-fast);
}

.sidebar-item a i {
    font-size: 1.15rem;
}

.sidebar-item a:hover {
    color: var(--color-primary);
    background-color: rgba(37, 99, 235, 0.05);
    transform: translateX(4px);
}

.sidebar-item.active a {
    color: var(--color-primary);
    background: rgba(37, 99, 235, 0.08);
    border-left: 4px solid var(--color-primary);
    padding-left: 12px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-inner);
    background-color: rgba(255, 255, 255, 0.45);
}

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

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: rgba(37, 99, 235, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--color-primary);
    border: 1px solid rgba(37, 99, 235, 0.15);
}

.user-details {
    overflow: hidden;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

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

/* Main Content Area - Fixed width constraint to prevent right side cutting off */
.main-wrapper {
    flex-grow: 1;
    margin-left: 260px;
    width: calc(100% - 260px);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Header Styling - Glassmorphic */
.main-header {
    height: 70px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background-color: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.02);
}

.page-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
}

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

/* Content Area */
.content-body {
    padding: 32px;
    flex-grow: 1;
}

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

.btn-primary {
    background-color: var(--color-primary);
    color: var(--text-inverse);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    color: var(--text-inverse);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.8);
    color: #334155;
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.9);
    color: #0f172a;
    transform: translateY(-1px);
}

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

.btn-danger:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Cards - Frosted Glassmorphism with slight lift on hover */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
}

.card:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.3);
    box-shadow: var(--shadow-lg);
}

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

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
}

/* Stats Widgets */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.widget-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.widget-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-lg);
}

.widget-info h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.widget-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #0f172a;
    font-family: var(--font-heading);
}

.widget-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--color-primary);
}

/* Modern Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

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

.table-custom th {
    padding: 16px;
    border-bottom: 1px solid var(--border-inner);
    color: var(--text-muted);
    font-weight: 600;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: rgba(255, 255, 255, 0.4);
}

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

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

.table-custom tr:hover td {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-enquiry { background-color: rgba(6, 182, 212, 0.1); color: #0891b2; border: 1px solid rgba(6, 182, 212, 0.2); }
.badge-design { background-color: rgba(139, 92, 246, 0.1); color: #7c3aed; border: 1px solid rgba(139, 92, 246, 0.2); }
.badge-boq { background-color: rgba(236, 72, 153, 0.1); color: #db2777; border: 1px solid rgba(236, 72, 153, 0.2); }
.badge-readyforproduction { background-color: rgba(37, 99, 235, 0.1); color: #2563eb; border: 1px solid rgba(37, 99, 235, 0.2); }
.badge-purchase { background-color: rgba(99, 102, 241, 0.1); color: #4f46e5; border: 1px solid rgba(99, 102, 241, 0.2); }
.badge-inproduction { background-color: rgba(6, 182, 212, 0.1); color: #0891b2; border: 1px solid rgba(6, 182, 212, 0.2); }
.badge-productioncomplete { background-color: rgba(16, 185, 129, 0.1); color: #059669; border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-hotdip { background-color: rgba(244, 63, 94, 0.1); color: #e11d48; border: 1px solid rgba(244, 63, 94, 0.2); }
.badge-readyfordispatch { background-color: rgba(20, 184, 166, 0.1); color: #0d9488; border: 1px solid rgba(20, 184, 166, 0.2); }
.badge-dispatched { background-color: rgba(107, 114, 128, 0.1); color: #4b5563; border: 1px solid rgba(107, 114, 128, 0.2); }

/* Forms & Inputs */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: #0f172a;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background-color: #ffffff;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

/* Authentication Page */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 10% 20%, #edf2f9 0%, #dbeafe 90%);
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    width: 50px;
    height: 50px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 800;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px var(--border-glow);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #0f172a;
}

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

/* Pipeline / Kanban Board - Premium Glass Columns with horizontal scrolling */
.pipeline-container {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 16px;
    height: calc(100vh - 180px);
    min-height: 500px;
    width: 100%;
}

.pipeline-column {
    flex: 0 0 280px;
    background-color: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    max-height: 100%;
    box-shadow: var(--shadow-sm);
}

.pipeline-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-inner);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(255, 255, 255, 0.5);
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
}

.pipeline-title {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0f172a;
}

.pipeline-count {
    background-color: rgba(37, 99, 235, 0.08);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary);
}

.pipeline-cards {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    flex-grow: 1;
}

.pipeline-card {
    background-color: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    cursor: grab;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.pipeline-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pipeline-card-id {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 8px;
    font-family: var(--font-heading);
}

.pipeline-card-client {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 4px;
}

.pipeline-card-detail {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pipeline-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-inner);
    padding-top: 10px;
    margin-top: 10px;
}

.pipeline-card-material {
    font-size: 0.75rem;
    background-color: rgba(255, 255, 255, 0.5);
    padding: 2px 6px;
    border-radius: 4px;
    color: #334155;
    border: 1px solid var(--border-color);
}

.pipeline-card-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Notes & Comments Section */
.notes-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.note-bubble {
    background-color: rgba(255, 255, 255, 0.45);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    max-width: 85%;
    align-self: flex-start; /* Aligned left */
}

.note-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.75rem;
}

.note-author {
    font-weight: 700;
    color: var(--color-primary);
}

.note-role {
    color: var(--text-muted);
}

.note-date {
    color: var(--text-muted);
    margin-left: auto;
}

.note-content {
    font-size: 0.9rem;
    color: #334155;
}

/* History Logs */
.history-timeline {
    position: relative;
    padding-left: 20px;
    margin-top: 20px;
}

.history-timeline::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background-color: var(--border-inner);
}

.history-item {
    position: relative;
    padding-bottom: 20px;
}

.history-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--color-primary);
    border: 2px solid var(--bg-card);
}

.history-item-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f172a;
}

.history-item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* File Upload Style */
.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background-color: rgba(255, 255, 255, 0.45);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.attachment-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.attachment-icon {
    font-size: 1.2rem;
    color: var(--color-primary);
}

.attachment-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.attachment-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Alerts and Messages */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.15);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Filters container */
.filter-bar {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* Responsive grid for columns */
@media (max-width: 992px) {
    .sidebar {
        width: 70px;
    }
    .sidebar-title, .sidebar-footer .user-details {
        display: none;
    }
    .main-wrapper {
        margin-left: 70px;
        width: calc(100% - 70px);
    }
}
