/* Общие стили страницы */

/* HEADER */

body {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background: #f5f7fa;
    margin: 0;
}

.stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 15px 20px;
    min-width: 140px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.stat-number {
    font-size: 28px;
    font-weight: bold;
}

.stat-label {
    color: #666;
    margin-top: 5px;
}

.stat-card.ok .stat-number {
    color: #16a34a;
}

.stat-card.outdated .stat-number {
    color: #d97706;
}

.stat-card.warning .stat-number {
    color: #dc2626;
}

.header {
    background: #1e293b;
    color: white;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 12px 20px;
}

.logo {
    font-size: 28px;
    font-weight: bold;
}

.header-center {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.context-block {
    display: flex;
    flex-direction: column;
}

.context-title {
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
}

.version-link {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13px;
}

.version-current {
    color: #4ade80;
    font-weight: bold;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-menu a {
    color: white;
    text-decoration: none;
}

/* PAGE */

.content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-weight: bold;
}

.latest-versions {
    margin-bottom: 15px;
}

.latest-versions .version-badge {
    display: inline-block;
    background-color: #e2e8f0;
    color: #333;
    padding: 3px 6px;
    margin-right: 5px;
    border-radius: 4px;
    font-size: 0.9em;
}

.object-search {
    margin-bottom: 20px;
}

.object-search input {
    width: 100%;
    padding: 8px 10px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Группы объектов */
.group {
    margin-bottom: 25px;
}

.group h3 {
    margin-bottom: 10px;
    cursor: pointer;
    font-size: 1.1em;
}

/* Карточки объектов */
.group-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.object-card {
    display: flex;
    flex-direction: column;
    width: auto;
    padding: 16px;
    border-radius: 10px;
    background: white;
    border: 1px solid #dbe2ea;
    text-decoration: none;
    color: inherit;
    min-height: 120px;
}

.object-card * {
    text-decoration: none;
}

.object-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.object-name {
    font-weight: bold;
    margin-bottom: 6px;
    font-size: 1em;
}

.object-versions {
    margin-bottom: 6px;
}

.object-versions span {
    display: inline-block;
    margin-bottom: 2px;
    margin-right: 3px;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.85em;
    color: #fff;
}

.version-ok {
    background-color: #38a169; /* зеленая для актуальной */
}

.version-warning {
    background-color: #d69e2e; /* желтая для устаревшей */
}

.object-lastseen {
    font-size: 0.8em;
    color: #555;
    margin-bottom: 4px;
}	

.object-status {
    font-weight: bold;
    font-size: 0.9em;
}

.object-card.ok .object-status {
    color: #38a169;
}

.object-card.outdated .object-status {
    color: #d69e2e;
}

.object-card.warning .object-status {
    color: #e53e3e;
}

.object-card.unknown .object-status {
    color: #718096;
}	

.object-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.object-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.object-lastseen {
    color: #666;
    font-size: 13px;
}

.object-status {
    font-weight: bold;
}

/* Collapsible Group Cards */
.group {
    margin-bottom: 20px;
}

.group-card {
    background: white;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.group-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
}

.group-card-header:hover {
    background-color: #f8fafc;
}

.group-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.group-card-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    color: #64748b;
}

.group-card-toggle.collapsed {
    transform: rotate(-90deg);
}

.group-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #64748b;
    font-size: 14px;
}

.group-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #f1f5f9;
    border-radius: 16px;
    font-size: 13px;
    color: #475569;
}

.group-card-content {
    padding: 0 20px 20px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.group-card-content.hidden {
    display: none;
}

/* Legacy group styles */
.group-header {
    background: white;
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
}

.group-title {
    font-size: 20px;
    font-weight: bold;
}

.group-meta {
    margin-top: 5px;
    color: #666;
}

.header-icon {
    display: flex;
    align-items: center;
    color: white;
}

.header-icon svg {
    width: 20px;
    height: 20px;
}

.header-icon:hover {
    color: #4ade80;
}

.object-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.object-lastseen {
    margin-left: auto;
    color: #666;
    font-size: 13px;
}

/* Forms */

.form-row {
    margin-bottom: 15px;
}

.form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #374151;
}

.form-row input[type="text"],
.form-row input[type="password"],
.form-row input[type="email"],
.form-row textarea,
.form-row select {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.button,
button[type="submit"] {
    display: inline-block;
    padding: 8px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}

.button:hover,
button[type="submit"]:hover {
    background: #2563eb;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

th, td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

/* Service Cards */

.service-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.service-card {
    background: white;
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    padding: 20px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
    color: inherit;
}

.service-card * {
    text-decoration: none;
}

.service-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.service-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.service-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.service-card-meta {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

.service-card-meta p {
    margin: 4px 0;
}

.service-card-footer {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.service-card-footer .button {
    font-size: 13px;
    padding: 6px 12px;
}

.service-card-footer .button-danger {
    background: #dc2626;
}

.service-card-footer .button-danger:hover {
    background: #b91c1c;
}

/* Object status colors in service cards */
.service-card.ok {
    border-left: none;
}

.service-card.warning,
.service-card.outdated {
    border-left: none;
}

.service-card.unknown {
    border-left: none;
}

/* Badges */

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-admin {
    background: #dbeafe;
    color: #1e40af;
}

.badge-engineer {
    background: #d1fae5;
    color: #065f46;
}

.badge-viewer {
    background: #e5e7eb;
    color: #374151;
}

.badge-active {
    background: #d1fae5;
    color: #065f46;
}

.badge-inactive {
    background: #fee2e2;
    color: #991b1b;
}

/* Settings Cards */

.settings-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.settings-card {
    background: white;
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: block;
}

.settings-card * {
    text-decoration: none;
}

.settings-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.settings-card-icon {
    width: 48px;
    height: 48px;
    background: #e0e7ff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.settings-card-icon svg {
    width: 24px;
    height: 24px;
    color: #4f46e5;
}

.settings-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px 0;
}

.settings-card-desc {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}