:root {
    --primary-color: #4a90e2;
    --secondary-color: #357abd;
    --accent-color: #50e3c2;
    --success-color: #28a745;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-bg: #f5f7fa;
    --white: #ffffff;
    --dark-text: #2c3e50;
    --gray-text: #7f8c8d;
    --border-color: #e1e4e8;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --radius: 8px;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    font-family: var(--font-main);
    background-color: var(--light-bg);
    color: var(--dark-text);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

.container {
    max-width: 1400px; /* Wider container */
    margin: 20px auto;
    padding: 0 20px;
}

/* Navigation */
.top-nav {
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
    padding: 0 20px;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.top-nav .logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
}

.top-nav .menu a {
    text-decoration: none;
    color: var(--dark-text);
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 0.95rem;
}

.top-nav .menu a:hover, .top-nav .menu a.active {
    background-color: #ebf4ff;
    color: var(--primary-color);
}

/* Tables - Card Layout on Mobile, Compact Table on Desktop */
.table-responsive {
    overflow-x: auto;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    table-layout: fixed; /* Fix layout */
}

.data-table th, .data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    word-wrap: break-word; /* Wrap long text */
}

/* Column Widths */
.data-table th:nth-child(1) { width: 10%; } /* Categorie */
.data-table th:nth-child(2) { width: 14%; } /* Nume */
.data-table th:nth-child(3) { width: 14%; } /* URL */
.data-table th:nth-child(4) { width: 14%; } /* User */
.data-table th:nth-child(5) { width: 14%; } /* Pass */
.data-table th:nth-child(6) { width: 20%; } /* Obs */
.data-table th:nth-child(7) { width: 14%; min-width: 140px; } /* Actions */

.data-table th {
    background-color: #f8f9fa;
    color: var(--gray-text);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

/* Actions */
.actions-cell {
    display: flex;
    gap: 4px;
    flex-wrap: wrap; /* Wrap buttons if needed */
}

.btn-sm {
    padding: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--dark-text);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sm:hover {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* Password Mask */
.password-wrapper {
    display: flex;
    align-items: center;
    background: #f1f1f1;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
    overflow: hidden;
    max-width: 100%;
}
.password-masked { letter-spacing: 2px; }
.password-text { word-break: break-all; }
.hidden { display: none; }

/* Filter Inputs */
.filter-input {
    width: 100%;
    margin-top: 5px;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.8rem;
    box-sizing: border-box;
}

/* Search Box */
.search-container {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

#searchInput {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    box-sizing: border-box;
}

/* Forms */
.form-group { margin-bottom: 15px; }
label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 0.9rem; }
input[type="text"], input[type="password"], textarea, select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-sizing: border-box;
}
textarea { resize: vertical; min-height: 80px; }

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger, .btn-warning {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    color: white;
    font-weight: 500;
    cursor: pointer;
}
.btn-primary { background-color: var(--primary-color); }
.btn-secondary { background-color: var(--gray-text); }
.btn-danger { background-color: var(--danger-color); }
.btn-warning { background-color: var(--warning-color); color: #333; }

/* Responsive / Mobile View */
@media (max-width: 992px) {
    .container { padding: 0 10px; margin: 10px auto; }
    
    /* Force table to not be like tables anymore */
    .data-table, .data-table thead, .data-table tbody, .data-table th, .data-table td, .data-table tr { 
        display: block; 
    }
    
    /* Hide table headers (but not display: none;, for accessibility) */
    .data-table thead tr { 
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .data-table tr { 
        border: 1px solid var(--border-color);
        border-radius: var(--radius);
        margin-bottom: 15px;
        background: var(--white);
        box-shadow: var(--shadow-sm);
        padding: 10px;
    }
    
    .data-table td { 
        border: none;
        border-bottom: 1px solid #eee; 
        position: relative;
        padding-left: 35%; 
        text-align: right;
        min-height: 24px;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        word-break: break-word;
    }

    .data-table td:last-child {
        border-bottom: none;
        justify-content: center;
        padding-left: 0;
        margin-top: 10px;
    }
    
    .data-table td:before { 
        position: absolute;
        top: 50%;
        left: 10px;
        transform: translateY(-50%);
        width: 30%; 
        padding-right: 10px; 
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        color: var(--gray-text);
        content: attr(data-label);
    }

    /* Adjust specific columns */
    .password-wrapper {
        justify-content: flex-end;
        background: transparent;
        padding: 0;
    }
    
    .actions-cell {
        justify-content: center;
        width: 100%;
    }
}

/* Modal */
.modal {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.5); 
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-md);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-text);
}

.modal-close:hover {
    color: var(--danger-color);
}

