* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
       background: #0f172a; color: #e2e8f0; min-height: 100vh; }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center;
              min-height: 100vh; }
.login-box { text-align: center; padding: 3rem; background: #1e293b;
             border-radius: 1rem; max-width: 400px; width: 90%;
             box-shadow: 0 4px 6px rgba(0,0,0,0.3); }
.login-box h1 { font-size: 2rem; margin-bottom: 0.5rem; color: #60a5fa; }
.login-box p { color: #94a3b8; margin-bottom: 2rem; }
.btn-github { display: inline-flex; align-items: center; padding: 0.75rem 2rem;
              background: #24292e; color: white; text-decoration: none;
              border-radius: 0.5rem; font-size: 1rem;
              border: 1px solid #444; transition: background 0.2s; }
.btn-github:hover { background: #444; }

/* Header */
header { display: flex; justify-content: space-between; align-items: center;
         padding: 1rem 2rem; background: #1e293b;
         border-bottom: 1px solid #334155; position: sticky; top: 0; z-index: 10; }
header h1 { color: #60a5fa; font-size: 1.5rem; font-weight: 700; }
.header-right { display: flex; align-items: center; gap: 1rem; }
.countdown { color: #64748b; font-size: 0.875rem; }
.user-badge { color: #94a3b8; font-size: 0.875rem; }

/* Buttons */
.btn-add { padding: 0.5rem 1rem; background: #3b82f6; color: white;
           border: none; border-radius: 0.375rem; cursor: pointer;
           font-size: 0.875rem; transition: background 0.2s; }
.btn-add:hover { background: #2563eb; }
.btn-logout { padding: 0.375rem 0.75rem; background: transparent;
              color: #94a3b8; border: 1px solid #475569;
              border-radius: 0.375rem; cursor: pointer; font-size: 0.875rem; }
.btn-logout:hover { background: #334155; }

/* NAS Grid */
.nas-grid { display: grid;
            grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
            gap: 1.5rem; padding: 2rem; }
.empty-msg { color: #64748b; text-align: center; padding: 3rem;
             grid-column: 1/-1; }

/* NAS Card */
.nas-card { background: #1e293b; border-radius: 0.75rem;
            border: 1px solid #334155; padding: 1.5rem;
            transition: border-color 0.2s, box-shadow 0.2s; }
.nas-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.nas-card.warning { border-color: #f59e0b; }
.nas-card.danger { border-color: #ef4444; }
.nas-card.offline { opacity: 0.65; }
.nas-card-header { display: flex; justify-content: space-between;
                    align-items: flex-start; margin-bottom: 1.25rem; }
.nas-name { font-weight: 600; font-size: 1.125rem; color: #f1f5f9; }
.nas-host { color: #64748b; font-size: 0.8rem; margin-top: 2px; }
.status-badge { padding: 0.25rem 0.625rem; border-radius: 9999px;
                font-size: 0.75rem; font-weight: 500; white-space: nowrap; }
.status-badge.online { background: #064e3b; color: #6ee7b7; }
.status-badge.offline { background: #1e293b; color: #64748b;
                         border: 1px solid #334155; }
.status-badge.warning { background: #451a03; color: #fbbf24; }
.status-badge.danger { background: #450a0a; color: #fca5a5; }
.status-badge.loading { background: #1e293b; color: #475569;
                         border: 1px solid #334155; }
.loading-msg { color: #475569; font-size: 0.875rem;
               margin-top: 1rem; padding: 0.75rem; }

/* Metrics */
.metric { margin: 0.75rem 0; }
.metric-label { display: flex; justify-content: space-between;
                font-size: 0.8rem; color: #94a3b8; margin-bottom: 0.3rem; }
.metric-label span:last-child { font-weight: 500; color: #e2e8f0; }
.progress-bar { background: #0f172a; border-radius: 9999px; height: 6px; overflow: hidden; }
.progress-fill { height: 6px; border-radius: 9999px;
                 background: #3b82f6; transition: width 0.5s ease; }
.progress-fill.warning { background: #f59e0b; }
.progress-fill.danger { background: #ef4444; }

/* System info grid */
.nas-info { display: grid; grid-template-columns: auto 1fr auto 1fr;
            gap: 0.4rem 0.75rem; margin-top: 1rem;
            font-size: 0.8rem; padding-top: 1rem;
            border-top: 1px solid #1e293b; }
.info-label { color: #64748b; }
.info-value { color: #e2e8f0; font-weight: 500; }

/* Volume list */
.volumes { margin-top: 1rem; }
.volumes-title { font-size: 0.8rem; color: #64748b; margin-bottom: 0.5rem; }
.volume { background: #0f172a; border-radius: 0.375rem;
          padding: 0.625rem; margin-bottom: 0.5rem; }
.volume-name { font-size: 0.75rem; color: #94a3b8; margin-bottom: 0.375rem; }

/* Offline error */
.offline-msg { color: #ef4444; font-size: 0.875rem;
               margin-top: 1rem; padding: 0.75rem;
               background: #450a0a20; border-radius: 0.375rem; }

/* Card footer */
.nas-card-footer { margin-top: 1.25rem; padding-top: 0.75rem;
                   border-top: 1px solid #1e293b;
                   display: flex; justify-content: flex-end; gap: 0.5rem; }
.btn-edit { padding: 0.3rem 0.75rem; background: transparent;
            color: #94a3b8; border: 1px solid #334155;
            border-radius: 0.375rem; cursor: pointer; font-size: 0.8rem;
            transition: background 0.2s; }
.btn-edit:hover { background: #1e293b; }
.btn-delete { padding: 0.3rem 0.75rem; background: transparent;
              color: #ef4444; border: 1px solid #7f1d1d;
              border-radius: 0.375rem; cursor: pointer; font-size: 0.8rem;
              transition: background 0.2s; }
.btn-delete:hover { background: #450a0a; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.75);
         display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal.hidden { display: none; }
.modal-content { background: #1e293b; border: 1px solid #334155;
                 border-radius: 0.75rem; padding: 2rem;
                 width: 90%; max-width: 480px;
                 display: flex; flex-direction: column; gap: 0.75rem; }
.modal-content h2 { color: #f1f5f9; margin-bottom: 0.25rem; }
.modal-content input[type="text"],
.modal-content input[type="password"],
.modal-content input[type="number"],
.modal-content input:not([type="checkbox"]) {
    padding: 0.625rem 0.875rem;
    background: #0f172a; border: 1px solid #334155;
    border-radius: 0.375rem; color: #e2e8f0; font-size: 0.9375rem;
    width: 100%; transition: border-color 0.15s; }
.modal-content input:focus { outline: none; border-color: #3b82f6; }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem;
                   color: #94a3b8; font-size: 0.875rem; cursor: pointer; }
.modal-buttons { display: flex; gap: 0.75rem; justify-content: flex-end;
                 margin-top: 0.5rem; }
.btn-save { padding: 0.5rem 1.5rem; background: #3b82f6; color: white;
            border: none; border-radius: 0.375rem; cursor: pointer;
            font-size: 0.9375rem; }
.btn-save:hover { background: #2563eb; }
.btn-cancel { padding: 0.5rem 1rem; background: transparent; color: #94a3b8;
              border: 1px solid #475569; border-radius: 0.375rem;
              cursor: pointer; font-size: 0.9375rem; }
.btn-cancel:hover { background: #334155; }

/* Messages */
.error-msg { color: #ef4444; font-size: 0.875rem; }
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 640px) {
    header { padding: 0.75rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
    .nas-grid { padding: 1rem; gap: 1rem; }
    .nas-info { grid-template-columns: auto 1fr; }
}
