:root {
    --bg-main: #09090b;
    --bg-card: #18181b;
    --bg-input: #09090b;
    --sidebar-bg: #09090b;
    --sidebar-border: #27272a;
    --accent: #ffffff;
    --accent-hover: #e4e4e7;
    --accent-text: #000000;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;
    --border: #27272a;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    --emerald: #10b981;
    --rose: #f43f5e;
    --blue: #3b82f6;
    --amber: #f59e0b;
}

.light {
    --bg-main: #f4f4f5;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --sidebar-bg: #ececf1;
    --sidebar-border: #d4d4d8;
    --accent: #09090b;
    --accent-hover: #27272a;
    --accent-text: #ffffff;
    --text-primary: #09090b;
    --text-secondary: #3f3f46;
    --text-muted: #71717a;
    --border: #e4e4e7;
}

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

html,
body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

#app-main {
    width: 100%;
    height: 100vh;
    display: block;
}

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

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    padding: 24px;
    flex-shrink: 0;
    height: 100vh;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo-box {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--bg-main);
}

.light .logo-box {
    background: #000000;
    color: #ffffff;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
}

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

.light .nav-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.nav-item.active {
    background: #27272a;
    color: var(--text-primary);
    border-color: #3f3f46;
}

.light .nav-item.active {
    background: #ffffff;
    color: #000000;
    border-color: #d4d4d8;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.nav-item svg {
    width: 18px;
    height: 18px;
}

/* History List in Sidebar */
.sidebar-separator {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin: 24px 0 12px 16px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 8px;
}

.history-search {
    padding: 0 8px;
    margin-bottom: 8px;
}

.history-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.75rem;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s;
}

.light .history-search input {
    background: #ffffff;
}

.history-search input:focus {
    border-color: var(--text-muted);
}

.scrollable-area {
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.scrollable-area::-webkit-scrollbar {
    width: 4px;
}

.scrollable-area::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.history-item {
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.light .history-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

.history-item-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.history-empty {
    padding: 12px 16px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

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

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #27272a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
}

.light .user-avatar {
    background: #e4e4e7;
    color: #27272a;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-main);
    position: relative;
}

/* Messages Area */
.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
    padding-bottom: 32px;
}

section#view-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.message {
    max-width: 70%;
    padding: 16px 20px;
    border-radius: 1.25rem;
    font-size: 0.95rem;
    line-height: 1.6;
    animation: slideIn 0.3s ease-out forwards;
    opacity: 0;
}

.bot-msg {
    align-self: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.light .bot-msg {
    background: #ffffff;
    border-color: #e4e4e7;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.user-msg {
    align-self: flex-end;
    background: var(--accent);
    color: var(--accent-text);
    font-weight: 500;
    border-bottom-right-radius: 4px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    position: relative;
}

.message-edit-btn {
    position: absolute;
    left: -28px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0;
    padding: 0;
}

.user-msg:hover .message-edit-btn {
    opacity: 1;
}

.message-edit-btn:hover {
    background: white;
    color: black;
}

.info-msg {
    max-width: 100% !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

.info-card {
    background: linear-gradient(145deg, #1e1e21, #18181b);
    border: 1px solid var(--border);
    border-left: 4px solid var(--amber);
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 600px;
    margin: 10px auto;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    text-align: left;
}

.light .info-card {
    background: #ffffff;
    border-left-width: 6px;
    box-shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.1);
}

.info-header {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--amber);
    margin-bottom: 12px;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-body {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.7;
}

/* Media styling */
.img-msg {
    max-width: 100%;
    border-radius: 12px;
    margin-top: 10px;
    border: 1px solid var(--border);
}

.vid-msg {
    max-width: 100%;
    border-radius: 12px;
    margin-top: 10px;
    border: 1px solid var(--border);
}

.aud-msg {
    width: 100%;
    margin-top: 10px;
    filter: invert(1);
    opacity: 0.8;
}

.light .aud-msg {
    filter: none;
    opacity: 1;
}

/* Selection Buttons */
.options-container {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.option-btn {
    background: #27272a;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.light .option-btn {
    background: #ffffff;
    border-color: #d4d4d8;
    color: #27272a;
}

.option-btn:hover {
    background: #3f3f46;
    border-color: #52525b;
}

.light .option-btn:hover {
    background: #f4f4f5;
    border-color: #a1a1aa;
}

.option-btn.selected {
    background: var(--accent);
    color: var(--accent-text);
}

.skip-container {
    margin-top: -10px;
    margin-bottom: 20px;
}

.skip-btn {
    background: transparent;
    border-style: dashed;
    color: var(--text-secondary);
    font-size: 0.75rem;
    opacity: 0.7;
}

.light .skip-btn {
    color: var(--text-muted);
    border-color: #d4d4d8;
}

.skip-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.05);
}

/* Confirm Multiselect button */
.confirm-btn {
    background: var(--emerald);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    margin-top: 20px;
    width: 100%;
    transition: transform 0.1s;
}

.confirm-btn:hover {
    transform: scale(1.02);
}

/* Input Styles */
.chat-input-wrapper {
    padding: 24px 40px;
    border-top: 1px solid var(--border);
    background: var(--bg-main);
    transition: opacity 0.3s;
}

.input-group {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 8px 8px 8px 16px;
    border-radius: 1rem;
    transition: all 0.2s;
}

.light .input-group {
    background: #ffffff;
    border-color: #d4d4d8;
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.05);
}

input#user-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
    font-size: 0.95rem;
}

input#user-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Kanban Board System */
#view-requests {
    padding: 32px;
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    /* Prevent page-level scroll */
    width: 100%;
}

.kanban-board {
    display: flex;
    gap: 20px;
    flex: 1;
    overflow-x: auto;
    /* Localized scroll */
    padding-bottom: 20px;
    align-items: flex-start;
    width: 100%;
}

.kanban-column {
    min-width: 300px;
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

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

.kanban-column-header h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.kanban-count {
    background: var(--border);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.kanban-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Full Screen Modal Redesign */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(12px);
    display: none;
    /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-container-fs {
    width: 100vw;
    height: 100vh;
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
}

.modal-header-fs {
    padding: 24px 40px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-main);
    backdrop-filter: blur(12px);
    z-index: 10;
}

.light .modal-header-fs {
    background: #ffffff;
}

.modal-header-fs h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    background: var(--border);
    color: var(--text-secondary);
    white-space: nowrap;
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.status-badge.executing {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.status-badge.review {
    background: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
}

.status-badge.done {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.modal-actions .modal-close-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.light .info-card {
    background: #ffffff;
    border-left-width: 6px;
}

.modal-actions .modal-close-btn:hover {
    background: var(--rose);
    border-color: var(--rose);
    color: white;
}

.modal-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.modal-sidebar-fs {
    width: 320px;
    border-right: 1px solid var(--border);
    padding: 32px;
    background: var(--bg-main);
}

.light .modal-sidebar-fs {
    background: #f8f9fa;
}

.modal-sidebar-fs h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 24px;
}

.modal-main-fs {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}



.timeline-item-h {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 25%;
}

.timeline-dot-h {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-main);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.3s;
}

.timeline-item-h.active .timeline-dot-h {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.timeline-item-h.done .timeline-dot-h {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.timeline-label-h {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-align: center;
}

.timeline-item-h.active .timeline-label-h {
    color: var(--text-primary);
}

/* Info Cards Right Sidebar */
.info-card-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.info-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.info-data label {
    display: block;
    font-size: 0.55rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 2px;
    letter-spacing: 0.05em;
}

.info-data span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.info-receipt-link {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--accent);
    color: var(--accent-text);
    padding: 12px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.8rem;
    transition: all 0.2s;
    justify-content: center;
}

.info-receipt-link:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* Tabs */
.modal-tabs {
    display: flex;
    padding: 0 40px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-main);
}

.light .modal-tabs {
    background: #ffffff;
}

.tab-item {
    padding: 20px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.tab-item:hover {
    color: var(--text-primary);
}

.tab-item.active {
    color: var(--text-primary);
}

.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
}

.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 40px;
}

.tab-content.active {
    display: block;
}

.badge-count {
    background: var(--rose);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 6px;
}

/* Briefing Grid */
.briefing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 32px;
}

.briefing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
}

.briefing-card-q {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}

.briefing-card-a {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.6;
    word-break: break-all;
}

.briefing-card-a a {
    color: var(--blue);
    text-decoration: underline;
}

/* Revision Chat Style - Matching Main Bot */
.rev-chat-container {
    max-width: 800px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
    position: relative;
}

.rev-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 32px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rev-chat-empty {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.rev-chat-input-wrapper {
    padding: 24px 0;
    border-top: 1px solid var(--border);
    background: var(--bg-main);
}

.rev-chat-input-group {
    display: flex;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 8px 8px 8px 16px;
    border-radius: 1rem;
    transition: border-color 0.2s;
    align-items: center;
}

.rev-chat-input-group input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
    font-size: 0.95rem;
}

.rev-chat-input-group button {
    background: var(--accent);
    color: #000;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.rev-chat-input-group button:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.rev-chat-input-group button svg {
    width: 18px;
    height: 18px;
}

/* Delivery */
.delivery-container {
    max-width: 900px;
    margin: 0 auto;
}

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

.delivery-header h3 {
    font-size: 1.25rem;
}

.delivery-btn-add {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.2s;
}

.delivery-btn-add:hover {
    background: rgba(255, 255, 255, 0.05);
}

.delivery-list {
    display: grid;
    gap: 16px;
}

.delivery-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: transform 0.2s;
}

.delivery-item:hover {
    transform: translateY(-2px);
    border-color: var(--text-muted);
}

.delivery-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.delivery-info {
    flex: 1;
}

.delivery-name {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

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

.delivery-download {
    color: var(--blue);
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
}

/* Cards */
.kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.kanban-card:hover {
    border-color: #3f3f46;
    transform: translateY(-2px);
}

.card-service {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: block;
}

.card-status-mini {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 8px;
    background: var(--border);
    color: var(--text-secondary);
}

.card-status-mini.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--amber);
}

.card-status-mini.executing {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue);
}

.card-status-mini.review {
    background: rgba(244, 63, 94, 0.1);
    color: var(--rose);
}

.card-status-mini.done {
    background: rgba(16, 185, 129, 0.1);
    color: var(--emerald);
}

.card-email {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

/* Formatting for modal items */
.briefing-item {
    margin-bottom: 24px;
}

.briefing-question {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.briefing-answer {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.5;
    background: rgba(255, 255, 255, 0.03);
    padding: 16px;
    border-radius: 12px;
    border-left: 3px solid var(--accent);
}

.light .briefing-answer {
    background: #f8f9fa;
    border-color: var(--accent);
}

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

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

#send-btn {
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.input-actions-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

#reset-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

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

.light #reset-btn:hover {
    background: rgba(0, 0, 0, 0.03);
}

#reset-btn svg {
    width: 18px;
    height: 18px;
}

#send-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

#send-btn svg {
    width: 18px;
    height: 18px;
}

/* Invoices Dashboard Enhancements */
.financial-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.stat-indicator {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-indicator.pending::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--amber);
}

.stat-indicator.paid::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--emerald);
}

.finance-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    gap: 20px;
}

.search-box-simple {
    flex: 1;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
}

.search-box-simple svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.search-box-simple input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 12px 0;
    outline: none;
    width: 100%;
}

.export-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.export-btn:hover {
    background: var(--bg-card);
    border-color: var(--text-muted);
}

/* Invoices View */
#view-invoices {
    padding: 40px;
    display: none;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
}

.invoice-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
    padding: 0 0 40px 0;
    flex: 1;
}

.column-header-simple {
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.column-header-simple h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.invoice-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.invoice-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 28px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.invoice-card:hover {
    border-color: var(--text-muted);
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.invoice-main-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.invoice-details .inv-service {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: block;
}

.invoice-details .inv-value {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.invoice-details .inv-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.invoice-actions {
    text-align: right;
}

.invoice-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    background: var(--border);
    color: var(--text-secondary);
}

.invoice-card:has(.pay-btn) .invoice-badge {
    background: rgba(245, 158, 11, 0.1);
    color: var(--amber);
}

.invoice-card:has(.nf-btn) .invoice-badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--emerald);
}

.pay-btn {
    background: var(--accent);
    color: var(--accent-text);
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    display: inline-block;
}

.nf-btn {
    background: transparent;
    border: 1px solid var(--emerald);
    color: var(--emerald);
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-block;
}

.nf-btn:hover {
    background: var(--emerald);
    color: white;
}

/* Authentication View */
#view-auth {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-main);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    padding: 24px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.4s ease-out;
}

.light .auth-card {
    background: #ffffff;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.1);
}

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

.auth-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 16px 0 8px;
    letter-spacing: -0.02em;
}

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

.input-group-auth {
    margin-bottom: 20px;
}

.input-group-auth label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.input-group-auth input {
    width: 100%;
    background: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.input-group-auth input:focus {
    border-color: var(--text-muted);
}

.auth-btn {
    width: 100%;
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 12px;
    transition: transform 0.2s, background 0.2s;
}

.auth-btn:hover {
    transform: scale(1.01);
    opacity: 0.9;
}

.auth-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    justify-content: center;
    gap: 8px;
}

.auth-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    color: var(--text-primary);
}

/* Modal (Full Screen Project Detail) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-container-fs {
    background: var(--bg-main);
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

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

.approve-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.approve-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

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

.modal-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.modal-main-fs {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
    overflow: hidden;
}

/* Unified Modal Header Content */
.modal-header-content-unified {
    display: flex;
    align-items: center;
    gap: 32px;
    flex: 1;
}

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

.header-main-titles h2 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.01em;
}

#modal-company-header {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--emerald);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 12px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 6px;
    white-space: nowrap;
}

.header-status-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    border-left: 1px solid var(--border);
    padding-left: 16px;
}

#modal-date-header {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.modal-sidebar-fs-right {
    width: 320px;
    padding: 30px;
    border-left: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.modal-tabs {
    display: flex;
    padding: 0 40px;
    border-bottom: 1px solid var(--border);
}

.tab-item {
    padding: 20px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-item.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
}

.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 40px;
}

.tab-content.active {
    display: block;
}

/* Horizontal Progress Bar */
.modal-horizontal-progress {
    padding: 12px 40px;
    background: rgba(255, 255, 255, 0.015);
    border-bottom: 1px solid var(--border);
}

.timeline-horizontal {
    display: flex;
    justify-content: space-between;
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline-horizontal::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: var(--border);
    z-index: 1;
}

.timeline-item-h {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.timeline-dot-h {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-card); /* Better visibility in dark mode */
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.3s;
}

.timeline-item-h.active .timeline-dot-h {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--bg-main);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

.timeline-item-h.done .timeline-dot-h {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.timeline-label-h {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-align: center;
}

.timeline-item-h.active .timeline-label-h {
    color: var(--text-primary);
}

.timeline-item-h.done .timeline-label-h {
    color: var(--text-secondary);
}


/* Revision Chat inside Modal */
.rev-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.rev-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rev-chat-input-wrapper {
    padding: 24px 40px;
    border-top: 1px solid var(--border);
}

.rev-chat-input-group {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    padding: 8px 8px 8px 24px;
    border-radius: 16px;
}

.rev-chat-input-group input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
    font-size: 0.9rem;
}

.rev-chat-input-group button {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.rev-chat-input-group button svg {
    width: 20px;
    height: 20px;
}

.rev-chat-input-group button:hover {
    transform: scale(1.05);
}

.rev-chat-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 40px;
}

/* Delivery Area */
.delivery-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.delivery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.delivery-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.delivery-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.delivery-item-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.delivery-item-info {
    flex: 1;
    overflow: hidden;
}

.delivery-item-name {
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.delivery-item-dl {
    color: var(--text-muted);
    transition: color 0.2s;
}

.delivery-item-dl:hover {
    color: var(--accent);
}