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

:root {
    --primary: #2f81f7;
    --primary-hover: #58a6ff;
    --bg-auth: #0d1117;
    --bg-main: #0d1117;
    --sidebar-bg: #010409;
    --sidebar-text: #8b949e;
    --sidebar-active: #2f81f7;
    --text-dark: #f0f6fc;
    --text-muted: #8b949e;
    --card-bg: #161b22;
    --card-border: #30363d;
    --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.light-mode {
    --bg-auth: #ffffff;
    --bg-main: #f6f8fa;
    --sidebar-bg: #ffffff;
    --sidebar-text: #57606a;
    --sidebar-active: #0969da;
    --text-dark: #1f2328;
    --text-muted: #656d76;
    --card-bg: #ffffff;
    --card-border: #d0d7de;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --primary: #0969da;
    --primary-hover: #0a75ef;
}

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

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-dark);
    line-height: 1.5;
    background-color: var(--bg-main);
    transition: background-color 0.3s, color 0.3s;
}

/* Auth Layout */
.auth-page {
    background-color: var(--bg-auth);
    overflow: hidden;
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.auth-top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-dark);
    font-weight: 700;
    margin-bottom: 4rem;
}

.auth-logo-text {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
}

.auth-top-icon {
    color: var(--text-muted);
    cursor: pointer;
}

.auth-main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4rem;
}

.login-card {
    background: #111827;
    border: 1px solid var(--card-border);
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

.login-header h2 {
     font-size: 1.5rem;
     color: white;
     margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 2rem;
}

.form-group-login {
    margin-bottom: 1.5rem;
}

.form-group-login label {
    display: block;
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-with-icon input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: #0d1117;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    outline: none;
}

.btn-login {
    width: 100%;
    padding: 0.85rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-login:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.magic-link-notice {
    margin-top: 2rem;
    background: rgba(47, 129, 247, 0.05);
    border: 1px solid rgba(47, 129, 247, 0.1);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    gap: 0.75rem;
}

.notice-icon {
    color: var(--primary);
    font-size: 0.8rem;
    margin-top: 2px;
}

.magic-link-notice p {
    font-size: 0.75rem;
    color: #8b949e;
    line-height: 1.5;
}

.auth-bottom-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.methodology {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
}

.page-indicators {
    display: flex;
    gap: 0.5rem;
}

.dot {
    width: 12px;
    height: 12px;
    background: #30363d;
    border-radius: 2px;
}

.dot.active {
    background: #8b949e;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dark);
}

.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    background-color: #0d1117;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    color: var(--text-dark);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(198, 166, 103, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 0.875rem;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: var(--transition);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.auth-footer {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

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

/* Main Layout */
.layout-main {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-main);
}

.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-brand h3 {
    font-size: 0.9rem;
    font-weight: 700;
}

.sidebar-logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

.sidebar-menu {
    flex: 1;
    padding: 1rem 0.75rem;
}

.menu-label {
    padding: 1.5rem 0.75rem 0.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sidebar-text);
    font-weight: 600;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 0.25rem;
    transition: var(--transition);
    font-size: 0.85rem;
}

.menu-item i {
    font-size: 1.1rem;
    width: 20px;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #f0f6fc;
}

.menu-item.active {
    background: rgba(47, 129, 247, 0.1);
    color: var(--primary);
    font-weight: 500;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: #30363d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f0f6fc;
    font-weight: 600;
}

.user-info p {
    font-size: 0.8rem;
    font-weight: 500;
    color: #f0f6fc;
}

.user-info span {
    font-size: 0.7rem;
    color: var(--sidebar-text);
}

/* Main Content area */
.main-content {
    flex: 1;
    margin-left: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-header {
    height: 72px;
    background-color: var(--sidebar-bg);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

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

.top-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link:hover {
    color: var(--text-dark);
}

.nav-link.active {
    color: var(--primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

.search-bar {
    flex: 1;
    max-width: 600px;
    position: relative;
    margin: 0 2rem;
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-bar input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    background: var(--bg-main);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    color: var(--text-dark);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
}

.search-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(47, 129, 247, 0.1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-btn {
    background: #21262d;
    color: #c9d1d9;
    border: 1px solid var(--card-border);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.header-btn:hover {
    background: #30363d;
    border-color: #8b949e;
}

.header-icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

.header-icon-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #f0f6fc;
}

.user-profile img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--card-border);
}

.content-wrapper {
    padding: 2.5rem;
    flex: 1;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
}

.page-title p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.btn-action {
    padding: 0.6rem 1.25rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--card-border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--card-border);
    font-size: 0.9rem;
    color: var(--text-dark);
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { 
    background: rgba(63, 185, 80, 0.15); 
    color: #3fb950; 
    border: 1px solid rgba(63, 185, 80, 0.3); 
}
.badge-danger { 
    background: rgba(248, 81, 73, 0.15); 
    color: #f85149; 
    border: 1px solid rgba(248, 81, 73, 0.3); 
}

.status-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Chat Panel and Three Column Layout */
.main-layout-horizontal {
    display: flex;
    flex: 1;
    overflow: hidden;
    background-color: var(--bg-main);
}

.chat-panel {
    width: 350px;
    background-color: var(--sidebar-bg);
    border-left: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px);
    position: sticky;
    top: 64px;
}

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

.chat-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.9rem;
}

.chat-title i {
    color: var(--primary);
}

.close-chat {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-message {
    max-width: 90%;
    padding: 0.85rem;
    border-radius: 12px;
    position: relative;
    font-size: 0.8rem;
    line-height: 1.4;
}

.chat-message.bot {
    background: #161b22;
    color: var(--text-dark);
    border: 1px solid var(--card-border);
    align-self: flex-start;
}

.chat-message.user {
    background: #054080;
    color: white;
    align-self: flex-end;
}

.chat-message .time {
    display: block;
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

.chat-footer {
    padding: 1rem;
    border-top: 1px solid var(--card-border);
}

.chat-input-wrapper {
    background: #0d1117;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.chat-input-wrapper textarea {
    background: none;
    border: none;
    resize: none;
    color: var(--text-dark);
    font-family: inherit;
    font-size: 0.8rem;
    outline: none;
    height: 50px;
}

.send-btn {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.ai-status {
    display: block;
    text-align: center;
    font-size: 0.55rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.collapse-panel-btn {
    width: 100%;
    background: #21262d;
    color: #c9d1d9;
    border: 1px solid var(--card-border);
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    cursor: pointer;
}
