:root {
    --primary: #2c3e50;
    --secondary: #34495e;
    --pass: #27ae60;
    --fail: #c0392b;
    --bg: #f4f7f6;
    --text: #333;
    --white: #fff;
    --card-bg: #fff;
    --border: #ddd;
    --info-bg: #ecf0f1;
}

body.dark-mode {
    --primary: #34495e;
    --secondary: #2c3e50;
    --bg: #121212;
    --text: #e0e0e0;
    --white: #1e1e1e;
    --card-bg: #1e1e1e;
    --border: #333;
    --info-bg: #2c3e50;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

#app {
    max-width: 600px;
    margin: 0 auto;
    padding: 10px;
}

header {
    text-align: center;
    padding: 10px 15px;
    background-color: var(--primary);
    color: white;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-controls {
    display: flex;
    align-items: center;
}

#dark-mode-toggle {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    z-index: 10;
}

h1, h2, h3 {
    margin: 10px 0;
}

section {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

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

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

input[type="text"], select, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 16px; /* Prevents auto-zoom on iOS */
    background-color: var(--white);
    color: var(--text);
}

.input-row {
    display: flex;
    gap: 10px;
}

.input-row input {
    flex: 1;
}

button {
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}

button:active {
    opacity: 0.7;
}

.primary-btn { background-color: var(--primary); color: white; width: 100%; margin-top: 10px; }
.secondary-btn { background-color: var(--secondary); color: white; }
.danger-btn { background-color: var(--fail); color: white; width: 100%; margin-bottom: 10px; }
.pass-btn { background-color: var(--pass); color: white; flex: 1; height: 60px; }
.fail-btn { background-color: var(--fail); color: white; flex: 1; height: 60px; }
.full-width { width: 100%; }

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

.small-btn {
    padding: 6px 12px;
    font-size: 14px;
    background-color: var(--secondary);
    color: white;
}

.config-transfer-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.config-transfer-actions button, 
.config-transfer-actions .file-input-label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 20px;
    height: 48px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
    line-height: normal;
    box-sizing: border-box;
    border: none;
    margin: 0;
}

.file-input-label {
    display: inline-block;
}

#kpi-list {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

#kpi-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid var(--border);
}

.kpi-item-content {
    display: flex;
    flex-direction: column;
}

.kpi-name {
    font-weight: bold;
}

.kpi-count {
    font-size: 12px;
    color: var(--text);
    opacity: 0.7;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.session-info {
    background: var(--info-bg);
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.session-info p { margin: 5px 0; }

#fail-notes-container {
    margin-top: 20px;
}

#fail-notes {
    height: 100px;
    margin-bottom: 10px;
}

#results-log {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.result-item {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.result-item.pass { border-left: 5px solid var(--pass); }
.result-item.fail { border-left: 5px solid var(--fail); }

.result-header {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
}

.result-meta {
    font-size: 12px;
    color: var(--text);
    opacity: 0.7;
}

.result-notes {
    margin-top: 5px;
    font-style: italic;
    background: var(--bg);
    padding: 5px;
}

@media (max-width: 480px) {
    #app { padding: 5px; }
    button { padding: 10px; }
}
