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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

header {
    background: #1a1a2e;
    padding: 0 2rem;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    height: 56px;
}

.logo {
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

h2 { margin-bottom: 1rem; }
h3 { margin-bottom: 0.5rem; }

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

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-success { background: #d4edda; color: #155724; }
.badge-error   { background: #f8d7da; color: #721c24; }
.badge-info    { background: #d1ecf1; color: #0c5460; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.875rem;
}
.btn:hover { background: #f0f0f0; }
.btn-primary { background: #1a1a2e; color: #fff; border-color: #1a1a2e; }
.btn-primary:hover { background: #2a2a4e; }
.btn-small { padding: 0.25rem 0.5rem; font-size: 0.8rem; }
.btn-delete {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-weight: bold;
    padding: 0 0.3rem;
}
.btn-delete:hover { color: #a71d2a; }
.btn-approve { background: #28a745; color: #fff; border-color: #28a745; }
.btn-approve:hover { background: #218838; }
.btn-reject { background: #dc3545; color: #fff; border-color: #dc3545; }
.btn-reject:hover { background: #c82333; }
.btn-disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: default;
}
.request-actions { display: flex; gap: 0.25rem; }
.pending-section { margin-bottom: 2rem; }

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.table th, .table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.table th { background: #f8f9fa; font-weight: 600; }
.table tr:hover { background: #f8f9fa; }

/* Forms */
.form {
    background: #fff;
    padding: 2rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    max-width: 500px;
}
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
    font-size: 0.875rem;
}
.form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
}
.form-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.5rem;
}

/* Upload Grid */
.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}
.upload-section {
    background: #fff;
    padding: 1.25rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.upload-hint {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 0.5rem;
}
.upload-area {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}
.upload-area input[type="file"] {
    font-size: 0.8rem;
    flex: 1;
}
.file-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}
.file-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.8rem;
    border-bottom: 1px solid #f0f0f0;
}

/* Customer Info */
.customer-info {
    background: #fff;
    padding: 1rem 1.25rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}
.customer-info p { margin-bottom: 0.25rem; }

/* Build Actions */
.build-actions {
    background: #fff;
    padding: 1.25rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Build Result */
.build-result {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.result-success { border-left: 4px solid #28a745; }
.result-error   { border-left: 4px solid #dc3545; }
.result-header {
    padding: 1rem 1.25rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    border-bottom: 1px solid #eee;
}
.log-output {
    padding: 1rem 1.25rem;
    background: #1a1a2e;
    color: #e0e0e0;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* Download */
.download-section {
    background: #fff;
    padding: 1.25rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.download-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Output Section */
.output-section {
    background: #fff;
    padding: 1.25rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.empty-state {
    color: #666;
    padding: 2rem;
    text-align: center;
}

.inline { display: inline; }

/* Token section */
.token-section {
    background: #fff;
    padding: 1.25rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin: 1.5rem 0;
}
.token-link {
    background: #f8f9fa;
    border: 2px dashed #1a1a2e;
    border-radius: 4px;
    padding: 1rem;
    margin: 0.75rem 0;
    word-break: break-all;
}
.token-link code {
    font-size: 0.95rem;
    color: #1a1a2e;
}

/* Upload overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.overlay-content {
    background: #fff;
    padding: 2rem 3rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.overlay-content p {
    margin-top: 1rem;
    font-size: 1rem;
    color: #333;
}
.spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 4px solid #ddd;
    border-top-color: #1a1a2e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* Login */
.login-container {
    max-width: 400px;
    margin: 3rem auto;
    text-align: center;
}
.login-container .form {
    margin: 0 auto;
    text-align: left;
}
.login-subtitle {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}
.login-divider {
    text-align: center;
    margin: 1.25rem 0;
    position: relative;
}
.login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 1px solid #ddd;
}
.login-divider span {
    background: #f5f5f5;
    padding: 0 0.75rem;
    position: relative;
    color: #999;
    font-size: 0.8rem;
    text-transform: uppercase;
}
.btn-full {
    width: 100%;
    text-align: center;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
.modal-box {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    max-width: 400px;
    width: 90%;
    overflow: hidden;
    animation: slideUp 0.25s ease;
}
.modal-header {
    background: #1a1a2e;
    color: #fff;
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
}
.modal-body {
    padding: 1.5rem 1.25rem;
    font-size: 0.9rem;
    color: #333;
    line-height: 1.5;
}
.modal-footer {
    padding: 0.75rem 1.25rem;
    text-align: right;
    border-top: 1px solid #eee;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.hidden { display: none; }
