:root {
    --primary-color: #0f3460;
    --primary-dark: #16213e;
    --primary-light: color-mix(in srgb, var(--primary-color) 10%, white);
    --primary-hover: color-mix(in srgb, var(--primary-color) 85%, black);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    min-height: 100vh;
}

/* Login */
.login-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}
.login-footer {
    color: rgba(255,255,255,0.6);
    font-size: 0.8rem;
    margin-top: 1.5rem;
    text-align: center;
}

.login-box {
    background: #fff;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
    width: 100%;
    max-width: 400px;
    margin: 1rem;
}

.login-box h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.login-box p {
    color: #666;
    margin-bottom: 1.5rem;
}

.login-box input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.login-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.login-box button:hover {
    background: var(--primary-dark);
}

.error {
    color: #e74c3c;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.success-msg {
    color: #2ecc71;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.forgot-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--primary-color);
    font-size: 0.85rem;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.forgot-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.captcha-question {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
    min-width: 120px;
    text-align: center;
    background: #f0f2f5;
    padding: 10px 14px;
    border-radius: 8px;
    letter-spacing: 1px;
}

.captcha-row input {
    flex: 1;
    margin-bottom: 0 !important;
}

/* Header */
header {
    background: #fff;
    color: #333;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    font-size: 1.8rem;
    line-height: 1;
    color: #333;
}

.header-left h1 {
    font-size: 1.3rem;
    letter-spacing: -0.3px;
    color: #222;
}

.subtitle {
    font-size: 0.8rem;
    opacity: 0.6;
    color: #666;
}

.header-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.header-right .btn-secondary,
.header-right .btn-primary {
    padding: 6px 12px;
    font-size: 0.82rem;
}

.user-info {
    font-size: 0.85rem;
    opacity: 0.7;
    color: #555;
    padding-right: 0.5rem;
    border-right: 1px solid rgba(255,255,255,0.2);
}
.user-info:hover { opacity: 1; text-decoration: underline; }
.btn-profile-icon {
    padding: 4px 8px !important;
    font-size: 0.9rem !important;
    min-width: unset;
}

/* Main container */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
    min-height: calc(100vh - 120px);
}

/* Content layout: table left, stats right */
.content-layout {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 1.25rem;
    align-items: start;
}

.content-main {
    min-width: 0;
}

/* Sidebar stats */
.sidebar-stats {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    position: sticky;
    top: 80px;
}

.sidebar-stats .stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 0.8rem 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    text-align: center;
}

.sidebar-stats .stat-card.highlight {
    background: var(--primary-color);
    color: #fff;
}

.sidebar-stats .stat-card.highlight .stat-label {
    color: rgba(255,255,255,0.7);
}

.sidebar-stats .stat-card.highlight .stat-value {
    color: #fff;
}

.sidebar-stats .stat-card.trivia {
    background: #f8f9fb;
    border: 1px dashed #d5dbe5;
}

.stat-label {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a2e;
}

.stat-highlight {
    color: var(--primary-color);
}

.sidebar-stats .stat-card.trivia .stat-value {
    font-size: 1rem;
    color: #555;
}

.stat-sub {
    font-size: 0.7rem;
    color: #999;
    margin-top: 1px;
}

.speed-table {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.3rem;
}

.speed-item {
    font-size: 0.78rem;
    color: #666;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.speed-item.top {
    font-weight: 700;
    color: var(--primary-color);
}

.speed-bar {
    display: inline-block;
    height: 5px;
    background: #d5dbe5;
    border-radius: 3px;
    flex-shrink: 0;
}

.speed-item.top .speed-bar {
    background: var(--primary-color);
}

/* Toolbar */
.toolbar {
    margin-bottom: 1rem;
}

.search-bar {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    opacity: 0.4;
    pointer-events: none;
}

.search-bar input {
    width: 100%;
    padding: 11px 16px 11px 40px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.93rem;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(15,52,96,0.1);
}

/* Table card */
.table-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 1rem;
}

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

thead th {
    background: var(--primary-dark);
    color: #fff;
    padding: 11px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

thead th:hover {
    background: #1a2744;
}

tbody tr {
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s;
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background: #f4f7fb;
}

tbody tr.sub-row {
    background: #fafbfc;
}

tbody tr.sub-row:hover {
    background: #f0f3f7;
}

.sub-marker {
    color: #bbb;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

tbody td {
    padding: 11px 14px;
    font-size: 0.9rem;
}

.price-cell {
    font-weight: 700;
    color: var(--primary-color);
}
.prices-hidden .price-cell {
    filter: blur(6px);
    user-select: none;
    transition: filter 0.2s;
}

.actions-cell {
    white-space: nowrap;
}

.actions-cell button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 7px;
    font-size: 0.95rem;
    border-radius: 6px;
    transition: background 0.15s;
}

.actions-cell button:hover {
    background: #eef1f6;
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #888;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.empty-state p {
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

.empty-hint {
    font-size: 0.9rem !important;
    color: #aaa;
}

/* Summary */
.summary-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.25rem;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    font-weight: 600;
    font-size: 0.85rem;
    color: #555;
}

#total-billing {
    font-size: 0.95rem;
    color: var(--primary-color);
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem;
    color: #aaa;
    font-size: 0.8rem;
    border-top: 1px solid #e5e7eb;
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

.footer-idea-btn {
    position: fixed;
    bottom: 16px;
    right: 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 24px;
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 100;
}

.footer-idea-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #f0f7ff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* Buttons */
.btn-primary {
    background: #2ecc71;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover {
    background: #27ae60;
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

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

.btn-danger {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-add-row {
    background: #3498db;
    color: #fff;
    border: none;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    cursor: pointer;
    margin-left: 0.75rem;
    vertical-align: middle;
    transition: background 0.2s;
}

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

.btn-remove-row {
    background: none;
    border: none;
    color: #ccc;
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.btn-remove-row:hover {
    color: #e74c3c;
    background: #fef2f2;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalIn 0.2s ease-out;
}

.modal-content.modal-wide {
    max-width: 800px;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    font-size: 1.3rem;
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #999;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.modal-close:hover {
    color: #333;
    background: #f0f0f0;
}

/* Form */
form {
    padding: 1.5rem;
}

form h3 {
    font-size: 0.95rem;
    color: var(--primary-color);
    margin: 1.25rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f2f5;
    display: flex;
    align-items: center;
}

form h3:first-of-type {
    margin-top: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.form-grid-liittyma {
    grid-template-columns: repeat(3, 1fr);
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.25rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 9px 11px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(15,52,96,0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #555;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #eee;
    justify-content: flex-end;
}

.form-actions .btn-secondary {
    color: #666;
    border-color: #ddd;
}

.form-actions .btn-secondary:hover {
    color: #333;
    border-color: #999;
}

/* Liittymä rows in form */
.liittyma-row {
    background: #f8f9fb;
    border: 1px solid #e8ebf0;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.6rem;
}

.liittyma-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.liittyma-row-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Detail view */
#detail-body {
    padding: 1.5rem;
}

.detail-section {
    margin-bottom: 1.5rem;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h3 {
    font-size: 0.95rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f2f5;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 2rem;
}

.detail-item {
    padding: 0.3rem 0;
}

.detail-label {
    font-size: 0.72rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.detail-value {
    font-size: 0.93rem;
    font-weight: 500;
    color: #1a1a2e;
    word-break: break-word;
}

.detail-value a {
    color: var(--primary-color);
    text-decoration: none;
}

.detail-value a:hover {
    text-decoration: underline;
}

.detail-value.empty,
span.empty {
    color: #ccc;
    font-style: italic;
}

/* Liittymä card in detail view */
.liittyma-card {
    background: #f8f9fb;
    border: 1px solid #e8ebf0;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
}

.liittyma-num {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.liittyma-total {
    text-align: right;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary-color);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 2px solid #e8ebf0;
}

/* Files */
.file-upload-area {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.75rem;
    background: #f8f9fb;
    border-radius: 8px;
    border: 1px solid #eee;
}

.file-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.file-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-name:hover {
    text-decoration: underline;
}

.file-meta {
    font-size: 0.75rem;
    color: #999;
}

.file-delete-btn {
    background: none;
    border: none;
    color: #ccc;
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s;
    flex-shrink: 0;
}

.file-delete-btn:hover {
    color: #e74c3c;
    background: #fef2f2;
}

/* Responsive */
@media (max-width: 1024px) {
    .content-layout {
        grid-template-columns: 1fr;
    }

    .sidebar-stats {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .sidebar-stats .stat-card {
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
        text-align: center;
    }

    .header-brand {
        justify-content: center;
    }

    .main-container {
        padding: 1rem;
    }

    .form-grid,
    .form-grid-liittyma,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .summary-bar {
        flex-direction: column;
        gap: 0.25rem;
        text-align: center;
    }

    thead th,
    tbody td {
        padding: 9px 10px;
        font-size: 0.83rem;
    }
}

@media (max-width: 480px) {
    .header-right {
        flex-direction: column;
        width: 100%;
    }

    .header-right .btn-primary,
    .header-right .btn-secondary {
        width: 100%;
        text-align: center;
    }
}

/* Tab bar */
.tab-bar {
    display: flex;
    gap: 0;
    background: var(--primary-color);
    padding: 0 2rem;
    position: sticky;
    top: 56px;
    z-index: 99;
}

.tab {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 0.88rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: all 0.2s;
}

.tab:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.tab.active {
    color: #fff;
    border-bottom-color: #fff;
    background: rgba(255,255,255,0.1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Sub-tabs (Tekniikka yms.) */
.sub-tab-bar {
    display: flex;
    gap: 0;
    background: #f0f2f5;
    border-bottom: 2px solid #e0e0e0;
    padding: 0 1rem;
}
.sub-tab {
    padding: 0.6rem 1.1rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 0.84rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}
.sub-tab:hover {
    color: var(--primary-color);
    background: rgba(0,0,0,0.03);
}
.sub-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}
.sub-tab-content {
    display: none;
}
.sub-tab-content.active {
    display: block;
}

/* IPAM tila-badget */
.ipam-tila { display:inline-block; padding:2px 10px; border-radius:12px; font-size:0.8rem; font-weight:600; }
.ipam-tila-vapaa { background:#e6f9ee; color:#1a7d42; }
.ipam-tila-varattu { background:#fef3cd; color:#856404; }
.ipam-tila-reserved { background:#e2e3e5; color:#495057; }

/* IPAM puunäkymä */
.ipam-tree-table tbody tr { cursor: pointer; }
.ipam-tree-table tbody tr:hover { background: #f0f4ff; }
.ipam-toggle { cursor:pointer; display:inline-block; width:1rem; text-align:center; font-size:0.7rem; color:#555; user-select:none; }
.ipam-toggle:hover { color:#0f3460; }
.ipam-toggle-placeholder { display:inline-block; width:1rem; }
.ipam-type-subnet { display:inline-block; padding:1px 8px; border-radius:4px; font-size:0.75rem; font-weight:700; background:#e0e7ff; color:#3730a3; }
.ipam-type-ip { display:inline-block; padding:1px 8px; border-radius:4px; font-size:0.75rem; font-weight:700; background:#f0fdf4; color:#166534; }
.ipam-network { font-size:0.85rem; background:#f8f9fa; padding:1px 6px; border-radius:3px; }
.ipam-drill { cursor:pointer; font-size:0.8rem; color:#6366f1; margin-left:0.4rem; }
.ipam-drill:hover { color:#4338ca; text-decoration:underline; }
.ipam-breadcrumb { padding:0.5rem 0; font-size:0.85rem; color:#555; }
.ipam-bc-link { cursor:pointer; color:#6366f1; }
.ipam-bc-link:hover { text-decoration:underline; }
.ipam-bc-current { color:#333; font-weight:600; cursor:default; }
.ipam-bc-current:hover { text-decoration:none; }
.ipam-usage { display:inline-block; margin-left:0.5rem; padding:1px 6px; border-radius:8px; font-size:0.72rem; font-weight:600; background:#f0f4ff; color:#4338ca; }
.ipam-free-row { background:#f0fdf4 !important; }
.ipam-free-row:hover { background:#dcfce7 !important; }
.ipam-type-free { display:inline-block; padding:1px 8px; border-radius:4px; font-size:0.75rem; font-weight:700; background:#d1fae5; color:#065f46; }
.ipam-network-free { color:#059669; background:#ecfdf5; }

/* ==================== OHJEET ==================== */
.guide-card { background:#fff; border-radius:12px; padding:1.25rem; box-shadow:0 1px 4px rgba(0,0,0,0.06); cursor:pointer; transition:transform 0.15s, box-shadow 0.15s; border:2px solid transparent; display:flex; flex-direction:column; }
.guide-card:hover { transform:translateY(-2px); box-shadow:0 4px 12px rgba(0,0,0,0.1); border-color:var(--primary-color); }
.guide-card.guide-pinned { border-color:#ffc107; background:#fffef5; }
.guide-card-header { display:flex; align-items:center; gap:0.5rem; margin-bottom:0.5rem; min-height:24px; }
.guide-pin-icon { font-size:0.9rem; }
.guide-category-badge { display:inline-block; padding:2px 8px; border-radius:10px; font-size:0.72rem; font-weight:600; background:var(--primary-light); color:var(--primary-color); }
.guide-card-title { font-size:1.05rem; color:#1a1a2e; margin-bottom:0.5rem; line-height:1.3; }
.guide-card-preview { font-size:0.85rem; color:#888; line-height:1.5; flex:1; margin-bottom:0.75rem; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.guide-card-footer { display:flex; justify-content:space-between; font-size:0.78rem; color:#aaa; }
.guide-card-tags { display:flex; gap:0.3rem; flex-wrap:wrap; margin-top:0.5rem; }
.guide-tag { display:inline-block; padding:2px 8px; border-radius:10px; font-size:0.72rem; font-weight:600; background:#e8ebf0; color:#555; }
.guide-content h1 { font-size:1.5rem; color:var(--primary-color); margin:1.5rem 0 0.75rem; }
.guide-content h2 { font-size:1.25rem; color:var(--primary-color); margin:1.25rem 0 0.5rem; border-bottom:2px solid #f0f2f5; padding-bottom:0.3rem; }
.guide-content h3 { font-size:1.1rem; color:#333; margin:1rem 0 0.5rem; }
.guide-content p { margin-bottom:0.75rem; }
.guide-content ul, .guide-content ol { margin:0.5rem 0 0.75rem 1.5rem; }
.guide-content li { margin-bottom:0.25rem; }
.guide-content code { background:#f0f2f5; padding:2px 6px; border-radius:4px; font-size:0.88rem; font-family:'SF Mono',Monaco,Consolas,monospace; }
.guide-content pre { background:#1a1a2e; color:#e0e0e0; padding:1rem; border-radius:8px; overflow-x:auto; margin:0.75rem 0; }
.guide-content pre code { background:none; padding:0; color:inherit; }
.guide-content blockquote { border-left:4px solid var(--primary-color); margin:0.75rem 0; padding:0.5rem 1rem; background:#f8f9fb; color:#555; border-radius:0 8px 8px 0; }
.guide-content a { color:var(--primary-color); text-decoration:underline; }
.guide-content hr { border:none; border-top:2px solid #f0f2f5; margin:1.5rem 0; }
.guide-tb-btn { background:#f0f2f5; border:1px solid #ddd; padding:4px 10px; border-radius:5px; font-size:0.78rem; font-weight:600; cursor:pointer; color:#555; transition:all 0.15s; }
.guide-tb-btn:hover { background:var(--primary-color); color:#fff; border-color:var(--primary-color); }
.guide-img { max-width:400px; border-radius:8px; margin:0.75rem 0; cursor:zoom-in; transition:box-shadow 0.15s; border:1px solid #e0e0e0; display:block; }
.guide-img:hover { box-shadow:0 4px 20px rgba(0,0,0,0.18); border-color:#bbb; }

/* Todo-moduuli */
.todo-card { background:#fff; border-radius:12px; padding:1.25rem; box-shadow:0 1px 4px rgba(0,0,0,0.06); cursor:pointer; transition:transform 0.15s, box-shadow 0.15s; border:2px solid transparent; display:flex; flex-direction:column; }
.todo-card:hover { transform:translateY(-2px); box-shadow:0 4px 12px rgba(0,0,0,0.1); border-color:var(--primary-color); }
.todo-card.overdue { border-color:#e74c3c; }
.todo-card.deadline-soon { border-color:#f39c12; }
.todo-row-overdue { background:#fef2f2 !important; }
.todo-row-overdue:hover { background:#fde8e8 !important; }
.todo-row-soon { background:#fffbeb !important; }
.todo-row-soon:hover { background:#fef3c7 !important; }
.todo-row-active { background:#ecfdf5 !important; }
.todo-row-active:hover { background:#d1fae5 !important; }
.todo-row-done { opacity:0.55; }
.todo-row-done:hover { opacity:0.75; }
.priority-badge { display:inline-block; padding:2px 8px; border-radius:10px; font-size:0.72rem; font-weight:600; }
.priority-normaali { background:#e8ebf0; color:#555; }
.priority-tarkea { background:#fff3cd; color:#856404; }
.priority-kiireellinen { background:#fde8e8; color:#dc2626; }
.todo-category { display:inline-block; padding:2px 8px; border-radius:10px; font-size:0.72rem; font-weight:600; }
.cat-tekniikka { background:#e0f2fe; color:#0369a1; }
.cat-laskutus { background:#fef3c7; color:#92400e; }
.cat-myynti { background:#d1fae5; color:#065f46; }
.cat-asennus { background:#ede9fe; color:#5b21b6; }
.cat-muu { background:#f3f4f6; color:#6b7280; }
.todo-status { display:inline-block; padding:2px 8px; border-radius:10px; font-size:0.72rem; font-weight:600; }
.status-avoin { background:#e3f2fd; color:#1565c0; }
.status-kaynnissa { background:#e8f5e9; color:#2e7d32; }
.status-odottaa { background:#fff8e1; color:#f57f17; }
.status-valmis { background:#f5f5f5; color:#888; }
.status-ehdotettu { background:#e3f2fd; color:#1565c0; }
.status-harkinnassa { background:#fff8e1; color:#f57f17; }
.status-toteutettu { background:#e8f5e9; color:#2e7d32; }
.status-hylatty { background:#fde8e8; color:#dc2626; }
.time-entries-table { width:100%; border-collapse:collapse; font-size:0.88rem; }
.time-entries-table th, .time-entries-table td { padding:0.5rem 0.75rem; text-align:left; border-bottom:1px solid #f0f2f5; }
.time-entries-table th { font-weight:600; color:#888; font-size:0.78rem; text-transform:uppercase; }
.todo-comment { padding:0.75rem; margin-bottom:0.5rem; background:#fafbfc; border-radius:8px; border-left:3px solid var(--primary-color); }
.todo-comment-meta { font-size:0.78rem; color:#888; margin-bottom:0.25rem; }
.subtask-item { display:flex; align-items:center; gap:0.5rem; padding:0.35rem 0.5rem; border-radius:6px; margin-bottom:2px; }
.subtask-item:hover { background:#f5f7fa; }
.subtask-item label { display:flex; align-items:center; gap:0.4rem; flex:1; cursor:pointer; font-size:0.9rem; }
.subtask-item.completed label span { text-decoration:line-through; color:#aaa; }
.subtask-item input[type="checkbox"] { width:16px; height:16px; cursor:pointer; accent-color:var(--primary-color); }
.subtask-delete { background:none; border:none; cursor:pointer; color:#ccc; font-size:1.1rem; padding:0 0.3rem; line-height:1; }
.subtask-delete:hover { color:#e74c3c; }
.subtask-progress { font-size:0.75rem; color:#888; font-weight:400; margin-left:0.4rem; }

/* Role badge */
.role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.role-superadmin {
    background: #7c3aed;
    color: #fff;
}

.role-admin {
    background: var(--primary-color);
    color: #fff;
}

.role-user {
    background: #e8ebf0;
    color: #555;
}

/* Small buttons */
.btn-small {
    display: inline-block;
    padding: 4px 10px;
    border: none;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-restore {
    background: #2ecc71;
    color: #fff;
}

.btn-restore:hover {
    background: #27ae60;
}

.btn-perm-delete {
    background: #e74c3c;
    color: #fff;
    margin-left: 4px;
}

.btn-perm-delete:hover {
    background: #c0392b;
}

/* Lead status badges */
.lead-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.lead-status-uusi {
    background: #3498db;
    color: #fff;
}

.lead-status-kontaktoitu {
    background: #f39c12;
    color: #fff;
}

.lead-status-kiinnostunut {
    background: #2ecc71;
    color: #fff;
}

.lead-status-odottaa {
    background: #9b59b6;
    color: #fff;
}

.lead-status-ei_kiinnosta {
    background: #e8ebf0;
    color: #888;
}

/* Ticket status badges */
.ticket-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.ticket-status-uusi {
    background: #3498db;
    color: #fff;
}

.ticket-status-kasittelyssa {
    background: #f39c12;
    color: #fff;
}

.ticket-status-odottaa {
    background: #f1c40f;
    color: #333;
}

.ticket-status-ratkaistu {
    background: #2ecc71;
    color: #fff;
}

.ticket-status-suljettu {
    background: #bdc3c7;
    color: #555;
}

/* Ticket type badges */
.ticket-type {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.ticket-type-laskutus {
    background: #e8f5e9;
    color: #2e7d32;
}

.ticket-type-tekniikka {
    background: #e3f2fd;
    color: #1565c0;
}

.ticket-type-vika {
    background: #fce4ec;
    color: #c62828;
}

.ticket-type-muu {
    background: #f5f5f5;
    color: #757575;
}

.ticket-type-abuse {
    background: #fff3e0;
    color: #e65100;
}

.ticket-type-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f2f5;
}

.ticket-type-item:last-child {
    border-bottom: none;
}

/* Active (käsittelyssä) ticket row — green tint */
.ticket-row-active {
    background: #e8f8e8 !important;
}

.ticket-row-active:hover {
    background: #d5f0d5 !important;
}

.ticket-row-urgent {
    background: #fef2f2 !important;
    border-left: 3px solid #e74c3c !important;
}
.ticket-row-urgent:hover {
    background: #fee2e2 !important;
}

.ticket-row-important {
    background: #fffbeb !important;
    border-left: 3px solid #f59e0b !important;
}
.ticket-row-important:hover {
    background: #fef3c7 !important;
}

.ticket-prio-urgent {
    font-size: 0.9rem;
}

.ticket-prio-important {
    font-size: 0.9rem;
}

/* Ticket thread */
.ticket-thread {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.25rem 0;
    padding: 1rem 0;
    border-top: 2px solid #f0f2f5;
    border-bottom: 2px solid #f0f2f5;
    max-height: 60vh;
    overflow-y: auto;
}

.ticket-message {
    border-radius: 10px;
    padding: 0.75rem 1rem;
    position: relative;
}

.ticket-msg-in {
    background: #e3f0fc;
    border-left: 4px solid #2980d9;
}

.ticket-msg-out {
    background: #e0f5e4;
    border-left: 4px solid #27ae60;
}

.ticket-msg-note {
    background: #fffbea;
    border-left: 3px solid #f39c12;
}

.ticket-msg-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.82rem;
    color: #555;
    flex-wrap: wrap;
}

.ticket-msg-type {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    opacity: 0.7;
}

.ticket-msg-time {
    margin-left: auto;
    color: #999;
    font-size: 0.78rem;
}

.ticket-msg-body {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Viestien liitteet */
.msg-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0,0,0,0.08);
}
.msg-attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.6rem;
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 6px;
    font-size: 0.8rem;
    color: #2563eb;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
}
.msg-attachment-link:hover {
    background: rgba(37,99,235,0.08);
    border-color: #2563eb;
}
.msg-att-size {
    color: #888;
    font-size: 0.75rem;
}

/* Ticket reply form */
.ticket-reply-form {
    padding-top: 1rem;
}

.ticket-reply-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ticket-reply-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.1);
}

.btn-reply-tab {
    background: #f0f2f5;
    border: 2px solid transparent;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    color: #888;
    transition: all 0.15s;
}

.btn-reply-tab:hover {
    color: #555;
    background: #e8ebf0;
}

.btn-reply-tab.active {
    color: var(--primary-color);
    background: #fff;
    border-color: var(--primary-color);
}

/* Ticket tags */
.ticket-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    background: #e8ebf0;
    color: #555;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.ticket-tag-editable {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 6px 3px 8px;
    cursor: default;
}

.ticket-tag-remove {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: #999;
    padding: 0 2px;
    line-height: 1;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
}

.ticket-tag-remove:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

/* Changelog */
.nowrap {
    white-space: nowrap;
}

.text-muted {
    color: #999;
    font-size: 0.85rem;
}

/* Company selector */
.company-selector {
    padding: 6px 10px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary-color);
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
}

.company-selector:hover,
.company-selector:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* Mailbox items */
.mailbox-item {
    transition: border-color 0.2s;
}

.mailbox-item:hover {
    border-color: var(--primary-color) !important;
}

/* Company badge */
.company-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #e8f0fe;
    color: #1a56db;
}

/* ==================== DOKUMENTIT ==================== */
.doc-category {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.doc-category.cat-sopimus { background: #dbeafe; color: #1e40af; }
.doc-category.cat-lasku { background: #fef3c7; color: #92400e; }
.doc-category.cat-ohje { background: #d1fae5; color: #065f46; }
.doc-category.cat-raportti { background: #ede9fe; color: #5b21b6; }
.doc-category.cat-kuva { background: #fef9c3; color: #854d0e; }
.doc-category.cat-muu { background: #f3f4f6; color: #374151; }
.doc-category.cat-kokousmuistio { background: #fce7f3; color: #9d174d; }

#doc-versions-table tbody tr:hover {
    background: #f0f7ff !important;
}

/* Dokumenttikansiot */
.doc-folder-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    transition: background 0.15s, border-color 0.15s;
}
.doc-folder-item:hover { background: #e5e7eb; }
.doc-folder-delete { background: none; border: none; cursor: pointer; font-size: 0.75rem; padding: 0 0.15rem; opacity: 0; transition: opacity 0.15s; margin-left: 0.25rem; }
.doc-folder-item:hover .doc-folder-delete { opacity: 0.6; }
.doc-folder-delete:hover { opacity: 1 !important; }

#doc-breadcrumbs a { color: var(--primary-color); text-decoration: none; font-weight: 500; }
#doc-breadcrumbs a:hover { text-decoration: underline; }
#doc-breadcrumbs .bc-sep { color: #aaa; margin: 0 0.25rem; }

#doc-inline-content {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.95rem;
    resize: vertical;
    width: 100%;
    font-family: inherit;
    line-height: 1.6;
}

/* Asiakaskansiot dokumentit-tabissa */
.doc-customer-folder {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.doc-customer-folder:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(15,52,96,0.12);
    transform: translateY(-2px);
}
.doc-customer-folder.empty {
    opacity: 0.5;
    border-style: dashed;
}
.doc-customer-folder.empty:hover {
    opacity: 0.8;
}
.doc-customer-folder-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.doc-customer-folder-name {
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.doc-customer-folder-count {
    font-size: 0.8rem;
    color: #888;
}

/* Drag & Drop -tiedostolataus */
.doc-dropzone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 2rem 1rem;
    text-align: center;
    transition: all 0.2s;
    margin-top: 1rem;
    cursor: pointer;
    background: #fafafa;
}
.doc-dropzone:hover {
    border-color: #a0aec0;
    background: #f7fafc;
}
.doc-dropzone.active {
    border-color: var(--primary-color);
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.doc-dropzone-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.doc-dropzone p {
    margin: 0.25rem 0;
    color: #666;
    font-size: 0.9rem;
}
.doc-dropzone-hint {
    font-size: 0.85rem !important;
    color: #999 !important;
}
.doc-dropzone-link {
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: underline;
}
.doc-upload-progress {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}
.doc-upload-progress-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}
.doc-upload-progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s;
    width: 0%;
    border-radius: 3px;
}
.doc-upload-status {
    font-size: 0.8rem;
    color: #666;
}

/* Asiakasprofiilin dokumentit */
.customer-doc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
}
.customer-doc-item:last-child { border-bottom: none; }
.customer-doc-item a { color: var(--primary-color); text-decoration: none; font-weight: 500; }
.customer-doc-item a:hover { text-decoration: underline; }

/* ==================== LAITETILAT ==================== */
.laitetilat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.laitetila-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.15s;
    border: 2px solid transparent;
}

.laitetila-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.laitetila-card h4 {
    margin: 0 0 0.25rem;
    color: var(--primary-dark);
    font-size: 1rem;
}

.laitetila-osoite {
    color: #888;
    font-size: 0.85rem;
    margin: 0 0 0.5rem;
}

.laitetila-meta {
    color: #aaa;
    font-size: 0.8rem;
    margin: 0;
}

.laitetila-stats {
    display: flex; gap: 1rem; font-size: 0.8rem; color: #888; margin: 0.35rem 0 0;
}

.lt-dev-list {
    display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.5rem;
    border-top: 1px solid #f0f0f0; padding-top: 0.5rem;
}
.lt-dev-chip {
    font-size: 0.75rem; background: #f3f4f6; padding: 2px 7px; border-radius: 4px; color: #555;
}
.lt-dev-more { font-size: 0.72rem; color: #aaa; padding: 2px 4px; }

.lt-devices-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.lt-devices-table th { text-align: left; font-weight: 600; color: #888; padding: 0.4rem 0.5rem; border-bottom: 1px solid #e5e7eb; font-size: 0.8rem; }
.lt-devices-table td { padding: 0.4rem 0.5rem; border-bottom: 1px solid #f0f0f0; }
.lt-devices-table code { background: #f3f4f6; padding: 1px 5px; border-radius: 3px; font-size: 0.82rem; }

/* Kuvagalleria */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.gallery-item {
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.gallery-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.2s;
}

.gallery-item img:hover {
    opacity: 0.85;
}

.gallery-caption {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    color: #666;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gallery-caption span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Laitetilan tiedostolistaus */
.laitetila-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.laitetila-file-item:last-child {
    border-bottom: none;
}

.laitetila-file-item .file-name {
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
}

.laitetila-file-item .file-name:hover {
    text-decoration: underline;
}

.laitetila-file-item .file-meta {
    display: block;
    font-size: 0.8rem;
    color: #999;
}

.laitetila-file-item .file-desc {
    display: block;
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background 0.15s;
}

.btn-icon:hover {
    background: #fee2e2;
}

/* ==================== NETADMIN ==================== */
.netadmin-speed {
    display: inline-block;
    padding: 2px 8px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.netadmin-status-up {
    color: #059669;
}
.netadmin-status-up::before {
    content: '●';
    margin-right: 4px;
    font-size: 0.7rem;
}

.netadmin-status-down {
    color: #dc2626;
}
.netadmin-status-down::before {
    content: '●';
    margin-right: 4px;
    font-size: 0.7rem;
}

.ipam-hint {
    background: #f0fdf4;
    color: #166534;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    border: 1px solid #bbf7d0;
    cursor: help;
}

#netadmin-table code {
    background: #f3f4f6;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.82rem;
}

/* Searchable combobox */
.combo-wrap { position: relative; }
.combo-wrap input {
    width: 100%; box-sizing: border-box;
    padding: 0.5rem 0.7rem; border: 1px solid #d1d5db; border-radius: 6px;
    font-size: 0.9rem; background: #fff;
}
.combo-wrap input:focus { border-color: var(--primary-color); outline: none; box-shadow: 0 0 0 2px rgba(59,130,246,.15); }
.combo-list {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    max-height: 220px; overflow-y: auto; z-index: 100;
    background: #fff; border: 1px solid #d1d5db; border-top: none;
    border-radius: 0 0 8px 8px; box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.combo-list.open { display: block; }
.combo-opt {
    padding: 0.4rem 0.7rem; cursor: pointer; font-size: 0.85rem;
    display: flex; align-items: center; gap: 0.4rem;
}
.combo-opt:hover, .combo-opt.active { background: #eff6ff; }
.combo-opt .combo-sub { font-size: 0.78rem; color: #888; margin-left: auto; white-space: nowrap; }
.combo-opt .combo-badge {
    font-size: 0.7rem; padding: 1px 5px; border-radius: 4px; font-weight: 500;
}
.combo-badge.free { background: #dcfce7; color: #166534; }
.combo-badge.taken { background: #fee2e2; color: #991b1b; }
.combo-badge.subnet { background: #e0e7ff; color: #3730a3; }
.combo-grp { padding: 0.3rem 0.7rem; font-size: 0.75rem; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: 0.03em; }

/* Integraatiot */
.integration-item {
    background: #f8f9fb;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    transition: background 0.15s;
}
.integration-item:hover { background: #eef1f6; }
.integration-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}
.integration-toggle input[type="checkbox"] {
    width: 18px; height: 18px; accent-color: var(--primary-color);
}
.integration-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}
.integration-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.integration-info strong { font-size: 0.95rem; color: #333; }
.integration-info small { font-size: 0.8rem; color: #888; }
.integration-config-card {
    border-left: 3px solid var(--primary-color);
}
