:root {
    --primary-color: #0b4d91;
    --secondary-color: #f5f7fa;
    --text-color: #333333;
    --border-color: #d0d7de;
    --danger-color: #c0392b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

.main-header, .main-footer {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
}

.main-footer {
    border-top: 1px solid var(--border-color);
    border-bottom: none;
    font-size: 0.9rem;
    color: #666666;
}

.main-header h1 {
    margin: 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.header-logo {
    max-height: 60px;
    width: auto;
}

.main-nav {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.main-nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.main-nav a:hover {
    text-decoration: underline;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0rem;
    text-align: center;
}

.footer-logo {
    max-height: 60px;
    width: auto;
}

.card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}

.card h2 {
    margin-top: 0;
}

form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

input[type="text"],
input[type="password"],
select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 1rem;
}

.form-help {
    display: block;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
    color: #555555;
    font-size: 0.85rem;
}

input[type="file"] {
    margin-bottom: 1rem;
}

button,
input[type="submit"] {
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    line-height: 1.2;
    cursor: pointer;
}

button.danger,
input[type="submit"].danger {
    background-color: var(--danger-color);
}

button:disabled,
input[type="submit"]:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

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

.table th,
.table td {
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    text-align: center;
    vertical-align: middle;
    height: auto;
}

.table th {
    background-color: #f0f3f7;
}

.table th.col-primary,
.table td.col-primary {
    width: 18%;
}

.table th.col-date,
.table td.col-date {
    width: 1%;
    white-space: nowrap;
}

.table .repo-name,
.table th.repo-name {
    font-size: 0.95rem;
    word-break: break-all;
    max-width: 260px;
    white-space: normal;
}

.inline-form {
    margin: 0;
}

.table .inline-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.button-action {
    display: inline-block;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

.button-action:hover {
    opacity: 0.92;
}

.qr-preview-box {
    width: 100px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    
    border-radius: 1px;
    background-color: #ffffff;
    padding: 0.25rem;
}

.qr-preview-box img {
    display: block;
    width: 100px;
    height: 100px;
}

.table-notes {
    width: 100%;
    min-width: 180px;
    min-height: 72px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    resize: none;
    overflow-y: hidden;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert.error {
    background-color: #fdecea;
    border: 1px solid #f5c6cb;
    color: #a71d2a;
}

.alert.success {
    background-color: #eafaf1;
    border: 1px solid #c7eed8;
    color: #1e7e34;
}

.qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.qr-item {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}

.qr-item img,
.qr-item canvas {
    max-width: 150px;
    height: auto;
    margin: 0 auto 0.5rem;
}

body.landing {
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

a.button {
    display: inline-block;
    background-color: #2ecc71;
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
}

a.button:hover {
    background-color: #27ae60;
}

.files-filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem 1rem;
    align-items: end;
    margin-bottom: 1rem;
}

.filter-field {
    margin: 0;
}

.filter-field label {
    margin-bottom: 0.35rem;
}

.files-filter-form input[type="text"],
.files-filter-form select {
    margin-bottom: 0;
}

.search-field {
    grid-column: span 2;
}

.toggle-field {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #9aa5b1;
    border-radius: 26px;
    transition: 0.2s;
}

.slider::before {
    position: absolute;
    content: '';
    height: 20px;
    width: 20px;
    left: 3px;
    top: 3px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: 0.2s;
}

.switch input:checked + .slider {
    background-color: var(--primary-color);
}

.switch input:checked + .slider::before {
    transform: translateX(22px);
}

.toggle-status {
    font-weight: 700;
    letter-spacing: 0.04em;
}

.filter-actions {
    display: flex;
    align-items: center;
}

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

ul {
    padding-left: 1.2rem;
}

.card ul {
    margin: 0.5rem 0 0;
}

.page-logo-bottom-right {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    max-width: 180px;
    width: 30vw;
    height: auto;
    z-index: 1000;
}

@media (max-width: 900px) {
    .container {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-brand {
        width: 100%;
    }

    .main-header h1 {
        font-size: 1.5rem;
    }

    .main-nav {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .main-nav a {
        display: inline-block;
        padding: 0.45rem 0.5rem;
        border-radius: 6px;
        background-color: rgba(11, 77, 145, 0.08);
    }
}

@media (max-width: 600px) {
    body {
        font-size: 0.95rem;
    }

    .container {
        padding: 0.85rem;
    }

    .card {
        padding: 1.1rem;
    }

    .main-header,
    .main-footer {
        text-align: center;
    }

    .header-content {
        gap: 0.75rem;
        align-items: center;
    }

    .main-nav {
        justify-content: center;
    }

    .main-nav a {
        width: 100%;
        text-align: center;
    }

    .table th,
    .table td {
        padding: 0.6rem;
        font-size: 0.95rem;
    }

    .search-field {
        grid-column: span 1;
    }
    
    .table .repo-name,
    .table th.repo-name {
        max-width: 180px;
    }
    
    .header-logo,
    .footer-logo {
        max-height: 48px;
    }

    .page-logo-bottom-right {
        max-width: 120px;
        right: 0.75rem;
        bottom: 0.75rem;
    }
}

