:root {
    --blue: #0C5ADB;
    --blue-dark: #0848b6;
    --background: #f5f8fd;
    --surface: #ffffff;
    --text: #172033;
    --muted: #667085;
    --border: #dbe4f0;
    --danger: #c62828;
    --success: #147a45;
    --shadow: 0 10px 30px rgba(12, 90, 219, 0.09);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: var(--blue);
}

.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-inner {
    max-width: 1180px;
    min-height: 72px;
    margin: auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    display: block;
    max-width: 210px;
    max-height: 48px;
}

.mode-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--blue);
    text-transform: uppercase;
}

.container {
    width: min(1180px, calc(100% - 28px));
    margin: 28px auto;
}

.login-shell {
    width: min(520px, calc(100% - 28px));
    margin: 50px auto;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo img {
    max-width: 250px;
    max-height: 70px;
}

h1, h2, h3 {
    margin-top: 0;
}

.subtitle {
    color: var(--muted);
    line-height: 1.55;
}

.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    font-weight: 700;
    margin-bottom: 7px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 13px;
    font: inherit;
    background: #fff;
    color: var(--text);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(12, 90, 219, .15);
    border-color: var(--blue);
}

.mode-options {
    display: grid;
    gap: 12px;
}

.mode-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
}

.mode-option input {
    width: auto;
    min-height: auto;
    margin-top: 4px;
}

.mode-option strong,
.mode-option span {
    display: block;
}

.mode-option span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 14px;
}

.btn {
    appearance: none;
    border: 0;
    border-radius: 10px;
    padding: 12px 18px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--blue);
    color: #fff;
}

.btn-primary:hover {
    background: var(--blue-dark);
}

.btn-secondary {
    background: #eaf1fd;
    color: var(--blue);
}

.btn-danger {
    background: #fdecec;
    color: var(--danger);
}

.btn-block {
    width: 100%;
}

.alert {
    padding: 13px 15px;
    margin-bottom: 18px;
    border-radius: 10px;
    line-height: 1.45;
}

.alert-error {
    background: #fff0f0;
    color: #9b1c1c;
    border: 1px solid #ffd0d0;
}

.alert-success {
    background: #eaf8f0;
    color: var(--success);
    border: 1px solid #c9ead7;
}

.alert-warning {
    background: #fff8e5;
    border: 1px solid #f0d88b;
    color: #6d5611;
}

.toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.search {
    flex: 1;
    min-width: 230px;
}

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

.app-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.app-icon {
    width: 76px;
    height: 76px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 8px;
    background: #fff;
    margin-bottom: 15px;
}

.app-client {
    color: var(--blue);
    font-weight: 700;
    font-size: 14px;
}

.app-purpose {
    color: var(--muted);
    line-height: 1.5;
    flex: 1;
}

.meta {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 15px;
}

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

.admin-notice {
    padding: 16px;
    border: 1px solid #efc554;
    background: #fff9e7;
    border-radius: 12px;
    margin-bottom: 18px;
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.checkbox-row input {
    width: auto;
    min-height: auto;
    margin-top: 4px;
}

@media (max-width: 600px) {
    .header-inner {
        min-height: 64px;
        padding: 10px 14px;
    }

    .logo {
        max-width: 170px;
    }

    .container {
        margin-top: 18px;
    }

    .card {
        padding: 19px;
        border-radius: 14px;
    }

    .app-grid {
        grid-template-columns: 1fr;
    }

    .btn {
        width: 100%;
    }
}
