body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f7fa;
    color: #202124;
}

.link-center {
    max-width: 960px;
    margin: 48px auto;
    padding: 0 24px;
}

.link-center.home-shell {
    max-width: 1600px;
    margin: 0 auto;
    padding: 28px 48px 56px;
}

.link-center.admin-wide {
    max-width: 1600px;
}

.home-header {
    display: flex;
    gap: 28px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #cfdbea;
    border-top: 3px solid #2f5f8f;
    padding-bottom: 22px;
    padding-top: 18px;
    margin-bottom: 28px;
}

.home-heading {
    min-width: 0;
}

.home-header h1 {
    margin: 0;
    color: #111827;
    font-size: 34px;
    line-height: 1.1;
}

.home-subtitle {
    margin: 8px 0 0;
    color: #58616d;
    font-size: 16px;
}

.home-user-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-items: end;
    justify-content: flex-end;
    gap: 12px 16px;
    min-width: 420px;
}

.home-user {
    display: grid;
    gap: 3px;
    text-align: right;
}

.home-user strong {
    color: #111827;
    font-size: 16px;
}

.home-user span,
.home-user-note {
    color: #58616d;
    font-size: 14px;
}

.home-user-note {
    margin: 0;
}

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

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

.page-header h1 {
    margin: 0 0 8px;
    font-size: 28px;
}

.muted {
    margin: 0;
    color: #5f6368;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    border: 1px solid #c7ccd1;
    border-radius: 6px;
    padding: 0 14px;
    color: #202124;
    background: #ffffff;
    text-decoration: none;
    font-weight: 600;
}

.button.primary {
    border-color: #2f5f8f;
    color: #ffffff;
    background: #2f5f8f;
}

.button.subtle {
    border-color: #c7d8eb;
    color: #244f78;
    background: #edf5fd;
}

.button:hover {
    border-color: #7fa0c5;
}

.button[href="/link/admin/"] {
    border-color: #2f5f8f;
    color: #ffffff;
    background: #2f5f8f;
}

.button[href="/link/auth/logout.php"] {
    border-color: #d8d2d2;
    color: #6f3f3f;
    background: #fbf8f8;
}

.notice {
    border: 1px solid #dfe3e7;
    border-radius: 6px;
    padding: 16px;
    background: #ffffff;
    color: #5f6368;
}

.notice.error {
    border-color: #d93025;
    color: #b3261e;
}

.notice p {
    margin: 0 0 8px;
}

.notice p:last-child {
    margin-bottom: 0;
}

.home-sections {
    display: grid;
    gap: 36px;
}

.link-group {
    margin-top: 28px;
}

.home-sections .link-group {
    margin-top: 0;
}

.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
    border-left: 4px solid #7fa0c5;
    padding-left: 12px;
    margin-bottom: 14px;
}

.link-group h2 {
    margin: 0 0 12px;
    font-size: 20px;
}

.section-heading h2 {
    margin: 0;
    color: #111827;
    font-size: 24px;
}

.section-heading span {
    color: #6b7280;
    font-size: 13px;
    font-weight: 700;
}

.link-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.card-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.link-card {
    display: grid;
    min-height: 126px;
    align-content: start;
    gap: 14px;
    box-sizing: border-box;
    height: 100%;
    border: 1px solid #dbe2ea;
    border-left: 4px solid #c7d8eb;
    border-radius: 8px;
    padding: 20px;
    color: #111827;
    background: #ffffff;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
    transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
}

.link-card:hover {
    transform: translateY(-2px);
    border-color: #8fb0d4;
    border-left-color: #2f5f8f;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
}

.link-card.invalid-url {
    color: #5f6368;
    background: #f8fafc;
}

.link-card.invalid-url:hover {
    transform: none;
    border-color: #dbe2ea;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

.link-title {
    color: #111827;
    font-size: 18px;
    line-height: 1.35;
    overflow-wrap: anywhere;
    text-decoration: none;
}

a.link-card .link-title {
    color: #244f78;
}

.description {
    margin: 0;
    color: #58616d;
    font-size: 14px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.badge {
    justify-self: start;
    border-radius: 999px;
    padding: 4px 9px;
    background: #e8f1fb;
    color: #244f78;
    font-size: 12px;
    font-weight: 700;
}

.badge-public {
    background: #e8f1fb;
    color: #244f78;
}

.badge-company {
    background: #e8f4ed;
    color: #246044;
}

.badge-personal {
    background: #f0eafa;
    color: #5b3f86;
}

.link-item {
    border: 1px solid #dfe3e7;
    border-radius: 6px;
    padding: 14px 16px;
    background: #ffffff;
}

.link-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
}

.invalid-url {
    color: #5f6368;
}

.table-wrap {
    margin-top: 20px;
    overflow-x: auto;
    border: 1px solid #dfe3e7;
    border-radius: 6px;
    background: #ffffff;
}

.admin-filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr)) auto;
    gap: 12px;
    align-items: end;
    border: 1px solid #dfe3e7;
    border-radius: 8px;
    padding: 16px;
    background: #ffffff;
}

.admin-filters label {
    display: grid;
    gap: 6px;
    color: #3c4043;
    font-size: 13px;
    font-weight: 700;
}

.admin-filters select {
    box-sizing: border-box;
    width: 100%;
    min-height: 40px;
    border: 1px solid #c7ccd1;
    border-radius: 6px;
    padding: 0 10px;
    color: #202124;
    background: #ffffff;
    font: inherit;
}

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

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1180px;
}

.admin-table.user-table {
    min-width: 1100px;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid #edf0f2;
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    background: #f1f3f4;
    color: #3c4043;
    font-size: 13px;
}

.admin-table tr:last-child td {
    border-bottom: 0;
}

.inactive-row {
    color: #6f7479;
    background: #fafafa;
}

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

.row-actions form {
    margin: 0;
}

.button.small {
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
}

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

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

.admin-form {
    display: grid;
    gap: 16px;
    max-width: 760px;
}

.admin-form label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
    box-sizing: border-box;
    width: 100%;
    border: 1px solid #c7ccd1;
    border-radius: 6px;
    padding: 10px 12px;
    font: inherit;
    color: #202124;
    background: #ffffff;
}

.admin-form textarea {
    resize: vertical;
}

.admin-form .checkbox-label {
    display: flex;
    gap: 8px;
    align-items: center;
}

.admin-form .checkbox-label input {
    width: auto;
}

.form-actions {
    justify-content: flex-start;
}

.detail-panel {
    border: 1px solid #dfe3e7;
    border-radius: 6px;
    padding: 18px;
    background: #ffffff;
}

.detail-panel h2 {
    margin: 0 0 14px;
    font-size: 20px;
}

.detail-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.detail-list div {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 12px;
}

.detail-list dt {
    color: #5f6368;
    font-weight: 700;
}

.detail-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}
