/* ============================================
   Station Manager
   ============================================ */

.sm-screen { display:flex; flex-direction:column; height:100%; overflow:hidden; }

.sm-header {
    height:56px; padding:0 20px; display:flex; align-items:center; justify-content:space-between;
    border-bottom:1px solid var(--border); flex-shrink:0; background:var(--bg-surface);
}
.sm-header-left { display:flex; align-items:center; gap:14px; }
.sm-header-right { display:flex; align-items:center; gap:10px; }
.sm-back {
    padding:6px 14px; border-radius:8px; border:1px solid var(--border); background:none;
    color:var(--text-secondary); font-size:13px; cursor:pointer; font-family:inherit; transition:all .15s;
}
.sm-back:hover { border-color:var(--accent); color:var(--accent); }
.sm-title { font-size:17px; font-weight:700; }

.sm-body { flex:1; overflow-y:auto; padding:20px 24px; }

/* Sections */
.sm-section { margin-bottom:28px; }
.sm-section-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.sm-section-header h3 { font-size:15px; font-weight:700; }

/* Terminal cards grid */
.sm-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(340px,1fr)); gap:12px; }

.sm-card {
    background:var(--bg-surface); border:1px solid var(--border); border-radius:10px;
    overflow:hidden; transition:border-color .2s;
}
.sm-card:hover { border-color:var(--bg-surface-hover); }
.sm-card.inactive { opacity:.5; }

.sm-card-header {
    padding:12px 14px; display:flex; justify-content:space-between; align-items:center;
    border-bottom:1px solid var(--border); background:rgba(255,255,255,0.02);
}
.sm-card-title { display:flex; align-items:center; gap:8px; }
.sm-card-icon { font-size:18px; }
.sm-card-name { font-size:15px; font-weight:700; }
.sm-card-status { font-size:10px; opacity:.5; }
.sm-card-status.online { opacity:1; }
.sm-card-type {
    padding:2px 8px; border-radius:4px; font-size:10px; font-weight:700; text-transform:uppercase;
    background:rgba(129,140,248,0.1); color:var(--blue); letter-spacing:.5px;
}

.sm-card-body { padding:10px 14px; }
.sm-card-row { display:flex; justify-content:space-between; padding:5px 0; font-size:13px; }
.sm-card-label { color:var(--text-muted); font-size:12px; }
.sm-card-value { font-weight:600; text-align:right; font-size:12px; }

.sm-card-footer {
    padding:8px 14px; border-top:1px solid var(--border);
    display:flex; justify-content:space-between; align-items:center;
}

/* Berg station cards */
.sm-berg-grid { display:flex; gap:10px; flex-wrap:wrap; }
.sm-berg-card {
    display:flex; align-items:center; gap:10px; padding:10px 14px;
    background:var(--bg-surface); border:1px solid var(--border); border-radius:8px; min-width:200px;
}
.sm-berg-status { font-size:12px; }
.sm-berg-info { flex:1; }
.sm-berg-name { font-size:14px; font-weight:700; }
.sm-berg-key { font-size:11px; color:var(--text-muted); font-family:monospace; }

/* Buttons */
.sm-btn {
    padding:8px 18px; border-radius:8px; font-size:13px; font-weight:600; cursor:pointer;
    font-family:inherit; border:1px solid var(--border); background:none; color:var(--text-secondary); transition:all .15s;
}
.sm-btn:hover { border-color:var(--blue); color:var(--blue); }
.sm-btn-primary { background:var(--blue); color:#fff; border-color:var(--blue); }
.sm-btn-primary:hover { filter:brightness(1.1); color:#fff; }
.sm-btn-danger { color:var(--red); border-color:transparent; }
.sm-btn-danger:hover { color:var(--red); border-color:var(--red); }
.sm-btn-small { padding:5px 12px; font-size:12px; }

/* Modal overlay */
.sm-overlay {
    position:fixed; inset:0; z-index:1000; background:rgba(0,0,0,0.6);
    display:flex; align-items:center; justify-content:center;
    animation:smFadeIn .2s ease;
}
@keyframes smFadeIn { from{opacity:0} to{opacity:1} }

.sm-modal {
    background:var(--bg-secondary); border:1px solid var(--border); border-radius:14px;
    width:540px; max-width:95vw; max-height:85vh; display:flex; flex-direction:column;
    animation:smSlideIn .25s ease;
}
@keyframes smSlideIn { from{transform:translateY(20px);opacity:0} to{transform:none;opacity:1} }

.sm-modal-header {
    padding:16px 20px; display:flex; justify-content:space-between; align-items:center;
    border-bottom:1px solid var(--border);
}
.sm-modal-header h3 { font-size:16px; font-weight:700; }
.sm-modal-close {
    width:32px; height:32px; border-radius:8px; border:1px solid var(--border); background:none;
    color:var(--text-muted); font-size:16px; cursor:pointer; display:flex; align-items:center; justify-content:center;
}
.sm-modal-close:hover { color:var(--red); border-color:var(--red); }

.sm-modal-body { padding:20px; overflow-y:auto; flex:1; }

.sm-modal-footer {
    padding:14px 20px; border-top:1px solid var(--border);
    display:flex; justify-content:flex-end; gap:8px;
}

/* Form elements */
.sm-form-group { margin-bottom:20px; }
.sm-form-group h4 { font-size:13px; font-weight:700; color:var(--text-secondary); margin-bottom:10px; padding-bottom:6px; border-bottom:1px solid var(--border); }

.sm-form-row { display:flex; align-items:center; gap:12px; margin-bottom:8px; }
.sm-form-row label { width:110px; font-size:12px; color:var(--text-muted); flex-shrink:0; text-align:right; }

.sm-input {
    flex:1; height:36px; padding:0 10px; background:var(--bg-primary); border:1px solid var(--border);
    border-radius:7px; color:var(--text-primary); font-size:13px; font-family:inherit; outline:none;
}
.sm-input:focus { border-color:var(--blue); }

.sm-form-hint { font-size:11px; color:var(--text-muted); margin:4px 0 0 122px; }

/* Toggle switch */
.sm-toggle { position:relative; display:inline-block; width:42px; height:24px; cursor:pointer; }
.sm-toggle input { opacity:0; width:0; height:0; }
.sm-toggle span {
    position:absolute; inset:0; background:var(--bg-surface-hover); border-radius:12px;
    transition:.2s;
}
.sm-toggle span::before {
    content:''; position:absolute; width:18px; height:18px; left:3px; bottom:3px;
    background:#fff; border-radius:50%; transition:.2s;
}
.sm-toggle input:checked + span { background:var(--green); }
.sm-toggle input:checked + span::before { transform:translateX(18px); }
