* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: stretch;
    min-height: 100vh;
    padding: 20px;
}

.container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    padding: 48px;
    max-width: 900px;
    width: 100%;
    display: flex;
    flex-direction: column;
}

h1 {
    text-align: center;
    font-size: 28px;
    color: #333;
    margin-bottom: 40px;
    font-weight: 600;
}

.workflow {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr auto 1fr;
    gap: 24px;
    align-items: stretch;
    flex: 1;
    min-height: 70vh;
}

/* Labels row */
.label-make-changes {
    grid-column: 1;
    grid-row: 1;
    text-align: center;
    font-size: 16px;
    color: #333;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
}

.label-publish {
    grid-column: 2;
    grid-row: 1;
    text-align: center;
    font-size: 16px;
    color: #333;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
}

/* Boxes */
.box {
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    color: #000;
    font-size: 20px;
    font-weight: 600;
    padding: 32px 24px;
    min-height: 260px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: default;
    position: relative;
}

.box:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.box-test {
    grid-column: 1;
    grid-row: 2;
    background: #7ED957;
}

.box-test .box-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.box-live {
    grid-column: 1;
    grid-row: 4;
    background: #38B6FF;
}

.box-live .box-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.box-transfer {
    grid-column: 2;
    grid-row: 2;
    background: #FFBD59;
}

.box-transfer .box-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.box-transfer .arrow {
    font-size: 60px;
    margin: 16px 0;
    line-height: 1;
}

/* Middle label */
.label-prepare {
    grid-column: 1;
    grid-row: 3;
    text-align: center;
    font-size: 16px;
    color: #333;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
}

/* Manage Live DB label */
.label-manage-live {
    grid-column: 2;
    grid-row: 3;
    text-align: center;
    font-size: 16px;
    color: #333;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
}

/* Manage Live DB box */
.box-manage-live {
    grid-column: 2;
    grid-row: 4;
    background: #C084FC;
}

/* Action button */
.box .action-btn {
    margin-top: 16px;
    padding: 10px 24px;
    border: 2px solid #1a5c1a;
    background: #2d7a2d;
    color: #000;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.box .action-btn:hover {
    background: #1a5c1a;
}

.box .action-btn-blue {
    border: 2px solid #0f4c72;
    background: #1a6fa8;
}

.box .action-btn-blue:hover {
    background: #0f4c72;
}

.box .action-btn-blue:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.box .action-btn-orange {
    border: 2px solid #b87a1a;
    background: #d4892a;
}

.box .action-btn-orange:hover {
    background: #b87a1a;
}

.box .action-btn-orange:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.box .action-btn-purple {
    border: 2px solid #7c3aed;
    background: #9b5de5;
}

.box .action-btn-purple:hover {
    background: #7c3aed;
}

.box .action-btn-purple:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Command output */
.box .cmd-output {
    margin-top: 12px;
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    padding: 12px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    font-weight: 400;
    color: #000;
    min-height: 80px;
    max-height: 160px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Status indicators */
.status {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-active {
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(255,255,255,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(255,255,255,0.1); }
}

/* Logout bar */
.logout-bar {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    padding: 0 0 8px 0;
    margin-bottom: 8px;
    font-size: 13px;
    color: #666;
    border-bottom: 1px solid #eee;
}

.logout-link {
    color: #666;
    text-decoration: none;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    transition: background 0.2s ease, color 0.2s ease;
}

.logout-link:hover {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
}

/* Login page */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    padding: 48px 40px;
    text-align: center;
}

.login-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.login-title {
    font-size: 26px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 14px;
    color: #888;
    margin-bottom: 32px;
}

.login-error {
    background: #fee2e2;
    color: #dc2626;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    border: 1px solid #fca5a5;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-field {
    text-align: left;
}

.login-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.login-field input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.login-field input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.1s ease;
}

.login-btn:hover {
    opacity: 0.9;
}

.login-btn:active {
    transform: scale(0.98);
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 24px;
    }

    .workflow {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .label-make-changes,
    .label-publish,
    .box-test,
    .box-transfer,
    .label-prepare,
    .box-live,
    .label-manage-live,
    .box-manage-live {
        grid-column: 1;
    }

    .label-make-changes { grid-row: 1; }
    .box-test { grid-row: 2; }
    .label-prepare { grid-row: 3; }
    .box-live { grid-row: 4; }
    .label-publish { grid-row: 5; }
    .box-transfer { grid-row: 6; }
    .label-manage-live { grid-row: 7; }
    .box-manage-live { grid-row: 8; }

    h1 {
        font-size: 22px;
        margin-bottom: 24px;
    }
}
