/* ==========================================================================
   01. Base
   ========================================================================== */

:root {
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color: #202124;
    background: #f5f6f7;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
}


/* ==========================================================================
   02. Application header
   ========================================================================== */

.app-header {
    background: #ffffff;
    border-bottom: 1px solid #dfe1e5;
}

.app-header__content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;

    display: flex;
    align-items: center;
    gap: 14px;
}

.app-header__home {
    display: block;
    flex: 0 0 auto;
}

.app-header__logo {
    display: block;
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex: 0 0 auto;
}

.app-header__title {
    display: flex;
    align-items: baseline;
    gap: 14px;
}

.app-header h1 {
    margin: 0;
    font-size: 1.35rem;
}

.app-header span {
    color: #6b7280;
    font-size: 0.9rem;
}


/* ==========================================================================
   03. Main layout
   ========================================================================== */

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

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

.page-header h2 {
    margin: 0 0 6px;
    font-size: 1.5rem;
}

.page-header p {
    margin: 0;
    color: #6b7280;
}


/* ==========================================================================
   04. Buttons
   ========================================================================== */

.button {
    display: inline-block;
    padding: 9px 14px;

    color: #ffffff;
    background: #374151;

    border: 1px solid #374151;
    border-radius: 4px;

    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.button:hover {
    background: #1f2937;
}

button.button {
    cursor: pointer;
    font-family: inherit;
}

.button--secondary {
    color: #374151;
    background: #ffffff;
    border-color: #c7cbd1;
}

.button--secondary:hover {
    background: #f5f6f7;
}


/* ==========================================================================
   05. Empty states
   ========================================================================== */

.empty-state {
    padding: 48px 32px;

    background: #ffffff;
    border: 1px solid #dfe1e5;
    border-radius: 6px;

    text-align: center;
}

.empty-state h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.empty-state p {
    margin: 0;
    color: #6b7280;
}


/* ==========================================================================
   06. Source list
   ========================================================================== */

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

.source-card {
    display: block;
    padding: 18px 20px;

    background: #ffffff;
    border: 1px solid #dfe1e5;
    border-radius: 6px;

    color: inherit;
    text-decoration: none;
}

.source-card:hover {
    border-color: #9ca3af;
}

.source-card__name {
    margin-bottom: 5px;

    font-size: 1rem;
    font-weight: 600;
}

.source-card__path {
    color: #6b7280;
    font-family: monospace;
    font-size: 0.85rem;
}


/* ==========================================================================
   07. Forms
   ========================================================================== */

.form-card {
    max-width: 720px;
    padding: 28px;

    background: #ffffff;
    border: 1px solid #dfe1e5;
    border-radius: 6px;
}

.form-field {
    margin-bottom: 24px;
}

.form-field label {
    display: block;
    margin-bottom: 7px;

    font-size: 0.9rem;
    font-weight: 600;
}

.form-field input,
.form-field select {
    width: 100%;
    padding: 10px 12px;

    color: #202124;
    background: #ffffff;

    border: 1px solid #c7cbd1;
    border-radius: 4px;

    font: inherit;
}

.form-field input:focus,
.form-field select:focus {
    outline: 2px solid #9ca3af;
    outline-offset: 1px;
    border-color: #6b7280;
}

.form-help {
    margin-top: 6px;

    color: #6b7280;
    font-size: 0.82rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    margin-top: 30px;
}


/* ==========================================================================
   09. Alerts
   ========================================================================== */

.alert {
    margin-bottom: 24px;
    padding: 12px 14px;

    border: 1px solid;
    border-radius: 4px;

    font-size: 0.9rem;
}

.alert--error {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}



/* ==========================================================================
   10. Source view
   ========================================================================== */

.source-heading {
    display: flex;
    align-items: center;
    gap: 14px;
}

.source-heading h2 {
    margin: 0;
}

.source-path {
    margin-top: 7px !important;

    color: #6b7280;
    font-family: monospace;
    font-size: 0.85rem;

    overflow-wrap: anywhere;
}

.status {
    display: inline-block;

    font-size: 0.85rem;
    font-weight: 600;
}

.status--ok {
    color: #166534;
}

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

.source-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    max-width: 720px;

    background: #ffffff;

    border: 1px solid #dfe1e5;
    border-radius: 6px;
}

.source-summary__item {
    padding: 22px 24px;
}

.source-summary__item + .source-summary__item {
    border-left: 1px solid #e5e7eb;
}

.source-summary__value {
    margin-bottom: 4px;

    font-size: 1.4rem;
    font-weight: 600;
}

.source-summary__label {
    color: #6b7280;
    font-size: 0.85rem;
}

.source-actions {
    display: flex;
    justify-content: flex-end;

    max-width: 720px;
    margin-top: 20px;
}

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


/* ==========================================================================
   11. Application footer
   ========================================================================== */

.app-footer {
    margin-top: 48px;

    color: #6b7280;
    background: #ffffff;

    border-top: 1px solid #dfe1e5;
}

.app-footer__content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 24px;

    font-size: 0.8rem;
}

.app-header__title h1 a {
    color: inherit;
    text-decoration: none;
}

.alert--success {
    color: #166534;
    background: #f0fdf4;
    border-color: #bbf7d0;
}