/* =========================
   REBAR TOOL CARD (SYSTEM A)
========================= */

.rebar-tool-card {
    max-width: 620px;
    margin: 1rem auto;
    padding: 1rem;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    font-family: Arial, sans-serif;
}

/* Title */
.rebar-tool-card h2 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

/* Sections */
.rebar-tool-card .section {
    margin-bottom: 1rem;
}

/* Labels (IMPORTANT FIX) */
.rebar-tool-card label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

/* ================= INPUT ROW ================= */
.rebar-tool-card .input-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: nowrap;
}

/* Inputs & Selects */
.rebar-tool-card select,
.rebar-tool-card input {
    padding: 0.45rem;
    font-size: 0.85rem;
    border-radius: 6px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

/* Width control (balanced) */
.dia-select { width: 75px; }
.dia-custom { width: 75px; }
.length { width: 85px; }
.qty { width: 70px; }
.price { width: 120px; }

/* Checkbox inline fix */
.price-toggle {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    gap: 4px;
    white-space: nowrap;
}

/* ================= BUTTONS ================= */
.rebar-tool-card .button-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.rebar-tool-card button {
    flex: 1;
    padding: 0.65rem;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
}

.rebar-tool-card .calculate-btn {
    background: #28a745;
    color: #fff;
}

.rebar-tool-card .calculate-btn:hover {
    background: #218838;
}

.rebar-tool-card .reset-btn {
    background: #dc3545;
    color: #fff;
}

.rebar-tool-card .reset-btn:hover {
    background: #b52a37;
}

/* ================= RESULT CARD ================= */
.tool-result-card {
    margin-top: 1rem;
    padding: 0.9rem;
    background: #fff;
    border-left: 6px solid #1e73be;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    font-size: 0.95rem;
}

/* Table */
.rebar-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.rebar-table th,
.rebar-table td {
    border: 1px solid #ddd;
    padding: 6px;
    text-align: center;
}

.rebar-table th {
    background: #f2f2f2;
}

/* ================= MOBILE ================= */
@media (max-width: 480px) {

    .rebar-tool-card .input-row {
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    .dia-select,
    .dia-custom,
    .length,
    .qty,
    .price {
        flex: 1 1 30%;
        min-width: 70px;
    }

    .price-toggle {
        flex: 1 1 100%;
        justify-content: flex-start;
        margin-top: 4px;
    }

    .rebar-tool-card .button-group {
        flex-direction: column;
    }
}

.rebar-tool-card input:focus,
.rebar-tool-card select:focus {
    outline: none;
    border-color: #1e73be;
    box-shadow: 0 0 3px rgba(30,115,190,0.3);
}

.add-btn {
  width: 32px;
  height: 32px;
  background: #007bff;
  color: #fff;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: bold;
}

.add-btn:hover {
  background: #0056b3;
}

.remove-btn {
  width: 32px;
  height: 32px;
  background: #dc3545;
  color: #fff;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: bold;
}

.remove-btn:hover {
  background: #b52a37;
}

.row-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: bold;
  flex-shrink: 0;
}

.add-btn {
  background: #007bff;
  color: #fff;
}

.remove-btn {
  background: #dc3545;
  color: #fff;
}

.bar-item {
  position: relative;
}

.row-action-btn {
  margin-left: auto;
}

/* Waste coloring */
.waste-medium {
    color: #ff9800; /* orange */
    font-weight: 600;
}

.waste-high {
    color: #dc3545; /* red */
    font-weight: 700;
}

#advancedSection,
#advancedToggle,
#advancedBtn {
    display: none !important;
}