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

body {
    background: #f3f4f6;
    color: #1f2937;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    min-height: 100vh;
}

a { color: #3b82f6; text-decoration: none; }
a:hover { color: #2563eb; }

.navbar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 32px;
    display: flex;
    align-items: center;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.5px;
    margin-right: 32px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand .brand-icon {
    width: 28px;
    height: 28px;
    background: #111827;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-brand .brand-icon svg {
    width: 14px;
    height: 14px;
    fill: #fff;
}

.navbar-nav {
    display: flex;
    gap: 4px;
    list-style: none;
}

.navbar-nav a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
}

.navbar-nav a:hover { background: #f3f4f6; color: #374151; }
.navbar-nav a.active { background: #111827; color: #fff; }
.navbar-nav a.active:hover { background: #1f2937; color: #fff; }

.navbar-right { margin-left: auto; }
.navbar-right a {
    color: #ef4444;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}
.navbar-right a:hover { color: #dc2626; }

.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 20px;
}

.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.card-toolbar {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #f3f4f6;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    max-width: 320px;
    padding: 9px 14px 9px 36px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    color: #374151;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") 12px center no-repeat;
    outline: none;
    transition: border-color 0.15s;
}
.search-input:focus { border-color: #3b82f6; }

.toolbar-info {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.count-badge {
    background: #f3f4f6;
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.btn:hover { background: #f9fafb; border-color: #d1d5db; }
.btn-dark { background: #111827; color: #fff; border-color: #111827; }
.btn-dark:hover { background: #1f2937; border-color: #1f2937; }
.btn-sm { padding: 4px 12px; font-size: 12px; }

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

thead th {
    text-align: left;
    padding: 12px 16px;
    color: #9ca3af;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #f3f4f6;
    background: #fafafa;
}

tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
    color: #374151;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f9fafb; }

.col-num { width: 50px; color: #9ca3af; font-weight: 500; }
.col-status { width: 20px; padding-right: 0; }
.col-check { width: 32px; text-align: center; }

.col-flag { width: 44px; text-align: center; }
.col-flag img {
    width: 24px;
    height: 18px;
    border-radius: 2px;
    object-fit: cover;
    vertical-align: middle;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}

.col-note { min-width: 120px; }

.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.dot.online { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.15); }
.dot.offline { background: #d1d5db; }

.note-text {
    cursor: pointer;
    color: #6b7280;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s;
}
.note-text:hover { background: #f3f4f6; color: #374151; }
.note-empty { color: #d1d5db; }

.note-input {
    background: #fff;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    color: #374151;
    padding: 4px 8px;
    font-family: inherit;
    font-size: 13px;
    width: 100%;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.agent-id {
    color: #3b82f6;
    font-weight: 500;
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 12px;
}
.agent-id:hover { color: #2563eb; }

.hostname { color: #6b7280; }

.actions {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.15s;
}
.icon-btn:hover { background: #f3f4f6; color: #374151; }
.icon-btn.delete:hover { background: #fef2f2; color: #ef4444; }

.icon-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.time-cell {
    color: #9ca3af;
    font-size: 12px;
    white-space: nowrap;
}

.empty {
    color: #9ca3af;
    text-align: center;
    padding: 60px 20px;
    font-size: 14px;
}

.empty-small {
    color: #9ca3af;
    text-align: center;
    padding: 24px 16px;
    font-size: 13px;
}

/* filter tabs */

.filter-tabs {
    display: flex;
    gap: 4px;
    background: #f3f4f6;
    padding: 3px;
    border-radius: 8px;
}

.filter-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #6b7280;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.filter-btn:hover { color: #374151; }
.filter-btn.active { background: #fff; color: #111827; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }

.filter-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-input {
    padding: 7px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    color: #374151;
    background: #fff;
    outline: none;
}
.filter-input:focus { border-color: #3b82f6; }

/* sortable headers */

.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: #374151; }
.sort-active { color: #3b82f6; }

/* modal */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal {
    background: #fff;
    border-radius: 16px;
    width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.modal-lg { width: 540px; }

.modal-header {
    padding: 20px 24px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f3f4f6;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 20px;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-close:hover { background: #f3f4f6; color: #374151; }

.modal-body { padding: 16px 24px 24px; }

/* payload list in modal */

.payload-list {
    max-height: 300px;
    overflow-y: auto;
}

.payload-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.15s;
}
.payload-item:hover { background: #f3f4f6; }

.payload-name {
    font-weight: 500;
    font-size: 13px;
    color: #111827;
    font-family: 'SF Mono', 'Consolas', monospace;
    flex: 1;
}

.payload-size { color: #9ca3af; font-size: 12px; }

.payload-actions { display: flex; gap: 6px; }

.btn-sm {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 5px;
    border: 1px solid #3b82f6;
    background: #3b82f6;
    color: #fff;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s;
}
.btn-sm:hover { background: #2563eb; }
.btn-sm.btn-dim {
    background: transparent;
    color: #6b7280;
    border-color: #d1d5db;
}
.btn-sm.btn-dim:hover { background: #f3f4f6; color: #374151; border-color: #9ca3af; }
.btn-sm.btn-danger { background: transparent; color: #ef4444; border-color: #fca5a5; font-size: 14px; line-height: 1; padding: 3px 8px; }
.btn-sm.btn-danger:hover { background: #fef2f2; border-color: #ef4444; }

.payload-upload { margin-top: 12px; }

/* exec badge */

.exec-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
}
.exec-badge.running { background: #fef3c7; color: #d97706; }
.exec-badge.done { background: #d1fae5; color: #059669; }
.exec-badge.error { background: #fef2f2; color: #ef4444; }

/* tags */

.tag {
    display: inline-block;
    background: #eff6ff;
    color: #3b82f6;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
    margin: 1px 2px;
}
.tag.subtle { background: #f3f4f6; color: #6b7280; }

.email-tag {
    display: inline-block;
    color: #6b7280;
    font-size: 11px;
    margin: 1px 4px 1px 0;
}

.emails-cell { max-width: 200px; }

/* stats bar */

.stats-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.stat-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 24px;
    min-width: 140px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.stat-label {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
}

/* settings */

.settings-section { margin-bottom: 24px; }
.settings-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.targets-list { max-height: 200px; overflow-y: auto; margin-bottom: 12px; }

.target-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border: 1px solid #f3f4f6;
    border-radius: 6px;
    margin-bottom: 4px;
}

.target-name { font-weight: 500; font-size: 13px; min-width: 100px; }
.target-domain { color: #6b7280; font-size: 13px; flex: 1; }

.targets-add { display: flex; gap: 8px; }

.auto-delete-options { display: flex; gap: 8px; }

/* stealer table in shell page */

.stealer-table { width: 100%; }
.stealer-table th {
    text-align: left;
    padding: 8px 12px;
    color: #94a3b8;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    border-bottom: 1px solid #1e293b;
}
.stealer-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #1e293b;
    font-size: 13px;
    color: #cbd5e1;
}
.stealer-table .tag { background: rgba(59,130,246,0.15); color: #93c5fd; }
.stealer-table .tag.subtle { background: rgba(255,255,255,0.05); color: #94a3b8; }

.stealer-logs-panel {
    flex: 1;
    overflow-y: auto;
    background: #0c1222;
    border: 1px solid #1e293b;
    border-radius: 10px;
    padding: 16px;
}

.stealer-logs-body .empty-small { color: #475569; }

/* shell tabs */

.shell-tabs {
    display: flex;
    gap: 4px;
    margin-left: 16px;
}

.shell-tab {
    padding: 6px 14px;
    border: 1px solid #334155;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.shell-tab:hover { background: #1e293b; color: #e2e8f0; }
.shell-tab.active { background: #3b82f6; color: #fff; border-color: #3b82f6; }

.tab-count {
    background: rgba(255,255,255,0.2);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.tab-content { display: flex; flex-direction: column; flex: 1; }
.tab-content:not(.active) { display: none; }

/* login */

.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f3f4f6;
}

.login-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 40px;
    width: 380px;
}

.login-box .login-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
}

.login-box .login-brand {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.login-box .brand-icon {
    width: 32px;
    height: 32px;
    background: #111827;
    border-radius: 50%;
}

.login-box input {
    display: block;
    width: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #374151;
    padding: 11px 14px;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 12px;
    outline: none;
    transition: border-color 0.15s;
}

.login-box input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.login-box input::placeholder { color: #9ca3af; }

.login-box button {
    width: 100%;
    background: #111827;
    border: none;
    border-radius: 8px;
    color: #fff;
    padding: 11px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.15s;
}

.login-box button:hover { background: #1f2937; }

.error {
    color: #ef4444;
    font-size: 13px;
    margin-bottom: 12px;
    background: #fef2f2;
    padding: 8px 12px;
    border-radius: 6px;
}

/* shell page dark theme */

.shell-page { background: #0f172a; min-height: 100vh; }
.shell-page .navbar { background: #1e293b; border-bottom: 1px solid #334155; }
.shell-page .navbar-brand { color: #f1f5f9; }
.shell-page .navbar-nav a { color: #94a3b8; }
.shell-page .navbar-nav a:hover { background: #334155; color: #e2e8f0; }
.shell-page .navbar-nav a.active { background: #3b82f6; color: #fff; }
.shell-page .navbar-right a { color: #f87171; }

.shell-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 32px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 56px);
}

.shell-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    color: #94a3b8;
    font-size: 13px;
}

.shell-info .agent-badge {
    background: #1e293b;
    border: 1px solid #334155;
    padding: 4px 12px;
    border-radius: 6px;
    font-family: 'SF Mono', 'Consolas', monospace;
    color: #e2e8f0;
    font-size: 12px;
}

#terminal {
    flex: 1;
    background: #0c1222;
    border: 1px solid #1e293b;
    border-radius: 10px;
    padding: 16px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
}

#terminal .output { color: #cbd5e1; }
#terminal .cmd { color: #60a5fa; }
#terminal .error { color: #f87171; }

.shell-input {
    display: flex;
    margin-top: 12px;
    margin-bottom: 8px;
}

.shell-input span {
    color: #64748b;
    padding: 10px 12px;
    background: #1e293b;
    border: 1px solid #334155;
    border-right: none;
    border-radius: 8px 0 0 8px;
    font-family: 'SF Mono', 'Consolas', monospace;
}

.shell-input input {
    flex: 1;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0 8px 8px 0;
    color: #e2e8f0;
    padding: 10px 14px;
    font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}

.shell-input input:focus { border-color: #3b82f6; }
.shell-input input::placeholder { color: #475569; }

.shell-actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
}

.shell-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: #1e293b;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s;
}

.shell-btn:hover { background: #334155; color: #e2e8f0; border-color: #475569; }
.shell-btn-danger:hover { background: #7f1d1d; color: #fca5a5; border-color: #991b1b; }

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    max-width: 380px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #334155;
    background: #1e293b;
    color: #e2e8f0;
    font-size: 0.85rem;
    line-height: 1.4;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    animation: toast-in 0.3s ease;
    pointer-events: auto;
    cursor: pointer;
}

.toast.toast-out { animation: toast-out 0.25s ease forwards; }

.toast-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.toast-icon svg { width: 12px; height: 12px; }

.toast.success .toast-icon { background: #065f46; color: #34d399; }
.toast.success { border-color: #065f46; }
.toast.error .toast-icon { background: #7f1d1d; color: #fca5a5; }
.toast.error { border-color: #7f1d1d; }
.toast.info .toast-icon { background: #1e3a5f; color: #60a5fa; }
.toast.info { border-color: #1e3a5f; }

.toast-body { flex: 1; }
.toast-title { font-weight: 600; margin-bottom: 2px; }
.toast-msg { color: #94a3b8; font-size: 0.8rem; }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}
