:root {
    --utalca-black: #000;
    --utalca-white: #fff;
    --utalca-red: #000;
    --utalca-red-dark: #222;
    --utalca-red-soft: #f1f1f1;
    --utalca-border: #d9d9d9;
    --utalca-muted: #666;
    --utalca-page: #f3f4f6;
    --utalca-panel: #fff;
    --utalca-text: #292d32;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    color: var(--utalca-black);
    background: var(--utalca-white);
    font-family: Arial, Helvetica, sans-serif;
}

.login-page {
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-shell {
    width: min(100%, 420px);
}

.login-panel {
    border: 1px solid var(--utalca-border);
    border-radius: 8px;
    padding: 32px;
    background: var(--utalca-white);
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 32px;
}

.brand-logo {
    width: 76px;
    height: 76px;
    object-fit: contain;
}

.brand-kicker {
    margin: 0 0 4px;
    color: var(--utalca-muted);
    font-size: 0.88rem;
}

.brand-block h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0;
}

.form-control {
    border-radius: 6px;
    border-color: var(--utalca-border);
    min-height: 44px;
}

.form-control:focus {
    border-color: var(--utalca-black);
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.12);
}

.btn {
    border-radius: 6px;
    min-height: 44px;
}

.app-page {
    background: #f7f7f7;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--utalca-border);
    background: var(--utalca-white);
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    color: var(--utalca-black);
    text-decoration: none;
}

.app-brand img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

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

.app-content {
    padding: 32px 24px;
}

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

.user-chip {
    border: 1px solid var(--utalca-border);
    border-radius: 999px;
    padding: 8px 12px;
    background: var(--utalca-white);
    color: var(--utalca-muted);
    font-size: 0.9rem;
}

.dashboard-actions {
    margin-top: 28px;
}

.dashboard-link {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    min-width: 280px;
    padding: 18px;
    border: 1px solid var(--utalca-border);
    border-radius: 8px;
    background: var(--utalca-white);
    color: var(--utalca-black);
    text-decoration: none;
}

.dashboard-link span {
    color: var(--utalca-muted);
}

.dependency-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.dependency-wide {
    grid-column: 1 / -1;
}

.panel-section {
    border: 1px solid var(--utalca-border);
    border-radius: 8px;
    background: var(--utalca-white);
    padding: 20px;
}

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

.section-head h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.section-head span {
    min-width: 32px;
    border-radius: 999px;
    padding: 4px 8px;
    background: #f0f0f0;
    text-align: center;
    font-size: 0.85rem;
}

.maintainer-form {
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--utalca-border);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.form-select {
    border-radius: 6px;
    border-color: var(--utalca-border);
    min-height: 44px;
}

.form-select:focus {
    border-color: var(--utalca-black);
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.12);
}

.app-table {
    margin-bottom: 0;
}

.app-table th {
    color: var(--utalca-muted);
    font-weight: 700;
}

.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    white-space: nowrap;
}

.table-actions form {
    margin: 0;
}

@media (max-width: 480px) {
    .login-panel {
        padding: 24px;
    }

    .brand-block {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 992px) {
    .dependency-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .app-header,
    .page-title-row {
        align-items: stretch;
        flex-direction: column;
    }

    .app-nav {
        width: 100%;
    }

    .app-nav .btn {
        flex: 1;
    }

    .table-actions {
        flex-direction: column;
    }
}

.system-page {
    min-height: 100vh;
    background: var(--utalca-page);
    color: var(--utalca-text);
}

.system-page img {
    max-width: 100%;
}

.system-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 82px;
    padding: 14px 28px;
    background: var(--utalca-red);
    color: var(--utalca-white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--utalca-white);
    text-decoration: none;
    font-size: 1.35rem;
    font-weight: 800;
}

.topbar-brand span {
    line-height: 1;
}

.topbar-brand:hover {
    color: var(--utalca-white);
}

.topbar-brand img {
    display: block;
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    padding: 8px;
    border-radius: 50%;
    object-fit: contain;
    background: var(--utalca-white);
}

.topbar-session {
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 700;
}

.topbar-session a {
    color: var(--utalca-white);
    text-decoration: none;
}

.topbar-session a:hover {
    text-decoration: underline;
}

.system-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: calc(100vh - 82px);
}

.system-sidebar {
    background: var(--utalca-white);
    border-right: 1px solid #e3e5e8;
}

.sidebar-nav {
    position: sticky;
    top: 82px;
    display: flex;
    flex-direction: column;
    padding: 18px 0 28px;
}

.sidebar-section {
    margin: 18px 22px 8px;
    color: #8a8f96;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.sidebar-link {
    display: block;
    padding: 13px 22px 13px 26px;
    border-left: 4px solid transparent;
    color: #31343a;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.15;
}

.sidebar-link:hover {
    background: #f7f7f8;
    color: var(--utalca-red);
}

.sidebar-link.active {
    border-left-color: var(--utalca-red);
    background: var(--utalca-red-soft);
    color: var(--utalca-red);
}

.sidebar-link.disabled {
    cursor: default;
    color: #3f4247;
}

.sidebar-link.disabled:hover {
    background: transparent;
    color: #3f4247;
}

.system-main {
    padding: 30px 32px 44px;
    overflow: hidden;
}

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

.content-heading h1 {
    margin: 0;
    color: var(--utalca-red);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0;
}

.content-heading p {
    margin: 6px 0 0;
    color: #6b6f76;
    font-size: 1.05rem;
}

.filter-panel,
.panel-section {
    border: 1px solid #e8eaed;
    border-radius: 8px;
    background: var(--utalca-panel);
    box-shadow: 0 10px 28px rgba(16, 24, 40, 0.06);
}

.filter-panel {
    padding: 20px 22px;
    margin-bottom: 20px;
}

.filter-panel h2 {
    margin: 0 0 16px;
    font-size: 1.2rem;
    font-weight: 800;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.quick-action-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-height: 96px;
    padding: 18px;
    border: 1px solid #e4e7eb;
    border-radius: 8px;
    background: #fff;
    color: var(--utalca-text);
    text-decoration: none;
}

.quick-action-card:hover {
    border-color: var(--utalca-red);
    color: var(--utalca-red);
}

.quick-action-card span {
    color: #6b6f76;
}

.metric-grid,
.dependency-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.dependency-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card {
    min-height: 104px;
    padding: 20px;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    background: var(--utalca-white);
    box-shadow: 0 10px 26px rgba(16, 24, 40, 0.06);
}

.metric-card span {
    display: block;
    margin-bottom: 8px;
    color: #6b6f76;
    font-weight: 650;
}

.metric-card strong {
    color: var(--utalca-red);
    font-size: 2rem;
    line-height: 1;
}

.dependency-grid {
    gap: 22px;
}

.panel-section {
    padding: 0;
    overflow: hidden;
}

.section-head {
    min-height: 62px;
    margin: 0;
    padding: 17px 22px;
    border-bottom: 1px solid #e8eaed;
}

.section-head h2 {
    font-size: 1.25rem;
}

.section-head span {
    background: var(--utalca-red-soft);
    color: var(--utalca-red);
    font-weight: 800;
}

.maintainer-form {
    margin: 0;
    padding: 20px 22px;
    border-bottom: 1px solid #e8eaed;
}

.panel-section .table-responsive {
    padding: 0 22px 18px;
}

.system-page .btn-dark {
    border-color: var(--utalca-red);
    background: var(--utalca-red);
}

.system-page .btn-dark:hover,
.system-page .btn-dark:focus {
    border-color: var(--utalca-red-dark);
    background: var(--utalca-red-dark);
}

.system-page .btn-outline-dark {
    border-color: #c9cdd2;
    color: #343840;
    background: var(--utalca-white);
}

.system-page .btn-outline-dark:hover,
.system-page .btn-outline-dark:focus {
    border-color: var(--utalca-red);
    background: var(--utalca-red-soft);
    color: var(--utalca-red);
}

.system-page .form-label {
    color: #343840;
    font-weight: 750;
}

.system-page .form-control,
.system-page .form-select {
    border-color: #cfd4da;
}

.app-table thead th {
    padding-top: 14px;
    padding-bottom: 14px;
    border-bottom-color: #dfe3e8;
    color: #6b6f76;
    font-size: 0.86rem;
    text-transform: uppercase;
}

.app-table tbody td {
    padding-top: 12px;
    padding-bottom: 12px;
}

@media (max-width: 1080px) {
    .system-shell {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .quick-actions,
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .system-topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .system-shell {
        grid-template-columns: 1fr;
    }

    .system-sidebar {
        border-right: 0;
        border-bottom: 1px solid #e3e5e8;
    }

    .sidebar-nav {
        position: static;
        padding: 12px;
    }

    .sidebar-section {
        margin-left: 10px;
    }

    .sidebar-link {
        border-left: 0;
        border-radius: 8px;
        padding: 11px 12px;
    }

    .system-main {
        padding: 24px 16px 34px;
    }

    .dependency-summary,
    .metric-grid,
    .quick-actions {
        grid-template-columns: 1fr;
    }
}
