:root {
    --bg-color: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --glass-blur: blur(16px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100dvh;
}

/* Backgrounds */
.login-bg {
    background: radial-gradient(circle at top left, #1e1b4b, #0f172a);
    display: flex;
    justify-content: center;
    align-items: center;
}

.dashboard-bg {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
}

/* Typography */
h1, h2, h3 {
    margin-bottom: 1rem;
    font-weight: 600;
}
p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* Glassmorphism Containers */
.glass-container {
    background: var(--panel-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
}

.login-box {
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.logo {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: inline-block;
    padding: 15px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 50%;
}

/* Forms */
.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}
input[type="text"], input[type="password"] {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}
input[type="text"]:focus, input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
    text-decoration: none;
    text-align: center;
}
.btn.small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}
.primary-btn {
    background: var(--primary-color);
    color: white;
}
.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}
.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}
.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}
.danger-btn {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}
.danger-btn:hover {
    background: var(--danger-color);
    color: white;
}
.warning-btn {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}
.outline-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}
.outline-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}
.w-100 {
    width: 100%;
}

/* Nav */
.glass-nav {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}
.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--primary-color);
}
.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Upload Zone */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
    margin-bottom: 2rem;
}
.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.05);
}
.upload-icon {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Progress Bar */
.progress-bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

/* Uploaded List */
.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}
.file-item-name {
    display: flex;
    align-items: center;
    gap: 10px;
}
.file-item.success { border-left: 4px solid var(--success-color); }
.file-item.error { border-left: 4px solid var(--danger-color); }

/* Tables */
.table-responsive {
    overflow-x: auto;
}
.jobs-table {
    width: 100%;
    border-collapse: collapse;
}
.jobs-table th, .jobs-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.jobs-table th {
    color: var(--text-secondary);
    font-weight: 500;
}
.jobs-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}
.action-buttons {
    display: flex;
    gap: 8px;
}

.text-center {
    text-align: center;
}
.error {
    color: var(--danger-color);
    margin-bottom: 1rem;
}

/* Chat Layout Styles */
.chat-container {
    display: flex;
    justify-content: center;
    flex: 1;
    overflow: hidden;
    padding: 0;
    max-width: 100%;
}

.chat-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    height: 100%;
    padding: 0;
    overflow: hidden;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
}

.chat-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
}
.chat-header h3 { margin-bottom: 5px; }
.chat-header p { margin: 0; font-size: 0.9rem; }

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.chat-history::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.chat-input-container {
    padding: 15px;
    background: var(--panel-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    align-items: center;
}
.input-wrapper {
    position: relative;
    flex-grow: 1;
    display: flex;
    align-items: center;
}
.chat-input {
    width: 100%;
    padding: 12px 15px; /* Reset padding since paperclip is now outside */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    color: white;
    outline: none;
    font-size: 1rem;
}
.chat-input:focus {
    border-color: #3b82f6;
}
.attach-btn-new {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.2rem;
}
.attach-btn-new:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    padding: 0;
}

.attached-files-preview {
    width: 100%;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.file-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}
.file-badge button {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-weight: bold;
}

/* Global Chat Bubbles (WhatsApp Style) */
.chat-bubble {
    border-radius: 8px;
    padding: 6px 7px 8px 9px;
    max-width: 65%;
    box-shadow: 0 1px 0.5px rgba(11,20,26,.13);
    color: #e9edef;
    position: relative;
    word-wrap: break-word;
}
.chat-bubble.sent {
    align-self: flex-end;
    background: #005c4b;
    border-top-right-radius: 0;
}
.chat-bubble.received {
    align-self: flex-start;
    background: #202c33;
    border-top-left-radius: 0;
}
.chat-bubble.temp {
    opacity: 0.5;
}
.msg-time {
    font-size: 0.6875rem;
    color: rgba(255,255,255,0.6);
    float: right;
    margin-top: 5px;
    margin-left: 10px;
    display: flex;
    align-items: center;
    gap: 3px;
}
.chat-bubble::after {
    content: '';
    clear: both;
    display: table;
}
.msg-text {
    margin: 0;
    color: inherit;
}
.msg-file {
    padding: 0;
    margin-top: 5px;
}
.msg-file.slim-border {
    padding: 0;
}
.chat-image-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 6px;
    object-fit: contain;
    background: rgba(0,0,0,0.3);
    display: block;
    margin: 0 auto;
}
.chat-pdf-preview {
    width: 100%;
    height: 150px;
    border: none;
    border-radius: 6px;
    background: white;
}
.print-options-form {
    display: flex;
    gap: 3px;
    margin-top: 5px;
    align-items: center;
    flex-wrap: wrap;
    background: transparent;
    padding: 0;
    border-radius: 0;
}
.print-options-form select, .print-options-form input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.75rem;
}
.print-options-form select option {
    color: black;
    background: white;
}
.print-options-form input {
    width: 35px;
}
.print-options-form .btn {
    padding: 2px 6px;
    font-size: 0.75rem;
}
.total-price-badge {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid #3b82f6;
    color: #60a5fa;
    border-radius: 20px;
    font-weight: bold;
    display: inline-block;
    white-space: nowrap;
}

/* Image Bubble Styles */
.chat-bubble.image-bubble {
    padding: 3px;
}
.chat-bubble.image-bubble .chat-image-preview {
    border-radius: 6px 6px 0 0;
    display: block;
}
.chat-bubble.image-bubble .msg-file-details {
    background: rgba(0, 0, 0, 0.25);
    padding: 6px 8px;
    border-radius: 0 0 6px 6px;
    margin-top: 0;
}
.print-done-badge {
    display: inline-block;
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}
.success-btn {
    background: var(--success-color);
    color: white;
}
.success-btn:hover {
    background: #059669;
}

/* Admin Split Layout */
.admin-layout {
    display: flex;
}
@media (max-width: 768px) {
    body { padding: 0; }
    .chat-wrapper { margin: 0; border-radius: 0; height: 100%; max-width: 100%; border: none; }
    .navbar { border-radius: 0; padding: 10px; }
}
.admin-layout {
    max-width: 100%;
    margin: 0;
    height: 100%;
    gap: 0;
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar {
    width: 320px;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    margin-top: 0;
    background: #111b21;
    border-right: 1px solid #222d34;
}
.sidebar-header {
    padding: 15px 20px;
    background: #202c33;
    border-bottom: 1px solid #222d34;
    color: #e9edef;
    font-weight: 600;
}
.contacts-list {
    flex: 1;
    overflow-y: auto;
    background: #111b21;
}
.contact-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #222d34;
    transition: background 0.2s;
    color: #e9edef;
    display: flex;
    align-items: center;
    gap: 15px;
}
    /* Avatar removed from ::before, now rendered via JS */
}
.contact-item:hover {
    background: #202c33;
}
.contact-item.active {
    background: #2a3942;
    border-left: none;
}

.admin-chat {
    flex: 1;
    margin-top: 0;
    border: none;
    border-radius: 0;
    background: #0b141a;
    display: flex;
    flex-direction: column;
}

.admin-chat .chat-header {
    background: #202c33;
    padding: 12px 20px;
    border-bottom: 1px solid #222d34;
    color: #e9edef;
}

.admin-chat .chat-input-container {
    background: #202c33;
    border-top: none;
    padding: 12px 20px;
    margin-top: 0;
    border-radius: 0;
}

.admin-chat .chat-input-container .input-wrapper input {
    background: #2a3942;
    border: none;
    border-radius: 8px;
    color: #d1d7db;
    padding: 12px 15px;
}

.admin-chat .chat-input-container .input-wrapper input::placeholder {
    color: #8696a0;
}

.admin-chat .chat-input-container .icon-btn {
    background: transparent;
    color: #8696a0;
}
.admin-chat .chat-input-container .icon-btn:hover {
    color: #e9edef;
    transform: none;
    background: transparent;
}

/* WhatsApp Admin Chat Layout Details */
.admin-chat .chat-history {
    background-color: #0b141a;
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><path d="M20 20 h2 v2 h-2 z" fill="%23202c33" fill-opacity="0.2"/></svg>');
}
.admin-chat .msg-file.image-bubble {
    padding: 2px;
}
.admin-chat .chat-image-preview {
    border-radius: 6px;
}

/* Custom Banner Header */
.custom-banner {
    background: #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 3px solid #f29822; /* Orange accent */
    font-family: 'Laila', sans-serif;
}

.banner-left {
    display: flex;
    align-items: center;
    background: transparent;
    padding: 10px;
    min-width: 80px;
    justify-content: center;
}

.banner-left img {
    max-height: 70px;
    object-fit: contain;
}

.banner-center {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.banner-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin: 0;
    letter-spacing: 2px;
    font-family: 'Khand', sans-serif !important;
}
.banner-title .text-white { color: #ffffff; }
.banner-title .text-orange { color: #f29822; }

.banner-subtitle-1 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e53e3e;
    font-weight: 700;
    font-size: 1.2rem;
    margin-top: 5px;
    font-family: 'Mukta', sans-serif !important;
}

.banner-subtitle-1 .line {
    height: 2px;
    width: 60px;
    background: #e53e3e;
    position: relative;
}
.banner-subtitle-1 .line::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #000;
    border: 2px solid #e53e3e;
    border-radius: 50%;
    top: -5px;
}
.banner-subtitle-1 .line:first-child::after { right: 0; }
.banner-subtitle-1 .line:last-child::after { left: 0; }

.banner-subtitle-2 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e53e3e;
    font-weight: 700;
    font-size: 1rem;
    margin-top: 2px;
    font-family: 'Mukta', sans-serif !important;
}
.banner-subtitle-2 .line-sm {
    height: 1px;
    width: 40px;
    background: #f29822;
}

.banner-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Khand', sans-serif;
    min-width: 150px;
}

.csc-id {
    color: #60a5fa;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.csc-logo {
    display: flex;
    gap: 5px;
}
.csc-box {
    width: 35px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: 800;
    font-size: 1.8rem;
    font-family: 'Inter', sans-serif;
    border-radius: 2px;
}
.csc-box.blue { background: #1e3a8a; }
.csc-box.grey { background: #6b7280; }

.csc-text {
    color: #fff;
    font-size: 0.8rem;
    margin-top: 5px;
    font-weight: 600;
}

.sub-navbar {
    background: rgba(30, 41, 59, 0.9);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .custom-banner {
        flex-direction: row;
        gap: 5px;
        padding: 5px;
    }
    .banner-left {
        min-width: 40px;
        padding: 5px;
    }
    .banner-left img {
        max-height: 40px;
    }
    .banner-left i {
        font-size: 24px !important;
    }
    .banner-title {
        font-size: 1.2rem;
        letter-spacing: 0px;
    }
    .banner-subtitle-1 {
        font-size: 0.55rem;
        gap: 4px;
        margin-top: 2px;
    }
    .banner-subtitle-1 .line {
        width: 15px;
    }
    .banner-subtitle-1 .line::after {
        width: 4px;
        height: 4px;
        top: -2px;
        border-width: 1px;
    }
    .banner-subtitle-2 {
        font-size: 0.5rem;
        gap: 4px;
    }
    .banner-subtitle-2 .line-sm {
        width: 15px;
    }
    .banner-right {
        min-width: 70px;
    }
    .csc-id {
        font-size: 0.55rem;
        margin-bottom: 2px;
    }
    .csc-logo {
        gap: 2px;
    }
    .csc-box {
        width: 15px;
        height: 20px;
        font-size: 0.8rem;
    }
    .csc-text {
        font-size: 0.4rem;
        margin-top: 2px;
        text-align: center;
    }
    .sub-navbar {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
}
