* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f3f6f8;
    color: #17324d;
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: #123b5d;
}

.topbar {
    background: #123b5d;
    color: white;
    padding: 17px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 23px;
    font-weight: 700;
}

.subtitle {
    font-size: 12px;
    opacity: .85;
    margin-top: 3px;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 14px;
}

.topnav a {
    color: white;
    text-decoration: none;
}

.user-name {
    opacity: .75;
}

.container {
    max-width: 1200px;
    margin: 28px auto;
    padding: 0 20px 50px;
}

h1 {
    margin: 0 0 8px;
}

h2 {
    margin-top: 0;
}

.muted {
    color: #71808d;
}

.small {
    font-size: 12px;
}

.welcome-panel,
.panel {
    background: white;
    border-radius: 12px;
    padding: 23px;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    margin-bottom: 20px;
}

.stats {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(210px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.stat {
    background: white;
    border-radius: 11px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.stat-label {
    color: #71808d;
    font-size: 13px;
}

.stat-value {
    font-size: 27px;
    font-weight: 700;
    margin-top: 6px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.module-card {
    position: relative;
    display: block;
    min-height: 150px;
    padding: 23px;
    background: white;
    border-radius: 12px;
    text-decoration: none;
    color: #17324d;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
}

.module-card:hover {
    transform: translateY(-2px);
}

.module-icon {
    font-size: 26px;
}

.module-card h2 {
    font-size: 20px;
    margin: 10px 0 7px;
}

.module-card p {
    color: #71808d;
    margin: 0;
    font-size: 14px;
}

.module-count {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #eaf1f6;
    border-radius: 20px;
    min-width: 30px;
    padding: 6px 9px;
    text-align: center;
    font-weight: 700;
}

.page-header,
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 18px;
}

.back-link {
    display: inline-block;
    margin-bottom: 10px;
    text-decoration: none;
}

.btn {
    display: inline-block;
    border: 0;
    border-radius: 7px;
    padding: 11px 17px;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
}

.btn.primary {
    background: #123b5d;
    color: white;
}

.btn.secondary,
.small-btn {
    background: #e8eef2;
    color: #17324d;
}

.small-btn {
    padding: 7px 11px;
}

.full-width {
    width: 100%;
    text-align: center;
    margin-top: 15px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    padding: 11px;
    border: 1px solid #cbd5dc;
    border-radius: 7px;
    font-size: 15px;
    background: white;
    margin-bottom: 16px;
}

textarea {
    resize: vertical;
}

.form-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(250px, 1fr));
    gap: 0 18px;
}

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

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.search-bar input {
    margin: 0;
}

.search-bar button {
    white-space: nowrap;
}

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

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

th,
td {
    padding: 14px 15px;
    text-align: left;
    border-bottom: 1px solid #e5eaee;
    vertical-align: middle;
}

th {
    font-size: 12px;
    color: #71808d;
    text-transform: uppercase;
    background: #f9fbfc;
}

.empty {
    text-align: center;
    color: #71808d;
    padding: 30px;
}

.two-column {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 11px 0;
    border-bottom: 1px solid #edf1f3;
}

.detail-row span:first-child {
    color: #71808d;
}

.affiliate-number {
    font-size: 25px;
    font-weight: 700;
    margin-bottom: 15px;
}

.badge {
    display: inline-block;
    border-radius: 20px;
    padding: 5px 9px;
    font-size: 12px;
    background: #e9eef2;
}

.badge.active {
    background: #e5f3e8;
}

.badge.expired {
    background: #f6e7e7;
}

.badge.suspended {
    background: #fff0d5;
}

.vessel-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.vessel-card {
    border: 1px solid #dde5ea;
    border-radius: 9px;
    padding: 16px;
}

.vessel-card h3 {
    margin-top: 0;
}

.alert {
    padding: 12px 14px;
    margin-bottom: 18px;
    border-radius: 7px;
}

.alert.success {
    background: #e5f3e8;
}

.alert.error {
    background: #f7e5e5;
}

.login-wrap {
    max-width: 430px;
    margin: 70px auto;
}

.login-box {
    background: white;
    border-radius: 13px;
    padding: 32px;
    box-shadow: 0 3px 15px rgba(0,0,0,.1);
}

.login-language {
    text-align: center;
    margin-top: 20px;
}

.centered {
    text-align: center;
    padding: 50px;
}

@media (max-width: 700px) {

    .topbar {
        align-items: flex-start;
        gap: 15px;
    }

    .topnav {
        flex-direction: column;
        align-items: flex-end;
        gap: 7px;
    }

    .page-header {
        align-items: flex-start;
    }

    .search-bar {
        flex-direction: column;
    }
}
