body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f8fafc;
    color: #0f172a;
}

* { box-sizing: border-box; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.title {
    margin: 0;
    font-size: 32px;
}

.subtitle {
    margin: 6px 0 0;
    color: #475569;
}

.actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.link-button, .button, .danger-button, .small-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    padding: 10px 14px;
}

.link-button, .button {
    background: #2563eb;
    color: #fff;
}

.nav-active {
    background: #1e3a8a;
}

.danger-button {
    background: #dc2626;
    color: #fff;
}

.small-button {
    background: #16a34a;
    color: #fff;
    padding: 8px 10px;
    margin-right: 8px;
}

.secondary-button {
    background: #e2e8f0;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
}

.card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.input, .select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    padding: 10px 12px;
    color: #0f172a;
}

.form-row {
    margin-bottom: 14px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-weight: 600;
}

.alert { 
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e2e8f0;
}

thead th {
    text-align: left;
    background: #f1f5f9;
    padding: 12px 14px;
    color: #0f172a;
}

tbody td {
    padding: 12px 14px;
    border-top: 1px solid #e2e8f0;
    vertical-align: top;
}

.pagination {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.login-panel {
    max-width: 420px;
    margin: 120px auto;
    background: #111827;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 24px;
    color: #e2e8f0;
}

.login-panel h1 {
    margin-top: 0;
    margin-bottom: 10px;
}

.login-panel .input {
    background: #0f172a;
    color: #f8fafc;
    border-color: #475569;
    margin-bottom: 16px;
}

.login-panel label {
    color: #cbd5e1;
}

.login-panel .button {
    width: 100%;
    padding: 12px 16px;
    background: #2563eb;
}

.error-summary {
    color: #fca5a5;
    margin-bottom: 12px;
}

.code-block {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    margin-top: 12px;
    white-space: pre-wrap;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.58);
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-card {
    width: min(760px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.28);
}

.modal-header,
.modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.modal-header {
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
}

.modal-actions {
    justify-content: flex-start;
    margin-top: 16px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.detail-label {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.detail-value {
    overflow-wrap: anywhere;
    color: #0f172a;
}

.delivery-log {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

@media (max-width: 700px) {
    .detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.inline-flex {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
