* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f3f5f7;
    color: #1f2937;
    font-family: Arial, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: #111827;
    color: #fff;
    padding: 24px 18px;
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 28px;
}

.brand strong {
    font-size: 22px;
}

.brand span {
    color: #9ca3af;
    font-size: 13px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav a {
    border-radius: 8px;
    color: #d1d5db;
    padding: 10px 12px;
}

.nav a:hover {
    background: #1f2937;
    color: #fff;
}

.main-content {
    flex: 1;
    padding: 28px;
}

.topbar {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
}

.topbar h1 {
    margin: 0 0 6px;
}

.topbar p {
    color: #6b7280;
    margin: 0;
}

.user-menu {
    align-items: center;
    display: flex;
    gap: 14px;
}

.user-menu a,
.button {
    background: #2563eb;
    border: 0;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: inline-block;
    font-size: 14px;
    padding: 10px 14px;
}

.button-secondary {
    background: #4b5563;
}

.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    padding: 22px;
}

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

.stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat strong {
    font-size: 28px;
}

.stat span {
    color: #6b7280;
}

.login-page {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-card {
    max-width: 420px;
    width: 100%;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
}

.form-control {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    padding: 10px 12px;
    width: 100%;
}

.form-group small {
    color: #6b7280;
    display: block;
    margin-top: 6px;
}

.form-section {
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 22px;
    padding-bottom: 18px;
}

.form-section h2 {
    margin: 0 0 16px;
}

.two-columns {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.info-list {
    display: grid;
    gap: 12px;
}

.info-list div {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: grid;
    gap: 6px;
    padding: 12px;
}

.info-list span {
    color: #4b5563;
}

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

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
}

.mt-18 {
    margin-top: 18px;
}

.checkbox-line {
    align-items: center;
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.status {
    border-radius: 999px;
    display: inline-block;
    font-size: 13px;
    font-weight: bold;
    padding: 5px 10px;
}

.status-success {
    background: #dcfce7;
    color: #166534;
}

.status-error {
    background: #fee2e2;
    color: #991b1b;
}

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

.actions form {
    margin: 0;
}

.inline-form {
    align-items: center;
    display: flex;
    gap: 8px;
    min-width: 220px;
}

.inline-form .form-control {
    min-width: 110px;
}

.mb-18 {
    margin-bottom: 18px;
}

.inline-number {
    display: inline-block;
    margin-right: 8px;
    max-width: 120px;
}

.filter-form {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(240px, 2fr) minmax(180px, 1fr) minmax(180px, 1fr) auto auto;
    margin-bottom: 18px;
}

.pagination {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.detail-list {
    display: grid;
    gap: 10px;
}

.detail-list div {
    border-bottom: 1px solid #e5e7eb;
    display: grid;
    gap: 4px;
    padding-bottom: 10px;
}

.detail-list strong {
    color: #374151;
    font-size: 13px;
    text-transform: uppercase;
}

.detail-list span {
    color: #111827;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.code-area {
    font-family: Consolas, monospace;
}

.variable-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.variable-list code {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    color: #3730a3;
    padding: 6px 10px;
}

.preview-box {
    border-top: 1px solid #e5e7eb;
    margin-top: 20px;
    padding-top: 18px;
}

.mail-preview-frame {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    margin-bottom: 14px;
    padding: 16px;
}

button:disabled,
.button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

@media (max-width: 900px) {
    .filter-form {
        grid-template-columns: 1fr;
    }
}

.dashboard-sections {
    display: grid;
    gap: 18px;
    grid-template-columns: 1fr;
    margin-top: 18px;
}

.section-title {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.section-title h2 {
    margin: 0;
}

.section-title span,
.muted {
    color: #6b7280;
}

.log-block {
    border-top: 1px solid #e5e7eb;
    padding: 14px 0;
}

.log-block:first-of-type {
    border-top: 0;
}

.log-block h3 {
    margin: 0 0 10px;
}

.log-list {
    background: #111827;
    border-radius: 8px;
    color: #d1d5db;
    font-family: Consolas, monospace;
    font-size: 13px;
    list-style: none;
    margin: 0;
    overflow-x: auto;
    padding: 12px;
}

.log-list li + li {
    margin-top: 6px;
}

.log-file-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.table-wrap {
    margin-bottom: 22px;
    overflow-x: auto;
}

.output-box {
    background: #111827;
    border-radius: 8px;
    color: #d1d5db;
    font-family: Consolas, monospace;
    font-size: 13px;
    margin: 0;
    max-height: 420px;
    overflow: auto;
    padding: 14px;
    white-space: pre-wrap;
}

.log-lines {
    background: #111827;
    border-radius: 8px;
    color: #d1d5db;
    font-family: Consolas, monospace;
    font-size: 13px;
    margin-bottom: 18px;
    max-height: 620px;
    overflow: auto;
    padding: 12px;
}

.log-line {
    display: grid;
    gap: 12px;
    grid-template-columns: 70px 1fr;
    line-height: 1.5;
    padding: 4px 0;
}

.log-line span {
    color: #9ca3af;
    text-align: right;
}

.log-line code {
    white-space: pre-wrap;
}

.log-line-error code {
    color: #fecaca;
}

table {
    border-collapse: collapse;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid #e5e7eb;
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f9fafb;
    color: #374151;
    font-size: 13px;
    text-transform: uppercase;
}
