/* ACPS WebUI Stylesheet */

:root {
    --primary-color: #1d4ed8;
    --secondary-color: #475569;
    --success-color: #047857;
    --danger-color: #b91c1c;
    --warning-color: #b45309;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
    --header-bg: #0f172a;
    --footer-bg: #1e293b;
}

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

body {
    font-family: "Segoe UI", "Noto Sans", "DejaVu Sans", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 0 16px;
}

.header {
    background: linear-gradient(130deg, #0f172a, #1e3a8a);
    color: #fff;
    padding: 14px 20px;
    margin-top: 12px;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.25);
}

.header .logo h1 {
    font-size: 1.35rem;
    font-weight: 700;
}

.subtle {
    color: #cbd5e1;
    font-size: 0.86rem;
}

.nav {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nav a {
    color: #fff;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
}

.nav a:hover {
    background-color: rgba(255, 255, 255, 0.17);
}

.main-content {
    padding: 24px 0 120px;
}

.main-content h2 {
    margin-bottom: 18px;
}

.hero {
    text-align: center;
    padding: 32px 0;
}

.hero h2 {
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    color: var(--primary-color);
    margin-bottom: 10px;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 18px;
}

.actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.05s ease-in-out;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background: #1e40af;
}

.btn-secondary {
    background: var(--secondary-color);
    color: #fff;
}

.btn-secondary:hover {
    background: #334155;
}

.btn-danger {
    background: var(--danger-color);
    color: #fff;
}

.btn-danger:hover {
    background: #991b1b;
}

.btn-block {
    width: 100%;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    margin-bottom: 14px;
}

.card h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.card p {
    margin-bottom: 6px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.status-indicator {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.status-active {
    background: #dcfce7;
    color: var(--success-color);
    border: 1px solid #86efac;
}

.status-inactive {
    background: #fee2e2;
    color: var(--danger-color);
    border: 1px solid #fca5a5;
}

.quick-actions h3 {
    margin-bottom: 12px;
}

.quick-actions a {
    margin-right: 8px;
    margin-bottom: 8px;
}

.login-container {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    width: min(420px, 100%);
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
    padding: 22px;
}

.login-box h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.login-box h2 {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 14px;
}

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

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

.form-group input,
.form-group select {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 0.96rem;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus {
    outline: 2px solid rgba(29, 78, 216, 0.25);
    border-color: #1d4ed8;
}

.login-footer {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.login-footer a:hover {
    text-decoration: underline;
}

.error-message,
.success-message {
    padding: 9px 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 0.92rem;
}

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

.success-message {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #166534;
}

.help-section {
    display: grid;
    gap: 12px;
}

.help-section ul {
    margin-left: 18px;
}

.help-section li {
    margin-bottom: 6px;
}

.help-section code,
code {
    background: #e2e8f0;
    color: #0f172a;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: "Consolas", "Menlo", monospace;
    font-size: 0.88rem;
}

.log-card {
    margin-bottom: 14px;
}

.log-output {
    margin-top: 8px;
    padding: 10px;
    border-radius: 8px;
    background: #0b1220;
    color: #e2e8f0;
    font-family: "Consolas", "Menlo", monospace;
    font-size: 0.82rem;
    line-height: 1.35;
    max-height: 280px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.log-line-link {
    color: #e2e8f0;
    text-decoration: none;
    display: block;
    padding: 1px 4px;
    border-radius: 4px;
}

.log-line-link:hover {
    background: #1e293b;
}

.inline-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.inline-form .form-group {
    margin-bottom: 0;
    min-width: 180px;
}

.compact-form input {
    min-width: 180px;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.data-table th,
.data-table td {
    border: 1px solid var(--border-color);
    padding: 8px;
    text-align: left;
    vertical-align: top;
    font-size: 0.9rem;
}

.data-table th {
    background: #e2e8f0;
}

.info-section {
    text-align: left;
    margin-top: 10px;
}

.footer {
    background: var(--footer-bg);
    color: #fff;
    text-align: center;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 12px;
}

.footer-fixed {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0;
    margin-bottom: 0;
    z-index: 50;
}

.footer-stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.88rem;
}

.mt-2 {
    margin-top: 1rem;
}

.text-muted {
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .main-content {
        padding-bottom: 140px;
    }

    .nav {
        gap: 6px;
    }

    .actions {
        flex-direction: column;
    }

    .login-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .inline-form .form-group,
    .compact-form input {
        min-width: 100%;
        width: 100%;
    }

    .footer-stats {
        flex-direction: column;
        gap: 4px;
    }
}
