/* DARKNET CRM - Darknet Aesthetic CSS */

:root {
  /* Colors */
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-tertiary: #1a1a1a;
  --bg-card: #141414;
  --bg-hover: #1f1f1f;
  
  --text-primary: #e0e0e0;
  --text-secondary: #808080;
  --text-muted: #555555;
  
  --accent-green: #00ff41;
  --accent-red: #ff0040;
  --accent-blue: #00d4ff;
  --accent-yellow: #ffcc00;
  --accent-orange: #ff6b00;
  --accent-purple: #9d00ff;
  
  --border-color: #2a2a2a;
  --border-glow: rgba(0, 255, 65, 0.3);
  
  /* Fonts */
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Sizes */
  --radius: 4px;
}

/* Custom Scrollbar - apply to all elements */
*::-webkit-scrollbar,
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track,
::-webkit-scrollbar-track {
  background: #1a1a1a;
  border-radius: 3px;
}

*::-webkit-scrollbar-thumb,
::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover,
::-webkit-scrollbar-thumb:hover {
  background: #00ff41;
}

*::-webkit-scrollbar-corner,
::-webkit-scrollbar-corner {
  background: #1a1a1a;
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: #333 #1a1a1a;
}

/* Hide number input spinners (arrows) */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
  background: transparent;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Variables */
:root {
  --radius-lg: 8px;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Base */
html, body {
  height: 100%;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
}

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
  z-index: 9999;
}

/* Scanlines */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.1) 0px,
    rgba(0, 0, 0, 0.1) 1px,
    transparent 1px,
    transparent 2px
  );
  z-index: 9998;
}

/* Layout */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.logo {
  font-size: 16px;
  font-weight: bold;
  color: var(--accent-green);
  text-transform: uppercase;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo::before {
  content: '▓▓▓';
  font-size: 12px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--bg-hover);
  color: var(--accent-green);
  border-left-color: var(--accent-green);
}

.nav-item-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.nav-badge {
  background: var(--accent-red);
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: auto;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-muted);
}

.main {
  flex: 1;
  margin-left: 240px;
  padding: 24px;
  min-height: 100vh;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.header-title {
  font-size: 24px;
  font-weight: normal;
  color: var(--text-primary);
}

.header-title::before {
  content: '> ';
  color: var(--accent-green);
}

.header-actions {
  display: flex;
  gap: 12px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.card-title::before {
  content: '> ';
  color: var(--accent-green);
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.page-header h1::before {
  content: '> ';
  color: var(--accent-green);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-green);
}

.stat-card.red::before { background: var(--accent-red); }
.stat-card.blue::before { background: var(--accent-blue); }
.stat-card.yellow::before { background: var(--accent-yellow); }

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: bold;
  color: var(--text-primary);
}

.stat-change {
  font-size: 12px;
  color: var(--accent-green);
  margin-top: 4px;
}

.stat-change.negative {
  color: var(--accent-red);
}

/* Tables */
.table-container {
  overflow-x: auto;
}

table,
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table {
  margin: 0;
}

th, td,
.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th,
.data-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: normal;
  background: var(--bg-tertiary);
}

tr:hover,
.data-table tr:hover {
  background: var(--bg-hover);
}

.data-table tbody tr:hover {
  background: var(--bg-hover);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state h2 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.empty-state p {
  margin: 0;
  font-size: 14px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent-green);
  box-shadow: 0 0 10px var(--border-glow);
}

.btn-primary {
  background: var(--accent-green);
  color: var(--bg-primary);
  border-color: var(--accent-green);
}

.btn-primary:hover {
  background: #00cc33;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.4);
}

.btn-danger {
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.btn-danger:hover {
  background: var(--accent-red);
  color: var(--bg-primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Inputs */
.input, .select, .textarea,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  transition: all 0.2s;
}

.input:focus, .select:focus, .textarea:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: 0 0 10px var(--border-glow);
}

.input::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

/* Labels */
label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Select styling */
select, 
select.input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300ff41' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

select option {
  background: #1a1a1a;
  color: #e0e0e0;
  padding: 8px;
}

/* Terminal input style */
.input-terminal {
  position: relative;
}

.input-terminal::before {
  content: '>';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-green);
}

.input-terminal .input {
  padding-left: 32px;
}

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: var(--radius);
  border: 1px solid;
}

.badge-green { color: var(--accent-green); border-color: var(--accent-green); background: rgba(0, 255, 65, 0.1); }
.badge-red { color: var(--accent-red); border-color: var(--accent-red); background: rgba(255, 0, 64, 0.1); }
.badge-blue { color: var(--accent-blue); border-color: var(--accent-blue); background: rgba(0, 212, 255, 0.1); }
.badge-yellow { color: var(--accent-yellow); border-color: var(--accent-yellow); background: rgba(255, 204, 0, 0.1); }
.badge-gray { color: var(--text-muted); border-color: var(--border-color); background: rgba(85, 85, 85, 0.1); }

/* Status badges */
.badge-created { color: var(--accent-yellow); border-color: var(--accent-yellow); background: rgba(255, 204, 0, 0.1); }
.badge-assigned_curator { color: var(--accent-blue); border-color: var(--accent-blue); background: rgba(0, 212, 255, 0.1); }
.badge-assigned_warehouse { color: var(--accent-purple); border-color: var(--accent-purple); background: rgba(157, 0, 255, 0.1); }
.badge-splitting { color: var(--accent-orange); border-color: var(--accent-orange); background: rgba(255, 107, 0, 0.1); }
.badge-on_review { color: var(--accent-yellow); border-color: var(--accent-yellow); background: rgba(255, 204, 0, 0.1); }
.badge-approved { color: var(--accent-green); border-color: var(--accent-green); background: rgba(0, 255, 65, 0.1); }
.badge-rejected { color: var(--accent-red); border-color: var(--accent-red); background: rgba(255, 0, 64, 0.1); }
.badge-in_progress { color: var(--accent-blue); border-color: var(--accent-blue); background: rgba(0, 212, 255, 0.1); }
.badge-completed { color: var(--accent-green); border-color: var(--accent-green); background: rgba(0, 255, 65, 0.1); }
.badge-active { color: var(--accent-green); border-color: var(--accent-green); background: rgba(0, 255, 65, 0.1); }
.badge-partial { color: var(--accent-orange); border-color: var(--accent-orange); background: rgba(255, 107, 0, 0.1); }
.badge-cancelled { color: var(--accent-red); border-color: var(--accent-red); background: rgba(255, 0, 64, 0.1); }
.badge-placed { color: var(--accent-blue); border-color: var(--accent-blue); background: rgba(0, 212, 255, 0.1); }
.badge-published { color: var(--accent-green); border-color: var(--accent-green); background: rgba(0, 255, 65, 0.1); }
.badge-pending { color: var(--accent-yellow); border-color: var(--accent-yellow); background: rgba(255, 204, 0, 0.1); }
.badge-busy { color: var(--accent-orange); border-color: var(--accent-orange); background: rgba(255, 107, 0, 0.1); }
.badge-blocked { color: var(--accent-red); border-color: var(--accent-red); background: rgba(255, 0, 64, 0.1); }
.badge-training { color: var(--accent-purple); border-color: var(--accent-purple); background: rgba(157, 0, 255, 0.1); }
.badge-inactive { color: var(--text-muted); border-color: var(--border-color); background: rgba(85, 85, 85, 0.1); }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-text:last-child {
  width: 60%;
}

/* Glitch effect */
.glitch {
  position: relative;
}

.glitch:hover::before,
.glitch:hover::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch:hover::before {
  animation: glitch-1 0.3s infinite;
  color: var(--accent-red);
  z-index: -1;
}

.glitch:hover::after {
  animation: glitch-2 0.3s infinite;
  color: var(--accent-blue);
  z-index: -2;
}

@keyframes glitch-1 {
  0%, 100% { clip-path: inset(0 0 0 0); transform: translate(0); }
  20% { clip-path: inset(20% 0 60% 0); transform: translate(-2px, 2px); }
  40% { clip-path: inset(40% 0 40% 0); transform: translate(2px, -2px); }
  60% { clip-path: inset(60% 0 20% 0); transform: translate(-2px, 2px); }
  80% { clip-path: inset(80% 0 0 0); transform: translate(2px, -2px); }
}

@keyframes glitch-2 {
  0%, 100% { clip-path: inset(0 0 0 0); transform: translate(0); }
  20% { clip-path: inset(80% 0 0 0); transform: translate(2px, -2px); }
  40% { clip-path: inset(60% 0 20% 0); transform: translate(-2px, 2px); }
  60% { clip-path: inset(40% 0 40% 0); transform: translate(2px, -2px); }
  80% { clip-path: inset(20% 0 60% 0); transform: translate(-2px, 2px); }
}

/* Fade animations */
.fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Progress bar */
.progress {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent-green);
  transition: width 0.3s;
}

.progress-bar.red { background: var(--accent-red); }
.progress-bar.yellow { background: var(--accent-yellow); }

/* Chat */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
}

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

.chat-message {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-tertiary);
}

.chat-message.outgoing {
  align-self: flex-end;
  background: var(--accent-green);
  color: var(--bg-primary);
}

.chat-message-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

.chat-input {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--border-color);
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 16px 24px;
  background: var(--bg-card);
  border: 1px solid var(--accent-green);
  border-radius: var(--radius);
  box-shadow: 0 0 20px var(--border-glow);
  animation: slideIn 0.3s ease-out;
  z-index: 1000;
}

.toast.error {
  border-color: var(--accent-red);
  box-shadow: 0 0 20px rgba(255, 0, 64, 0.3);
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* Modal styles - works with .modal-overlay wrapper or standalone .modal.active */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

/* When modal is inside modal-overlay, it should be visible and not fixed */
.modal-overlay .modal {
  display: block;
  position: relative;
  top: auto;
  left: auto;
  width: auto;
  height: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 500px;
  min-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.3s ease-out;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--text-primary);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  transition: color 0.2s;
}

.close-btn:hover {
  color: var(--accent-red);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 24px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
  line-height: 1;
}
.modal-close:hover {
  background: rgba(255, 0, 64, 0.2);
  color: var(--accent-red);
}

/* Online indicator */
.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 255, 65, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(0, 255, 65, 0); }
}

@keyframes pulse-danger {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(255, 59, 48, 0); }
}

.stat-card.urgent {
  border-color: var(--accent-red) !important;
  animation: pulse-danger 2s infinite;
}

/* Cursor blink */
.cursor-blink::after {
  content: '█';
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Login page */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-title {
  font-size: 24px;
  color: var(--accent-green);
  margin-bottom: 8px;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 12px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-error {
  color: var(--accent-red);
  font-size: 12px;
  margin-top: 8px;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
}

.alert-error {
  background: rgba(255, 0, 64, 0.1);
  border: 1px solid var(--accent-red);
  color: var(--accent-red);
}

.alert-success {
  background: rgba(0, 255, 65, 0.1);
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
}

.alert-warning {
  background: rgba(255, 204, 0, 0.1);
  border: 1px solid var(--accent-yellow);
  color: var(--accent-yellow);
}

.alert-info {
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid var(--accent-blue);
  color: var(--accent-blue);
}

/* DEV Switcher */
.dev-switcher {
  padding: 12px;
  margin: 8px;
  background: linear-gradient(135deg, rgba(157, 0, 255, 0.15), rgba(0, 212, 255, 0.15));
  border: 1px dashed var(--accent-purple);
  border-radius: var(--radius);
}

.dev-switcher-label {
  font-size: 10px;
  color: var(--accent-purple);
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.dev-switcher-buttons {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.dev-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: bold;
  text-decoration: none;
  transition: all 0.15s ease;
}

.dev-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

.dev-btn.active {
  background: var(--accent-green);
  color: var(--bg-primary);
  border-color: var(--accent-green);
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

/* ============ CHAT SYSTEM ============ */

.chat-layout {
  display: flex;
  height: calc(100vh - 120px);
  gap: 0;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Chat Sidebar */
.chat-sidebar {
  width: 300px;
  min-width: 300px;
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

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

.chat-sidebar-header h3 {
  margin: 0;
  font-size: 14px;
  color: var(--text-primary);
}

.chat-search {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

.chat-search .input {
  width: 100%;
  background: var(--bg-tertiary);
}

/* Folders */
.chat-folders {
  padding: 8px;
  border-bottom: 1px solid var(--border-color);
  max-height: 150px;
  overflow-y: auto;
}

.chat-folder {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}

.chat-folder:hover {
  background: var(--bg-hover);
}

.chat-folder.active {
  background: var(--bg-tertiary);
  color: var(--accent-green);
}

.folder-icon {
  font-size: 14px;
}

.folder-name {
  flex: 1;
  font-size: 13px;
}

.folder-count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 10px;
}

/* Chat List */
.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.chat-list-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.chat-item:hover {
  background: var(--bg-hover);
}

.chat-item.active {
  background: var(--bg-tertiary);
  border-left: 2px solid var(--accent-green);
}

.chat-item-icon {
  font-size: 20px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 50%;
}

.chat-item-info {
  flex: 1;
  min-width: 0;
}

.chat-item-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item-preview {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-unread {
  background: var(--accent-green);
  color: var(--bg-primary);
  font-size: 11px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.chat-sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 8px;
}

/* Chat Window */
.chat-window {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  min-height: 0;
  overflow: hidden;
}

.chat-window-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.chat-window-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* Chat Header */
.chat-header {
  padding: 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.chat-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-header-name {
  font-size: 14px;
  font-weight: 600;
}

.chat-header-status {
  font-size: 12px;
  color: var(--text-muted);
}

.chat-header-actions {
  display: flex;
  gap: 8px;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.chat-messages-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.chat-date-divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  padding: 8px 0;
  position: relative;
}

.chat-date-divider::before,
.chat-date-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: var(--border-color);
}

.chat-date-divider::before { left: 0; }
.chat-date-divider::after { right: 0; }

/* Message */
.chat-message {
  max-width: 70%;
  padding: 10px 14px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  position: relative;
}

.chat-message.own {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(0, 255, 65, 0.1), rgba(0, 212, 255, 0.1));
  border-color: rgba(0, 255, 65, 0.3);
}

.chat-message.sending {
  opacity: 0.6;
}

.chat-message.sending::after {
  content: '⏳';
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: 10px;
}

.chat-message:hover .message-actions {
  opacity: 1;
}

.message-sender {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-blue);
  margin-bottom: 4px;
}

.message-content {
  font-size: 13px;
  line-height: 1.4;
  word-wrap: break-word;
}

.message-meta {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 4px;
}

.message-time {
  font-size: 10px;
  color: var(--text-muted);
}

.message-edited {
  font-size: 10px;
  color: var(--text-muted);
  font-style: italic;
}

/* Typing indicator */
.typing-indicator {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--primary);
  font-style: italic;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Departments */
.departments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.department-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--card-bg);
  border-radius: 6px;
}

.dept-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dept-name {
  flex: 1;
}

.department-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.department-form h4 {
  margin-bottom: 12px;
}

.department-form .input {
  margin-bottom: 8px;
}

.department-form input[type="color"] {
  width: 50px;
  height: 36px;
  padding: 2px;
  margin-right: 8px;
}

/* Folder with add button */
.chat-folder {
  display: flex;
  align-items: center;
  gap: 4px;
}

.folder-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s;
}

.folder-main:hover {
  background: var(--hover-bg);
}

.folder-add-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: 0;
  transition: all 0.2s;
}

.chat-folder:hover .folder-add-btn {
  opacity: 1;
}

.folder-add-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--bg);
}

/* Add to folder list */
.add-to-folder-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 400px;
  overflow-y: auto;
}

.add-to-folder-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--card-bg);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.add-to-folder-item:hover {
  background: var(--primary);
  color: var(--bg);
}

.add-to-folder-item .item-icon {
  font-size: 18px;
}

.add-to-folder-item .item-name {
  flex: 1;
}

.add-to-folder-item .item-type {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
}

.add-to-folder-item:hover .item-type {
  background: rgba(0,0,0,0.2);
  color: inherit;
}

/* Context menu */
.context-menu {
  position: fixed;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  padding: 4px 0;
  min-width: 180px;
  z-index: 10000;
}

.context-menu-item {
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.context-menu-item:hover {
  background: var(--primary);
  color: var(--bg);
}

.context-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.context-submenu {
  padding: 4px 0;
}

/* Photo upload area */
.photo-upload-area {
  position: relative;
  width: 100%;
  max-width: 300px;
}

.photo-placeholder {
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}

.photo-placeholder:hover {
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.photo-preview {
  position: relative;
  display: inline-block;
}

.photo-preview img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  border: 2px solid var(--accent-green);
}

.photo-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.photo-preview-item {
  position: relative;
  display: inline-block;
}

.photo-preview-item img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--accent-green);
}

.photo-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-red);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.message-actions {
  position: absolute;
  top: -10px;
  right: 10px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2px;
}

.message-actions button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  padding: 4px;
  border-radius: 2px;
}

.message-actions button:hover {
  background: var(--bg-hover);
}

/* Reply Preview */
.message-reply-preview {
  font-size: 11px;
  padding: 6px 8px;
  margin-bottom: 6px;
  background: var(--bg-tertiary);
  border-left: 2px solid var(--accent-blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  transition: background 0.15s;
}

.message-reply-preview:hover {
  background: var(--bg-hover);
}

/* Message Highlight (when scrolling to replied message) */
.message-highlight {
  animation: highlightPulse 2s ease-out;
}

@keyframes highlightPulse {
  0%, 100% { background: transparent; }
  25%, 75% { background: rgba(0, 255, 157, 0.15); }
}

.reply-sender {
  color: var(--accent-blue);
  font-weight: 600;
}

.reply-text {
  color: var(--text-muted);
  margin-left: 4px;
}

/* Hidden Message Indicator */
.message-forwarded-indicator {
  font-size: 11px;
  color: var(--accent-green);
  padding: 4px 8px;
  margin-top: 4px;
  background: rgba(0, 255, 157, 0.1);
  border-radius: 4px;
}

.message-timer-indicator {
  font-size: 10px;
  color: var(--text-muted);
  padding: 2px 6px;
  margin-top: 4px;
  opacity: 0.7;
}

/* Message delivery status */
.message-status {
  margin-left: 4px;
  font-size: 10px;
}

.message-status.sending {
  color: var(--text-muted);
}

.message-status.delivered {
  color: var(--accent-green);
}

.message-status.read {
  color: var(--accent-green);
  letter-spacing: -2px;
}

/* Search results */
.search-results {
  display: none;
  max-height: 300px;
  overflow-y: auto;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.search-header {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
}

.search-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
}

.search-result {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s;
}

.search-result:hover {
  background: var(--bg-hover);
}

.search-result-chat {
  font-size: 11px;
  color: var(--accent-primary);
  margin-bottom: 4px;
}

.search-result-content {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-content mark {
  background: var(--accent-warning);
  color: var(--bg-primary);
  padding: 0 2px;
  border-radius: 2px;
}

.search-result-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.message.highlight {
  animation: highlightPulse 2s ease-out;
}

@keyframes highlightPulse {
  0%, 100% { background: transparent; }
  50% { background: rgba(255, 193, 7, 0.3); }
}

.message-hidden-indicator {
  font-size: 11px;
  color: var(--accent-yellow);
  background: rgba(255, 204, 0, 0.1);
  padding: 6px 8px;
  margin-top: 6px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Reactions */
.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.reaction {
  font-size: 12px;
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 10px;
  cursor: pointer;
}

.reaction:hover {
  background: var(--bg-hover);
}

.reaction-picker {
  position: fixed;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 8px;
  display: flex;
  gap: 4px;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.reaction-picker span {
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius);
}

.reaction-picker span:hover {
  background: var(--bg-hover);
}

/* Sticker Picker */
.sticker-picker {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 320px;
  max-height: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sticker-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}

.sticker-picker-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.sticker-picker-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
}

.sticker-picker-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sticker-tabs {
  display: flex;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  flex-shrink: 0;
}

.sticker-tab {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  cursor: pointer;
  padding: 4px;
  border: 2px solid transparent;
  background: var(--bg-tertiary);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sticker-tab:hover {
  background: var(--bg-hover);
}

.sticker-tab.active {
  border-color: var(--accent-green);
  background: rgba(0, 255, 157, 0.1);
}

.sticker-tab img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(4, 64px);
  justify-content: center;
  gap: 8px;
  padding: 12px;
  overflow-y: auto;
  flex: 1;
  min-height: 200px;
}

.sticker-item {
  width: 64px;
  height: 64px;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius);
  transition: transform 0.15s, background 0.15s;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sticker-item:hover {
  transform: scale(1.1);
  background: var(--bg-hover);
}

.sticker-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Sticker button in chat input */
.chat-sticker-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius);
  transition: background 0.15s;
}

.chat-sticker-btn:hover {
  background: var(--bg-hover);
}

/* Sticker in message */
.chat-sticker {
  max-width: 160px;
  max-height: 160px;
  display: block;
}

.chat-sticker-animated {
  width: 160px;
  height: 160px;
}

.chat-sticker-animated svg {
  width: 100% !important;
  height: 100% !important;
}

/* Animated sticker in picker */
.sticker-item.sticker-animated {
  display: flex;
  align-items: center;
  justify-content: center;
}

.sticker-item.sticker-animated svg {
  max-width: 56px !important;
  max-height: 56px !important;
}

/* Sticker message has no bubble background */
.chat-message.sticker-message {
  background: transparent !important;
  border: none !important;
  padding: 4px;
}

.chat-message.sticker-message.own {
  background: transparent !important;
  border: none !important;
}

.chat-message.sticker-message .message-content {
  background: transparent;
}

/* System Message */
.chat-message-system {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border-radius: 16px;
  margin: 8px auto;
}

/* Chat Image */
.chat-image {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.chat-image:hover {
  transform: scale(1.02);
  opacity: 0.9;
}

.chat-image-caption {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Photo Collage (grouped images) */
.photo-collage {
  display: grid;
  gap: 2px;
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 400px;
}

.photo-collage.cols-2 {
  grid-template-columns: 1fr 1fr;
}

.photo-collage.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.photo-collage.layout-2 {
  grid-template-columns: 1fr 1fr;
}

.photo-collage.layout-3 {
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.photo-collage.layout-3 .collage-img:first-child {
  grid-row: 1 / 3;
}

.photo-collage.layout-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.photo-collage.layout-5,
.photo-collage.layout-6 {
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.photo-collage.layout-5 .collage-img:first-child,
.photo-collage.layout-5 .collage-img:nth-child(2) {
  grid-column: span 1;
}

.collage-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: opacity 0.2s;
  min-height: 80px;
  max-height: 200px;
}

.collage-img:hover {
  opacity: 0.85;
}

/* Photo Gallery Lightbox */
.photo-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.photo-lightbox.visible {
  display: flex;
}

.lightbox-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
  z-index: 10;
}

.lightbox-counter {
  color: #fff;
  font-size: 14px;
  font-family: var(--font-mono);
}

.lightbox-close {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  transition: background 0.2s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
  padding: 60px 80px;
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  user-select: none;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-nav:hover {
  background: rgba(0, 255, 65, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-nav.prev {
  left: 20px;
}

.lightbox-nav.next {
  right: 20px;
}

.lightbox-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.lightbox-nav:disabled:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-50%);
}

.lightbox-thumbnails {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  display: flex;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  overflow-x: auto;
}

.lightbox-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.2s;
  border: 2px solid transparent;
  flex-shrink: 0;
}

.lightbox-thumb:hover {
  opacity: 0.8;
}

.lightbox-thumb.active {
  opacity: 1;
  border-color: var(--accent-green);
}

/* Chat Input Area */
.chat-input-area {
  padding: 12px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.chat-reply-preview,
.chat-image-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  border-left: 2px solid var(--accent-blue);
}

.chat-image-preview img {
  max-height: 60px;
  border-radius: var(--radius);
}

/* Chat Multi-Image Preview */
.chat-images-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  border-left: 2px solid var(--accent-green);
}

.chat-images-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 300px;
}

.chat-images-grid img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.chat-images-info {
  flex: 1;
  font-size: 12px;
  color: var(--text-secondary);
}

.reply-content,
.image-preview-info {
  flex: 1;
  font-size: 12px;
}

.reply-cancel,
.preview-cancel {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-attach-btn {
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius);
}

.chat-attach-btn:hover {
  background: var(--bg-hover);
}

.chat-input {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 13px;
}

.chat-input:focus {
  outline: none;
  border-color: var(--accent-green);
}

.chat-send-btn {
  background: var(--accent-green);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-lg);
  width: 40px;
  height: 40px;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.15s;
}

.chat-send-btn:hover {
  transform: scale(1.05);
}

/* Member Select */
.member-select {
  max-height: 350px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 8px;
}

.member-groups {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.member-group-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.member-search {
  width: 100%;
  margin-bottom: 8px;
  font-size: 12px;
  padding: 8px;
}

.member-list {
  max-height: 180px;
  overflow-y: auto;
}

.member-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  cursor: pointer;
  border-radius: var(--radius);
}

.member-option:hover {
  background: var(--bg-hover);
}

.member-option.role-option {
  background: rgba(157, 0, 255, 0.1);
  border: 1px solid rgba(157, 0, 255, 0.3);
  margin-bottom: 4px;
}

.member-option.role-option:hover {
  background: rgba(157, 0, 255, 0.2);
}

.member-role {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

/* Chat Info Modal */
.modal-lg {
  max-width: 500px;
}

.chat-info-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
  overflow: hidden; /* clearfix */
}

.chat-info-section:first-child {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.chat-info-section:last-child {
  border-bottom: none;
}

.chat-info-section h4 {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.chat-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.chat-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  overflow: hidden;
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-info-details h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
}

.chat-info-details .text-muted {
  margin: 0 0 8px 0;
  font-size: 13px;
}

/* Invite Link */
.invite-link-box {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.invite-link-box .input {
  flex: 1;
  font-size: 12px;
}

/* Members List */
.members-list {
  max-height: 200px;
  overflow-y: auto;
}

.member-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius);
}

.member-item:hover {
  background: var(--bg-hover);
}

.member-icon {
  font-size: 16px;
}

.member-name {
  flex: 1;
  font-size: 13px;
}

.member-role-badge {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 8px;
}

/* Danger Zone */
.danger-zone {
  background: rgba(255, 59, 48, 0.1);
  border-radius: var(--radius);
  padding: 12px !important;
  margin-top: 12px;
}

.danger-zone h4 {
  color: var(--accent-red) !important;
}

.btn-danger {
  background: var(--accent-red);
  color: white;
}

.btn-danger:hover {
  background: #ff3b30;
}

/* Emoji Picker */
.emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.emoji-option {
  font-size: 20px;
  padding: 6px;
  cursor: pointer;
  border-radius: var(--radius);
  border: 2px solid transparent;
}

.emoji-option:hover {
  background: var(--bg-hover);
}

.emoji-option.selected {
  border-color: var(--accent-green);
  background: rgba(0, 255, 65, 0.1);
}

/* ============ END CHAT SYSTEM ============ */

/* ============ ADDRESS LIST (Courier) ============ */
.address-list {
  padding: 0;
}

.address-item {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}

.address-item:last-child {
  border-bottom: none;
}

.address-status {
  flex-shrink: 0;
}

.address-info {
  flex: 1;
  min-width: 200px;
}

.address-info .placement-type {
  display: inline-block;
  background: var(--bg-tertiary);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.address-info .description {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 13px;
}

.address-time {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.rejection-reason {
  width: 100%;
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  border-left: 3px solid var(--accent-red);
}

/* Badge for statuses */
.badge-placed { background: var(--accent-blue); color: white; }
.badge-on_review { background: rgba(255, 204, 0, 0.15); color: var(--accent-yellow); border: 1px solid var(--accent-yellow); }
.badge-approved { background: var(--accent-green); color: black; }
.badge-rejected { background: var(--accent-red); color: white; }
.badge-published { background: var(--accent-purple); color: white; }
.badge-sold { background: #2ecc71; color: white; }
.badge-active { background: var(--accent-green); color: black; }
.badge-completed { background: var(--accent-blue); color: white; }
.badge-pending { background: var(--accent-yellow); color: black; }

/* ============ END ADDRESS LIST ============ */

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 40px;
  height: 40px;
  background: #00ff41 !important;
  border: 2px solid #00ff41 !important;
  border-radius: 8px;
  cursor: pointer;
  padding: 9px 7px;
  margin-right: 12px;
  z-index: 1001;
  box-shadow: 0 0 15px #00ff41, 0 0 30px rgba(0,255,65,0.5);
}

.mobile-menu-btn span {
  display: block;
  width: 100%;
  height: 3px;
  background: #000;
  border-radius: 2px;
  transition: all 0.3s;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Overlay */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 998;
}

.mobile-overlay.active {
  display: block;
}

/* Responsive */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }
  
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    z-index: 999;
    transition: left 0.3s ease;
  }
  
  .sidebar.mobile-open {
    left: 0;
  }
  
  .main {
    margin-left: 0;
  }
  
  .header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    min-height: 56px;
  }
  
  .header-title {
    font-size: 16px;
    flex: 1;
  }
  
  .header-actions {
    font-size: 11px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .chat-sidebar {
    width: 100%;
    display: none;
  }
  
  .chat-layout.show-sidebar .chat-sidebar {
    display: flex;
  }
  
  .chat-layout.show-sidebar .chat-window {
    display: none;
  }
  
  /* Sticker picker mobile */
  .sticker-picker {
    width: 280px;
    max-height: 280px;
    left: 10px;
    right: 10px;
    bottom: 70px;
  }
  
  .sticker-grid {
    grid-template-columns: repeat(3, 64px);
  }
  
  /* Chat input mobile */
  .chat-input-area {
    padding: 8px;
  }
  
  .chat-input {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

