* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f8fa;
    color: #333;
    line-height: 1.6;
}

a {
    color: inherit;
}

.page-shell,
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header-card,
.header {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    padding: 12px 14px;
    margin-bottom: 12px;
}

.header-container {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: nowrap;
}

.logo {
    flex-shrink: 0;
}

.logo img {
    max-width: 80px;
    height: auto;
    display: block;
}

.title-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-shrink: 0;
}

h1 {
    font-size: 20px;
    font-weight: 500;
    color: #2c3e50;
    margin: 0;
}

.subtitle {
    margin-top: 4px;
    font-size: 12px;
    color: #7f8c8d;
    line-height: 1.3;
}

.controls-section {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
}

.control-row,
.nav-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.control-row {
    justify-content: flex-end;
}

.nav-controls {
    justify-content: flex-end;
}

select {
    padding: 7px 10px;
    border: 1px solid #dce4ec;
    border-radius: 4px;
    font-size: 12px;
    background: #fff;
    color: #2c3e50;
}

.btn {
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 7px 11px;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s ease;
}

.btn:hover {
    background-color: #2980b9;
}

.btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-gray,
.btn-secondary {
    background-color: #95a5a6;
}

.btn-gray:hover,
.btn-secondary:hover {
    background-color: #7f8c8d;
}

.avail-container,
.directory-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    overflow: hidden;
}

.surface-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.field-input {
    width: 100%;
    padding: 14px;
    border: 1px solid #dce4ec;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.12);
    outline: none;
}

.link-button-row {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #dce4ec;
    border-radius: 6px;
    background: #fff;
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.link-button:hover {
    background: #eef6fc;
    border-color: #cddcea;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

#centre_popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    box-sizing: border-box;
    padding: 16px;
    overflow: auto;
    z-index: 10000;
    text-align: left;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
}

@media (min-width: 700px) {
    .subtitle {
        white-space: nowrap;
    }
}

@media (max-width: 899px) {
    .subtitle {
        word-wrap: break-word;
    }

    .header-container {
        flex-direction: column;
        align-items: stretch;
    }

    .header-left {
        gap: 10px;
    }

    .controls-section {
        align-items: flex-start;
    }

    .control-row,
    .nav-controls {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .page-shell,
    .container {
        padding: 10px;
    }

    .header-card,
    .header {
        padding: 12px;
    }

    .logo img {
        max-width: 68px;
    }

    .control-row {
        width: 100%;
    }

    select {
        width: 100%;
    }

    .link-button-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 18px;
    }

    .subtitle {
        font-size: 11px;
    }

    #centre_popup {
        padding: 12px;
        max-width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
    }
}
