:root {
    --primary: #2c3e50;
    --secondary: #34495e;
    --accent: #3498db;
    --success: #27ae60;
    --danger: #e74c3c;
    --light: #f4f7f6;
    --white: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light);
    margin: 0;
    color: var(--primary);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:visited {
    color: var(--accent);
}

a:hover {
    color: var(--secondary);
    text-decoration: none;
}

.container {
    max-width: 90%;
    margin: 0 auto;
    padding: 0 20px;
}

.table-responsive {
    overflow: auto;
    width: 100%;
    margin-bottom: 15px;
    max-height: calc(100vh - 250px);
    border: 1px solid #ddd;
    border-radius: 4px;
}

.navbar {
    background-color: var(--primary);
    color: var(--white);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar .brand {
    font-size: 24px;
    font-weight: bold;
    color: var(--white);
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
}

.main-content {
    padding-top: 20px;
    min-height: 80vh;
}

.card {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

h1, h2 {
    margin-top: 0;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"], input[type="password"], textarea, select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

button, .btn {
    background-color: var(--accent);
    color: white !important;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

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

.alert {
    background-color: #d1ecf1;
    color: #0c5460;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

/* Sticky last column (Actions) */
#tests-table th:last-child,
#tests-table td:last-child {
    position: sticky;
    right: 0;
    z-index: 5;
    box-shadow: -2px 0 5px -2px rgba(0,0,0,0.1);
}

#tests-table th:last-child {
    z-index: 15;
    background-color: #f4f7f6; /* Matching var(--light) */
}

#tests-table tr:nth-child(even) td:last-child {
    background-color: #f9f9f9;
}

#tests-table tr:nth-child(odd) td:last-child {
    background-color: #ffffff;
}

#tests-table tr:hover td:last-child {
    background-color: #f0f0f0;
}

th {
    background-color: var(--light);
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 2px -1px rgba(0,0,0,0.1);
}

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.param-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    color: white !important;
    text-decoration: none;
    border: none;
    cursor: pointer;
    margin-right: 2px;
}

.btn-edit { background-color: var(--accent); }
.btn-duplicate { background-color: var(--success); }
.btn-delete { background-color: var(--danger); }
.btn-run { background-color: #f39c12; }
.btn-remove { background-color: var(--danger); color: white; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; }

.status-Pass { color: var(--success); font-weight: bold; }
.status-Fail { color: var(--danger); font-weight: bold; }
.status-Blocked { color: #f39c12; font-weight: bold; }
/* Dropdown Checkbox List */
.dropdown-check-list {
    display: inline-block;
    position: relative;
    width: 100%;
}
.dropdown-check-list .anchor {
    position: relative;
    cursor: pointer;
    display: block;
    padding: 8px 30px 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dropdown-check-list .anchor:after {
    position: absolute;
    content: "";
    border-left: 2px solid black;
    border-top: 2px solid black;
    padding: 3px;
    right: 12px;
    top: 35%;
    transform: rotate(-135deg);
}
.dropdown-check-list .items {
    padding: 8px;
    display: none;
    position: absolute;
    z-index: 1000;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    width: 100%;
    box-sizing: border-box;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.dropdown-check-list.visible .items {
    display: block;
}
.dropdown-check-list .items label {
    display: block;
    padding: 4px 0;
    font-weight: normal;
    font-size: 13px;
    cursor: pointer;
}
.dropdown-check-list .items input {
    width: auto;
    margin-right: 8px;
}

/* Draggable Column List (Horizontal) */
.sortable-container {
    overflow-x: auto;
    width: 100%;
    background: #fcfcfc;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #eee;
}
#sortable-cols {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 10px;
}
#sortable-cols li {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: move;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}
#sortable-cols li:hover {
    background: #eee;
}
#sortable-cols li .handle {
    color: #ccc;
    cursor: move;
}
.btn-icon:hover {
    opacity: 0.8;
}

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.settings-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    margin-top: 30px;
    align-items: start;
}

.settings-sidebar {
    position: sticky;
    top: 100px;
}

.settings-sidebar ul {
    list-style: none;
    padding: 10px;
    margin: 0;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.settings-sidebar li {
    margin-bottom: 5px;
}

.settings-sidebar li:last-child {
    margin-bottom: 0;
}

.settings-sidebar a {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    text-decoration: none;
    color: #64748b;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.settings-sidebar a:hover {
    background: #f1f5f9;
    color: var(--primary);
    transform: translateX(5px);
}

.settings-sidebar a.active {
    background: #eff6ff;
    color: var(--accent);
    box-shadow: inset 4px 0 0 var(--accent);
}

.settings-content {
    min-width: 0; /* Prevents flex/grid blowouts */
}

.card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.03);
    margin-bottom: 30px;
}

.card h2 {
    font-size: 1.25rem;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--primary);
}

.badge {
    background: #f1f5f9;
    color: #475569;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-type {
    background: #dcfce7;
    color: #166534;
}

/* Modern Inputs */
input[type="text"], input[type="password"], textarea, select {
    border: 1.5px solid #e2e8f0;
    padding: 12px 15px;
    border-radius: 8px;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

footer {
    text-align: center;
    padding: 20px 0;
    color: #777;
}

/* Sorting Links Styling */
th a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

th a:hover {
    color: var(--accent);
}

.sort-icon {
    font-size: 10px;
    opacity: 0.6;
    display: inline-flex;
    flex-direction: column;
    line-height: 1;
}

.sort-icon.active {
    opacity: 1;
    color: var(--accent);
}
