/* --- Root Variables & Theme Definition --- */
:root {
    --bg-primary: #0a0e14;        /* Deep Carbon Black */
    --card-bg: #141b24;          /* Slate Gray Card */
    --border-color: #2d3748;     /* Subtle Gray Border */
    --text-primary: #f1f5f9;     /* Off-White Text */
    --text-muted: #94a3b8;       /* Muted Slate Text */
    
    /* Functional Colors */
    --accent-blue: #3182ce;      /* Professional Blue */
    --accent-green: #38a169;     /* Emerald Success */
    --accent-amber: #d69e2e;     /* Warning/Process Amber */
    --accent-red: #e53e3e;       /* Critical Red */
}

/* --- Global Reset --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    padding: 2rem;
}

.app-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

/* --- Header Section --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    background: rgba(49, 130, 206, 0.1);
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    font-size: 0.75rem;
    font-weight: 800;
}

/* --- Grid Layout --- */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* --- Module Cards --- */
.module-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.module-card.full-width {
    grid-column: 1 / -1;
}

.module-header {
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--accent-blue);
    padding-left: 1rem;
}

.module-header h3 {
    font-size: 1rem;
    color: var(--text-primary);
    text-transform: uppercase;
}

/* --- Status Boxes & Icons --- */
.status-box {
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-box.success {
    background: rgba(56, 161, 105, 0.1);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
}

.info-note {
    margin-top: 1.5rem;
    padding: 0.8rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
    display: flex;
    gap: 8px;
}

/* --- Form Elements --- */
.field-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.text-input, .select-input {
    width: 100%;
    background: #0a0e14;
    border: 1px solid var(--border-color);
    padding: 0.85rem 1rem;
    color: white;
    border-radius: 6px;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.text-input:focus, .select-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.2);
}

/* --- Buttons --- */
.btn {
    padding: 0.8rem 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 6px;
    border: none;
    transition: all 0.2s;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-full { width: 100%; }

.btn-primary { background: var(--accent-blue); color: white; }
.btn-primary:hover { background: #2b6cb0; transform: translateY(-1px); }

.btn-success { background: var(--accent-green); color: white; }
.btn-success:hover { background: #2f855a; transform: translateY(-1px); }

.btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    filter: grayscale(1);
}

.address-subtext {
    text-align: center;
    margin-top: 8px;
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--accent-blue);
}

/* --- Toggle Switch --- */
.toggle-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 1.5rem 0;
    background: rgba(0,0,0,0.2);
    padding: 12px;
    border-radius: 8px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #4a5568;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px; width: 16px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider { background-color: var(--accent-green); }
input:checked + .slider:before { transform: translateX(22px); }

/* --- Activity Monitor (Console) --- */
.console {
    background: #000;
    height: 300px;
    overflow-y: auto;
    padding: 1.2rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column-reverse;
}

.msg-system { color: var(--text-muted); }
.msg-success { color: var(--accent-green); border-left: 3px solid var(--accent-green); padding-left: 10px; margin-bottom: 5px; }
.msg-error { color: var(--accent-red); border-left: 3px solid var(--accent-red); padding-left: 10px; margin-bottom: 5px; }