/* ---------------------------------------------------------
   Global Styles
--------------------------------------------------------- */

body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f4f6f8;
    color: #222;
}

h1, h2, h3 {
    margin: 0;
    font-weight: 600;
}

p {
    margin: 6px 0;
}

/* ---------------------------------------------------------
   Header
--------------------------------------------------------- */

.app-header {
    background: #1f6feb;
    color: white;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.app-header h1 {
    font-size: 28px;
}

.app-header h2 {
    font-size: 18px;
    opacity: 0.9;
    margin-top: 6px;
}

/* ---------------------------------------------------------
   Layout
--------------------------------------------------------- */

.app-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    padding: 20px;
}

.left-column,
.right-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 1000px) {
    .app-container {
        grid-template-columns: 1fr;
    }
}

/* ---------------------------------------------------------
   Cards
--------------------------------------------------------- */

.card {
    background: white;
    padding: 18px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card h3 {
    margin-bottom: 12px;
    font-size: 18px;
}

/* ---------------------------------------------------------
   Table
--------------------------------------------------------- */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th, td {
    padding: 8px;
    text-align: left;
}

th {
    background: #e9eef5;
    font-weight: 600;
}

tbody tr:nth-child(even) {
    background: #f7f9fc;
}

tbody tr:hover {
    background: #eef4ff;
}

tr.selected-row {
    background: #d8e6ff !important;
}

/* ---------------------------------------------------------
   Form Elements
--------------------------------------------------------- */

.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0;
}

.form-row input,
.form-row select {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

/* ---------------------------------------------------------
   Buttons
--------------------------------------------------------- */

.button-row {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 14px;
    background: #1f6feb;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.btn:hover {
    background: #155ac7;
}

.btn-danger {
    background: #d9534f;
}

.btn-danger:hover {
    background: #b94743;
}

/* ---------------------------------------------------------
   Visual Layer Diagram
--------------------------------------------------------- */

#layer-visual {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0;
}

.layer-bar {
    position: relative;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding-left: 10px;
    display: flex;
    align-items: center;
    transition: height 0.35s ease, background-color 0.35s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    overflow: hidden;
}

.layer-bar span {
    z-index: 2;
}

.layer-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.15;
    background: linear-gradient(to bottom right, #ffffff, #000000);
    pointer-events: none;
}