* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: 100%;
}

.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-card {
    overflow-y: auto;
    max-height: 90vh;
}

.logs-card {
    grid-column: 2;
    grid-row: 1;
    overflow-y: auto;
    max-height: 90vh;
}

.main-card::-webkit-scrollbar,
.logs-card::-webkit-scrollbar {
    width: 8px;
}

.main-card::-webkit-scrollbar-track,
.logs-card::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.main-card::-webkit-scrollbar-thumb,
.logs-card::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.main-card::-webkit-scrollbar-thumb:hover,
.logs-card::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    flex-shrink: 0;
}

.header h1 {
    font-size: 26px;
    color: #333;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff6b6b;
    animation: pulse 1s infinite;
}

.status-dot.ready {
    background: #51cf66;
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* TABS */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    flex-shrink: 0;
}

.tab-btn {
    padding: 12px 18px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: #999;
    transition: all 0.3s;
    font-size: 13px;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #333;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s;
    background: #fafafa;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    color: #999;
    font-size: 11px;
    margin-top: 2px;
}

/* CHECKBOXES & RADIOS */
.actions-grid,
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-item,
.radio-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    background: #fafafa;
    position: relative;
    overflow: hidden;
}

.checkbox-item::before,
.radio-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: -1;
}

.checkbox-item:hover,
.radio-item:hover {
    border-color: #667eea;
    transform: translateX(2px);
    background: rgba(102, 126, 234, 0.02);
}

/* CUSTOM CHECKBOX */
.checkbox-item input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    border: 2.5px solid #d0d0d0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.checkbox-item input[type="checkbox"]:hover {
    border-color: #667eea;
    box-shadow: 0 0 12px rgba(102, 126, 234, 0.2);
}

.checkbox-item input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    box-shadow: 0 0 12px rgba(102, 126, 234, 0.3);
}

.checkbox-item input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 16px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: checkmark 0.3s ease;
}

@keyframes checkmark {
    0% {
        transform: translate(-50%, -50%) scale(0);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* CUSTOM RADIO */
.radio-item input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    border: 2.5px solid #d0d0d0;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.radio-item input[type="radio"]:hover {
    border-color: #667eea;
    box-shadow: 0 0 12px rgba(102, 126, 234, 0.2);
}

.radio-item input[type="radio"]:checked {
    border-color: #667eea;
    box-shadow: 0 0 12px rgba(102, 126, 234, 0.3);
}

.radio-item input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: radioCheck 0.3s ease;
}

@keyframes radioCheck {
    0% {
        transform: translate(-50%, -50%) scale(0);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

.checkbox-item input[type="checkbox"]:checked + span,
.radio-item input[type="radio"]:checked + span {
    color: #667eea;
    font-weight: 600;
}

.checkbox-item span,
.radio-item span {
    flex: 1;
    font-size: 14px;
    transition: all 0.3s;
    color: #333;
}

/* BUTTONS */
.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-top: 10px;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    padding: 8px 16px;
    font-size: 12px;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-success {
    width: 100%;
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
    color: white;
    margin-top: 10px;
    box-shadow: 0 5px 15px rgba(81, 207, 102, 0.3);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(81, 207, 102, 0.4);
}

.btn-success:active:not(:disabled) {
    transform: translateY(0);
}

.btn-success:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* PROGRESS */
.progress-section {
    margin-top: 20px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    animation: loading 1.5s infinite;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.6);
}

@keyframes loading {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.progress-text {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
    text-align: center;
    font-weight: 500;
}

/* STATS */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 10px;
    flex-shrink: 0;
}

.stat-item {
    text-align: center;
    padding: 16px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
}

.stat-label {
    display: block;
    font-size: 11px;
    color: #999;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #667eea;
}

/* LOGS */
.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 12px;
    flex-shrink: 0;
}

.logs-header h2 {
    font-size: 18px;
    color: #333;
}

.logs-container {
    background: #1e1e1e;
    border-radius: 10px;
    padding: 15px;
    flex: 1;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
}

.logs-container::-webkit-scrollbar {
    width: 6px;
}

.logs-container::-webkit-scrollbar-track {
    background: #333;
    border-radius: 10px;
}

.logs-container::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 10px;
}

.logs-container::-webkit-scrollbar-thumb:hover {
    background: #888;
}

.log-entry {
    margin-bottom: 6px;
    line-height: 1.5;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.log-entry.log-info {
    color: #888;
}

.log-entry.log-success {
    color: #51cf66;
    font-weight: 600;
}

.log-entry.log-error {
    color: #ff6b6b;
    font-weight: 600;
}

.log-entry.log-warning {
    color: #ffd43b;
    font-weight: 600;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr;
    }

    .logs-card {
        grid-column: 1;
        grid-row: 2;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .card {
        padding: 20px;
        border-radius: 12px;
    }

    .container {
        gap: 15px;
    }

    .header {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 15px;
    }

    .header h1 {
        font-size: 20px;
        text-align: center;
    }

    .status-badge {
        align-self: center;
    }

    .tabs {
        gap: 5px;
    }

    .tab-btn {
        padding: 10px 12px;
        font-size: 12px;
        flex: 1;
    }

    .form-group {
        gap: 6px;
    }

    .form-group label {
        font-size: 12px;
    }

    .form-group input[type="text"],
    .form-group input[type="number"],
    .form-group textarea {
        padding: 10px;
        font-size: 14px;
    }

    .actions-grid,
    .radio-group {
        gap: 8px;
    }

    .checkbox-item,
    .radio-item {
        padding: 12px;
        font-size: 13px;
        gap: 10px;
    }

    .checkbox-item input[type="checkbox"],
    .radio-item input[type="radio"] {
        width: 22px;
        height: 22px;
        min-width: 22px;
        min-height: 22px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 13px;
    }

    .btn-primary,
    .btn-success {
        margin-top: 8px;
    }

    .progress-section {
        margin-top: 15px;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 15px;
        margin-top: 15px;
    }

    .stat-item {
        padding: 12px;
    }

    .stat-label {
        font-size: 10px;
        margin-bottom: 6px;
    }

    .stat-value {
        font-size: 20px;
    }

    .logs-header h2 {
        font-size: 16px;
    }

    .logs-container {
        font-size: 11px;
        padding: 12px;
    }

    .main-card,
    .logs-card {
        max-height: 60vh;
    }
}

/* EXTRA SMALL DEVICES */
@media (max-width: 480px) {
    body {
        padding: 8px;
    }

    .card {
        padding: 16px;
        border-radius: 10px;
    }

    .container {
        gap: 10px;
    }

    .header {
        margin-bottom: 12px;
        border-bottom: 1px solid #f0f0f0;
        padding-bottom: 10px;
    }

    .header h1 {
        font-size: 16px;
    }

    .status-badge {
        font-size: 11px;
        padding: 6px 12px;
    }

    .tabs {
        gap: 4px;
        margin-bottom: 15px;
    }

    .tab-btn {
        padding: 8px 10px;
        font-size: 11px;
        font-weight: 500;
    }

    .form-group {
        gap: 5px;
        margin-bottom: 12px;
    }

    .form-group label {
        font-size: 11px;
        font-weight: 600;
    }

    .form-group input[type="text"],
    .form-group input[type="number"],
    .form-group textarea {
        padding: 10px;
        font-size: 14px;
        border-radius: 6px;
    }

    .form-group small {
        font-size: 10px;
    }

    .actions-grid,
    .radio-group {
        gap: 6px;
    }

    .checkbox-item,
    .radio-item {
        padding: 10px 12px;
        font-size: 12px;
        gap: 8px;
        border-radius: 8px;
        border-width: 2px;
    }

    .checkbox-item input[type="checkbox"],
    .radio-item input[type="radio"] {
        width: 20px;
        height: 20px;
        min-width: 20px;
        min-height: 20px;
    }

    .checkbox-item span,
    .radio-item span {
        font-size: 12px;
    }

    .btn {
        padding: 11px 16px;
        font-size: 12px;
        border-radius: 8px;
        letter-spacing: 0.3px;
    }

    .btn-primary,
    .btn-success {
        margin-top: 6px;
    }

    .progress-section {
        margin-top: 12px;
        margin-bottom: 15px;
    }

    .progress-bar {
        height: 6px;
    }

    .progress-text {
        font-size: 11px;
    }

    .stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 12px;
        margin-top: 12px;
        border-radius: 8px;
    }

    .stat-item {
        padding: 10px;
        border-radius: 8px;
    }

    .stat-label {
        font-size: 9px;
        margin-bottom: 4px;
    }

    .stat-value {
        font-size: 18px;
    }

    .logs-header {
        margin-bottom: 10px;
        padding-bottom: 8px;
    }

    .logs-header h2 {
        font-size: 14px;
    }

    .logs-container {
        font-size: 10px;
        padding: 10px;
        border-radius: 8px;
        line-height: 1.5;
    }

    .log-entry {
        margin-bottom: 4px;
    }

    .main-card,
    .logs-card {
        max-height: 50vh;
    }

    /* Fix input styling on mobile */
    input[type="text"],
    input[type="number"],
    textarea {
        font-size: 16px !important;
        border-radius: 6px;
    }
}

/* VERY SMALL DEVICES (< 360px) */
@media (max-width: 360px) {
    .card {
        padding: 12px;
    }

    .header h1 {
        font-size: 14px;
    }

    .tab-btn {
        padding: 6px 8px;
        font-size: 10px;
    }

    .checkbox-item,
    .radio-item {
        padding: 8px 10px;
        font-size: 11px;
    }

    .checkbox-item input[type="checkbox"],
    .radio-item input[type="radio"] {
        width: 18px;
        height: 18px;
    }

    .stats {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .stat-value {
        font-size: 16px;
    }

    .logs-container {
        font-size: 9px;
    }

    .main-card,
    .logs-card {
        max-height: 45vh;
    }
}
