:root {
    --bg-color: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --col-bg: rgba(15, 23, 42, 0.5);
    --success: #10b981;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at top left, #1e1b4b, #0f172a);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
}
.overlay.active { display: flex; }
.overlay .glass-panel {
    padding: 3rem;
    border-radius: 24px;
    width: 400px;
    max-width: 90%;
}

.text-center { text-align: center; }

.gradient-text {
    background: linear-gradient(135deg, #60a5fa, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
}

#qr-container img {
    border-radius: 12px;
    margin: 1.5rem 0;
    width: 250px;
    height: 250px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    background: white;
    padding: 10px;
}

.spinner {
    width: 40px; height: 40px;
    border: 4px solid var(--glass-border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.app-header {
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    border-bottom: 1px solid var(--glass-border);
}
.app-header h1 {
    font-size: 1.5rem;
    margin: 0;
}
.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s;
}
.status-badge.visible { opacity: 1; }
.status-badge .dot {
    width: 8px; height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success);
}

.kanban-board {
    display: flex;
    flex: 1;
    gap: 1.5rem;
    padding: 2rem;
    overflow-x: auto;
}
.column {
    flex: 1;
    min-width: 320px;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    background: var(--col-bg);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}
.column-title {
    padding: 1.2rem;
    border-bottom: 1px solid var(--glass-border);
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.column-content {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.column-content.drag-over {
    background: rgba(255, 255, 255, 0.03);
}

.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
}
.card:active { cursor: grabbing; }
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    border-color: rgba(255, 255, 255, 0.2);
}
.card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.card-number { font-weight: 600; color: #fff; }
.card-body {
    font-size: 0.95rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    justify-content: center;
    align-items: center;
}
.modal-overlay.active { display: flex; }
.modal-content {
    width: 500px;
    height: 600px;
    max-width: 95%;
    max-height: 90vh;
    border-radius: 20px;
    overflow: hidden;
}
.flex-col { display: flex; flex-direction: column; }
.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.close-btn {
    background: none; border: none; color: white;
    font-size: 1.5rem; cursor: pointer;
    opacity: 0.7; transition: opacity 0.2s;
}
.close-btn:hover { opacity: 1; }

.chat-history {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.95rem;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
}
.msg.received {
    background: rgba(255, 255, 255, 0.1);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.msg.sent {
    background: var(--accent);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.msg-text {
    margin-bottom: 2px;
}
.msg-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    font-size: 0.70rem;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
}
.msg.received .msg-meta {
    justify-content: flex-start;
}
.msg.sent .msg-meta {
    color: rgba(255,255,255,0.7);
}
.msg-tick {
    display: inline-block;
}

.chat-input-area {
    padding: 1rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 10px;
}
#chat-input {
    flex: 1;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 0 1rem;
    color: white;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}
#chat-input:focus { border-color: var(--accent); }
.primary-btn {
    background: var(--accent);
    border: none;
    width: 44px; height: 44px;
    border-radius: 50%;
    color: white;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.primary-btn:hover { background: var(--accent-hover); }
.primary-btn:active { transform: scale(0.95); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px;}
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }
