/* GitLab Pajamas-inspired theme */
:root {
    --purple-800: #380D75;
    --purple-600: #6B4FBB;
    --purple-500: #7B58CF;
    --purple-100: #E1D8F9;
    --purple-50: #F4F0FF;
    --green-500: #108548;
    --green-100: #C3E6CD;
    --red-500: #DD2B0E;
    --red-100: #FDD4CD;
    --gray-950: #1F1E24;
    --gray-700: #525252;
    --gray-500: #737278;
    --gray-300: #BFBFC3;
    --gray-100: #ECECEF;
    --gray-50: #F0F0F3;
    --gray-10: #FAFAFA;
    --white: #FFFFFF;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --radius: 4px;
    --radius-lg: 8px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

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

body {
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--gray-950);
    background: var(--gray-50);
    line-height: 1.5;
    padding-bottom: 140px;
}

/* ===== Login Page ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--purple-50) 0%, var(--gray-50) 100%);
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    text-align: center;
    box-shadow: var(--shadow-md);
    width: 380px;
    max-width: 90vw;
}

.login-logo {
    margin-bottom: 20px;
}

.login-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-950);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 28px;
}

.login-btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
}

/* ===== Layout ===== */
.layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Top Bar ===== */
.topbar {
    height: 48px;
    background: var(--purple-800);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-logo {
    flex-shrink: 0;
}

.topbar-brand {
    color: var(--white);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

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

.topbar-user {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
}

/* ===== Content ===== */
.content {
    flex: 1;
    padding: 32px 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

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

.content-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-950);
}

/* ===== Table ===== */
.table-wrapper {
    background: var(--white);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

.table thead {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
}

.table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
    color: var(--gray-950);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background: var(--gray-10);
}

.td-id {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 12px;
    color: var(--gray-700);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.td-empty {
    text-align: center;
    color: var(--gray-500);
    padding: 40px 16px !important;
}

/* ===== Badges ===== */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: var(--green-100);
    color: var(--green-500);
}

.badge-danger {
    background: var(--red-100);
    color: var(--red-500);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background 0.15s, box-shadow 0.15s;
    line-height: 1.4;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--purple-600);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--purple-500);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-50);
}

.btn-text {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    padding: 4px 8px;
    font-size: 13px;
}

.btn-text:hover {
    color: var(--white);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-outline {
    background: transparent;
    color: var(--purple-600);
    border: 1px solid var(--purple-600);
}

.btn-outline:hover {
    background: var(--purple-50);
}

.btn-danger-outline {
    background: transparent;
    color: var(--red-500);
    border: 1px solid var(--red-500);
}

.btn-danger-outline:hover {
    background: var(--red-100);
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.15s ease;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 480px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.2s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--gray-950);
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    padding: 0 24px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ===== Form ===== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font-family);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.form-input:focus {
    border-color: var(--purple-600);
    box-shadow: 0 0 0 3px var(--purple-100);
}

.form-input::placeholder {
    color: var(--gray-500);
}

.form-error {
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--red-100);
    color: var(--red-500);
    border-radius: var(--radius);
    font-size: 13px;
}

/* ===== Detail List ===== */
.detail-list {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 12px 16px;
    align-items: baseline;
}

.detail-list dt {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
}

.detail-list dd {
    font-size: 14px;
    color: var(--gray-950);
    word-break: break-all;
}

.dd-signature code {
    font-size: 11px;
    word-break: break-all;
}

code {
    background: var(--gray-50);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* ===== Footer ===== */
.page-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--white);
    border-top: 1px solid var(--gray-100);
    padding: 16px 40px;
    margin-top: 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.footer-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.footer-list {
    list-style: none;
}

.footer-list li {
    margin-bottom: 8px;
}

.footer-list a {
    color: var(--gray-500);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.15s;
}

.footer-list a:hover {
    color: var(--purple-600);
}

.footer-text {
    color: var(--gray-500);
    font-size: 13px;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .content {
        padding: 20px 16px;
    }

    .table-wrapper {
        overflow-x: auto;
    }

    .table {
        min-width: 600px;
    }

    .content-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .page-footer {
        padding: 24px 16px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}
