/* Base layout */
html,
body {
    margin: 0;
    padding: 0;
    font-family: "Inter", Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f6f8fb;
}

a {
    color: #0b6efd;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Containers */
.admin_layers,
#Layer1 {
    max-width: 1024px;
    margin: 20px auto;
    background: #fff;
    padding: 20px 24px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Headings */
.page_heading {
    font-size: 18px;
    font-weight: bold;
    color: #222;
    padding: 8px 0 10px 0;
    border-bottom: 1px solid #e6e9ef;
    margin-bottom: 12px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

td {
    padding: 8px 10px;
    vertical-align: top;
    border-bottom: 1px solid #edf0f5;
}

tr:nth-child(even) td {
    background-color: #fafbfe;
}

.table_headings {
    background: #eef2f8;
    color: #333;
    font-weight: bold;
    text-transform: none;
    border-bottom: 1px solid #dfe6f1;
}

.no_border {
    border: none !important;
}

/* Messages */
.result_message {
    background: #ecfdf3;
    border: 1px solid #c6f6d5;
    color: #166534;
    padding: 8px 10px;
    border-radius: 6px;
    margin: 6px 0 10px 0;
}

/* Home page */
.home {
    font-size: 16px;
    color: #333;
}

/* Forms */
input[type="text"],
select,
textarea {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    padding: 6px 8px;
    border: 1px solid #cfd6e4;
    border-radius: 6px;
    background: #fff;
    outline: none;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.buttons,
input[type="submit"],
button {
    background: #0b6efd;
    color: #fff;
    border: 1px solid #0b6efd;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
}

.buttons:hover,
input[type="submit"]:hover,
button:hover {
    background: #095ad6;
    border-color: #095ad6;
}

/* Utilities */
.mt-2 {
    margin-top: 8px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mt-3 {
    margin-top: 12px;
}

.mb-3 {
    margin-bottom: 12px;
}

/* Profile cards */
.profile-card {
    background: #fff;
    border: 1px solid #e6e9ef;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
    margin: 6px 0 14px 0;
}

.profile-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #222;
}

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

.kv-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #f0f2f7;
}

.kv-table tr:last-child td {
    border-bottom: none;
}

.kv-label {
    color: #555;
    width: 40%;
}

.kv-value {
    color: #111;
    text-align: right;
    font-weight: 600;
}

.profile-actions {
    text-align: center;
    margin-top: 10px;
}

/* Contacts */
.contact-cell .contact-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 2px 0;
}

.contact-cell .icon {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

/* Debug SQL block */
.debug-sql {
    margin-top: 16px;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 12px;
}

.debug-sql-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 700;
}

.debug-sql code {
    display: block;
    white-space: pre-wrap;
    font-family: Consolas, Menlo, Monaco, monospace;
    font-size: 12px;
}

.copy-btn {
    background: #22c55e;
    border: 1px solid #16a34a;
    color: #052e16;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
}

.copy-btn:hover {
    background: #16a34a;
}

/* Layout adjustments when left admin menu is present */
body.has-admin-menu .admin_layers,
body.has-admin-menu #Layer1 {
    /* Centered combined width: menu 276 + gap 5 + content 1078 = 1359 */
    margin-left: calc(50% - 679.5px + 276px + 5px);
    width: 1078px;
    /* 898px * 1.2 */
    max-width: 1078px;
    margin-top: 40px;
    /* align with fixed menu top offset */
}

/* Landing page wrapper */
.landing-wrap {
    max-width: 1024px;
    margin: 0 auto;
    padding: 10px 16px;
}

/* Left admin menu styling */
#menu {
    padding: 12px 14px;
    border-right: 1px solid #e6e9ef;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    border-bottom-left-radius: 10px;
    box-sizing: border-box;
}

#menu .page_heading {
    margin-top: 0;
}

#menu a {
    display: inline-block;
    padding: 6px 0;
}