* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    padding: 2rem;
    font-size: 16px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

header {
    background: #2d6a4f;
    color: white;
    padding: 1.4rem 2rem;
    border-radius: 10px 10px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

#tunnel-badge {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    border: 1px solid rgba(255,255,255,0.4);
}

.card {
    background: white;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 2rem;
}

/* Formulário de adição */
.add-form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.8rem;
    flex-wrap: wrap;
    align-items: center;
}

.add-form input {
    flex: 1;
    min-width: 160px;
    padding: 0.75rem 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.add-form input:focus {
    outline: none;
    border-color: #2d6a4f;
}

.add-form input::placeholder {
    color: #aaa;
}

#in-porta {
    max-width: 100px;
    flex: 0 0 100px;
}

/* Campo de subdomínio composto */
.subdomain-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
    flex: 2;
    min-width: 300px;
    transition: border-color 0.2s;
}

.subdomain-wrap:focus-within {
    border-color: #2d6a4f;
}

.subdomain-prefix,
.subdomain-suffix {
    background: #f0f2f5;
    color: #555;
    padding: 0.75rem 0.7rem;
    font-size: 1rem;
    white-space: nowrap;
    user-select: none;
}

.subdomain-wrap input {
    flex: 1;
    min-width: 100px;
    border: none;
    border-radius: 0;
    padding: 0.75rem 0.5rem;
    font-size: 1rem;
}

/* Botões */
.btn {
    padding: 0.75rem 1.3rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 500;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.btn:hover { opacity: 0.85; }

.btn-green { background: #2d6a4f; color: white; }
.btn-blue  { background: #2563eb; color: white; }
.btn-red   { background: #dc2626; color: white; padding: 0.5rem 0.9rem; font-size: 0.95rem; }

/* Tabela */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}

thead tr {
    background: #e9f5ee;
    color: #1b4332;
}

th, td {
    padding: 0.9rem 1.1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

th { font-weight: 600; white-space: nowrap; }

tbody tr:hover { background: #f9fafb; }

tr.row-default { background: #e9f5ee; }
tr.row-default:hover { background: #d8eddf; }

.tag-raspberry {
    background: #2d6a4f;
    color: white;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    vertical-align: middle;
    margin-left: 0.4rem;
}

td a {
    color: #2563eb;
    text-decoration: none;
}

td a:hover { text-decoration: underline; }

td.actions { white-space: nowrap; }

.empty-msg {
    text-align: center;
    color: #999;
    padding: 2rem;
    font-style: italic;
    font-size: 1rem;
}

/* Toast */
#toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: #1b4332;
    color: white;
    padding: 0.9rem 1.4rem;
    border-radius: 8px;
    font-size: 1rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

#toast.show {
    opacity: 1;
    transform: translateY(0);
}

.save-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.2rem;
}

/* Barra de IPs */
.ip-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 0.7rem 1.5rem;
    border-top: 1px solid #d1fae5;
    border-left: 4px solid #2d6a4f;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    margin-bottom: 0.2rem;
}

.ip-label {
    font-size: 0.85rem;
    color: #6b7280;
    margin-right: 0.3rem;
    white-space: nowrap;
}

.ip-chip {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.88rem;
    font-family: 'Courier New', monospace;
}

.ip-chip-vpn {
    background: #eff6ff;
    border-color: #2563eb;
    color: #1d4ed8;
}
