body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    color: #222;
}

.header {
    background: #1f2937;
    color: white;
    padding: 14px 24px;
}

.header a {
    color: white;
    margin-right: 16px;
    text-decoration: none;
}

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

.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    margin-bottom: 20px;
}

.form-row {
    margin-bottom: 14px;
}

input, select, button {
    padding: 8px 10px;
    font-size: 14px;
}

.btn {
    background: #2563eb;
    color: white;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

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

.table th, .table td {
    border-bottom: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.error {
    color: #b91c1c;
}

.container-wide {
    max-width: 95vw;
}

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

.resizable-table {
    table-layout: fixed;
    min-width: 100%;
}

.resizable-table th {
    position: relative;
    user-select: none;
}

.resizable-table th .resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 7px;
    height: 100%;
    cursor: col-resize;
}

.resizable-table td {
    vertical-align: top;
    overflow-wrap: anywhere;
}

.audit-ip {
    white-space: nowrap;
}

.audit-ip {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    white-space: nowrap;
}

.resizable-table td,
.resizable-table th {
    min-width: 0;
}

.link-input {
    width: 100%;
    box-sizing: border-box;
    font-size: 12px;
}

.action-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 100px;
}

.action-stack form {
    margin: 0;
}

.btn-open,
.btn-success,
.btn-danger {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 6px 10px;
    border: 0;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.2;
    cursor: pointer;
    text-align: center;
    text-decoration: none !important;
    color: #fff !important;
}

.btn-open {
    background: #2563eb;
}

.btn-open:hover,
.btn-success:hover,
.btn-danger:hover {
    opacity: 0.9;
}

.btn-success {
    background: #22c55e;
}

.btn-danger {
    background: #ef4444;
}

.extend-days {
    width: 100% !important;
    box-sizing: border-box;
    padding: 6px 10px;
    margin-bottom: 6px;
    font-size: 14px;
}

.public-links-table th:nth-child(1),
.public-links-table td:nth-child(1) {
    width: 160px;
}

.public-links-table th:nth-child(2),
.public-links-table td:nth-child(2) {
    width: 160px;
}

.public-links-table th:nth-child(3),
.public-links-table td:nth-child(3) {
    width: 180px;
}

.public-links-table th:nth-child(4),
.public-links-table td:nth-child(4) {
    width: 220px;
}

.public-links-table th:nth-child(5),
.public-links-table td:nth-child(5) {
    width: 600px;
}

.public-links-table th:nth-child(6),
.public-links-table td:nth-child(6) {
    width: 110px;
}

.search-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 210px));
    gap: 14px 16px;
    align-items: end;
}

.search-filter-grid .form-row {
    margin-bottom: 0;
}

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

.search-filter-actions .btn {
    width: 100%;
}


.audit-filter-grid .search-filter-actions .btn {
    width: auto;
    min-width: 140px;
}


#search-filter-form input[type="text"],
#search-filter-form input[type="date"],
#search-filter-form select,
#search-filter-form .search-filter-actions .btn {
    width: 195px;
    box-sizing: border-box;
}

#search-filter-form .search-filter-actions .btn {
    height: auto;
}


#audit-filter-form input[type="text"],
#audit-filter-form input[type="date"],
#audit-filter-form select,
#audit-filter-form .search-filter-actions .btn {
    width: 195px;
    box-sizing: border-box;
}

#audit-filter-form .search-filter-actions .btn {
    height: auto;
}


.admin-role-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 220px));
    gap: 14px 16px;
    align-items: end;
}

.admin-role-form .form-row {
    margin-bottom: 0;
}

.admin-role-form input[type="email"],
.admin-role-form select,
.admin-role-form .admin-role-actions .btn {
    width: 220px;
    box-sizing: border-box;
}


.page-jump-input {
    width: 60px !important;
    height: 32px;
    box-sizing: border-box;
}

