/* ===== WireCutter — Dark Theme ===== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
    --bg: #0f1117;
    --bg-card: #1a1d27;
    --bg-card-hover: #1f2230;
    --bg-input: #12141c;
    --border: #2a2d3a;
    --border-focus: #6c5ce7;

    --text: #e8e9ed;
    --text-muted: #8b8fa3;
    --text-heading: #f0f1f5;

    --primary: #6c5ce7;
    --primary-hover: #7c6ef7;
    --primary-glow: rgba(108, 92, 231, 0.3);

    --danger: #e74c3c;
    --danger-hover: #f75c4c;
    --danger-glow: rgba(231, 76, 60, 0.3);

    --success: #00cec9;
    --success-bg: rgba(0, 206, 201, 0.1);
    --success-border: rgba(0, 206, 201, 0.3);

    --error-bg: rgba(231, 76, 60, 0.1);
    --error-border: rgba(231, 76, 60, 0.3);

    --secondary: #2d3142;
    --secondary-hover: #3d4162;

    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
}

html { font-size: 16px; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* ===== HEADER ===== */

header {
    background: rgba(26, 29, 39, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.02em;
}

nav {
    display: flex;
    gap: 0.25rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255,255,255,0.05);
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-glow);
}

.nav-logout {
    color: var(--danger);
    opacity: 0.7;
}

.nav-logout:hover {
    opacity: 1;
    background: var(--error-bg);
}

/* ===== MAIN ===== */

main {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ===== CARDS ===== */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    transition: border-color var(--transition);
}

.card:hover {
    border-color: rgba(108, 92, 231, 0.2);
}

.card h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 1.25rem;
    letter-spacing: -0.01em;
}

.card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-heading);
    margin: 1.5rem 0 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

/* ===== STATUS BAR ===== */

.status-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
    transition: background var(--transition);
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px rgba(0, 206, 201, 0.5);
}

.status-dot.offline {
    background: var(--danger);
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.5);
}

/* ===== FORMS ===== */

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-styled,
.select-styled {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9375rem;
    font-family: inherit;
    outline: none;
    transition: all var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

.input-styled:focus,
.select-styled:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.select-styled {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%238b8fa3' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

input[type="number"] {
    -moz-appearance: textfield;
}

.form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 140px;
}

.flex-grow { flex-grow: 1; }

/* ===== BUTTONS ===== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    outline: none;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: var(--danger-hover);
    box-shadow: 0 4px 20px var(--danger-glow);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--secondary-hover);
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
}

.btn-full {
    width: 100%;
}

.btn-self-end {
    align-self: flex-end;
    margin-bottom: 1rem;
}

.btn-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.btn-group .btn {
    flex: 1;
}

/* ===== PROGRESS ===== */

.progress-section {
    margin: 1rem 0 0.5rem;
}

.progress-bar-wrap {
    width: 100%;
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 4px;
    transition: width 0.4s ease;
}

.progress-text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-weight: 500;
}

/* ===== TABLE ===== */

.table-wrap {
    overflow-x: auto;
    margin-bottom: 0.5rem;
}

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

th, td {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    color: var(--text);
}

tr:last-child td {
    border-bottom: none;
}

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

/* ===== ALERTS ===== */

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.alert-success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success);
}

.alert-error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--danger);
}

/* ===== TEXT ===== */

.text-muted {
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

/* ===== LOGIN PAGE ===== */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.25rem;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(108, 92, 231, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(0, 206, 201, 0.06) 0%, transparent 50%),
        var(--bg);
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    text-align: center;
}

.login-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.login-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

.login-card .form-group {
    text-align: left;
}

.login-card .btn {
    margin-top: 0.5rem;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 600px) {
    .header-inner {
        height: auto;
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    nav {
        width: 100%;
        justify-content: center;
    }

    .form-row {
        flex-direction: column;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-self-end {
        align-self: stretch;
    }

    .card {
        padding: 1.25rem;
    }
}
