* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #0f172a;
  color: #f8fafc;
  font-family: "Montserrat", "Poppins", sans-serif;
  height: 100vh;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

#matrix-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  opacity: 0.15;
  pointer-events: none;
}

.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.auth-overlay .auth-card {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(12px);
  padding: 3rem 2rem;
  border-radius: 2px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.auth-overlay .auth-card .logo img {
  max-width: 150px;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 10px rgba(45, 156, 219, 0.3));
}
.auth-overlay .auth-card h2 {
  font-size: 1.2rem;
  color: #94a3b8;
  margin-bottom: 2rem;
  font-weight: 500;
}
.auth-overlay .auth-card input {
  width: 100%;
  padding: 0.85rem;
  margin-bottom: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  border-radius: 2px;
  font-family: "Montserrat", "Poppins", sans-serif;
}
.auth-overlay .auth-card input:focus {
  border-color: #2d9cdb;
  outline: none;
}
.auth-overlay .auth-card .captcha-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.auth-overlay .auth-card .captcha-group label {
  color: #ffd600;
  font-weight: 600;
  white-space: nowrap;
}
.auth-overlay .auth-card .captcha-group input {
  margin-bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.5rem;
  text-align: center;
}
.auth-overlay .auth-card .btn-primary {
  width: 100%;
  padding: 0.85rem;
  background: #2d9cdb;
  color: white;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  font-weight: 600;
  font-family: "Montserrat", "Poppins", sans-serif;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.auth-overlay .auth-card .btn-primary:hover {
  background: #207cae;
  box-shadow: 0 0 15px rgba(45, 156, 219, 0.4);
}
.auth-overlay .auth-card .error-msg {
  color: #ef4444;
  margin-top: 1rem;
  font-size: 0.875rem;
}
.app-wrapper {
  display: flex;
  height: 100vh;
}
.sidebar {
  width: 280px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}
.sidebar .sidebar-header {
  padding: 1.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.sidebar .sidebar-header .sidebar-logo {
  max-width: 120px;
  filter: drop-shadow(0 0 5px rgba(45, 156, 219, 0.2));
}
.sidebar .sidebar-header .btn-icon {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #94a3b8;
  cursor: pointer;
}
.sidebar .chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}
.sidebar .sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.sidebar .sidebar-footer .user-info {
  display: flex;
  justify-content: space-between;
  font-weight: 500;
}
.sidebar .sidebar-footer .btn-text {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-weight: 600;
}
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.chat-area .chat-header, .users-view .chat-header {
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
}
.chat-area .chat-header h3, .users-view .chat-header h3 {
  font-weight: 600;
}
.chat-area .chat-header .agent-status {
  font-size: 0.85rem;
  color: #0f172a;
  background: #2d9cdb;
  padding: 0.3rem 0.8rem;
  border-radius: 2px;
  font-weight: 600;
  box-shadow: 0 0 10px rgba(45, 156, 219, 0.3);
}
.chat-area .messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.chat-area .messages-container .message {
  display: flex;
  flex-direction: column;
  max-width: 75%;
  margin-bottom: 1.5rem;
  clear: both;
}
.chat-area .messages-container .message .content {
  padding: 1rem 1.5rem;
  border-radius: 2px;
  line-height: 1.6;
  word-wrap: break-word;
}
.chat-area .messages-container .message .content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.chat-area .messages-container .message .content table th,
.chat-area .messages-container .message .content table td {
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}
.chat-area .messages-container .message .content table th {
  background: rgba(45, 156, 219, 0.1);
  color: #2d9cdb;
  font-weight: 600;
}
.chat-area .messages-container .message .content table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}
.chat-area .messages-container .message.user {
  align-self: flex-end;
  margin-left: auto;
}
.chat-area .messages-container .message.user .content {
  background: #2d9cdb;
  color: white;
  border-bottom-right-radius: 4px;
}
.chat-area .messages-container .message.assistant {
  align-self: flex-start;
  margin-right: auto;
}
.chat-area .messages-container .message.assistant .content {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom-left-radius: 4px;
}
.chat-area .input-area {
  max-width: 800px;
  width: 100%;
  margin: 0 auto 2rem;
  padding: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(12px);
}
.chat-area .input-area form {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}
.chat-area .input-area textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: #f8fafc;
  resize: none;
  padding: 0.5rem;
  font-family: "Montserrat", "Poppins", sans-serif;
  max-height: 150px;
}
.chat-area .input-area textarea:focus {
  outline: none;
}
.chat-area .input-area .btn-icon {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.5rem;
  font-size: 1.2rem;
}
.chat-area .input-area .btn-primary {
  background: #2d9cdb;
  color: white;
  border: none;
  border-radius: 2px;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  font-weight: 600;
  font-family: "Montserrat", "Poppins", sans-serif;
  margin-bottom: 0.2rem;
  margin-right: 0.2rem;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.chat-area .input-area .btn-primary:hover {
  background: #207cae;
  box-shadow: 0 0 10px rgba(45, 156, 219, 0.4);
}

/* Model Selector Styles */
.header-actions { display: flex; align-items: center; gap: 15px; }
.model-select { background: rgba(255, 255, 255, 0.05); color: #f8f9fa; border: 1px solid rgba(255, 255, 255, 0.1);  border-radius: 2px;
  padding: 6px 12px;
  font-family: "Poppins", "Font Awesome 6 Free", sans-serif;
  font-size: 0.85rem;
  font-weight: 900; outline: none; cursor: pointer; transition: all 0.3s ease; appearance: none; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0aec0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; padding-right: 30px; }
.model-select:hover { background-color: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); }
.model-select:focus { border-color: #2d9cdb; box-shadow: 0 0 0 2px rgba(45, 156, 219, 0.2); }
.model-select option { background-color: #1e293b; color: #f8f9fa; }

.chat-area .messages-container .message.loading-bubble .content { background: transparent !important; border: none !important; color: #a0aec0; font-style: italic; display: flex; align-items: center; gap: 10px; padding: 0.5rem 1rem; }
.chat-area .messages-container .message.loading-bubble .content i { color: #2d9cdb; }

.chat-list { list-style: none; padding: 1rem; margin: 0; flex: 1; overflow-y: auto; }
.chat-list li { margin-bottom: 0.5rem; border-radius: 2px; }
.chat-list li a { display: flex; align-items: center; gap: 10px; padding: 0.75rem 1rem; color: #cbd5e1; text-decoration: none; border-radius: 2px; transition: background 0.2s, color 0.2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.9rem; }
.chat-list li a i { color: #64748b; }
.chat-list li:hover a { background: rgba(45, 156, 219, 0.1); color: #fff; }
.chat-list li:hover a i { color: #2d9cdb; }
.chat-list li.active a { background: rgba(45, 156, 219, 0.2); color: #fff; border-left: 3px solid #2d9cdb; border-radius: 0 6px 6px 0; }
.chat-list li.active a i { color: #2d9cdb; }

/* Sidebar chat list improvements */
.chat-list li a .chat-title-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}
.chat-list li.empty-state a {
    color: #475569;
    font-style: italic;
    cursor: default;
}
.chat-list li.empty-state:hover a {
    background: transparent;
    color: #475569;
}

/* Profile Menu & Chat Options UI */
.sidebar-footer { position: relative; }
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 8px;
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.2s;
}
.user-info:hover { background: rgba(255,255,255,0.05); }
.user-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #8b5cf6, #d946ef);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 0.9rem; color: white;
}
.user-details { display: flex; flex-direction: column; flex: 1; }
.user-details #display-user { font-size: 0.9rem; font-weight: 600; color: #f8fafc; }
.user-details .user-plan { font-size: 0.75rem; color: #94a3b8; }

.profile-menu-popup {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 10px; right: 10px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 2px;
    padding: 8px 0;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 100;
}
.profile-menu-popup.hidden { display: none; }
.profile-menu-header {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 16px 12px;
    border-bottom: 1px solid #334155;
    margin-bottom: 8px;
}
.profile-menu-list { list-style: none; padding: 0; margin: 0; }
.profile-menu-list li a {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 16px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}
.profile-menu-list li a:hover { background: rgba(255,255,255,0.05); color: white; }
.profile-menu-list li.separator { height: 1px; background: #334155; margin: 8px 0; }
.profile-menu-list li.divider { height: 1px; background: #334155; margin: 8px 0; }
.profile-menu-list li a#btn-logout { color: #ef4444; }
.profile-menu-list li a#btn-logout:hover { background: rgba(239,68,68,0.1); }

/* Chat Item Options */
.chat-list li { position: relative; }
.chat-list li .chat-options-btn {
    position: absolute;
    right: 10px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none; color: #94a3b8;
    padding: 5px; cursor: pointer;
    border-radius: 2px;
    opacity: 0; transition: opacity 0.2s;
}
.chat-list li:hover .chat-options-btn { opacity: 1; }
.chat-list li .chat-options-btn:hover { color: white; background: rgba(255,255,255,0.1); }

.chat-options-menu {
    position: absolute;
    top: 100%; right: 10px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 2px;
    padding: 4px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    z-index: 50;
    min-width: 150px;
}
.chat-options-menu.hidden { display: none; }
.chat-options-menu ul { list-style: none; padding: 0; margin: 0; }
.chat-options-menu li a {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.85rem;
}
.chat-options-menu li a:hover { background: rgba(255,255,255,0.05); color: white; }
.chat-options-menu li a.delete-chat { color: #ef4444; }
.chat-options-menu li a.delete-chat:hover { background: rgba(239,68,68,0.1); }
/* Users Management Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}
.modal-overlay.hidden { display: none; }
.modal-content {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 2px;
    width: 90%; max-width: 800px;
    max-height: 90vh;
    display: flex; flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}
.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #334155;
    display: flex; justify-content: space-between; align-items: center;
}
.modal-header h2 { font-size: 1.25rem; font-weight: 600; margin: 0; }
.btn-close-modal {
    background: none; border: none; color: #94a3b8; font-size: 1.2rem; cursor: pointer; transition: color 0.2s;
}
.btn-close-modal:hover { color: #ef4444; }
.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}
.modal-actions { margin-bottom: 1.5rem; display: flex; justify-content: flex-end; }
.form-panel {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid #334155;
    border-radius: 2px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.form-panel h3 { margin-top: 0; margin-bottom: 1rem; font-size: 1.1rem; }
.form-group { display: flex; gap: 1rem; margin-bottom: 1rem; }
.form-group input, .form-group select {
    flex: 1;
    background: #0f172a;
    border: 1px solid #334155;
    color: white;
    padding: 0.75rem;
    border-radius: 2px;
}
.form-actions { display: flex; gap: 1rem; }
.btn-secondary {
    background: #334155; color: white; border: none; padding: 0.75rem 1.5rem; border-radius: 2px; cursor: pointer; transition: background 0.2s;
}
.btn-secondary:hover { background: #475569; }

/* Data Table */
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    padding: 1rem; text-align: left; border-bottom: 1px solid #334155;
}
.data-table th { font-weight: 600; color: #94a3b8; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.data-table .role-select {
    background: #0f172a; border: 1px solid #334155; color: white; padding: 0.25rem 0.5rem; border-radius: 2px;
}

/* Toggle Switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #334155; transition: .4s; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; }
input:checked + .slider { background-color: #2d9cdb; }
input:checked + .slider:before { transform: translateX(20px); }
.slider.round { border-radius: 2px; }
.slider.round:before { border-radius: 50%; }

.users-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(30, 41, 59, 0.4);
    margin: 2rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}
.users-view.hidden { display: none !important; }
.users-content {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}
.btn-primary { background: #2d9cdb; color: white; border: none; border-radius: 2px; padding: 0.6rem 1.2rem; cursor: pointer; font-weight: 600; font-family: Montserrat, Poppins, sans-serif; transition: background 0.2s ease, box-shadow 0.2s ease; }
.btn-primary:hover { background: #207cae; box-shadow: 0 0 10px rgba(45, 156, 219, 0.4); }
.btn-secondary { background: #334155; color: white; border: none; border-radius: 2px; padding: 0.6rem 1.2rem; cursor: pointer; font-weight: 600; font-family: Montserrat, Poppins, sans-serif; transition: background 0.2s ease; }
.btn-secondary:hover { background: #475569; }

/* Typing Indicator */
.typing-indicator { display: flex; align-items: center; gap: 4px; height: 20px; }
.typing-indicator span { width: 6px; height: 6px; background-color: #94a3b8; border-radius: 50%; animation: typing 1s infinite ease-in-out; }
.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* Chat List Improvements */
.chat-list li { position: relative; padding-right: 35px !important; }
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.2s;
}
.user-info:hover { background: rgba(255,255,255,0.05); }
.user-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #8b5cf6, #d946ef);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 0.9rem; color: white;
}
.user-details { display: flex; flex-direction: column; flex: 1; }
.user-details #display-user { font-size: 0.9rem; font-weight: 600; color: #f8fafc; }
.user-details .user-plan { font-size: 0.75rem; color: #94a3b8; }

.profile-menu-popup {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 10px; right: 10px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 2px;
    padding: 8px 0;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 100;
}
.profile-menu-popup.hidden { display: none; }
.profile-menu-header {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 16px 12px;
    border-bottom: 1px solid #334155;
    margin-bottom: 8px;
}
.profile-menu-list { list-style: none; padding: 0; margin: 0; }
.profile-menu-list li a {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 16px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}
.profile-menu-list li a:hover { background: rgba(255,255,255,0.05); color: white; }
.profile-menu-list li.separator { height: 1px; background: #334155; margin: 8px 0; }
.profile-menu-list li.divider { height: 1px; background: #334155; margin: 8px 0; }
.profile-menu-list li a#btn-logout { color: #ef4444; }
.profile-menu-list li a#btn-logout:hover { background: rgba(239,68,68,0.1); }

/* Chat Item Options */
.chat-list li { position: relative; }
.chat-list li .chat-options-btn {
    position: absolute;
    right: 10px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none; color: #94a3b8;
    padding: 5px; cursor: pointer;
    border-radius: 2px;
    opacity: 0; transition: opacity 0.2s;
}
.chat-list li:hover .chat-options-btn { opacity: 1; }
.chat-list li .chat-options-btn:hover { color: white; background: rgba(255,255,255,0.1); }

.chat-options-menu {
    position: absolute;
    top: 100%; right: 10px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 2px;
    padding: 4px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    z-index: 50;
    min-width: 150px;
}
.chat-options-menu.hidden { display: none; }
.chat-options-menu ul { list-style: none; padding: 0; margin: 0; }
.chat-options-menu li a {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.85rem;
}
.chat-options-menu li a:hover { background: rgba(255,255,255,0.05); color: white; }
.chat-options-menu li a.delete-chat { color: #ef4444; }
.chat-options-menu li a.delete-chat:hover { background: rgba(239,68,68,0.1); }
/* Users Management Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}
.modal-overlay.hidden { display: none; }
.modal-content {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 2px;
    width: 90%; max-width: 800px;
    max-height: 90vh;
    display: flex; flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}
.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #334155;
    display: flex; justify-content: space-between; align-items: center;
}
.modal-header h2 { font-size: 1.25rem; font-weight: 600; margin: 0; }
.btn-close-modal {
    background: none; border: none; color: #94a3b8; font-size: 1.2rem; cursor: pointer; transition: color 0.2s;
}
.btn-close-modal:hover { color: #ef4444; }
.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}
.modal-actions { margin-bottom: 1.5rem; display: flex; justify-content: flex-end; }
.form-panel {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid #334155;
    border-radius: 2px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.form-panel h3 { margin-top: 0; margin-bottom: 1rem; font-size: 1.1rem; }
.form-group { display: flex; gap: 1rem; margin-bottom: 1rem; }
.form-group input, .form-group select {
    flex: 1;
    background: #0f172a;
    border: 1px solid #334155;
    color: white;
    padding: 0.75rem;
    border-radius: 2px;
}
.form-actions { display: flex; gap: 1rem; }
.btn-secondary {
    background: #334155; color: white; border: none; padding: 0.75rem 1.5rem; border-radius: 2px; cursor: pointer; transition: background 0.2s;
}
.btn-secondary:hover { background: #475569; }

/* Data Table */
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    padding: 1rem; text-align: left; border-bottom: 1px solid #334155;
}
.data-table th { font-weight: 600; color: #94a3b8; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.data-table .role-select {
    background: #0f172a; border: 1px solid #334155; color: white; padding: 0.25rem 0.5rem; border-radius: 2px;
}

/* Toggle Switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #334155; transition: .4s; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; }
input:checked + .slider { background-color: #2d9cdb; }
input:checked + .slider:before { transform: translateX(20px); }
.slider.round { border-radius: 2px; }
.slider.round:before { border-radius: 50%; }

.users-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(30, 41, 59, 0.4);
    margin: 2rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}
.users-view.hidden { display: none !important; }
.users-content {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}
.btn-primary { background: #2d9cdb; color: white; border: none; border-radius: 2px; padding: 0.6rem 1.2rem; cursor: pointer; font-weight: 600; font-family: Montserrat, Poppins, sans-serif; transition: background 0.2s ease, box-shadow 0.2s ease; }
.btn-primary:hover { background: #207cae; box-shadow: 0 0 10px rgba(45, 156, 219, 0.4); }
.btn-secondary { background: #334155; color: white; border: none; border-radius: 2px; padding: 0.6rem 1.2rem; cursor: pointer; font-weight: 600; font-family: Montserrat, Poppins, sans-serif; transition: background 0.2s ease; }
.btn-secondary:hover { background: #475569; }

/* Typing Indicator */
.typing-indicator { display: flex; align-items: center; gap: 4px; height: 20px; }
.typing-indicator span { width: 6px; height: 6px; background-color: #94a3b8; border-radius: 50%; animation: typing 1s infinite ease-in-out; }
.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* Chat List Improvements */
.chat-list li { position: relative; padding-right: 35px !important; }
.chat-list li .chat-link { display: flex; align-items: center; width: 100%; overflow: hidden; }
.chat-title-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; max-width: 140px; margin-left: 8px; }
.chat-options-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); opacity: 0.7; background: none; border: none; color: #94a3b8; cursor: pointer; }
.chat-options-btn:hover { color: white; opacity: 1; }

/* Better spacing between chat bubbles */
.chat-area .messages-container .message { margin-bottom: 2rem !important; }

/* Token Usage */
.token-usage {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 0.4rem;
}
.token-usage i { color: #f59e0b; }

/* Softer Link Colors */
.content a {
    color: #60a5fa;
    text-decoration: none;
    border-bottom: 1px dotted #60a5fa;
    transition: all 0.2s;
}
.content a:hover {
    color: #93c5fd;
    border-bottom: 1px solid #93c5fd;
}

/* Approval Box for Shell Commands */
.approval-box {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid #f59e0b;
    border-radius: 4px;
    padding: 1rem;
    margin-top: 1rem;
}
.approval-box p {
    color: #fcd34d;
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.approval-box pre {
    background: #000;
    color: #10b981;
    padding: 0.75rem;
    border-radius: 2px;
    overflow-x: auto;
    margin-bottom: 1rem;
    font-family: monospace;
}
.approval-actions {
    display: flex;
    gap: 1rem;
}
.btn-approve {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 2px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}
.btn-approve:hover { background: #059669; }
.btn-deny {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 2px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}
.btn-deny:hover { background: #dc2626; }

/* User Admin Panel Improvements */
.users-view {
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.6) !important;
    border: 1px solid rgba(45, 156, 219, 0.15) !important;
}
.users-view .chat-header {
    background: linear-gradient(90deg, rgba(15,23,42,0.8), rgba(30,41,59,0.8)) !important;
    border-bottom: 1px solid rgba(45, 156, 219, 0.2) !important;
}
.data-table tr { transition: background 0.2s; }
.data-table tr:hover { background: rgba(255,255,255,0.02); }
.data-table td { vertical-align: middle; }
.data-table .btn-icon {
    width: 32px; height: 32px; border-radius: 50%;
    display: inline-flex; justify-content: center; align-items: center;
    transition: all 0.2s; background: rgba(255,255,255,0.05);
    margin-right: 4px; border: none; color: #cbd5e1; cursor: pointer;
}
.data-table .btn-icon:hover { transform: scale(1.1); background: rgba(45,156,219,0.2); color: white; }
.data-table .btn-delete-user:hover { background: rgba(239,68,68,0.2) !important; color: #ef4444 !important; }
/* Live Terminal */
.live-terminal {
    background: #0f172a !important;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 0 !important;
    overflow: hidden;
}
.live-terminal .content {
    padding: 0 !important;
}
.live-terminal .term-header {
    background: #1e293b;
    padding: 0.5rem 1rem;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.live-terminal .terminal-output {
    margin: 0;
    padding: 1rem;
    background: #000;
    color: #22c55e;
    font-family: 'Consolas', monospace;
    font-size: 0.85rem;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
}
.live-terminal .btn-cancel-process {
    width: 100%;
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    border-top: 1px solid #7f1d1d;
}
.live-terminal .btn-cancel-process:hover {
    background: #dc2626;
}
.live-terminal .btn-cancel-process:disabled {
    background: #7f1d1d;
    cursor: not-allowed;
}

.staged-files-container {
    display: flex;
    gap: 10px;
    padding: 0;
    overflow-x: auto;
    margin-bottom: 0;
}
.staged-files-container:not(:empty) {
    padding: 10px 10px 0 10px;
    margin-bottom: 10px;
}
.staged-file-item {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 5px;
    min-width: 80px;
    max-width: 80px;
    text-align: center;
    flex-shrink: 0;
}
.staged-file-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 5px;
}
.staged-file-item i.fa-file-lines {
    font-size: 2rem;
    color: #38bdf8;
    margin: 15px 0;
    display: block;
}
.staged-file-item .file-name {
    font-size: 0.65rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #cbd5e1;
}
.staged-file-item .remove-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.staged-file-item .remove-btn:hover {
    background: #dc2626;
}
.staged-file-item .spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    color: #38bdf8;
    animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: translate(-50%, -50%) rotate(360deg); } }

.code-block-wrapper {
    position: relative;
    background: #1e1e1e;
    border-radius: 8px;
    margin: 15px 0;
    overflow: hidden;
    border: 1px solid #333;
}
.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #2d2d2d;
    border-bottom: 1px solid #333;
}
.code-lang {
    color: #a0a0a0;
    font-size: 0.85em;
    text-transform: uppercase;
}
.btn-copy {
    background: transparent;
    border: 1px solid #555;
    color: #ddd;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s;
}
.btn-copy:hover {
    background: #444;
    color: #fff;
}
.code-block-wrapper pre {
    margin: 0;
    padding: 15px;
    overflow-x: auto;
}
.code-block-wrapper code {
    font-family: 'Consolas', monospace;
    font-size: 0.9em;
    color: #d4d4d4;
}
