* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #090a0d;
    color: #e5e7eb;
    min-height: 100vh;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #111318; }
::-webkit-scrollbar-thumb { background: #262a33; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #353a47; }

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

.sidebar {
    width: 240px;
    background: #101217;
    border-right: 1px solid #1c2029;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.brand {
    padding: 24px 20px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #1c2029;
}

.brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e11d2e;
    box-shadow: 0 0 10px #e11d2e;
}

.brand-text {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.5px;
    color: #fff;
}

.brand-badge {
    font-size: 10px;
    background: rgba(225, 29, 46, 0.15);
    color: #ff4757;
    border: 1px solid rgba(225, 29, 46, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
    font-weight: 600;
}

.nav-menu {
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: #9ca3af;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.nav-link:hover {
    background: #171a22;
    color: #fff;
}

.nav-link.active {
    background: rgba(225, 29, 46, 0.12);
    color: #ff4757;
    border-left: 3px solid #e11d2e;
    font-weight: 600;
}

.nav-link .icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

/* Main Content Area */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-y: auto;
}

.topbar {
    padding: 16px 32px;
    border-bottom: 1px solid #1c2029;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0d0f14;
    min-height: 64px;
}

.page-title {
    font-size: 19px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.2px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #13161e;
    border: 1px solid #202431;
    padding: 4px 12px 4px 5px;
    border-radius: 20px;
}

.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #1e222d;
    border: 1px solid #2d3342;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #ff4757;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: #e5e7eb;
}

.btn-signout {
    background: none;
    border: 1px solid #2c3240;
    color: #8b92a1;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-left: 2px;
}

.btn-signout:hover {
    border-color: #e11d2e;
    color: #ff4757;
    background: rgba(225, 29, 46, 0.08);
}

.main-body {
    padding: 32px;
    flex: 1;
}

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

.stat-card {
    background: #13151b;
    border: 1px solid #1c2029;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: transparent;
}

.stat-card.danger::before { background: #e11d2e; }
.stat-card.success::before { background: #10b981; }
.stat-card.warning::before { background: #f59e0b; }
.stat-card.info::before { background: #3b82f6; }

.stat-val {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}

.stat-lbl {
    font-size: 13px;
    color: #8b92a1;
    margin-top: 6px;
    font-weight: 500;
}

.card {
    background: #13151b;
    border: 1px solid #1c2029;
    border-radius: 12px;
    padding: 22px;
    margin-bottom: 24px;
}

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

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tables */
.table-wrap {
    width: 100%;
    overflow-x: auto;
}

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

th, td {
    padding: 12px 14px;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid #1a1e27;
}

th {
    color: #717887;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    background: #101217;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Controls */
.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

input, select, textarea {
    padding: 9px 14px;
    background: #0f1116;
    border: 1px solid #222632;
    border-radius: 8px;
    color: #e5e7eb;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 36px !important;
    background-color: #0f1116;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b92a1' stroke-width='2.5' 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 14px center;
    cursor: pointer;
}

select:focus {
    border-color: #e11d2e;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23e11d2e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

select option {
    background: #14171f;
    color: #e5e7eb;
    padding: 10px;
}

input:focus, textarea:focus {
    border-color: #e11d2e;
}

.btn {
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary {
    background: #e11d2e;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: #ff2b3e;
    box-shadow: 0 4px 12px rgba(225, 29, 46, 0.35);
}

.btn-dark {
    background: #1b1e26;
    color: #d1d5db;
    border: 1px solid #272c38;
}

.btn-dark:hover:not(:disabled) {
    background: #252a36;
    color: #fff;
}

.btn-success {
    background: #10b981;
    color: #fff;
}

.btn-success:hover:not(:disabled) {
    background: #059669;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 6px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-green { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.25); }
.badge-red { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.25); }
.badge-yellow { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.25); }
.badge-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.25); }
.badge-gray { background: #1c2029; color: #9ca3af; border: 1px solid #262c38; }

/* Status dot */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.dot-green { background: #10b981; box-shadow: 0 0 8px #10b981; }
.dot-red { background: #ef4444; }
.dot-gray { background: #6b7280; }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: #14171f;
    border: 1px solid #262c3a;
    border-radius: 14px;
    padding: 26px;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

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

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.modal-close {
    background: none;
    border: none;
    color: #8890a0;
    font-size: 20px;
    cursor: pointer;
}

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

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.form-input {
    width: 100%;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    background: #161922;
    border: 1px solid #282e3d;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toastIn 0.2s ease;
}

.toast.toast-success { border-left: 4px solid #10b981; }
.toast.toast-error { border-left: 4px solid #ef4444; }

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

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.text-muted { color: #8890a0; }

/* Clean Minimal Copy Buttons across all pages */
button.btn-copy, button.copy-icon-btn, .btn-copy, .copy-icon-btn {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #8b92a1 !important;
    cursor: pointer !important;
    padding: 3px 5px !important;
    border-radius: 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    transition: all 0.15s ease !important;
    line-height: 1 !important;
    outline: none !important;
    margin-left: 4px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    font-size: 11px !important;
}

button.btn-copy:hover, button.copy-icon-btn:hover, .btn-copy:hover, .copy-icon-btn:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08) !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
}

button.btn-copy:active, button.copy-icon-btn:active, .btn-copy:active, .copy-icon-btn:active {
    color: #ff4757 !important;
    background: rgba(225, 29, 46, 0.15) !important;
    transform: scale(0.92);
}

button.btn-copy.copied, .btn-copy.copied {
    color: #34d399 !important;
}

button.btn-copy svg, button.copy-icon-btn svg, .btn-copy svg, .copy-icon-btn svg {
    width: 13px !important;
    height: 13px !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    display: inline-block !important;
    pointer-events: none !important;
}

