/* ========================================================================== */
/* ADMIN --> APPLICATIONS                                                       */
/* ========================================================================== */

.applications-wrapper {
    padding: 60px 70px;
    margin-left: var(--sidenav-width);
    margin-top: var(--topnav-height);
    margin-bottom: 300px;
}

@media (max-width: 991.98px) {
    .applications-wrapper {
        padding: 24px var(--page-gutter);
    }
}

/* HEADER */
.applications-header {
    margin-bottom: 45px;
}

.applications-header h1 {
    font-size: 2.6rem;
    font-weight: 650;
    color: #032f4f;
}

.applications-sub {
    margin-top: 6px;
    font-size: 1.1rem;
    max-width: 700px;
    color: #4f6b80;
}

.viewmode-toggle-row {
    margin-top: 12px;
}

/* SECTION TITLE */
.applications-section-title {
    margin-top: 15px;
    margin-bottom: 25px;
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.08rem;
    color: #022a46;
    font-weight: 700;
}

/* TOOLBAR */
.app-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 25px 0 14px 0;
}

.toolbar-actions {
    display: flex;
    gap: 10px;
}

.search-group {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 5;
}

.app-search {
    width: 260px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: white;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.25s ease;
    position: relative;
    z-index: 5;
}

.app-search:hover {
    border-color: rgba(0, 0, 0, 0.18);
}

.app-search:focus {
    border-color: #3da5ff;
    box-shadow: 0 0 0 3px rgba(61, 165, 255, 0.35);
    outline: none;
}

.search-group.search-inside {
    position: relative;
}

.app-search.app-search-inside {
    padding-right: 54px;
}

.search-btn.search-btn-inside {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 999px;
    border: none;
    background: rgba(45, 100, 216, 0.10);
    color: #2d64d8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    z-index: 10;
}

.search-btn.search-btn-inside:hover {
    background: rgba(45, 100, 216, 0.18);
    transform: translateY(-50%) scale(1.02);
}

.search-btn.search-btn-inside:active {
    transform: translateY(-50%) scale(0.98);
}

/* ADD APPLICATION BUTTON */
.app-add-btn {
    padding: 10px 16px;
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    border-radius: 12px;
    background: #16a34a;
    color: white;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.app-add-btn:hover {
    background: #15803d;
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

/* REFRESH BUTTON */
.app-refresh-btn {
    padding: 10px 16px;
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    border-radius: 12px;
    background: #2d64d8;
    color: white;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.app-refresh-btn:hover:not(:disabled) {
    background: #1e4cb3;
    transform: translateY(-1px);
}

.app-refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* INSTALL BUTTON (kept for future) */
.app-install-btn {
    padding: 10px 16px;
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    border-radius: 12px;
    background: #2d64d8;
    color: white;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    white-space: nowrap;
}

.app-install-btn:hover {
    background: #1e4cb3;
    transform: translateY(-1px);
}

/* LOADING / EMPTY */
.app-loading, .app-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #4f6b80;
    gap: 16px;
}

/* TABLE — Base styles are centralized in admin-shared.css */
/* This section intentionally removed; see admin-shared.css for .app-table styles */

/* APP CELL */
.app-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-state-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-running {
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.dot-stopped {
    background: #94a3b8;
}

.app-name-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-name {
    font-weight: 600;
    color: #022a46;
}

.app-image {
    font-size: 0.8rem;
    color: #64748b;
    font-family: monospace;
}

.app-icon {
    width: 30px;
    height: auto;
    flex-shrink: 0;
}

/* METRIC CELLS */
.metric-cell {
    font-family: 'JetBrains Mono', 'Cascadia Code', monospace;
    font-size: 0.88rem;
    color: #334155;
}



/* ACTION BUTTONS */
.actions-cell {
    white-space: nowrap;
}

.actions-cell .action-btn {
    margin-right: 4px;
}

.actions-cell .action-btn:last-child {
    margin-right: 0;
}

.app-table td {
    vertical-align: middle;
}

.action-btn {
    padding: 4px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: background 0.2s, transform 0.15s;
    white-space: nowrap;
}

.action-btn:hover:not(:disabled) {
    transform: scale(1.1);
}

.action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.action-start {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.action-start:hover:not(:disabled) {
    background: rgba(34, 197, 94, 0.25);
}

.action-stop {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.action-stop:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.2);
}

.action-restart {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
}

.action-restart:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.2);
}

.action-delete {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.action-delete:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.4);
}

.delete-confirm-panel {
    max-width: 420px;
}

.delete-confirm-text {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #475569;
}

.delete-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.action-cancel-delete {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
    padding: 8px 20px;
}

.action-cancel-delete:hover {
    background: rgba(100, 116, 139, 0.2);
}

.action-confirm-delete {
    background: #dc2626;
    color: white;
    padding: 8px 20px;
}

.action-confirm-delete:hover {
    background: #b91c1c;
}

/* DETAIL GRID */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04rem;
    color: #64748b;
}

.detail-value {
    font-size: 0.95rem;
    color: #1e293b;
    font-weight: 500;
    word-break: break-all;
}

/* LOGS */
.logs-section {
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
}

.modal-panel .logs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.modal-panel .logs-header h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #022a46;
    margin: 0;
}

.logs-refresh-btn {
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #2d64d8;
    cursor: pointer;
    transition: all 0.2s;
}

.logs-refresh-btn:hover:not(:disabled) {
    background: #f1f5f9;
}

.logs-refresh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.logs-container {
    background: #1a1a1a;
    border-radius: 10px;
    padding: 16px;
    max-height: 350px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', 'Cascadia Code', monospace;
    font-size: 0.82rem;
    line-height: 1.6;
}

.logs-empty {
    color: #64748b;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.log-line {
    color: #e2e8f0;
    white-space: pre-wrap;
    word-break: break-all;
    padding: 1px 0;
}

.log-line:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* RESPONSIVE */
/* Details btn column right-aligned */
.app-table td:last-child {
    text-align: right;
}

/* Dark mode → css/dark/admin/dark-admin-applications.css */

/* RESPONSIVE */
@media (max-width: 768px) {
    .app-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .app-table-wrapper {
        overflow-x: auto;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }
}

